Commit 726cfac8 authored by Falko Timme's avatar Falko Timme

- Added "Generate Password" function to all modules.

- Random password length: by default, generated passwords will have a length between 10 and 15 characters (instead of a fixed length of 10 characters).
parent 00385e0d
......@@ -40,4 +40,5 @@ $wb['DNS rp functions'] = 'DNS rp Funktionen';
$wb['DNS srv functions'] = 'DNS srv Funktionen';
$wb['DNS txt functions'] = 'DNS txt Funktionen';
$wb['Mail mailing list functions'] = 'Mail mailinglist functions';
$wb['generate_password_txt'] = 'Passwort erzeugen';
?>
......@@ -25,4 +25,5 @@ $wb['username_empty'] = 'Der Benutzername ist leer';
$wb['username_unique'] = 'Es gibt bereits einen Benutzer mit diesem Namen';
$wb['startmodule_err'] = 'Start Modul ist nicht innerhalb der Module.';
$wb['password_strength_txt'] = 'Passwortkomplexität';
$wb['generate_password_txt'] = 'Passwort erzeugen';
?>
......@@ -40,4 +40,5 @@ $wb['DNS ptr functions'] = 'DNS ptr functions';
$wb['DNS rp functions'] = 'DNS rp functions';
$wb['DNS srv functions'] = 'DNS srv functions';
$wb['DNS txt functions'] = 'DNS txt functions';
$wb['generate_password_txt'] = 'Generate Password';
?>
......@@ -25,4 +25,5 @@ $wb["fax_txt"] = 'Fax';
$wb["groups_txt"] = 'Groups';
$wb["default_group_txt"] = 'Default Group';
$wb["startmodule_err"] = 'Start module is not within modules.';
$wb['generate_password_txt'] = 'Generate Password';
?>
......@@ -13,7 +13,7 @@
<div class="ctrlHolder">
<label for="remote_password">{tmpl_var name='password_txt'}</label>
<input name="remote_password" id="password" value="{tmpl_var name='remote_password'}" size="30" maxlength="255" type="password" class="textInput" onkeyup="pass_check(this.value)" />
<input name="remote_password" id="password" value="{tmpl_var name='remote_password'}" size="30" maxlength="255" type="password" class="textInput" onkeyup="pass_check(this.value)" />&nbsp;<a href="javascript:void(0);" onClick="generatePassword('password');">{tmpl_var name='generate_password_txt'}</a>
</div>
<div class="ctrlHolder">
<p class="label">{tmpl_var name='password_strength_txt'}</p>
......
......@@ -11,7 +11,7 @@
</div>
<div class="ctrlHolder">
<label for="passwort">{tmpl_var name='passwort_txt'}</label>
<input name="passwort" id="passwort" value="{tmpl_var name='passwort'}" size="15" maxlength="100" type="password" class="textInput" onkeyup="pass_check(this.value)"/>
<input name="passwort" id="passwort" value="{tmpl_var name='passwort'}" size="15" maxlength="100" type="password" class="textInput" onkeyup="pass_check(this.value)"/>&nbsp;<a href="javascript:void(0);" onClick="generatePassword('passwort');">{tmpl_var name='generate_password_txt'}</a>
</div>
<div class="ctrlHolder">
<p class="label">{tmpl_var name='password_strength_txt'}</p>
......
......@@ -118,4 +118,5 @@ $wb["database_limits_txt"] = 'Datenbank-Limits';
$wb["cron_job_limits_txt"] = 'Cron Job-Limits';
$wb["dns_limits_txt"] = 'DNS-Limits';
$wb["virtualization_limits_txt"] = 'Virtualisierungs-Limits';
$wb['generate_password_txt'] = 'Passwort erzeugen';
?>
......@@ -113,4 +113,5 @@ $wb["database_limits_txt"] = 'Datenbank-Limits';
$wb["cron_job_limits_txt"] = 'Cron Job-Limits';
$wb["dns_limits_txt"] = 'DNS-Limits';
$wb["virtualization_limits_txt"] = 'Virtualisierungs-Limits';
$wb['generate_password_txt'] = 'Passwort erzeugen';
?>
......@@ -121,4 +121,5 @@ $wb["database_limits_txt"] = 'Database Limits';
$wb["cron_job_limits_txt"] = 'Cron Job Limits';
$wb["dns_limits_txt"] = 'DNS Limits';
$wb["virtualization_limits_txt"] = 'Virtualization Limits';
$wb['generate_password_txt'] = 'Generate Password';
?>
......@@ -115,4 +115,5 @@ $wb["database_limits_txt"] = 'Database Limits';
$wb["cron_job_limits_txt"] = 'Cron Job Limits';
$wb["dns_limits_txt"] = 'DNS Limits';
$wb["virtualization_limits_txt"] = 'Virtualization Limits';
$wb['generate_password_txt'] = 'Generate Password';
?>
......@@ -23,7 +23,7 @@
</div>
<div class="ctrlHolder">
<label for="password">{tmpl_var name='password_txt'}</label>
<input name="password" id="password" value="{tmpl_var name='password'}" size="30" maxlength="255" type="password" class="textInput" onkeyup="pass_check(this.value)" />
<input name="password" id="password" value="{tmpl_var name='password'}" size="30" maxlength="255" type="password" class="textInput" onkeyup="pass_check(this.value)" />&nbsp;<a href="javascript:void(0);" onClick="generatePassword('password');">{tmpl_var name='generate_password_txt'}</a>
</div>
<div class="ctrlHolder">
<p class="label">{tmpl_var name='password_strength_txt'}</p>
......
......@@ -23,7 +23,7 @@
</div>
<div class="ctrlHolder">
<label for="password">{tmpl_var name='password_txt'}</label>
<input name="password" id="password" value="{tmpl_var name='password'}" size="30" maxlength="255" type="password" class="textInput" onkeyup="pass_check(this.value)" />
<input name="password" id="password" value="{tmpl_var name='password'}" size="30" maxlength="255" type="password" class="textInput" onkeyup="pass_check(this.value)" />&nbsp;<a href="javascript:void(0);" onClick="generatePassword('password');">{tmpl_var name='generate_password_txt'}</a>
</div>
<div class="ctrlHolder">
<p class="label">{tmpl_var name='password_strength_txt'}</p>
......
......@@ -526,11 +526,13 @@ function getInternetExplorerVersion() {
return rv;
}
function password(length, special) {
function password(minLength, special){
var iteration = 0;
var password = "";
var randomNumber;
length = length || 10;
minLength = minLength || 10;
var maxLength = minLength + 5;
var length = getRandomInt(minLength, maxLength);
if(special == undefined){
var special = false;
}
......@@ -555,3 +557,8 @@ function generatePassword(passwordFieldID){
oldPWField.remove();
newPWField.attr('id', passwordFieldID).val(password(10, true)).trigger('keyup');
}
function getRandomInt(min, max){
return Math.floor(Math.random() * (max - min + 1)) + min;
}
......@@ -12,4 +12,5 @@ $wb['listname_txt'] = 'Listname';
$wb['client_txt'] = 'Client';
$wb['email_txt'] = 'Email';
$wb['password_txt'] = 'Password';
$wb['generate_password_txt'] = 'Passwort erzeugen';
?>
......@@ -41,4 +41,5 @@ $wb['login_txt'] = 'Login';
$wb['error_login_email_txt'] = 'Dieser Loginname ist nicht zulässig. Bitte verwenden Sie einen anderen Loginnamen oder die E-Mail-Adresse als Login.';
$wb['domain_txt'] = 'Domain';
$wb['now_txt'] = 'Now';
$wb['generate_password_txt'] = 'Passwort erzeugen';
?>
......@@ -12,4 +12,5 @@ $wb["listname_txt"] = 'Listname';
$wb["client_txt"] = 'Client';
$wb["email_txt"] = 'Email';
$wb["password_txt"] = 'Password';
$wb['generate_password_txt'] = 'Generate Password';
?>
\ No newline at end of file
......@@ -43,4 +43,5 @@ $wb['login_error_unique'] = 'Login is already taken.';
$wb['login_error_regex'] = 'Valid characters are A-Z, a-z, 0-9, ., _ and -.';
$wb['login_txt'] = 'Login';
$wb['error_login_email_txt'] = 'This login is not allowed. Please enter a different login or use the mail address as login.';
$wb['generate_password_txt'] = 'Generate Password';
?>
......@@ -60,7 +60,7 @@
</tmpl_if>
<div class="ctrlHolder">
<label for="password">{tmpl_var name='password_txt'}</label>
<input name="password" id="password" value="{tmpl_var name='password'}" size="30" maxlength="255" type="password" class="textInput" onkeyup="pass_check(this.value)" />
<input name="password" id="password" value="{tmpl_var name='password'}" size="30" maxlength="255" type="password" class="textInput" onkeyup="pass_check(this.value)" />&nbsp;<a href="javascript:void(0);" onClick="generatePassword('password');">{tmpl_var name='generate_password_txt'}</a>
</div>
<div class="ctrlHolder">
<p class="label">{tmpl_var name='password_strength_txt'}</p>
......
......@@ -23,7 +23,7 @@
</div></tmpl_if>
<div class="ctrlHolder">
<label for="password">{tmpl_var name='password_txt'}</label>
<input name="password" id="password" value="{tmpl_var name='password'}" size="30" maxlength="255" type="password" class="textInput" onkeyup="pass_check(this.value)" />
<input name="password" id="password" value="{tmpl_var name='password'}" size="30" maxlength="255" type="password" class="textInput" onkeyup="pass_check(this.value)" />&nbsp;<a href="javascript:void(0);" onClick="generatePassword('password');">{tmpl_var name='generate_password_txt'}</a>
</div>
<div class="ctrlHolder">
<p class="label">{tmpl_var name='password_strength_txt'}</p>
......
......@@ -5,4 +5,5 @@ $wb['password_mismatch'] = 'Die Passw&ouml;rter stimmen nicht &uuml;berein.';
$wb['password_strength_txt'] = 'Passwortkomplexit&auml;t';
$wb['Form to edit the user password and language.'] = 'Formular, um das Benutzerpasswort und die Sprache zu bearbeiten.';
$wb['Settings'] = 'Einstellungen';
$wb['generate_password_txt'] = 'Passwort erzeugen';
?>
......@@ -5,4 +5,5 @@ $wb["language_txt"] = 'Language';
$wb["password_mismatch"] = 'The password in the second password field does not match the first password.';
$wb["Form to edit the user password and language."] = 'Form to edit the user password and language.';
$wb["Settings"] = 'Settings';
$wb['generate_password_txt'] = 'Generate Password';
?>
......@@ -7,7 +7,7 @@
<fieldset class="inlineLabels">
<div class="ctrlHolder">
<label for="passwort">{tmpl_var name='passwort_txt'}</label>
<input name="passwort" id="passwort" value="{tmpl_var name='passwort'}" size="15" maxlength="100" type="password" class="textInput" onkeyup="pass_check(this.value)"/>
<input name="passwort" id="passwort" value="{tmpl_var name='passwort'}" size="15" maxlength="100" type="password" class="textInput" onkeyup="pass_check(this.value)"/>&nbsp;<a href="javascript:void(0);" onClick="generatePassword('passwort');">{tmpl_var name='generate_password_txt'}</a>
</div>
<div class="ctrlHolder">
<p class="label">{tmpl_var name='password_strength_txt'}</p>
......
......@@ -37,4 +37,5 @@ $wb['io_priority_error_empty'] = 'I/O Priorit&auml;t ist leer.';
$wb['template_nameserver_error_empty'] = 'Nameserver ist leer.';
$wb['Virtual server'] = 'Virtueller Server';
$wb['Advanced'] = 'Erweitert';
$wb['generate_password_txt'] = 'Passwort erzeugen';
?>
......@@ -37,4 +37,5 @@ $wb["io_priority_error_empty"] = 'I/O priority is empty.';
$wb["template_nameserver_error_empty"] = 'Nameserver(s) is empty.';
$wb["Virtual server"] = 'Virtual server';
$wb["Advanced"] = 'Advanced';
$wb['generate_password_txt'] = 'Generate Password';
?>
\ No newline at end of file
......@@ -69,7 +69,7 @@
</div>
<div class="ctrlHolder">
<label for="vm_password">{tmpl_var name='vm_password_txt'}</label>
<input name="vm_password" id="vm_password" value="{tmpl_var name='vm_password'}" size="30" maxlength="255" type="text" class="textInput" />
<input name="vm_password" id="vm_password" value="{tmpl_var name='vm_password'}" size="30" maxlength="255" type="text" class="textInput" />&nbsp;<a href="javascript:void(0);" onClick="generatePassword('vm_password');">{tmpl_var name='generate_password_txt'}</a>
</div>
<div class="ctrlHolder">
<p class="label">{tmpl_var name='start_boot_txt'}</p>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment