* When enabling password_sip/web_validate, panel checks password against username (web and sip, respectively), and runs it through cracklib to enforce a reasonably strong password. * Add auto-generate buttons next to web/sip password. Change-Id: I11f5f6c2d69dc5658f298094f7d17d26d0a26ee1changes/59/16059/6
parent
ab869fa2a4
commit
373dd4c202
@ -0,0 +1,17 @@
|
||||
#!/usr/bin/perl
|
||||
use strict;
|
||||
use warnings;
|
||||
use English;
|
||||
|
||||
use Crypt::Cracklib;
|
||||
|
||||
my $pass = $ARGV[0];
|
||||
unless(defined $pass) {
|
||||
die "Usage: $PROGRAM_NAME <password>\n";
|
||||
}
|
||||
|
||||
if(check($pass, undef)) {
|
||||
print "Password ok\n";
|
||||
} else {
|
||||
print "Password NOT ok\n";
|
||||
}
|
@ -0,0 +1,25 @@
|
||||
function generate_password(len) {
|
||||
var text = "";
|
||||
var possible = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!?/-_%$()[]";
|
||||
for (var i = 0; i < len; i++) {
|
||||
text += possible.charAt(Math.floor(Math.random() * possible.length));
|
||||
}
|
||||
return text;
|
||||
}
|
||||
$(document).ready(function() {
|
||||
var btn = '<div id="gen_password" class="btn btn-primary pull-right" style="width:10%">Generate</div>';
|
||||
|
||||
var passwd_btn = $(btn);
|
||||
passwd_btn.click(function() {
|
||||
$('input#password').val(generate_password(16));
|
||||
});
|
||||
$('input#password').attr("style", "width: 80% !important");
|
||||
$('input#password').after(passwd_btn);
|
||||
|
||||
var webpasswd_btn = $(btn);
|
||||
webpasswd_btn.click(function() {
|
||||
$('input#webpassword').val(generate_password(16));
|
||||
});
|
||||
$('input#webpassword').attr("style", "width: 80% !important");
|
||||
$('input#webpassword').after(webpasswd_btn);
|
||||
});
|
Loading…
Reference in new issue