Commit 00385e0d authored by Falko Timme's avatar Falko Timme

- Added JavaScript functions for generating passwords.

- Added "Generate Password" links to forms of the sites module.
parent 77dbe511
......@@ -525,3 +525,33 @@ function getInternetExplorerVersion() {
}
return rv;
}
function password(length, special) {
var iteration = 0;
var password = "";
var randomNumber;
length = length || 10;
if(special == undefined){
var special = false;
}
while(iteration < length){
randomNumber = (Math.floor((Math.random() * 100)) % 94) + 33;
if(!special){
if ((randomNumber >=33) && (randomNumber <=47)) { continue; }
if ((randomNumber >=58) && (randomNumber <=64)) { continue; }
if ((randomNumber >=91) && (randomNumber <=96)) { continue; }
if ((randomNumber >=123) && (randomNumber <=126)) { continue; }
}
iteration++;
password += String.fromCharCode(randomNumber);
}
return password;
}
function generatePassword(passwordFieldID){
var oldPWField = jQuery('#'+passwordFieldID);
var newPWField = oldPWField.clone();
newPWField.attr('type', 'text').attr('id', 'tmp'+passwordFieldID).insertBefore(oldPWField);
oldPWField.remove();
newPWField.attr('id', passwordFieldID).val(password(10, true)).trigger('keyup');
}
......@@ -22,4 +22,5 @@ $wb['database_charset_change_txt'] = 'Der Zeichensatz der Datenbank kann nicht g
$wb['password_strength_txt'] = 'Passwortkomplexität';
$wb['database_name_error_len'] = 'Datenbank Name - {db} - zu lang. Die max. Datenbank Namen Länge inkl. Präfix ist 64 Zeichen.';
$wb['database_user_error_len'] = 'Datenbank Benutzername - {user}- zu lang. Die max. Datenbank Benutzernamen Länge inkl. Präfix ist 16 Zeichen.';
$wb['generate_password_txt'] = 'Passwort erzeugen';
?>
......@@ -24,7 +24,8 @@ $wb['directory_error_empty'] = 'Verzeichnis ist leer.';
$wb['password_strength_txt'] = 'Passwortkomplexität';
$wb['directory_error_notinweb'] = 'Das Verzeichnis befindet sich nicht innerhalb des Verzeichnisses der Website.';
$wb['parent_domain_id_error_empty'] = 'Keine Domain ausgewählt.';
$wb['quota_size_error_regex'] = 'Quota: enter a -1 for unlimited or a number > 0';
$wb['dir_dot_error'] = 'No .. in path allowed.';
$wb['dir_slashdot_error'] = 'No ./ in path allowed.';
$wb['quota_size_error_regex'] = 'Quota: Geben Sie -1 ein für unlimitiert oder eine Nummer > 0';
$wb['dir_dot_error'] = 'Kein .. im Pfad erlaubt.';
$wb['dir_slashdot_error'] = 'Kein ./ im Pfad erlaubt.';
$wb['generate_password_txt'] = 'Passwort erzeugen';
?>
......@@ -20,6 +20,7 @@ $wb['parent_domain_id_error_empty'] = 'Keine Website ausgewählt.';
$wb['puser_txt'] = 'Web Username';
$wb['pgroup_txt'] = 'Web Group';
$wb['ssh_rsa_txt'] = 'SSH-RSA Public Key (f&uuml;r key-basierte Logins)';
$wb['dir_dot_error'] = 'No .. in path allowed.';
$wb['dir_slashdot_error'] = 'No ./ in path allowed.';
$wb['dir_dot_error'] = 'Kein .. im Pfad erlaubt.';
$wb['dir_slashdot_error'] = 'Kein ./ im Pfad erlaubt.';
$wb['generate_password_txt'] = 'Passwort erzeugen';
?>
......@@ -98,4 +98,5 @@ $wb["pm_max_requests_txt"] = 'PHP-FPM pm.max_requests';
$wb["pm_process_idle_timeout_error_regex"] = 'PHP-FPM pm.process_idle_timeout mu&szlig; eine positive ganze Zahl sein.';
$wb["pm_max_requests_error_regex"] = 'PHP-FPM pm.max_requests mu&szlig; eine ganze Zahl >= 0 sein.';
$wb["pm_ondemand_hint_txt"] = 'Bitte beachten Sie, daß Ihre PHP-Version >= 5.3.9 sein muß, wenn Sie den ondemand Process-Manager nutzen möchten. Wenn Sie ondemand für eine ältere PHP-Version auswählen, wird PHP nicht mehr starten!';
$wb['generate_password_txt'] = 'Passwort erzeugen';
?>
<?php
$wb['web_folder_id_txt'] = 'Folder';
$wb['web_folder_id_txt'] = 'Ordner';
$wb['username_txt'] = 'Username';
$wb['password_txt'] = 'Password';
$wb['active_txt'] = 'Active';
$wb['folder_error_empty'] = 'No web folder selecetd.';
$wb['password_txt'] = 'Passwort';
$wb['active_txt'] = 'Aktiv';
$wb['folder_error_empty'] = 'Kein Web-Ordner ausgewhlt.';
$wb['generate_password_txt'] = 'Passwort erzeugen';
?>
......@@ -12,6 +12,7 @@ $wb['username_error_unique'] = 'Der Benutzername muss einzigartig sein.';
$wb['username_error_regex'] = 'Der Benutzername enthält nicht erlaubte Zeichen.';
$wb['directory_error_empty'] = 'Verzeichnis ist leer.';
$wb['parent_domain_id_error_empty'] = 'Keine Website ausgewählt.';
$wb['dir_dot_error'] = 'No .. in path allowed.';
$wb['dir_slashdot_error'] = 'No ./ in path allowed.';
$wb['dir_dot_error'] = 'Kein .. im Pfad erlaubt.';
$wb['dir_slashdot_error'] = 'Kein ./ im Pfad erlaubt.';
$wb['generate_password_txt'] = 'Passwort erzeugen';
?>
......@@ -27,4 +27,5 @@ $wb["database_site_error_empty"] = 'Select the site to which the database belong
$wb["select_site_txt"] = '- Select Site -';
$wb["btn_save_txt"] = 'Save';
$wb["btn_cancel_txt"] = 'Cancel';
$wb['generate_password_txt'] = 'Generate Password';
?>
......@@ -28,4 +28,5 @@ $wb["parent_domain_id_error_empty"] = 'No website selected.';
$wb["quota_size_error_regex"] = 'Quota: enter a -1 for unlimited or a number > 0';
$wb['dir_dot_error'] = 'No .. in path allowed.';
$wb['dir_slashdot_error'] = 'No ./ in path allowed.';
$wb['generate_password_txt'] = 'Generate Password';
?>
......@@ -23,4 +23,5 @@ $wb["parent_domain_id_error_empty"] = 'No website selected.';
$wb["ssh_rsa_txt"] = 'SSH-RSA Public Key (for key-based logins)';
$wb['dir_dot_error'] = 'No .. in path allowed.';
$wb['dir_slashdot_error'] = 'No ./ in path allowed.';
$wb['generate_password_txt'] = 'Generate Password';
?>
......@@ -98,4 +98,5 @@ $wb["pm_max_requests_txt"] = 'PHP-FPM pm.max_requests';
$wb["pm_process_idle_timeout_error_regex"] = 'PHP-FPM pm.process_idle_timeout must be a positive integer value.';
$wb["pm_max_requests_error_regex"] = 'PHP-FPM pm.max_requests must be an integer value >= 0.';
$wb["pm_ondemand_hint_txt"] = 'Please note that you must have PHP version >= 5.3.9 in order to use the ondemand process manager. If you select ondemand for an older PHP version, PHP will not start anymore!';
$wb['generate_password_txt'] = 'Generate Password';
?>
\ No newline at end of file
......@@ -4,4 +4,5 @@ $wb["username_txt"] = 'Username';
$wb["password_txt"] = 'Password';
$wb["active_txt"] = 'Active';
$wb["folder_error_empty"] = 'No web folder selecetd.';
$wb['generate_password_txt'] = 'Generate Password';
?>
\ No newline at end of file
......@@ -15,4 +15,5 @@ $wb["parent_domain_id_error_empty"] = 'No website selected.';
$wb['password_strength_txt'] = 'Password strength';
$wb['dir_dot_error'] = 'No .. in path allowed.';
$wb['dir_slashdot_error'] = 'No ./ in path allowed.';
$wb['generate_password_txt'] = 'Generate Password';
?>
......@@ -50,7 +50,7 @@
</div>
<div class="ctrlHolder">
<label for="database_password">{tmpl_var name='database_password_txt'}</label>
<input name="database_password" id="database_password" value="{tmpl_var name='database_password'}" size="30" maxlength="255" type="password" class="textInput formLengthHalf" onkeyup="pass_check(this.value)" />
<input name="database_password" id="database_password" value="{tmpl_var name='database_password'}" size="30" maxlength="255" type="password" class="textInput formLengthHalf" onkeyup="pass_check(this.value)" />&nbsp;<a href="javascript:void(0);" onClick="generatePassword('database_password');">{tmpl_var name='generate_password_txt'}</a>
</div>
<div class="ctrlHolder">
<p class="label">{tmpl_var name='password_strength_txt'}</p>
......
......@@ -18,7 +18,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>
......@@ -45,4 +45,4 @@
</div>
</div>
</div>
</div>
\ No newline at end of file
......@@ -26,7 +26,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>
......
......@@ -10,7 +10,7 @@
</div>
<div class="ctrlHolder">
<label for="stats_password">{tmpl_var name='stats_password_txt'}</label>
<input name="stats_password" id="stats_password" value="{tmpl_var name='stats_password'}" size="30" maxlength="255" type="password" class="textInput" />
<input name="stats_password" id="stats_password" value="{tmpl_var name='stats_password'}" size="30" maxlength="255" type="password" class="textInput" />&nbsp;<a href="javascript:void(0);" onClick="generatePassword('stats_password');">{tmpl_var name='generate_password_txt'}</a>
</div>
<div class="ctrlHolder">
<label for="stats_type">{tmpl_var name='stats_type_txt'}</label>
......
......@@ -17,7 +17,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" />
<input name="password" id="password" value="{tmpl_var name='password'}" size="30" maxlength="255" type="password" class="textInput" />&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='active_txt'}</p>
......
......@@ -26,7 +26,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>
......
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