function tryExit() { global $rcodes; $message = ''; $rnum = sizeof($rcodes); if (!$rnum) { return; } for ($i = 0; $i < $rnum; $i++) { $modifed = true; switch ($rcodes[$i]) { case 2: $message .= lng('INCORRECT') . '. (' . lng('LOGIN') . ')'; break; case 3: $message .= lng('INCORRECT') . '. (' . lng('PASS') . ')'; break; case 4: $message .= lng('INCORRECT') . '. (' . lng('REPASS') . ')'; break; case 12: $message .= lng('INCORRECT') . '. (' . lng('EMAIL') . ')'; break; case 6: $message .= lng('INCORRECT_LEN') . '. (' . lng('LOGIN') . ')'; break; case 7: $message .= lng('INCORRECT_LEN') . '. (' . lng('PASS') . ')'; break; case 8: $message .= lng('INCORRECT_LEN') . '. (' . lng('REPASS') . ')'; break; case 9: $message .= lng('REPASSVSPASS'); break; case 13: $message .= lng('INCORRECT_LEN') . '. (' . lng('EMAIL') . ')'; break; default: $modifed = false; break; } if ($modifed) { $message .= "<br />"; } } aExit(2, $message); }
function CaptchaCheck($exit_mess = 2, $ajaxExit = true, $post_name = 'antibot') { if (!isset($_SESSION)) { session_start(); } $input = Filter::input($post_name, 'post', 'int', true); if (empty($_SESSION['code']) or $input === false or $_SESSION['code'] != $input) { if (isset($_SESSION['code'])) { unset($_SESSION['code']); } if ($ajaxExit) { aExit($exit_mess, lng('CAPTCHA_FAIL')); } return false; } unset($_SESSION['code']); return true; }
public function aCreate($message, $fUser, $item_id, $item_type) { global $ajax_message, $config; if ($this->id) { return 0; } $this->parent_id = (int) $item_id; $this->parent_type = (int) $item_type; if (!$this->initParent()) { aExit(2, lng('MESS_NOT_FOUND')); } loadTool('ajax.php'); if (!$fUser->id()) { aExit(1, lng('MESS_FAIL')); } if (!$fUser->canPostComment()) { aExit(1, lng('MESS_TIMEOUT')); } $rcode = $this->Create($message, $fUser->id(), $item_id, $item_type); if ($rcode == 1701) { aExit(1, lng('MESS_SHORT')); } elseif ($rcode == 1702 or $rcode == 1703) { aExit(2, lng('MESS_NOT_FOUND')); } elseif ($rcode == 1) { $ajax_message['comment_html'] = $this->Show($fUser); $ajax_message['comment_revers'] = $config['comm_revers']; $fUser->setStatistic('comments_num', 1); aExit(0, lng('MESS_COMPLITE')); } else { aExit(3, lng('MESS_FAIL')); } }
break; case 2: case 6: $error = 'Ошибка добавления файла. Включите лог для просмотра подробной информации.'; break; case 7: $error = 'Ошибка при сохранении изображения предварительного просмотра.'; break; } } if ($result == 0) { $skin_info = $sp_item->getInfo(); $ajax_message['gender'] = (int) $skin_info['gender']; $ajax_message['ratio'] = (int) $skin_info['ratio']; } aExit($result, $error); break; default: exit; break; } } /* Default vars */ $page = 'Галерея образов'; $curlist = isset($_GET['l']) ? (int) $_GET['l'] : 1; if ($curlist <= 0) { $curlist = 1; } $ratio = isset($_GET['ratio']) ? (int) $_GET['ratio'] : 1; $skin_id = isset($_GET['cid']) ? (int) $_GET['cid'] : false; $mode = 'base';
case 1902: $message .= lng('AUTH_EXIST_EMAIL'); break; default: $modifed = false; break; } if ($modifed) { $message .= "\n"; } } $ajax_message['name'] = $mod_user->name(); $ajax_message['group'] = $mod_user->getGroupName(); $ajax_message['id'] = $mod_user->id(); $ajax_message['skin_link'] = $mod_user->getSkinLink(false, '&', true); $ajax_message['mskin_link'] = $mod_user->getSkinLink(true, '&', true); if (file_exists($mod_user->getCloakFName())) { $ajax_message['cloak'] = 1; } if ($mod_user->defaultSkinTrigger()) { $ajax_message['skin'] = 1; } if ($message) { aExit(2, $message); } elseif (!$rnum) { aExit(100, $message); } else { aExit(0, lng('PROFILE_COMPLITE')); } break; }
public function ShowInfo() { global $ajax_message; $ajax_message = array('code' => 0, 'message' => '', 'info' => '', 'address' => '', 'port' => 0, 'online' => 0, 'numpl' => 0, 'pl_array' => '', 'slots' => 0, 'name' => '', 'id' => 0); if (!$this->id) { aExit(1, 'server_state'); } $ajax_message['id'] = (int) $this->id; $ajax_message['name'] = $this->name; $ajax_message['online'] = $this->online ? 1 : 0; $ajax_message['info'] = $this->info; $ajax_message['address'] = $this->address; $ajax_message['port'] = (int) $this->port; if (!$this->online) { aExit(2, 'server_state'); } $players = $this->GetPlayers(); $ajax_message['numpl'] = (int) $players[1]; $ajax_message['slots'] = (int) $this->slots; $ajax_message['pl_array'] = $players[0]; aExit(0, 'server_state'); }
exit; } loadTool('ajax.php'); loadTool('user.class.php'); DBinit('login'); if ($out) { header("Location: " . BASE_URL); MCRAuth::userLoad(); if (!empty($user)) { $user->logout(); } } elseif ($login) { $pass = Filter::input('pass'); $tmp_user = new User($login, strpos($login, '@') === false ? $bd_users['login'] : $bd_users['email']); $ajax_message['auth_fail_num'] = (int) $tmp_user->auth_fail_num(); if (!$tmp_user->id()) { aExit(4, lng('AUTH_NOT_EXIST')); } if ($tmp_user->auth_fail_num() >= 5) { CaptchaCheck(6); } if (!$tmp_user->authenticate($pass)) { $ajax_message['auth_fail_num'] = (int) $tmp_user->auth_fail_num(); aExit(1, lng('AUTH_FAIL') . '.<br /> <a href="#" style="color: #656565;" onclick="RestoreStart(); return false;">' . lng('AUTH_RESTORE') . ' ?</a>'); } if ($tmp_user->lvl() <= 0) { aExit(4, lng('USER_BANNED')); } $tmp_user->login(randString(15), GetRealIp(), Filter::input('save', 'post', 'bool')); aExit(0, 'success'); }