diff --git a/libraries/user_details.js b/libraries/user_details.js index af496f6de..3034700b8 100644 --- a/libraries/user_details.js +++ b/libraries/user_details.js @@ -63,7 +63,32 @@ function checkAddUser() } return checkPassword(the_form); -} // end of the 'addUser()' function +} // end of the 'checkAddUser()' function + + +/** + * Validates the "update a profile" form + * + * @return boolean whether the form is validated or not + */ +function checkUpdProfile() +{ + var the_form = document.forms['updUserForm']; + + if (the_form.elements['anyhost'][1].checked && the_form.elements['new_server'].value == '') { + alert(jsHostEmpty); + the_form.elements['new_server'].focus(); + return false; + } + + if (the_form.elements['anyuser'][1].checked && the_form.elements['new_user'].value == '') { + alert(jsUserEmpty); + the_form.elements['new_user'].focus(); + return false; + } + + return checkPassword(the_form); +} // end of the 'checkUpdProfile()' function /** diff --git a/user_details.php3 b/user_details.php3 index fb34e39f3..8ddd31596 100644 --- a/user_details.php3 +++ b/user_details.php3 @@ -605,7 +605,7 @@ function edit_operations($host, $user)