diff options
author | Patrick Brown <ptbrown@whoopdedo.org> | 2015-05-07 21:10:22 -0400 |
---|---|---|
committer | Patrick Brown <ptbrown@whoopdedo.org> | 2015-05-07 21:10:22 -0400 |
commit | d0d224a82eddf30aa6daead4796cb10dd0466767 (patch) | |
tree | d04692b0379451db55b7dc556dee7be7846d3cc8 /lib/plugins/authmysql/auth.php | |
parent | 699e3c4900f2d6cc860a3587a05798cd23b7944d (diff) | |
parent | cffb4528cea1b9e7e03dc724aaa9719dbd6e23c9 (diff) | |
download | rpg-d0d224a82eddf30aa6daead4796cb10dd0466767.tar.gz rpg-d0d224a82eddf30aa6daead4796cb10dd0466767.tar.bz2 |
Merge branch 'master' into ioreplaceinfile
Diffstat (limited to 'lib/plugins/authmysql/auth.php')
-rw-r--r-- | lib/plugins/authmysql/auth.php | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/lib/plugins/authmysql/auth.php b/lib/plugins/authmysql/auth.php index 0d423b6c9..1b7d0bfa4 100644 --- a/lib/plugins/authmysql/auth.php +++ b/lib/plugins/authmysql/auth.php @@ -222,6 +222,7 @@ class auth_plugin_authmysql extends DokuWiki_Auth_Plugin { if($this->_openDB()) { if(($info = $this->_getUserInfo($user)) !== false) { + msg($this->getLang('userexists'), -1); return false; // user already exists } @@ -235,7 +236,13 @@ class auth_plugin_authmysql extends DokuWiki_Auth_Plugin { $rc = $this->_addUser($user, $pwd, $name, $mail, $grps); $this->_unlockTables(); $this->_closeDB(); - if($rc) return true; + if(!$rc) { + msg($this->getLang('writefail')); + return null; + } + return true; + } else { + msg($this->getLang('connectfail'), -1); } return null; // return error } @@ -279,7 +286,9 @@ class auth_plugin_authmysql extends DokuWiki_Auth_Plugin { $rc = $this->_updateUserInfo($user, $changes); - if($rc && isset($changes['grps']) && $this->cando['modGroups']) { + if(!$rc) { + msg($this->getLang('usernotexists'), -1); + } elseif(isset($changes['grps']) && $this->cando['modGroups']) { $groups = $this->_getGroups($user); $grpadd = array_diff($changes['grps'], $groups); $grpdel = array_diff($groups, $changes['grps']); @@ -295,10 +304,14 @@ class auth_plugin_authmysql extends DokuWiki_Auth_Plugin { $rc = false; } } + + if(!$rc) msg($this->getLang('writefail')); } $this->_unlockTables(); $this->_closeDB(); + } else { + msg($this->getLang('connectfail'), -1); } return $rc; } @@ -328,6 +341,8 @@ class auth_plugin_authmysql extends DokuWiki_Auth_Plugin { $this->_unlockTables(); } $this->_closeDB(); + } else { + msg($this->getLang('connectfail'), -1); } return $count; } |