Some functions moved from server_privilages.js to functions.js and typo error removed
Signed-off-by: Piyush Vijay <piyushvijay.1997@gmail.com>
This commit is contained in:
parent
224ae6d86b
commit
38cfa4630c
@ -5105,3 +5105,61 @@ jQuery.fn.getPostData = function () {
|
||||
}
|
||||
return dataPost;
|
||||
};
|
||||
|
||||
/**
|
||||
* Copy of functions copied from different files to make them globally
|
||||
* available so that build does not break during modularisation
|
||||
*/
|
||||
/**
|
||||
* server_privilages.js
|
||||
*/
|
||||
/**
|
||||
* Validates the "add a user" form
|
||||
*
|
||||
* @return boolean whether the form is validated or not
|
||||
*/
|
||||
function checkAddUser (the_form) {
|
||||
if (the_form.elements.pred_hostname.value === 'userdefined' && the_form.elements.hostname.value === '') {
|
||||
alert(PMA_messages.strHostEmpty);
|
||||
the_form.elements.hostname.focus();
|
||||
return false;
|
||||
}
|
||||
|
||||
if (the_form.elements.pred_username.value === 'userdefined' && the_form.elements.username.value === '') {
|
||||
alert(PMA_messages.strUserEmpty);
|
||||
the_form.elements.username.focus();
|
||||
return false;
|
||||
}
|
||||
|
||||
return PMA_checkPassword($(the_form));
|
||||
} // end of the 'checkAddUser()' function
|
||||
|
||||
function checkPasswordStrength (value, meter_obj, meter_object_label, username) {
|
||||
// List of words we don't want to appear in the password
|
||||
var customDict = [
|
||||
'phpmyadmin',
|
||||
'mariadb',
|
||||
'mysql',
|
||||
'php',
|
||||
'my',
|
||||
'admin',
|
||||
];
|
||||
if (username !== null) {
|
||||
customDict.push(username);
|
||||
}
|
||||
var zxcvbn_obj = zxcvbn(value, customDict);
|
||||
var strength = zxcvbn_obj.score;
|
||||
strength = parseInt(strength);
|
||||
meter_obj.val(strength);
|
||||
switch (strength) {
|
||||
case 0: meter_object_label.html(PMA_messages.strExtrWeak);
|
||||
break;
|
||||
case 1: meter_object_label.html(PMA_messages.strVeryWeak);
|
||||
break;
|
||||
case 2: meter_object_label.html(PMA_messages.strWeak);
|
||||
break;
|
||||
case 3: meter_object_label.html(PMA_messages.strGood);
|
||||
break;
|
||||
case 4: meter_object_label.html(PMA_messages.strStrong);
|
||||
}
|
||||
}
|
||||
@ -9,57 +9,6 @@
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* Validates the "add a user" form
|
||||
*
|
||||
* @return boolean whether the form is validated or not
|
||||
*/
|
||||
function checkAddUser (the_form) {
|
||||
if (the_form.elements.pred_hostname.value === 'userdefined' && the_form.elements.hostname.value === '') {
|
||||
alert(PMA_messages.strHostEmpty);
|
||||
the_form.elements.hostname.focus();
|
||||
return false;
|
||||
}
|
||||
|
||||
if (the_form.elements.pred_username.value === 'userdefined' && the_form.elements.username.value === '') {
|
||||
alert(PMA_messages.strUserEmpty);
|
||||
the_form.elements.username.focus();
|
||||
return false;
|
||||
}
|
||||
|
||||
return PMA_checkPassword($(the_form));
|
||||
} // end of the 'checkAddUser()' function
|
||||
|
||||
function checkPasswordStrength (value, meter_obj, meter_object_label, username) {
|
||||
// List of words we don't want to appear in the password
|
||||
customDict = [
|
||||
'phpmyadmin',
|
||||
'mariadb',
|
||||
'mysql',
|
||||
'php',
|
||||
'my',
|
||||
'admin',
|
||||
];
|
||||
if (username !== null) {
|
||||
customDict.push(username);
|
||||
}
|
||||
var zxcvbn_obj = zxcvbn(value, customDict);
|
||||
var strength = zxcvbn_obj.score;
|
||||
strength = parseInt(strength);
|
||||
meter_obj.val(strength);
|
||||
switch (strength) {
|
||||
case 0: meter_obj_label.html(PMA_messages.strExtrWeak);
|
||||
break;
|
||||
case 1: meter_obj_label.html(PMA_messages.strVeryWeak);
|
||||
break;
|
||||
case 2: meter_obj_label.html(PMA_messages.strWeak);
|
||||
break;
|
||||
case 3: meter_obj_label.html(PMA_messages.strGood);
|
||||
break;
|
||||
case 4: meter_obj_label.html(PMA_messages.strStrong);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* AJAX scripts for server_privileges page.
|
||||
*
|
||||
@ -75,7 +24,6 @@ function checkPasswordStrength (value, meter_obj, meter_object_label, username)
|
||||
* @name document.ready
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* Unbind all event handlers before tearing down a page
|
||||
*/
|
||||
|
||||
@ -40,10 +40,10 @@ var plugins = [
|
||||
export default [{
|
||||
mode: MODE,
|
||||
entry: {
|
||||
db_search_new: './js/src/db_search.js'
|
||||
index_new: './js/src/index.js'
|
||||
},
|
||||
output: {
|
||||
filename: 'db_search_new.js',
|
||||
filename: '[name].js',
|
||||
path: path.resolve(__dirname, 'js/dist'),
|
||||
publicPath: PUBLIC_PATH
|
||||
},
|
||||
|
||||
Loading…
Reference in New Issue
Block a user