isadmin() || setmsg(t('Permission Dennied.')); $new = intval($_REQUEST['package']); $res = ZPackage::setUserPackage($name, $new) && syncCBand(); $package_name = ZPackage::getPackage($new)->name; $message = t("Package for {$name} has been changed to ") . "[{$package_name}]."; setmsg($message, 'notice', 'self'); } if ('shell' == $op) { isadmin() || setmsg(t('Permission Dennied.')); $new = $_REQUEST['shell']; $res = ZShell::setUserShell($name, $new); $message = t("Shell for {$name} has been changed to ") . "[{$new}]."; setmsg($message, 'notice', 'self'); } if ('suspend' == $op) { if (ZUser::suspendUser($name, !intval($_REQUEST['suspend']))) { setmsg('', 'notice'); } else { setmsg(t('Error')); } } if ('remove' == $op) { header("Location: ?task=remove&name={$name}&token={$_REQUEST['token']}"); exit; } } break; case 'switch': $name = isset($_REQUEST['name']) ? $_REQUEST['name'] : ''; $name = preg_replace("/[^a-z0-9]+/i", "", $name); $user = ZUser::getUser($name);
function suspendUser($name, $state) { return ZUser::suspendUser($name, $state); }