} } else { $_SESSION['dialog']['info'][] = _('User is not on banned users list') . ' (' . _('username') . ': ' . $_REQUEST['uname'] . ')'; } header("Location: " . _u('index.php?app=main&inc=core_user&route=user_mgmnt&op=user_list&view=' . $view)); exit; break; case "user_ban": $uid = user_username2uid($_REQUEST['uname']); if ($uid && ($uid == 1 || $uid == $user_config['uid'])) { $_SESSION['dialog']['info'][] = _('Account admin or currently logged in administrator cannot be banned'); } else { if (user_banned_get($uid)) { $_SESSION['dialog']['info'][] = _('User is already on banned users list') . ' (' . _('username') . ': ' . $_REQUEST['uname'] . ')'; } else { if (user_banned_add($uid)) { $_SESSION['dialog']['info'][] = _('Account has been banned') . ' (' . _('username') . ': ' . $_REQUEST['uname'] . ')'; } else { $_SESSION['dialog']['info'][] = _('Unable to ban account') . ' (' . _('username') . ': ' . $_REQUEST['uname'] . ')'; } } } header("Location: " . _u('index.php?app=main&inc=core_user&route=user_mgmnt&op=user_list&view=' . $view)); exit; break; case "login_as": user_session_remove($_SESSION['uid'], $_SESSION['sid']); $uid = user_username2uid($_REQUEST['uname']); auth_login_as($uid); if (auth_isvalid()) { logger_print("login as u:" . $_SESSION['username'] . " uid:" . $uid . " status:" . $_SESSION['status'] . " sid:" . $_SESSION['sid'] . " ip:" . $_SERVER['REMOTE_ADDR'], 2, "user_mgmnt");
function webservices_account_ban($uid) { if ($parent_uid = user_banned_add($uid)) { $json['status'] = 'OK'; $json['error'] = '0'; } else { $json['status'] = 'ERR'; $json['error'] = '612'; } return $json; }