function _account_exists($name) { $ots = POT::getInstance(); $ots->connect(POT::DB_MYSQL, connection()); $account = new OTS_Account(); $account->find($name); if ($account->isLoaded()) { $this->form_validation->set_message('_account_exists', 'Account with this name already exists.'); return false; } else { return true; } }
$mysqlhost = $server_config['sqlHost']; $mysqluser = $server_config['sqlUser']; $mysqlpass = $server_config['sqlPass']; $mysqldatabase = $server_config['sqlDatabase']; $sqlitefile = $server_config['sqliteDatabase']; } // loads #####POT mainfile##### include '../libs/pot/OTS.php'; // PDO and POT connects to database $ots = POT::getInstance(); if ($server_config['sqlType'] == "mysql") { $ots->connect(POT::DB_MYSQL, array('host' => $mysqlhost, 'user' => $mysqluser, 'password' => $mysqlpass, 'database' => $mysqldatabase)); } elseif ($server_config['sqlType'] == "sqlite") { $ots->connect(POT::DB_SQLITE, array('database' => $config_ini['server_path'] . $sqlitefile)); } $email_db = new OTS_Account(); $email_db->find($email); if ($email_db->isLoaded()) { echo '<image src="../images/false.gif"> <font color="red">Account with this e-mail already exist.</font>'; } else { echo '<image src="../images/true.gif"> <font color="green">Good e-mail.</font>'; } } else { echo '<image src="../images/true.gif"> <font color="green">Good e-mail.</font>'; } } else { echo '<image src="../images/false.gif"> <font color="red">Wrong e-mail format.</font>'; } } else { echo '<image src="../images/false.gif"> <font color="red">E-mail is too long (max. 255 chars).</font>'; }
if (!check_password($reg_password)) { $reg_form_errors[] = "Password contains illegal chars (a-z, A-Z and 0-9 only!) or lenght."; } } //SECOND check ## check e-mail address in database if (empty($reg_form_errors)) { if ($config['site']['one_email']) { $test_email_account = $ots->createObject('Account'); $test_email_account->findByEmail($reg_email); if ($test_email_account->isLoaded()) { $reg_form_errors[] = "Account with this e-mail address already exist in database."; } } $account_db = new OTS_Account(); $account_db->find($reg_name); if ($account_db->isLoaded()) { $reg_form_errors[] = 'Account with this name already exist.'; } if ($config['site']['referrer']) { $ref_check = $SQL->query('SELECT id FROM accounts WHERE id = ' . $reg_referrer . ' LIMIT 1')->fetch(); if ($reg_referrer > 0 && $ref_check['id'] < 1) { $reg_form_errors[] = 'Uzywany przez Ciebie numer gracza, ktory polecil Ci nasz serwer nie istnieje. Popros go o poprawny link lub ponow rejestracje, aby kontynowac rejestracje bez polecajacego.'; } } } // ----------creates account-------------(save in database) if (empty($reg_form_errors)) { //create object 'account' and generate new acc. number if ($config['site']['create_account_verify_mail']) { $reg_password = '';
$mysqluser = $server_config['mysqlUser']; $mysqlpass = $server_config['mysqlPass']; $mysqldatabase = $server_config['mysqlDatabase']; $sqlitefile = $server_config['sqliteDatabase']; } elseif (isset($server_config['sqlHost'])) { //old (0.2.4) ots config.lua file $mysqlhost = $server_config['sqlHost']; $mysqluser = $server_config['sqlUser']; $mysqlpass = $server_config['sqlPass']; $mysqldatabase = $server_config['sqlDatabase']; $sqlitefile = $server_config['sqliteDatabase']; } // loads #####POT mainfile##### include '../pot/OTS.php'; // PDO and POT connects to database $ots = POT::getInstance(); if ($server_config['sqlType'] == "mysql") { $ots->connect(POT::DB_MYSQL, array('host' => $mysqlhost, 'user' => $mysqluser, 'password' => $mysqlpass, 'database' => $mysqldatabase)); } elseif ($server_config['sqlType'] == "sqlite") { $ots->connect(POT::DB_SQLITE, array('database' => $config_ini['server_path'] . $sqlitefile)); } $account_db = new OTS_Account(); $account_db->find($account); if ($account_db->isLoaded()) { echo '<font color="red">Account with this name already exist.</font>'; } else { echo '<font color="green">Good account name ( ' . $account . ' ). You can create account.</font>'; } } else { echo '<font color="red">Account name is too long (max. 32 chars).</font>'; }
if ($config['site']['verify_code_shop']) { $main_content .= '<tr><td><B>Verify code: </B></td><td><img src="imgverification/imagebuilder.php?image_refresher=' . mt_rand(1, 99999) . '" border="0" alt=""></td></tr> <tr><td><B>Enter verify code: </B></td><td><INPUT id="verify" NAME="verify_code" VALUE="" SIZE=30></td></tr>'; } $main_content .= '<tr><td></td><td><input type="submit" value="Check Code" /></td></tr></table></form>'; } elseif ($_REQUEST['system'] == 'dotpay' && $config['dotpay_active']) { ################################################################################# $sms_type = (int) $_POST['sms_type']; $posted_code = trim($_POST['code']); $to_user = trim($_POST['to_user']); $verify_code = trim($_POST['verify_code']); ################################################################################# if (!empty($to_user)) { if (is_numeric($to_user)) { $account = new OTS_Account(); $account->find($to_user); } else { $player = new OTS_Player(); $player->find($to_user); if ($player->isLoaded()) { $account = $player->getAccount(); } else { $account = new OTS_Account(); } } if (empty($posted_code)) { $errors[] = 'Prosze wpisac kod z SMSa/przelewu.'; } if (!$account->isLoaded()) { $errors[] = 'Konto/konto postaci o podanym nicku nie istnieje.'; }