Routine pour suggérer des mots de passe compliqué.
Maintenant, faut l'intégrer dans les pages web
This commit is contained in:
parent
639e948dfd
commit
50fb508e6a
|
@ -252,6 +252,7 @@ bureau/admin/images/passwordstrength.jpg -text
|
||||||
bureau/admin/images/plus.png -text
|
bureau/admin/images/plus.png -text
|
||||||
bureau/admin/images/pumpkin.png -text
|
bureau/admin/images/pumpkin.png -text
|
||||||
bureau/admin/images/quota.png -text
|
bureau/admin/images/quota.png -text
|
||||||
|
bureau/admin/images/refresh.png -text
|
||||||
bureau/admin/images/row-down.png -text
|
bureau/admin/images/row-down.png -text
|
||||||
bureau/admin/images/row-down.png2 -text
|
bureau/admin/images/row-down.png2 -text
|
||||||
bureau/admin/images/schedule.png -text
|
bureau/admin/images/schedule.png -text
|
||||||
|
|
|
@ -66,14 +66,8 @@ if (isset($error) && $error) {
|
||||||
<label for="login"><?php __("Username"); ?></label></th><td>
|
<label for="login"><?php __("Username"); ?></label></th><td>
|
||||||
<select class="inl" name="prefixe"><?php $ftp->select_prefix_list($prefixe); ?></select> <b>_</b> <input type="text" class="int" name="login" id="login" value="" size="20" maxlength="64" />
|
<select class="inl" name="prefixe"><?php $ftp->select_prefix_list($prefixe); ?></select> <b>_</b> <input type="text" class="int" name="login" id="login" value="" size="20" maxlength="64" />
|
||||||
</td></tr>
|
</td></tr>
|
||||||
<tr><th><label for="dir"><?php __("Folder"); ?></label></th><td><input type="text" class="int" name="dir" id="dir" value="" size="20" maxlength="255" />
|
<tr><th><label for="dir"><?php __("Folder"); ?></label></th><td><input type="text" class="int" name="dir" id="dir" value="" size="20" maxlength="255" /></td></tr>
|
||||||
<script type="text/javascript">
|
<tr><th><label for="pass"><?php __("Password"); ?></label></th><td><input type="password" class="int" name="pass" id="pass" value="" size="20" maxlength="64" /><?php display_div_generate_password(); ?></td></tr>
|
||||||
<!--
|
|
||||||
document.write(" <input type=\"button\" name=\"bff\" onclick=\"browseforfolder('main.dir');\" value=\" <?php __("Choose a folder..."); ?> \" class=\"bff\">");
|
|
||||||
// -->
|
|
||||||
</script>
|
|
||||||
</td></tr>
|
|
||||||
<tr><th><label for="pass"><?php __("Password"); ?></label></th><td><input type="password" class="int" name="pass" id="pass" value="" size="20" maxlength="64" /></td></tr>
|
|
||||||
<tr><th><label for="passconf"><?php __("Confirm password"); ?></label></th><td><input type="password" class="int" name="passconf" id="passconf" value="" size="20" maxlength="64" /></td></tr>
|
<tr><th><label for="passconf"><?php __("Confirm password"); ?></label></th><td><input type="password" class="int" name="passconf" id="passconf" value="" size="20" maxlength="64" /></td></tr>
|
||||||
<tr class="trbtn"><td colspan="2">
|
<tr class="trbtn"><td colspan="2">
|
||||||
<input type="submit" class="inb" name="submit" value="<?php __("Create this new FTP account."); ?>" />
|
<input type="submit" class="inb" name="submit" value="<?php __("Create this new FTP account."); ?>" />
|
||||||
|
|
Binary file not shown.
After Width: | Height: | Size: 842 B |
|
@ -209,3 +209,27 @@ function false_if_empty(id,err_msg) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function generate_password(len){
|
||||||
|
len = parseInt(len);
|
||||||
|
if(!len)
|
||||||
|
len = 8;
|
||||||
|
var password = "";
|
||||||
|
var chars = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
|
||||||
|
var charsN = chars.length;
|
||||||
|
var nextChar;
|
||||||
|
|
||||||
|
for(i=0; i<len; i++){
|
||||||
|
nextChar = chars.charAt(Math.floor(Math.random()*charsN));
|
||||||
|
password += nextChar;
|
||||||
|
}
|
||||||
|
return password;
|
||||||
|
}
|
||||||
|
|
||||||
|
function generate_password_html(id, size) {
|
||||||
|
$("#"+id).html("<input type='textbox' size=8 disabled value='"+generate_password(size)+"' /> <a href='javascript:generate_password_html("+id+","+size+");'><img src='/images/refresh.png' alt='Refresh'/></a>");
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -600,6 +600,14 @@ function create_pass($length = 8){
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function display_div_generate_password($pass_size=8) {
|
||||||
|
$id=rand(1,1000);
|
||||||
|
echo "<div id='$id' style='display:none;'><a href=\"javascript:generate_password_html('$id',$pass_size);\">";
|
||||||
|
__("Clic here to generate a password");
|
||||||
|
echo "</a></div>";
|
||||||
|
echo "<script type='text/javascript'>$('#'+$id).show();</script>";
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
Loading…
Reference in New Issue