If result param is null not show bad result message when delete,disable user - #122

This commit is contained in:
enriquecd 2017-04-12 13:44:25 +02:00
parent b3e1125526
commit 976fea2613
1 changed files with 12 additions and 11 deletions

View File

@ -127,7 +127,7 @@ else {
$disable_user = get_parameter ("disable_user", false);
if (isset ($_GET["user_del"])) { //delete user
if (isset ($_GET["user_del"]) && isset ($_GET["delete_user"])) { //delete user
$id_user = get_parameter ("delete_user", 0);
// Only allow delete user if is not the actual user
if ($id_user != $config['id_user']) {
@ -197,16 +197,17 @@ elseif ($disable_user !== false) { //disable_user
else {
$result = false;
}
if ($disable_user == 1) {
ui_print_result_message ($result,
__('Successfully disabled'),
__('There was a problem disabling user'));
}
else {
ui_print_result_message ($result,
__('Successfully enabled'),
__('There was a problem enabling user'));
if($result != null){
if ($disable_user == 1) {
ui_print_result_message ($result,
__('Successfully disabled'),
__('There was a problem disabling user'));
}
else {
ui_print_result_message ($result,
__('Successfully enabled'),
__('There was a problem enabling user'));
}
}
}