$token = token(); $packages = ZPackage::getPackages(); if (checktoken()) { $username = $_REQUEST['name']; $password = $_REQUEST['password']; $domain = $_REQUEST['domain']; $package = intval($_REQUEST['package']); $shell = $_REQUEST['shell']; $break = false; // check username if (true !== ($res = ZUser::chkUsername($username))) { $err['name'] = $res == 'invalid' ? t('Username Invalid. No uppercase, not starting with number, less than 7 chars.') : t('Username Occupied.'); $break = true; } // check password if (true !== ($res = ZUser::chkPassword($password))) { $err['password'] = t('Password can not be empty.'); $break = true; } // check domain if (true !== ($res = ZVhosts::chkDomain($domain))) { $err['domain'] = t('Domain Invalid.'); if ($res == 'occupied') { $err['domain'] = t('Domain Occupied.'); } $break = true; } if ($break) { break; } // execute!
function chkPassword($password) { return ZUser::chkPassword($password); }