diff options
author | Chris Smith <chris.eureka@jalakai.co.uk> | 2009-10-04 13:57:40 +0200 |
---|---|---|
committer | Chris Smith <chris.eureka@jalakai.co.uk> | 2009-10-04 13:57:40 +0200 |
commit | 6733c4d7da44a7f0c2d431e1c26dab2693a7d297 (patch) | |
tree | 35057c94e8c4c9a44c0f580d9cd40a2810ed1c30 | |
parent | 30897fec7ecf86fbc37c5a38d4a05c25203aaa44 (diff) | |
download | rpg-6733c4d7da44a7f0c2d431e1c26dab2693a7d297.tar.gz rpg-6733c4d7da44a7f0c2d431e1c26dab2693a7d297.tar.bz2 |
FS#1728, ensure create user correctly checks field modification 'canDo'
Ignore-this: e4d974b5e09e45861a5e463784c6b946
darcs-hash:20091004115740-f07c6-46e15fc4f69949530690400fcb0698b9b7a0e350.gz
-rw-r--r-- | lib/plugins/usermanager/admin.php | 41 |
1 files changed, 34 insertions, 7 deletions
diff --git a/lib/plugins/usermanager/admin.php b/lib/plugins/usermanager/admin.php index 1975dc6c9..26ee95093 100644 --- a/lib/plugins/usermanager/admin.php +++ b/lib/plugins/usermanager/admin.php @@ -358,16 +358,43 @@ class admin_plugin_usermanager extends DokuWiki_Admin_Plugin { list($user,$pass,$name,$mail,$grps) = $this->_retrieveUser(); if (empty($user)) return false; - if (empty($pass)){ - if(!empty($_REQUEST['usernotify'])){ - $pass = auth_pwgen(); - } else { + + if ($this->_auth->canDo('modPass')){ + if (empty($pass)){ + if(!empty($_REQUEST['usernotify'])){ + $pass = auth_pwgen(); + } else { + msg($this->lang['add_fail'], -1); + return false; + } + } + } else { + if (!empty($pass)){ + msg($this->lang['add_fail'], -1); return false; } } - if (empty($name) || empty($mail)){ - msg($this->lang['add_fail'], -1); - return false; + + if ($this->_auth->canDo('modName')){ + if (empty($name)){ + msg($this->lang['add_fail'], -1); + return false; + } + } else { + if (!empty($name)){ + return false; + } + } + + if ($this->_auth->canDo('modMail')){ + if (empty($mail)){ + msg($this->lang['add_fail'], -1); + return false; + } + } else { + if (!empty($mail)){ + return false; + } } if ($ok = $this->_auth->triggerUserMod('create', array($user,$pass,$name,$mail,$grps))) { |