diff --git a/lib/formfields/admin/admin/formfield.admin_add.php b/lib/formfields/admin/admin/formfield.admin_add.php index 465fcb69..0e8e6ab6 100644 --- a/lib/formfields/admin/admin/formfield.admin_add.php +++ b/lib/formfields/admin/admin/formfield.admin_add.php @@ -34,6 +34,11 @@ return array( 'type' => 'password', 'mandatory' => true ), + 'admin_password_suggestion' => array( + 'label' => $lng['customer']['generated_pwd'], + 'type' => 'text', + 'value' => generatePassword(), + ), 'def_language' => array( 'label' => $lng['login']['language'], 'type' => 'select', diff --git a/lib/formfields/admin/admin/formfield.admin_edit.php b/lib/formfields/admin/admin/formfield.admin_edit.php index 68e706d1..d1a5dbd4 100644 --- a/lib/formfields/admin/admin/formfield.admin_edit.php +++ b/lib/formfields/admin/admin/formfield.admin_edit.php @@ -43,6 +43,12 @@ return array( 'type' => 'password', 'visible' => ($result['adminid'] == $userinfo['userid'] ? false : true) ), + 'admin_password_suggestion' => array( + 'label' => $lng['customer']['generated_pwd'], + 'type' => 'text', + 'value' => generatePassword(), + 'visible' => ($result['adminid'] == $userinfo['userid'] ? false : true) + ), 'def_language' => array( 'label' => $lng['login']['language'], 'type' => 'select', diff --git a/lib/formfields/admin/customer/formfield.customer_add.php b/lib/formfields/admin/customer/formfield.customer_add.php index 1b15f760..1901a3ca 100644 --- a/lib/formfields/admin/customer/formfield.customer_add.php +++ b/lib/formfields/admin/customer/formfield.customer_add.php @@ -46,7 +46,12 @@ return array( ), 'new_customer_password' => array( 'label' => $lng['login']['password'], - 'type' => 'password' + 'type' => 'password', + ), + 'new_customer_password_suggestion' => array( + 'label' => $lng['customer']['generated_pwd'], + 'type' => 'text', + 'value' => generatePassword(), ), 'sendpassword' => array( 'label' => $lng['admin']['sendpassword'], diff --git a/lib/formfields/admin/customer/formfield.customer_edit.php b/lib/formfields/admin/customer/formfield.customer_edit.php index 6edd0bfb..3b8ff32c 100644 --- a/lib/formfields/admin/customer/formfield.customer_edit.php +++ b/lib/formfields/admin/customer/formfield.customer_edit.php @@ -54,6 +54,11 @@ return array( 'label' => $lng['login']['password'].' ('.$lng['panel']['emptyfornochanges'].')', 'type' => 'password' ), + 'new_customer_password_suggestion' => array( + 'label' => $lng['customer']['generated_pwd'], + 'type' => 'text', + 'value' => generatePassword(), + ), 'def_language' => array( 'label' => $lng['login']['language'], 'type' => 'select', diff --git a/lib/formfields/customer/email/formfield.emails_accountchangepasswd.php b/lib/formfields/customer/email/formfield.emails_accountchangepasswd.php index da72cf02..b3fec20c 100644 --- a/lib/formfields/customer/email/formfield.emails_accountchangepasswd.php +++ b/lib/formfields/customer/email/formfield.emails_accountchangepasswd.php @@ -32,6 +32,11 @@ return array( 'email_password' => array( 'label' => $lng['login']['password'], 'type' => 'password' + ), + 'email_password_suggestion' => array( + 'label' => $lng['customer']['generated_pwd'], + 'type' => 'text', + 'value' => generatePassword(), ) ) ) diff --git a/lib/formfields/customer/email/formfield.emails_addaccount.php b/lib/formfields/customer/email/formfield.emails_addaccount.php index 48b1ea1c..e7830a70 100644 --- a/lib/formfields/customer/email/formfield.emails_addaccount.php +++ b/lib/formfields/customer/email/formfield.emails_addaccount.php @@ -33,6 +33,11 @@ return array( 'label' => $lng['login']['password'], 'type' => 'password' ), + 'email_password_suggestion' => array( + 'label' => $lng['customer']['generated_pwd'], + 'type' => 'text', + 'value' => generatePassword(), + ), 'email_quota' => array( 'visible' => ($settings['system']['mail_quota_enabled'] == '1' ? true : false), 'label' => $lng['emails']['quota'], diff --git a/lib/formfields/customer/extras/formfield.htpasswd_add.php b/lib/formfields/customer/extras/formfield.htpasswd_add.php index a0487e6b..61a6690b 100644 --- a/lib/formfields/customer/extras/formfield.htpasswd_add.php +++ b/lib/formfields/customer/extras/formfield.htpasswd_add.php @@ -39,6 +39,11 @@ return array( 'label' => $lng['login']['password'], 'type' => 'password' ), + 'directory_password_suggestion' => array( + 'label' => $lng['customer']['generated_pwd'], + 'type' => 'text', + 'value' => generatePassword(), + ), 'directory_authname' => array( 'label' => $lng['extras']['htpasswdauthname'], 'type' => 'text' diff --git a/lib/formfields/customer/extras/formfield.htpasswd_edit.php b/lib/formfields/customer/extras/formfield.htpasswd_edit.php index a21b085a..45326f6e 100644 --- a/lib/formfields/customer/extras/formfield.htpasswd_edit.php +++ b/lib/formfields/customer/extras/formfield.htpasswd_edit.php @@ -38,6 +38,11 @@ return array( 'label' => $lng['login']['password'], 'type' => 'password' ), + 'directory_password_suggestion' => array( + 'label' => $lng['customer']['generated_pwd'], + 'type' => 'text', + 'value' => generatePassword(), + ), 'directory_authname' => array( 'label' => $lng['extras']['htpasswdauthname'], 'type' => 'text', diff --git a/lib/formfields/customer/ftp/formfield.ftp_add.php b/lib/formfields/customer/ftp/formfield.ftp_add.php index bdd28d89..0c625870 100644 --- a/lib/formfields/customer/ftp/formfield.ftp_add.php +++ b/lib/formfields/customer/ftp/formfield.ftp_add.php @@ -45,6 +45,11 @@ return array( 'label' => $lng['login']['password'], 'type' => 'password', ), + 'ftp_password_suggestion' => array( + 'label' => $lng['customer']['generated_pwd'], + 'type' => 'text', + 'value' => generatePassword(), + ), 'sendinfomail' => array( 'label' => $lng['customer']['sendinfomail'], 'type' => 'checkbox', diff --git a/lib/formfields/customer/ftp/formfield.ftp_edit.php b/lib/formfields/customer/ftp/formfield.ftp_edit.php index 4047f042..fbbf74ac 100644 --- a/lib/formfields/customer/ftp/formfield.ftp_edit.php +++ b/lib/formfields/customer/ftp/formfield.ftp_edit.php @@ -39,6 +39,11 @@ return array( 'label' => $lng['login']['password'], 'desc' => $lng['ftp']['editpassdescription'], 'type' => 'password', + ), + 'ftp_password_suggestion' => array( + 'label' => $lng['customer']['generated_pwd'], + 'type' => 'text', + 'value' => generatePassword(), ) ) ) diff --git a/lib/formfields/customer/mysql/formfield.mysql_add.php b/lib/formfields/customer/mysql/formfield.mysql_add.php index fdd45293..d580052e 100644 --- a/lib/formfields/customer/mysql/formfield.mysql_add.php +++ b/lib/formfields/customer/mysql/formfield.mysql_add.php @@ -37,6 +37,11 @@ return array( 'label' => $lng['login']['password'], 'type' => 'password', ), + 'mysql_password_suggestion' => array( + 'label' => $lng['customer']['generated_pwd'], + 'type' => 'text', + 'value' => generatePassword(), + ), 'sendinfomail' => array( 'label' => $lng['customer']['sendinfomail'], 'type' => 'checkbox', diff --git a/lib/formfields/customer/mysql/formfield.mysql_edit.php b/lib/formfields/customer/mysql/formfield.mysql_edit.php index bd812fae..a7bcd8a2 100644 --- a/lib/formfields/customer/mysql/formfield.mysql_edit.php +++ b/lib/formfields/customer/mysql/formfield.mysql_edit.php @@ -43,6 +43,11 @@ return array( 'label' => $lng['changepassword']['new_password_ifnotempty'], 'type' => 'password', ), + 'mysql_password_suggestion' => array( + 'label' => $lng['customer']['generated_pwd'], + 'type' => 'text', + 'value' => generatePassword(), + ) ) ) ) diff --git a/lib/functions/froxlor/function.generatePassword.php b/lib/functions/froxlor/function.generatePassword.php new file mode 100644 index 00000000..ca58a202 --- /dev/null +++ b/lib/functions/froxlor/function.generatePassword.php @@ -0,0 +1,28 @@ + (2010-) + * @license GPLv2 http://files.froxlor.org/misc/COPYING.txt + * @package Functions + * @version $Id$ + */ + +/** + * Generates a random password + */ + +function generatePassword() +{ + global $db, $settings; + + return substr(md5(uniqid(microtime(), 1)), 24, 10); +} +?> \ No newline at end of file diff --git a/lng/english.lng.php b/lng/english.lng.php index dffda386..21bc4880 100644 --- a/lng/english.lng.php +++ b/lng/english.lng.php @@ -1579,3 +1579,4 @@ $lng['emails']['back_to_overview'] = 'Back to overview'; $lng['error']['user_banned'] = 'Your account has been banned. Please contact your administrator for further information.'; $lng['serversettings']['validate_domain'] = 'Validate domain names'; $lng['login']['combination_not_found'] = 'Combination of user and email adress not found.'; +$lng['customer']['generated_pwd'] = 'Password suggestion'; diff --git a/lng/german.lng.php b/lng/german.lng.php index dd910342..744a59db 100644 --- a/lng/german.lng.php +++ b/lng/german.lng.php @@ -1561,3 +1561,4 @@ $lng['emails']['back_to_overview'] = 'Zurück zur Übersicht'; $lng['error']['user_banned'] = 'Ihr Benutzerkonto wurde gesperrt. Bitte kontaktieren Sie Ihren Administrator für weitere Informationen.'; $lng['serversettings']['validate_domain'] = 'Validiere Domainnamen'; $lng['login']['combination_not_found'] = 'Kombination von Benutzer und E-Mail Adresse nicht gefunden.'; +$lng['customer']['generated_pwd'] = 'Passwortvorschlag';