summaryrefslogtreecommitdiff
path: root/inc/auth.php
diff options
context:
space:
mode:
authorPatrick Brown <ptbrown@whoopdedo.org>2015-05-06 01:30:59 -0400
committerPatrick Brown <ptbrown@whoopdedo.org>2015-05-06 01:30:59 -0400
commitdb9faf025cf129d15a086a803e8056e977975d76 (patch)
tree400146b7d748f24f6c39f878f097bd90ff09018c /inc/auth.php
parentdfe7cc3f3bfbfccec6a38a94ac0f2242e8bc59e7 (diff)
downloadrpg-db9faf025cf129d15a086a803e8056e977975d76.tar.gz
rpg-db9faf025cf129d15a086a803e8056e977975d76.tar.bz2
Report more meaningful errors when an auth backend fails. closes #1093
Diffstat (limited to 'inc/auth.php')
-rw-r--r--inc/auth.php25
1 files changed, 13 insertions, 12 deletions
diff --git a/inc/auth.php b/inc/auth.php
index 17923ba2a..dd0fc35b3 100644
--- a/inc/auth.php
+++ b/inc/auth.php
@@ -1006,7 +1006,7 @@ function register() {
//okay try to create the user
if(!$auth->triggerUserMod('create', array($login, $pass, $fullname, $email))) {
- msg($lang['reguexists'], -1);
+ msg($lang['regfail'], -1);
return false;
}
@@ -1098,17 +1098,18 @@ function updateprofile() {
}
}
- if($result = $auth->triggerUserMod('modify', array($INPUT->server->str('REMOTE_USER'), &$changes))) {
- // update cookie and session with the changed data
- if($changes['pass']) {
- list( /*user*/, $sticky, /*pass*/) = auth_getCookie();
- $pass = auth_encrypt($changes['pass'], auth_cookiesalt(!$sticky, true));
- auth_setCookie($INPUT->server->str('REMOTE_USER'), $pass, (bool) $sticky);
- }
- return true;
+ if(!($result = $auth->triggerUserMod('modify', array($INPUT->server->str('REMOTE_USER'), &$changes)))) {
+ msg($lang['proffail'], -1);
+ return false;
}
- return false;
+ // update cookie and session with the changed data
+ if($changes['pass']) {
+ list( /*user*/, $sticky, /*pass*/) = auth_getCookie();
+ $pass = auth_encrypt($changes['pass'], auth_cookiesalt(!$sticky, true));
+ auth_setCookie($INPUT->server->str('REMOTE_USER'), $pass, (bool) $sticky);
+ }
+ return true;
}
/**
@@ -1221,7 +1222,7 @@ function act_resendpwd() {
// change it
if(!$auth->triggerUserMod('modify', array($user, array('pass' => $pass)))) {
- msg('error modifying user data', -1);
+ msg($lang['proffail'], -1);
return false;
}
@@ -1229,7 +1230,7 @@ function act_resendpwd() {
$pass = auth_pwgen($user);
if(!$auth->triggerUserMod('modify', array($user, array('pass' => $pass)))) {
- msg('error modifying user data', -1);
+ msg($lang['proffail'], -1);
return false;
}