summaryrefslogtreecommitdiff
path: root/lib/plugins
diff options
context:
space:
mode:
authorGina Haeussge <osd@foosel.net>2008-09-01 19:00:41 +0200
committerGina Haeussge <osd@foosel.net>2008-09-01 19:00:41 +0200
commitc3f4fb63f0c18cc70b32c658198dff3cc105c682 (patch)
tree95b956b4f7bc7507fefadc18715002c18ce2641d /lib/plugins
parent46c0ed7427c2ff2f45d7ec1a61cfb3b3dd92c914 (diff)
downloadrpg-c3f4fb63f0c18cc70b32c658198dff3cc105c682.tar.gz
rpg-c3f4fb63f0c18cc70b32c658198dff3cc105c682.tar.bz2
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
Diffstat (limited to 'lib/plugins')
-rw-r--r--lib/plugins/usermanager/admin.php10
-rw-r--r--lib/plugins/usermanager/lang/de/lang.php1
-rw-r--r--lib/plugins/usermanager/lang/en/lang.php1
3 files changed, 11 insertions, 1 deletions
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;
}
diff --git a/lib/plugins/usermanager/lang/de/lang.php b/lib/plugins/usermanager/lang/de/lang.php
index 71742b397..bef64eea6 100644
--- a/lib/plugins/usermanager/lang/de/lang.php
+++ b/lib/plugins/usermanager/lang/de/lang.php
@@ -43,6 +43,7 @@ $lang['edit_usermissing'] = 'Der ausgewählte Nutzer wurde nicht gefunden.
$lang['user_notify'] = 'Nutzer benachrichtigen';
$lang['note_notify'] = 'Benachrichtigungsmails werden nur versandt wenn ein neues Passwort vergeben wurde.';
$lang['note_group'] = 'Neue Nutzer werden der Standard-Gruppe (%s) hinzugefügt, wenn keine Gruppe angegeben wurde.';
+$lang['note_pass'] = 'Das Password wird automatisch generiert wenn das entsprechende Feld leergelassen wird und die Benachrichtigung des Nutzers aktiviert ist.';
$lang['add_ok'] = 'Nutzer erfolgreich angelegt';
$lang['add_fail'] = 'Nutzer konnte nicht angelegt werden';
$lang['notify_ok'] = 'Benachrichtigungsmail wurde versandt';
diff --git a/lib/plugins/usermanager/lang/en/lang.php b/lib/plugins/usermanager/lang/en/lang.php
index f15e38f2a..189a1db20 100644
--- a/lib/plugins/usermanager/lang/en/lang.php
+++ b/lib/plugins/usermanager/lang/en/lang.php
@@ -50,6 +50,7 @@ $lang['edit_usermissing'] = 'Selected user not found, the specified user name ma
$lang['user_notify'] = 'Notify user';
$lang['note_notify'] = 'Notification emails are only sent if the user is given a new password.';
$lang['note_group'] = 'New users will be added to the default group (%s) if no group is specified.';
+$lang['note_pass'] = 'The password will be autogenerated if the field is left empty and notification of the user is enabled.';
$lang['add_ok'] = 'User added successfully';
$lang['add_fail'] = 'User addition failed';
$lang['notify_ok'] = 'Notification email sent';