cfoe
2012-05-24 0ce0fdbef0940e4408abc8a717d8321dae0e191c
interface/web/js/scrigo.js.php
@@ -526,11 +526,13 @@
    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;
   }
@@ -553,5 +555,27 @@
   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');
   newPWField.attr('id', passwordFieldID).val(password(10, false)).trigger('keyup');
}
function checkPassMatch(pwField1,pwField2){
    var rpass = jQuery('#'+pwField2).val();
    var npass = jQuery('#'+pwField1).val();
    if(npass!= rpass) {
      jQuery('#confirmpasswordOK').hide();
        jQuery('#confirmpasswordError').show();
      jQuery('button.positive').attr('disabled','disabled');
      jQuery('.tabbox_tabs ul li a').attr('onclick','return false;');
        return false;
    } else {
      jQuery('#confirmpasswordError').hide();
        jQuery('#confirmpasswordOK').show();
      jQuery('button.positive').removeAttr('disabled');
      jQuery('.tabbox_tabs ul li a').removeAttr('onclick');
    }
}
function getRandomInt(min, max){
    return Math.floor(Math.random() * (max - min + 1)) + min;
}