$rcodes[] = 1; } } if ($money) { if ($mod_user->addMoney($money)) { $rcodes[] = 1; } } if ($gender !== false) { $gender = !$gender ? 0 : 1; if ($mod_user->changeGender($gender)) { $rcodes[] = 1; } } if ($mail) { $rcodes[] = $mod_user->changeEmail($mail); } $ajax_message['token_data'] = tokenTool('get'); } $newlogin = Filter::input('new_login'); $newpass = Filter::input('new_password'); $delete_skin = Filter::input('new_delete_skin', 'post', 'bool'); $delete_cloak = Filter::input('new_delete_cloak', 'post', 'bool'); if ($newlogin) { $rcodes[] = $mod_user->changeName($newlogin); } if ($newpass) { $oldpass = Filter::input('old_password'); $newrepass = Filter::input('new_repassword'); if ($user->lvl() >= 15 and $user_id) { $rcodes[] = $mod_user->changePassword($newpass);
$rcodes[] = 13; } if (strcmp($input['pass'], $input['repass'])) { $rcodes[] = 9; } tryExit(); $verification = (bool) sqlConfigGet('email-verification'); if ($verification) { $group = 4; } else { $group = 1; } $sql = "INSERT INTO `{$bd_names['users']}` (" . "`{$bd_users['login']}`," . "`{$bd_users['password']}`," . "`{$bd_users['ip']}`," . "`{$bd_users['female']}`," . "`{$bd_users['ctime']}`," . "`{$bd_users['group']}`) VALUES(:login, :pass, :ip, '{$female}', NOW(),'{$group}')"; $result = getDB()->ask($sql, array('login' => $input['login'], 'pass' => MCRAuth::createPass($input['pass']), 'ip' => GetRealIp())); if (!$result) { aExit(14); } $tmp_user = new User(getDB()->lastInsertId()); $tmp_user->setDefaultSkin(); $next_reg = (int) sqlConfigGet('next-reg-time'); if ($next_reg > 0) { getDB()->ask("INSERT INTO `{$bd_names['ip_banning']}` (`IP`,`time_start`,`ban_until`) " . "VALUES (:ip, NOW(), NOW()+INTERVAL {$next_reg} HOUR)", array('ip' => $_SERVER['REMOTE_ADDR'])); } if ($tmp_user->changeEmail($input['email'], $verification) > 1) { aExit(14, lng('MAIL_FAIL')); } if (!$verification) { aExit(0, lng('REG_COMPLETE') . '. <a href="#" class="btn" onclick="Login();">' . lng('ENTER') . '</a>'); } else { aExit(0, lng('REG_COMPLETE') . '. ' . lng('REG_CONFIRM_INFO')); }