From c3f4fb63f0c18cc70b32c658198dff3cc105c682 Mon Sep 17 00:00:00 2001 From: Gina Haeussge Date: Mon, 1 Sep 2008 19:00:41 +0200 Subject: Usermanager: Add autogeneration of password The password of a newly added user account is now autogenerated if the backend supports it, the password field is left empty and the notification of the user is enabled. A corresponding note was added to the dialog to inform admins about this behaviour. darcs-hash:20080901170041-2b4f5-e66173fe74395a1dab8e6deaf59541d258d4bacb.gz --- lib/plugins/usermanager/admin.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'lib/plugins/usermanager/admin.php') diff --git a/lib/plugins/usermanager/admin.php b/lib/plugins/usermanager/admin.php index 1d35c7abe..8f1016cbf 100644 --- a/lib/plugins/usermanager/admin.php +++ b/lib/plugins/usermanager/admin.php @@ -283,6 +283,7 @@ class admin_plugin_usermanager extends DokuWiki_Admin_Plugin { $this->_htmlInputField($cmd."_usergroups","usergroups",$this->lang["user_groups"],$groups,$this->_auth->canDo("modGroups"),$indent+6); if ($this->_auth->canDo("modPass")) { + $notes[] = $this->lang['note_pass']; if ($user) { $notes[] = $this->lang['note_notify']; } @@ -341,7 +342,14 @@ class admin_plugin_usermanager extends DokuWiki_Admin_Plugin { list($user,$pass,$name,$mail,$grps) = $this->_retrieveUser(); if (empty($user)) return false; - if (empty($pass) || empty($name) || empty($mail)){ + if (empty($pass)){ + if(!empty($_REQUEST['usernotify'])){ + $pass = auth_pwgen(); + } else { + return false; + } + } + if (empty($name) || empty($mail)){ msg($this->lang['add_fail'], -1); return false; } -- cgit v1.2.3