public function getACSPageData($fleetID) { global $USER, $LNG; $db = Database::get(); $sql = "SELECT fleet_start_time, fleet_end_id, fleet_group, fleet_mess FROM %%FLEETS%% WHERE fleet_id = :fleetID;"; $fleetData = $db->selectSingle($sql, array(':fleetID' => $fleetID)); if ($db->rowCount() != 1) { return array(); } if ($fleetData['fleet_mess'] == 1 || $fleetData['fleet_start_time'] <= TIMESTAMP) { return array(); } if ($fleetData['fleet_group'] == 0) { $acsData = $this->createACS($fleetID, $fleetData); } else { $acsData = $this->loadACS($fleetData); } if (empty($acsData)) { return array(); } $acsName = HTTP::_GP('acsName', '', UTF8_SUPPORT); if (!empty($acsName)) { if (PlayerUtil::isNameValid($acsName)) { $this->sendJSON($LNG['fl_acs_newname_alphanum']); } $sql = "UPDATE %%AKS%% SET name = acsName WHERE id = :acsID;"; $db->update($sql, array(':acsName' => $acsName, ':acsID' => $acsData['id'])); $this->sendJSON(false); } $invitedUsers = array(); $sql = "SELECT id, username FROM %%USERS_ACS%% INNER JOIN %%USERS%% ON userID = id WHERE acsID = :acsID;"; $userResult = $db->select($sql, array(':acsID' => $acsData['id'])); foreach ($userResult as $userRow) { $invitedUsers[$userRow['id']] = $userRow['username']; } $newUser = HTTP::_GP('username', '', UTF8_SUPPORT); $statusMessage = ""; if (!empty($newUser)) { $sql = "SELECT id FROM %%USERS%% WHERE universe = :universe AND username = :username;"; $newUserID = $db->selectSingle($sql, array(':universe' => Universe::current(), ':username' => $newUser), 'id'); if (empty($newUserID)) { $statusMessage = $LNG['fl_player'] . " " . $newUser . " " . $LNG['fl_dont_exist']; } elseif (isset($invitedUsers[$newUserID])) { $statusMessage = $LNG['fl_player'] . " " . $newUser . " " . $LNG['fl_already_invited']; } else { $statusMessage = $LNG['fl_player'] . " " . $newUser . " " . $LNG['fl_add_to_attack']; $sql = "INSERT INTO %%USERS_ACS%% SET acsID = :acsID, userID = :newUserID;"; $db->insert($sql, array(':acsID' => $acsData['id'], ':newUserID' => $newUserID)); $invitedUsers[$newUserID] = $newUser; $inviteTitle = $LNG['fl_acs_invitation_title']; $inviteMessage = $LNG['fl_player'] . $USER['username'] . $LNG['fl_acs_invitation_message']; PlayerUtil::sendMessage($newUserID, $USER['id'], TIMESTAMP, 1, $USER['username'], $inviteTitle, $inviteMessage); } } return array('invitedUsers' => $invitedUsers, 'acsName' => $acsData['name'], 'mainFleetID' => $fleetID, 'statusMessage' => $statusMessage); }
function rename() { global $LNG, $PLANET; $newname = HTTP::_GP('name', '', UTF8_SUPPORT); if (!empty($newname)) { if (!PlayerUtil::isNameValid($newname)) { $this->sendJSON(array('message' => $LNG['ov_newname_specialchar'], 'error' => true)); } else { $db = Database::get(); $sql = "UPDATE %%PLANETS%% SET name = :newName WHERE id = :planetID;"; $db->update($sql, array(':newName' => $newname, ':planetID' => $PLANET['id'])); $this->sendJSON(array('message' => $LNG['ov_newname_done'], 'error' => false)); } } }
function send() { global $LNG; $config = Config::get(); if ($config->game_disable == 0 || $config->reg_closed == 1) { $this->printMessage($LNG['registerErrorUniClosed'], array(array('label' => $LNG['registerBack'], 'url' => 'javascript:window.history.back()'))); } $userName = HTTP::_GP('username', '', UTF8_SUPPORT); $password = HTTP::_GP('password', '', true); $password2 = HTTP::_GP('passwordReplay', '', true); $mailAddress = HTTP::_GP('email', ''); $mailAddress2 = HTTP::_GP('emailReplay', ''); $rulesChecked = HTTP::_GP('rules', 0); $language = HTTP::_GP('lang', ''); $referralID = HTTP::_GP('referralID', 0); $externalAuth = HTTP::_GP('externalAuth', array()); if (!isset($externalAuth['account'], $externalAuth['method'])) { $externalAuthUID = 0; $externalAuthMethod = ''; } else { $externalAuthUID = $externalAuth['account']; $externalAuthMethod = strtolower(str_replace(array('_', '\\', '/', '.', ""), '', $externalAuth['method'])); } $errors = array(); if (empty($userName)) { $errors[] = $LNG['registerErrorUsernameEmpty']; } if (!PlayerUtil::isNameValid($userName)) { $errors[] = $LNG['registerErrorUsernameChar']; } if (strlen($password) < 6) { $errors[] = $LNG['registerErrorPasswordLength']; } if ($password != $password2) { $errors[] = $LNG['registerErrorPasswordSame']; } if (!PlayerUtil::isMailValid($mailAddress)) { $errors[] = $LNG['registerErrorMailInvalid']; } if (empty($mailAddress)) { $errors[] = $LNG['registerErrorMailEmpty']; } if ($mailAddress != $mailAddress2) { $errors[] = $LNG['registerErrorMailSame']; } if ($rulesChecked != 1) { $errors[] = $LNG['registerErrorRules']; } $db = Database::get(); $sql = "SELECT (\n\t\t\t\tSELECT COUNT(*)\n\t\t\t\tFROM %%USERS%%\n\t\t\t\tWHERE universe = :universe\n\t\t\t\tAND username = :userName\n\t\t\t) + (\n\t\t\t\tSELECT COUNT(*)\n\t\t\t\tFROM %%USERS_VALID%%\n\t\t\t\tWHERE universe = :universe\n\t\t\t\tAND username = :userName\n\t\t\t) as count;"; $countUsername = $db->selectSingle($sql, array(':universe' => Universe::current(), ':userName' => $userName), 'count'); $sql = "SELECT (\n\t\t\tSELECT COUNT(*)\n\t\t\tFROM %%USERS%%\n\t\t\tWHERE universe = :universe\n\t\t\tAND (\n\t\t\t\temail = :mailAddress\n\t\t\t\tOR email_2 = :mailAddress\n\t\t\t)\n\t\t) + (\n\t\t\tSELECT COUNT(*)\n\t\t\tFROM %%USERS_VALID%%\n\t\t\tWHERE universe = :universe\n\t\t\tAND email = :mailAddress\n\t\t) as count;"; $countMail = $db->selectSingle($sql, array(':universe' => Universe::current(), ':mailAddress' => $mailAddress), 'count'); if ($countUsername != 0) { $errors[] = $LNG['registerErrorUsernameExist']; } if ($countMail != 0) { $errors[] = $LNG['registerErrorMailExist']; } if ($config->capaktiv === '1') { require_once 'includes/libs/reCAPTCHA/recaptchalib.php'; $recaptcha_challenge_field = HTTP::_GP('recaptcha_challenge_field', ''); $recaptcha_response_field = HTTP::_GP('recaptcha_response_field', ''); $resp = recaptcha_check_answer($config->capprivate, Session::getClientIp(), $recaptcha_challenge_field, $recaptcha_response_field); if (!$resp->is_valid) { $errors[] = $LNG['registerErrorCaptcha']; } } if (!empty($errors)) { $this->printMessage(implode("<br>\r\n", $errors), array(array('label' => $LNG['registerBack'], 'url' => 'javascript:window.history.back()'))); } $path = 'includes/extauth/' . $externalAuthMethod . '.class.php'; if (!empty($externalAuth['account']) && file_exists($path)) { require $path; $methodClass = ucwords($externalAuthMethod) . 'Auth'; /** @var $authObj externalAuth */ $authObj = new $methodClass(); $externalAuthUID = 0; if ($authObj->isActiveMode() && $authObj->isValid()) { $externalAuthUID = $authObj->getAccount(); } } if ($config->ref_active == 1 && !empty($referralID)) { $sql = "SELECT COUNT(*) as state FROM %%USERS%% WHERE id = :referralID AND universe = :universe;"; $Count = $db->selectSingle($sql, array(':referralID' => $referralID, ':universe' => Universe::current()), 'state'); if ($Count == 0) { $referralID = 0; } } else { $referralID = 0; } $validationKey = md5(uniqid('2m')); $sql = "INSERT INTO %%USERS_VALID%% SET\n\t\t\t\t`userName` = :userName,\n\t\t\t\t`validationKey` = :validationKey,\n\t\t\t\t`password` = :password,\n\t\t\t\t`email` = :mailAddress,\n\t\t\t\t`date` = :timestamp,\n\t\t\t\t`ip` = :remoteAddr,\n\t\t\t\t`language` = :language,\n\t\t\t\t`universe` = :universe,\n\t\t\t\t`referralID` = :referralID,\n\t\t\t\t`externalAuthUID` = :externalAuthUID,\n\t\t\t\t`externalAuthMethod` = :externalAuthMethod;"; $db->insert($sql, array(':userName' => $userName, ':validationKey' => $validationKey, ':password' => PlayerUtil::cryptPassword($password), ':mailAddress' => $mailAddress, ':timestamp' => TIMESTAMP, ':remoteAddr' => Session::getClientIp(), ':language' => $language, ':universe' => Universe::current(), ':referralID' => $referralID, ':externalAuthUID' => $externalAuthUID, ':externalAuthMethod' => $externalAuthMethod)); $validationID = $db->lastInsertId(); $verifyURL = 'index.php?page=vertify&i=' . $validationID . '&k=' . $validationKey; if ($config->user_valid == 0 || !empty($externalAuthUID)) { $this->redirectTo($verifyURL); } else { require 'includes/classes/Mail.class.php'; $MailRAW = $LNG->getTemplate('email_vaild_reg'); $MailContent = str_replace(array('{USERNAME}', '{PASSWORD}', '{GAMENAME}', '{VERTIFYURL}', '{GAMEMAIL}'), array($userName, $password, $config->game_name . ' - ' . $config->uni_name, HTTP_PATH . $verifyURL, $config->smtp_sendmail), $MailRAW); $subject = sprintf($LNG['registerMailVertifyTitle'], $config->game_name); Mail::send($mailAddress, $userName, $subject, $MailContent); $this->printMessage($LNG['registerSendComplete']); } }
function show() { global $USER, $CONF, $LNG, $UNI; $ranki = $GLOBALS['DATABASE']->query("SELECT `id`, s.total_rank, s.build_rank, s.tech_rank FROM " . USERS . " as u INNER JOIN " . STATPOINTS . " as s ON u.id = s.id_owner WHERE onlinetime < " . (TIMESTAMP - 15 * 24 * 60 * 60) . " AND bana = '0' LIMIT 5 ;"); $balken = $GLOBALS['DATABASE']->countquery("SELECT COUNT(*) FROM " . USERS . " WHERE universe = " . $UNI . " AND onlinetime > '" . (TIMESTAMP - 45 * 60) . "';"); $länge2 = 365 / $CONF['users_amount']; $länge = $balken * $länge2; $RangeList = array(); while ($StatRow = $GLOBALS['DATABASE']->fetch_array($ranki)) { $RangeList[] = array('id' => $StatRow['id'], 'total_rank' => $StatRow['total_rank'], 'build_rank' => $StatRow['build_rank'], 'tech_rank' => $StatRow['tech_rank']); } if ($_POST) { $userName = HTTP::_GP('username', '', UTF8_SUPPORT); $password = HTTP::_GP('password', '', true); $mailAddress = HTTP::_GP('email', ''); $rulesChecked = HTTP::_GP('rules', 0); $id = HTTP::_GP('idc', ''); $allowedTo = $GLOBALS['DATABASE']->query("SELECT `id`, onlinetime, authlevel FROM " . USERS . " WHERE id = " . $id . " ;"); $allowedTo = $GLOBALS['DATABASE']->fetch_array($allowedTo); $errors = array(); if (Config::get('game_disable') == 0 || Config::get('reg_closed') == 1) { $this->printMessage(t('registerErrorUniClosed'), NULL, array(array('label' => t('registerBack'), 'url' => 'javascript:window.history.back()'))); } //Esto es para verificar si existe ya un usuario con esa ip. if (empty($userName)) { $errors[] = t('registerErrorUsernameEmpty'); } if ($allowedTo['onlinetime'] > TIMESTAMP - 15 * 24 * 60 * 60) { $errors[] = t('youcanttakeoverthisaccount'); } if ($allowedTo['authlevel'] > 0) { $errors[] = t('adminaccount'); } if (!PlayerUtil::isNameValid($userName)) { $errors[] = t('registerErrorUsernameChar'); } if (strlen($password) < 6) { $errors[] = t('registerErrorPasswordLength'); } if (!PlayerUtil::isMailValid($mailAddress)) { $errors[] = t('registerErrorMailInvalid'); } if (empty($mailAddress)) { $errors[] = t('registerErrorMailEmpty'); } if ($rulesChecked != 1) { $errors[] = t('registerErrorRules'); } $countUsername = $GLOBALS['DATABASE']->getFirstCell("SELECT (\n\t\t\tSELECT COUNT(*) \n\t\t\tFROM " . USERS . " \n\t\t\tWHERE universe = " . $GLOBALS['UNI'] . "\n\t\t\tAND username = '******'DATABASE']->escape($userName) . "'\n\t\t) + (\n\t\t\tSELECT COUNT(*)\n\t\t\tFROM " . USERS_VALID . "\n\t\t\tWHERE universe = " . $GLOBALS['UNI'] . "\n\t\t\tAND username = '******'DATABASE']->escape($userName) . "'\n\t\t);"); $countMail = $GLOBALS['DATABASE']->getFirstCell("SELECT (\n\t\t\tSELECT COUNT(*)\n\t\t\tFROM " . USERS . "\n\t\t\tWHERE universe = " . $GLOBALS['UNI'] . "\n\t\t\tAND (\n\t\t\t\temail = '" . $GLOBALS['DATABASE']->escape($mailAddress) . "'\n\t\t\t\tOR email_2 = '" . $GLOBALS['DATABASE']->escape($mailAddress) . "'\n\t\t\t)\n\t\t) + (\n\t\t\tSELECT COUNT(*)\n\t\t\tFROM " . USERS_VALID . "\n\t\t\tWHERE universe = " . $GLOBALS['UNI'] . "\n\t\t\tAND email = '" . $GLOBALS['DATABASE']->escape($mailAddress) . "'\n\t\t);"); if ($countUsername != 0) { $errors[] = t('registerErrorUsernameExist'); } if ($countMail != 0) { $errors[] = t('registerErrorMailExist'); } if (!empty($errors)) { $this->printMessage(implode("<br>\r\n", $errors), NULL, array(array('label' => t('registerBack'), 'url' => 'javascript:window.history.back()'))); } $validationKey = md5(uniqid('2m')); $SQL = "UPDATE " . USERS . " SET\n\t\t\t\t`userName` = '" . $GLOBALS['DATABASE']->escape($userName) . "',\n\t\t\t\t`password` = '" . PlayerUtil::cryptPassword($password) . "',\n\t\t\t\t`email` = '" . $GLOBALS['DATABASE']->escape($mailAddress) . "',\n\t\t\t\t`darkmatter` = '300000',\n\t\t\t\t`ip_at_reg` = '" . $_SERVER['REMOTE_ADDR'] . "' WHERE id = '" . $id . "' ;"; $GLOBALS['DATABASE']->query($SQL); $vertifyURL = 'game.php?page=overview'; if (Config::get('user_valid') == 0 || !empty($externalAuthUID)) { $this->redirectTo($vertifyURL); } else { require 'includes/classes/Mail.class.php'; $MailSubject = t('registerMailVertifyTitle'); $MailRAW = $GLOBALS['LNG']->getTemplate('email_vaild_reg'); $MailContent = str_replace(array('{USERNAME}', '{PASSWORD}', '{GAMENAME}', '{GAMEMAIL}'), array($userName, $password, Config::get('game_name') . ' - ' . Config::get('uni_name'), Config::get('smtp_sendmail')), $MailRAW); Mail::send($mailAddress, $userName, t('registerMailVertifyTitle', Config::get('game_name')), $MailContent); $this->printMessage(t('registerSendComplete')); } } $this->tplObj->assign_vars(array('RangeList' => $RangeList, 'reg_user' => $CONF['users_amount'], 'online_users' => $balken, 'balken')); $this->render('page.takeover.default.tpl'); }
function ShowCreatorPage() { global $LNG, $USER; $template = new template(); switch ($_GET['mode']) { case 'user': $LNG->includeData(array('PUBLIC')); if ($_POST) { $UserName = HTTP::_GP('name', '', UTF8_SUPPORT); $UserPass = HTTP::_GP('password', ''); $UserPass2 = HTTP::_GP('password2', ''); $UserMail = HTTP::_GP('email', ''); $UserMail2 = HTTP::_GP('email2', ''); $UserAuth = HTTP::_GP('authlevel', 0); $Galaxy = HTTP::_GP('galaxy', 0); $System = HTTP::_GP('system', 0); $Planet = HTTP::_GP('planet', 0); $Language = HTTP::_GP('lang', ''); $ExistsUser = $GLOBALS['DATABASE']->getFirstCell("SELECT (SELECT COUNT(*) FROM " . USERS . " WHERE universe = " . Universe::getEmulated() . " AND username = '******'DATABASE']->sql_escape($UserName) . "') + (SELECT COUNT(*) FROM " . USERS_VALID . " WHERE universe = " . Universe::getEmulated() . " AND username = '******'DATABASE']->sql_escape($UserName) . "')"); $ExistsMails = $GLOBALS['DATABASE']->getFirstCell("SELECT (SELECT COUNT(*) FROM " . USERS . " WHERE universe = " . Universe::getEmulated() . " AND (email = '" . $GLOBALS['DATABASE']->sql_escape($UserMail) . "' OR email_2 = '" . $GLOBALS['DATABASE']->sql_escape($UserMail) . "')) + (SELECT COUNT(*) FROM " . USERS_VALID . " WHERE universe = " . Universe::getEmulated() . " AND email = '" . $GLOBALS['DATABASE']->sql_escape($UserMail) . "')"); $errors = ""; $config = Config::get(Universe::getEmulated()); if (!PlayerUtil::isMailValid($UserMail)) { $errors .= $LNG['invalid_mail_adress']; } if (empty($UserName)) { $errors .= $LNG['empty_user_field']; } if (strlen($UserPass) < 6) { $errors .= $LNG['password_lenght_error']; } if ($UserPass != $UserPass2) { $errors .= $LNG['different_passwords']; } if ($UserMail != $UserMail2) { $errors .= $LNG['different_mails']; } if (!PlayerUtil::isNameValid($UserName)) { $errors .= $LNG['user_field_specialchar']; } if ($ExistsUser != 0) { $errors .= $LNG['user_already_exists']; } if ($ExistsMails != 0) { $errors .= $LNG['mail_already_exists']; } if (!PlayerUtil::isPositionFree(Universe::getEmulated(), $Galaxy, $System, $Planet)) { $errors .= $LNG['planet_already_exists']; } if ($Galaxy > $config->max_galaxy || $System > $config->max_system || $Planet > $config->max_planets) { $errors .= $LNG['po_complete_all2']; } if (!empty($errors)) { $template->message($errors, '?page=create&mode=user', 10, true); exit; } $Language = array_key_exists($Language, $LNG->getAllowedLangs(false)) ? $Language : $config->lang; PlayerUtil::createPlayer(Universe::getEmulated(), $UserName, PlayerUtil::cryptPassword($UserPass), $UserMail, $Language, $Galaxy, $System, $Planet, $LNG['fcm_planet'], $UserAuth); $template->message($LNG['new_user_success'], '?page=create&mode=user', 5, true); exit; } $AUTH = array(); $AUTH[AUTH_USR] = $LNG['user_level'][AUTH_USR]; if ($USER['authlevel'] >= AUTH_OPS) { $AUTH[AUTH_OPS] = $LNG['user_level'][AUTH_OPS]; } if ($USER['authlevel'] >= AUTH_MOD) { $AUTH[AUTH_MOD] = $LNG['user_level'][AUTH_MOD]; } if ($USER['authlevel'] >= AUTH_ADM) { $AUTH[AUTH_ADM] = $LNG['user_level'][AUTH_ADM]; } $template->assign_vars(array('admin_auth' => $USER['authlevel'], 'new_add_user' => $LNG['new_add_user'], 'new_creator_refresh' => $LNG['new_creator_refresh'], 'new_creator_go_back' => $LNG['new_creator_go_back'], 'universe' => $LNG['mu_universe'], 'user_reg' => $LNG['user_reg'], 'pass_reg' => $LNG['pass_reg'], 'pass2_reg' => $LNG['pass2_reg'], 'email_reg' => $LNG['email_reg'], 'email2_reg' => $LNG['email2_reg'], 'new_coord' => $LNG['new_coord'], 'new_range' => $LNG['new_range'], 'lang_reg' => $LNG['lang_reg'], 'new_title' => $LNG['new_title'], 'Selector' => array('auth' => $AUTH, 'lang' => $LNG->getAllowedLangs(false)))); $template->show('CreatePageUser.tpl'); break; case 'moon': if ($_POST) { $PlanetID = HTTP::_GP('add_moon', 0); $MoonName = HTTP::_GP('name', '', UTF8_SUPPORT); $Diameter = HTTP::_GP('diameter', 0); $MoonPlanet = $GLOBALS['DATABASE']->getFirstRow("SELECT temp_max, temp_min, id_luna, galaxy, system, planet, planet_type, destruyed, id_owner FROM " . PLANETS . " WHERE id = '" . $PlanetID . "' AND universe = '" . Universe::getEmulated() . "' AND planet_type = '1' AND destruyed = '0';"); if (!isset($MoonPlanet)) { $template->message($LNG['mo_planet_doesnt_exist'], '?page=create&mode=moon', 3, true); exit; } $moonId = PlayerUtil::createMoon(Universe::getEmulated(), $MoonPlanet['galaxy'], $MoonPlanet['system'], $MoonPlanet['planet'], $MoonPlanet['id_owner'], 20, $_POST['diameter_check'] == 'on' ? NULL : $Diameter, $MoonName); if ($moonId !== false) { $template->message($LNG['mo_moon_added'], '?page=create&mode=moon', 3, true); } else { $template->message($LNG['mo_moon_unavaible'], '?page=create&mode=moon', 3, true); } exit; } $template->assign_vars(array('admin_auth' => $USER['authlevel'], 'universum' => $LNG['mu_universe'], 'po_add_moon' => $LNG['po_add_moon'], 'input_id_planet' => $LNG['input_id_planet'], 'mo_moon_name' => $LNG['mo_moon_name'], 'mo_diameter' => $LNG['mo_diameter'], 'mo_temperature' => $LNG['mo_temperature'], 'mo_fields_avaibles' => $LNG['mo_fields_avaibles'], 'button_add' => $LNG['button_add'], 'new_creator_refresh' => $LNG['new_creator_refresh'], 'mo_moon' => $LNG['fcm_moon'], 'new_creator_go_back' => $LNG['new_creator_go_back'])); $template->show('CreatePageMoon.tpl'); break; case 'planet': if ($_POST) { $id = HTTP::_GP('id', 0); $Galaxy = HTTP::_GP('galaxy', 0); $System = HTTP::_GP('system', 0); $Planet = HTTP::_GP('planet', 0); $name = HTTP::_GP('name', '', UTF8_SUPPORT); $field_max = HTTP::_GP('field_max', 0); $config = Config::get(Universe::getEmulated()); if ($Galaxy > $config->max_galaxy || $System > $config->max_system || $Planet > $config->max_planets) { $template->message($LNG['po_complete_all2'], '?page=create&mode=planet', 3, true); exit; } $ISUser = $GLOBALS['DATABASE']->getFirstRow("SELECT id, authlevel FROM " . USERS . " WHERE id = '" . $id . "' AND universe = '" . Universe::getEmulated() . "';"); if (!PlayerUtil::checkPosition(Universe::getEmulated(), $Galaxy, $System, $Planet) || !isset($ISUser)) { $template->message($LNG['po_complete_all'], '?page=create&mode=planet', 3, true); exit; } $planetId = PlayerUtil::createPlanet($Galaxy, $System, $Planet, Universe::getEmulated(), $id, NULL, false, $ISUser['authlevel']); $SQL = "UPDATE " . PLANETS . " SET "; if ($_POST['diameter_check'] != 'on' || $field_max > 0) { $SQL .= "field_max = '" . $field_max . "' "; } if (!empty($name)) { $SQL .= ", name = '" . $GLOBALS['DATABASE']->sql_escape($name) . "' "; } $SQL .= "WHERE "; $SQL .= "id = '" . $planetId . "'"; $GLOBALS['DATABASE']->query($SQL); $template->message($LNG['po_complete_succes'], '?page=create&mode=planet', 3, true); exit; } $template->assign_vars(array('admin_auth' => $USER['authlevel'], 'po_add_planet' => $LNG['po_add_planet'], 'po_galaxy' => $LNG['po_galaxy'], 'po_system' => $LNG['po_system'], 'po_planet' => $LNG['po_planet'], 'input_id_user' => $LNG['input_id_user'], 'new_creator_coor' => $LNG['new_creator_coor'], 'po_name_planet' => $LNG['po_name_planet'], 'po_fields_max' => $LNG['po_fields_max'], 'button_add' => $LNG['button_add'], 'po_colony' => $LNG['fcp_colony'], 'new_creator_refresh' => $LNG['new_creator_refresh'], 'new_creator_go_back' => $LNG['new_creator_go_back'])); $template->show('CreatePagePlanet.tpl'); break; default: $template->assign_vars(array('new_creator_title_u' => $LNG['new_creator_title_u'], 'new_creator_title_p' => $LNG['new_creator_title_p'], 'new_creator_title_l' => $LNG['new_creator_title_l'], 'new_creator_title' => $LNG['new_creator_title'])); $template->show('CreatePage.tpl'); break; } }
private function sendDefault() { global $USER, $LNG, $THEME; $adminprotection = HTTP::_GP('adminprotection', 0); $username = HTTP::_GP('username', $USER['username'], UTF8_SUPPORT); $password = HTTP::_GP('password', ''); $newpassword = HTTP::_GP('newpassword', ''); $newpassword2 = HTTP::_GP('newpassword2', ''); $email = HTTP::_GP('email', $USER['email']); $timezone = HTTP::_GP('timezone', ''); $language = HTTP::_GP('language', ''); $planetSort = HTTP::_GP('planetSort', 0); $planetOrder = HTTP::_GP('planetOrder', 0); $theme = HTTP::_GP('theme', $THEME->getThemeName()); $queueMessages = HTTP::_GP('queueMessages', 0); $spyMessagesMode = HTTP::_GP('spyMessagesMode', 0); $spycount = HTTP::_GP('spycount', 1.0); $fleetactions = HTTP::_GP('fleetactions', 5); $galaxySpy = HTTP::_GP('galaxySpy', 0); $galaxyMessage = HTTP::_GP('galaxyMessage', 0); $galaxyBuddyList = HTTP::_GP('galaxyBuddyList', 0); $galaxyMissle = HTTP::_GP('galaxyMissle', 0); $blockPM = HTTP::_GP('blockPM', 0); $vacation = HTTP::_GP('vacation', 0); $delete = HTTP::_GP('delete', 0); // Vertify $adminprotection = $adminprotection == 1 && $USER['authlevel'] != AUTH_USR ? $USER['authlevel'] : 0; $spycount = min(max(round($spycount), 1), 4294967295); $fleetactions = min(max($fleetactions, 1), 99); $language = array_key_exists($language, $LNG->getAllowedLangs(false)) ? $language : $LNG->getLanguage(); $theme = array_key_exists($theme, Theme::getAvalibleSkins()) ? $theme : $THEME->getThemeName(); $db = Database::get(); if (!empty($username) && $USER['username'] != $username) { if (PlayerUtil::isNameValid($username)) { $this->printMessage($LNG['op_user_name_no_alphanumeric'], array(array('label' => $LNG['sys_back'], 'url' => 'game.php?page=settings'))); } elseif ($USER['uctime'] >= TIMESTAMP - USERNAME_CHANGETIME) { $this->printMessage($LNG['op_change_name_pro_week'], array(array('label' => $LNG['sys_back'], 'url' => 'game.php?page=settings'))); } else { $sql = "SELECT\n\t\t\t\t\t(SELECT COUNT(*) FROM %%USERS%% WHERE universe = :universe AND username = :username) +\n\t\t\t\t\t(SELECT COUNT(*) FROM %%USERS_VALID%% WHERE universe = :universe AND username = :username)\n\t\t\t\tAS count"; $Count = $db->selectSingle($sql, array(':universe' => Universe::current(), ':username' => $username), 'count'); if (!empty($Count)) { $this->printMessage(sprintf($LNG['op_change_name_exist'], $username), array(array('label' => $LNG['sys_back'], 'url' => 'game.php?page=settings'))); } else { $sql = "UPDATE %%USERS%% SET username = :username, uctime = :timestampt WHERE id = :userID;"; $db->update($sql, array(':username' => $username, ':userID' => $USER['id'], ':timestamp' => TIMESTAMP)); Session::load()->delete(); } } } if (!empty($newpassword) && PlayerUtil::cryptPassword($password) == $USER["password"] && $newpassword == $newpassword2) { $newpass = PlayerUtil::cryptPassword($newpassword); $sql = "UPDATE %%USERS%% SET password = :newpass WHERE id = :userID;"; $db->update($sql, array(':newpass' => $newpass, ':userID' => $USER['id'])); Session::load()->delete(); } if (!empty($email) && $email != $USER['email']) { if (PlayerUtil::cryptPassword($password) != $USER['password']) { $this->printMessage($LNG['op_need_pass_mail'], array(array('label' => $LNG['sys_back'], 'url' => 'game.php?page=settings'))); } elseif (!ValidateAddress($email)) { $this->printMessage($LNG['op_not_vaild_mail'], array(array('label' => $LNG['sys_back'], 'url' => 'game.php?page=settings'))); } else { $sql = "SELECT\n\t\t\t\t\t\t\t(SELECT COUNT(*) FROM %%USERS%% WHERE id != :userID AND universe = :universe AND (email = :email OR email_2 = :email)) +\n\t\t\t\t\t\t\t(SELECT COUNT(*) FROM %%USERS_VALID%% WHERE universe = :universe AND email = :email)\n\t\t\t\t\t\tas COUNT"; $Count = $db->selectSingle($sql, array(':universe' => Universe::current(), ':userID' => $USER['id'], ':email' => $email), 'count'); if (!empty($Count)) { $this->printMessage(sprintf($LNG['op_change_mail_exist'], $email), array(array('label' => $LNG['sys_back'], 'url' => 'game.php?page=settings'))); } else { $sql = "UPDATE %%USERS%% SET email = :email, setmail = :time WHERE id = :userID;"; $db->update($sql, array(':email' => $email, ':time' => TIMESTAMP + 604800, ':userID' => $USER['id'])); } } } if ($vacation == 1) { if (!$this->CheckVMode()) { $this->printMessage($LNG['op_cant_activate_vacation_mode'], array(array('label' => $LNG['sys_back'], 'url' => 'game.php?page=settings'))); } else { $sql = "UPDATE %%USERS%% SET urlaubs_modus = '1', urlaubs_until = :time WHERE id = :userID"; $db->update($sql, array(':userID' => $USER['id'], ':time' => TIMESTAMP + Config::get()->vmode_min_time)); $sql = "UPDATE %%PLANETS%% SET energy_used = '0', energy = '0', metal_mine_porcent = '0', crystal_mine_porcent = '0', deuterium_sintetizer_porcent = '0', solar_plant_porcent = '0', fusion_plant_porcent = '0', solar_satelit_porcent = '0', metal_perhour = '0', crystal_perhour = '0', deuterium_perhour = '0' WHERE id_owner = :userID;"; $db->update($sql, array(':userID' => $USER['id'])); } } if ($delete == 1) { $sql = "UPDATE %%USERS%% SET db_deaktjava = :timestamp WHERE id = :userID;"; $db->update($sql, array(':userID' => $USER['id'], ':timestamp' => TIMESTAMP)); } else { $sql = "UPDATE %%USERS%% SET db_deaktjava = 0 WHERE id = :userID;"; $db->update($sql, array(':userID' => $USER['id'])); } $sql = "UPDATE %%USERS%% SET\n\t\tdpath\t\t\t\t\t= :theme,\n\t\ttimezone\t\t\t\t= :timezone,\n\t\tplanet_sort\t\t\t\t= :planetSort,\n\t\tplanet_sort_order\t\t= :planetOrder,\n\t\tspio_anz\t\t\t\t= :spyCount,\n\t\tsettings_fleetactions\t= :fleetActions,\n\t\tsettings_esp\t\t\t= :galaxySpy,\n\t\tsettings_wri\t\t\t= :galaxyMessage,\n\t\tsettings_bud\t\t\t= :galaxyBuddyList,\n\t\tsettings_mis\t\t\t= :galaxyMissle,\n\t\tsettings_blockPM\t\t= :blockPM,\n\t\tauthattack\t\t\t\t= :adminProtection,\n\t\tlang\t\t\t\t\t= :language,\n\t\thof\t\t\t\t\t\t= :queueMessages,\n\t\tspyMessagesMode\t\t\t= :spyMessagesMode\n\t\tWHERE id = :userID;"; $db->update($sql, array(':theme' => $theme, ':timezone' => $timezone, ':planetSort' => $planetSort, ':planetOrder' => $planetOrder, ':spyCount' => $spycount, ':fleetActions' => $fleetactions, ':galaxySpy' => $galaxySpy, ':galaxyMessage' => $galaxyMessage, ':galaxyBuddyList' => $galaxyBuddyList, ':galaxyMissle' => $galaxyMissle, ':blockPM' => $blockPM, ':adminProtection' => $adminprotection, ':language' => $language, ':queueMessages' => $queueMessages, ':spyMessagesMode' => $spyMessagesMode, ':userID' => $USER['id'])); $this->printMessage($LNG['op_options_changed'], array(array('label' => $LNG['sys_forward'], 'url' => 'game.php?page=settings'))); }
function send() { $userName = HTTP::_GP('username', '', UTF8_SUPPORT); $password = HTTP::_GP('password', '', true); $mailAddress = HTTP::_GP('email', ''); $language = HTTP::_GP('lang', ''); $race = HTTP::_GP('race', ''); $universum = HTTP::_GP('uni', 1); $referralID = HTTP::_GP('referralID', 0); $externalAuth = HTTP::_GP('externalAuth', array()); if (!isset($externalAuth['account'], $externalAuth['method'])) { $externalAuthUID = 0; $externalAuthMethod = ''; } else { $externalAuthUID = $externalAuth['account']; $externalAuthMethod = strtolower(str_replace(array('_', '\\', '/', '.', ""), '', $externalAuth['method'])); } $errors = array(); if (Config::get('game_disable') == 0 || Config::get('reg_closed') == 1) { $this->printMessage(t('registerErrorUniClosed'), NULL, array(array('label' => t('registerBack'), 'url' => 'javascript:window.history.back()'))); } if (empty($userName)) { $errors[] = t('registerErrorUsernameEmpty'); } if (!PlayerUtil::isNameValid($userName)) { $errors[] = t('registerErrorUsernameChar'); } if (strlen($password) < 6) { $errors[] = t('registerErrorPasswordLength'); } if (!PlayerUtil::isMailValid($mailAddress)) { $errors[] = t('registerErrorMailInvalid'); } /* if(!PlayerUtil::valid_mail($mailAddress)) { $errors[] = t('registerErrorMailInvalid2'); } */ if (empty($mailAddress)) { $errors[] = t('registerErrorMailEmpty'); } $countUsername = $GLOBALS['DATABASE']->getFirstCell("SELECT (\n\t\t\tSELECT COUNT(*) \n\t\t\tFROM " . USERS . " \n\t\t\tWHERE universe = " . $universum . "\n\t\t\tAND username = '******'DATABASE']->escape($userName) . "'\n\t\t) + (\n\t\t\tSELECT COUNT(*)\n\t\t\tFROM " . USERS_VALID . "\n\t\t\tWHERE universe = " . $universum . "\n\t\t\tAND username = '******'DATABASE']->escape($userName) . "'\n\t\t);"); $countMail = $GLOBALS['DATABASE']->getFirstCell("SELECT (\n\t\t\tSELECT COUNT(*)\n\t\t\tFROM " . USERS . "\n\t\t\tWHERE universe = " . $universum . "\n\t\t\tAND (\n\t\t\t\temail = '" . $GLOBALS['DATABASE']->escape($mailAddress) . "'\n\t\t\t\tOR email_2 = '" . $GLOBALS['DATABASE']->escape($mailAddress) . "'\n\t\t\t)\n\t\t) + (\n\t\t\tSELECT COUNT(*)\n\t\t\tFROM " . USERS_VALID . "\n\t\t\tWHERE universe = " . $universum . "\n\t\t\tAND email = '" . $GLOBALS['DATABASE']->escape($mailAddress) . "'\n\t\t);"); if ($countUsername != 0) { $errors[] = t('registerErrorUsernameExist'); } if ($countMail != 0) { $errors[] = t('registerErrorMailExist'); } if (Config::get('capaktiv') === '1') { require_once 'includes/libs/reCAPTCHA/recaptchalib.php'; $resp = recaptcha_check_answer(Config::get('capprivate'), $_SERVER['REMOTE_ADDR'], $_REQUEST['recaptcha_challenge_field'], $_REQUEST['recaptcha_response_field']); if (!$resp->is_valid) { $errors[] = t('registerErrorCaptcha'); } } if (!empty($errors)) { $this->printMessage(implode("<br>\r\n", $errors), NULL, array(array('label' => t('registerBack'), 'url' => 'javascript:window.history.back()'))); } if (!empty($externalAuth['account']) && file_exists('includes/extauth/' . $externalAuthMethod . '.class.php')) { require 'includes/extauth/' . $externalAuthMethod . '.class.php'; $methodClass = ucwords($externalAuthMethod) . 'Auth'; $authObj = new $methodClass(); if (!$authObj->isActiveMode()) { $externalAuthUID = 0; } if (!$authObj->isVaild()) { $externalAuthUID = 0; } $externalAuthUID = $authObj->getAccount(); } if (Config::get('ref_active') == 1 && !empty($referralID)) { $Count = $GLOBALS['DATABASE']->getFirstCell("SELECT COUNT(*) FROM " . USERS . " WHERE id = " . $referralID . " AND universe = " . $GLOBALS['UNI'] . ";"); if ($Count == 0) { $referralID = 0; } } else { $referralID = 0; } $validationKey = md5(uniqid('2m')); $SQL = "INSERT INTO " . USERS_VALID . " SET\n\t\t\t\t`userName` = '" . $GLOBALS['DATABASE']->escape($userName) . "',\n\t\t\t\t`validationKey` = '" . $validationKey . "',\n\t\t\t\t`password` = '" . md5($password) . "',\n\t\t\t\t`email` = '" . $GLOBALS['DATABASE']->escape($mailAddress) . "',\n\t\t\t\t`date` = '" . TIMESTAMP . "',\n\t\t\t\t`ip` = '" . $_SERVER['REMOTE_ADDR'] . "',\n\t\t\t\t`language` = '" . $GLOBALS['DATABASE']->escape($language) . "',\n\t\t\t\t`race` = '" . $GLOBALS['DATABASE']->escape($race) . "',\n\t\t\t\t`universe` = " . $GLOBALS['UNI'] . ",\n\t\t\t\t`referralID` = " . $referralID . ",\n\t\t\t\t`externalAuthUID` = '" . $GLOBALS['DATABASE']->escape($externalAuthUID) . "',\n\t\t\t\t`externalAuthMethod` = '" . $externalAuthMethod . "';"; $GLOBALS['DATABASE']->query($SQL); $validationID = $GLOBALS['DATABASE']->GetInsertID(); $vertifyURL = 'index.php?page=vertify&i=' . $validationID . '&k=' . $validationKey; if (Config::get('user_valid') == 0 || !empty($externalAuthUID)) { $this->redirectTo($vertifyURL); } else { require 'includes/classes/Mail.class.php'; $MailSubject = t('registerMailVertifyTitle'); $MailRAW = $GLOBALS['LNG']->getTemplate('email_vaild_reg'); $MailContent = str_replace(array('{USERNAME}', '{PASSWORD}', '{GAMENAME}', '{VERTIFYURL}', '{GAMEMAIL}'), array($mailAddress, $password, Config::get('game_name') . ' - ' . Config::get('uni_name'), HTTP_PATH . $vertifyURL, Config::get('smtp_sendmail')), $MailRAW); Mail::send($mailAddress, $userName, t('registerMailVertifyTitle', Config::get('game_name')), $MailContent); $this->printMessage(t('registerSendComplete')); } }
protected function adminPermissionsSend() { global $LNG; if (!$this->rights['RANKS']) { $this->redirectToHome(); } $newRank = HTTP::_GP('newrank', array(), true); $delete = HTTP::_GP('deleteRank', 0); $rankData = HTTP::_GP('rank', array()); $db = Database::get(); if (!empty($newRank['rankName'])) { if (!PlayerUtil::isNameValid($newRank['rankName'])) { $this->printMessage($LNG['al_invalid_rank_name'], array(array('label' => $LNG['sys_back'], 'url' => '?page=alliance&mode=admin&action=permission'))); } $sql = 'INSERT INTO %%ALLIANCE_RANK%% SET rankName = :rankName, allianceID = :allianceID'; $params = array(':rankName' => $newRank['rankName'], ':allianceID' => $this->allianceData['id']); unset($newRank['rankName']); foreach ($newRank as $key => $value) { if (isset($this->availableRanks[$key]) && $this->rights[$this->availableRanks[$key]]) { $sql .= ', `' . $this->availableRanks[$key] . '` = :' . $this->availableRanks[$key]; $params[':' . $this->availableRanks[$key]] = $value == 1 ? 1 : 0; } } $db->insert($sql, $params); } else { if (!empty($delete)) { $sql = "DELETE FROM %%ALLIANCE_RANK%% WHERE rankID = :rankID AND allianceId = :allianceId;"; $db->delete($sql, array(':allianceId' => $this->allianceData['id'], ':rankID' => $delete)); $sql = "UPDATE %%USERS%% SET ally_rank_id = 0 WHERE ally_rank_id = :rankID AND ally_id = :allianceId;"; $db->update($sql, array(':allianceId' => $this->allianceData['id'], ':rankID' => $delete)); } else { foreach ($rankData as $rankId => $rowData) { $sql = 'UPDATE %%ALLIANCE_RANK%% SET rankName = :rankName'; $params = array(':rankName' => $rowData['rankName'], ':allianceID' => $this->allianceData['id'], ':rankId' => $rankId); unset($rowData['rankName']); foreach ($rowData as $key => $value) { if (isset($this->availableRanks[$key]) && $this->rights[$this->availableRanks[$key]]) { $sql .= ', `' . $this->availableRanks[$key] . '` = :' . $this->availableRanks[$key]; $params[':' . $this->availableRanks[$key]] = $value == 1 ? 1 : 0; } } $sql .= ' WHERE rankID = :rankId AND allianceID = :allianceID'; $db->update($sql, $params); } } } $this->redirectTo('game.php?page=alliance&mode=admin&action=permissions'); }
function send() { $userName = HTTP::_GP('username', '', UTF8_SUPPORT); $password = HTTP::_GP('password', '', true); $password2 = HTTP::_GP('passwordReplay', '', true); $captcha = HTTP::_GP('captcha', ''); $mailAddress = HTTP::_GP('email', ''); $rulesChecked = HTTP::_GP('reglement', 0); $condition = HTTP::_GP('condition', 0); $id_reprise = HTTP::_GP('id_reprise', 0); $nom_planete = HTTP::_GP('nom_planete', ''); $stats_sql = 'SELECT DISTINCT u.*, s.total_points, p.name, a.ally_tag, a.ally_name FROM ' . USERS . ' as u INNER JOIN ' . STATPOINTS . ' as s ON s.id_owner = u.id LEFT JOIN ' . ALLIANCE . ' as a ON a.id = u.ally_id LEFT JOIN ' . PLANETS . ' as p ON p.id = u.id_planet WHERE s.`universe` = 1 AND u.id = ' . $id_reprise . ';'; $query = $GLOBALS['DATABASE']->query($stats_sql); $errors = array(); if (Config::get('reg_closed') == 1) { $this->printMessage(t('registerErrorUniClosed'), NULL, array(array('label' => t('registerBack'), 'url' => 'javascript:window.history.back()'))); } if ($_SESSION['code'] != $captcha) { $errors[] = t('registerErrorCaptchas'); } while ($StatRow = $GLOBALS['DATABASE']->fetch_array($query)) { if ($StatRow['onlinetime'] > TIMESTAMP - 90 * 24 * 3600) { $errors[] = t('cannottakeover'); } } if (empty($userName)) { $errors[] = t('registerErrorUsernameEmpty'); } if (empty($nom_planete)) { $errors[] = t('registerErrorPlanetnameEmpty'); } if (strlen($nom_planete) > 18) { $errors[] = t('registerErrorPlanetnametolong'); } if (strlen($nom_planete) < 5) { $errors[] = t('registerErrorPlanetnametoshort'); } if (!PlayerUtil::isNameValid($userName)) { $errors[] = t('registerErrorUsernameChar'); } if (strlen($userName) < 3) { $errors[] = t('registerErroruserNameLength'); } if (strlen($userName) > 16) { $errors[] = t('registerErroruserNameLength'); } if (strlen($password) < 6) { $errors[] = t('registerErrorPasswordLength'); } if (strlen($password) > 32) { $errors[] = t('registerErrorPasswordLength'); } if ($password != $password2) { $errors[] = t('registerErrorPasswordSame'); } if (!PlayerUtil::isMailValid($mailAddress)) { $errors[] = t('registerErrorMailInvalid'); } if (!PlayerUtil::valid_mail($mailAddress)) { $errors[] = t('registerErrorMailInvalid2'); } if (empty($mailAddress)) { $errors[] = t('registerErrorMailEmpty'); } if ($rulesChecked != 1) { $errors[] = t('registerErrorRules'); } if ($condition != 1) { $errors[] = t('registerErrorTerms'); } $countUsername = $GLOBALS['DATABASE']->getFirstCell("SELECT (\n\t\t\tSELECT COUNT(*) \n\t\t\tFROM " . USERS . " \n\t\t\tWHERE universe = " . $GLOBALS['UNI'] . "\n\t\t\tAND username = '******'DATABASE']->escape($userName) . "'\n\t\t) + (\n\t\t\tSELECT COUNT(*)\n\t\t\tFROM " . USERS_VALID . "\n\t\t\tWHERE universe = " . $GLOBALS['UNI'] . "\n\t\t\tAND username = '******'DATABASE']->escape($userName) . "'\n\t\t);"); $countMail = $GLOBALS['DATABASE']->getFirstCell("SELECT (\n\t\t\tSELECT COUNT(*)\n\t\t\tFROM " . USERS . "\n\t\t\tWHERE universe = " . $GLOBALS['UNI'] . "\n\t\t\tAND (\n\t\t\t\temail = '" . $GLOBALS['DATABASE']->escape($mailAddress) . "'\n\t\t\t\tOR email_2 = '" . $GLOBALS['DATABASE']->escape($mailAddress) . "'\n\t\t\t)\n\t\t) + (\n\t\t\tSELECT COUNT(*)\n\t\t\tFROM " . USERS_VALID . "\n\t\t\tWHERE universe = " . $GLOBALS['UNI'] . "\n\t\t\tAND email = '" . $GLOBALS['DATABASE']->escape($mailAddress) . "'\n\t\t);"); if ($countUsername != 0) { $errors[] = t('registerErrorUsernameExist'); } if ($countMail != 0) { $errors[] = t('registerErrorMailExist'); } if (!empty($errors)) { $this->printMessage(implode("<br>\r\n", $errors), NULL, array(array('label' => t('registerBack'), 'url' => 'javascript:window.history.back()'))); } $validationKey = md5(uniqid('2m')); $SQL = "UPDATE " . USERS . " SET\n\t\t\t\t`username` = '" . $GLOBALS['DATABASE']->escape($userName) . "',\n\t\t\t\t`password` = '" . PlayerUtil::cryptPassword($password) . "',\n\t\t\t\t`email` = '" . $GLOBALS['DATABASE']->escape($mailAddress) . "',\n\t\t\t\t`email_2` = '" . $GLOBALS['DATABASE']->escape($mailAddress) . "',\n\t\t\t\t`register_time` = '" . TIMESTAMP . "',\n\t\t\t\t`ip_at_reg` = '" . $_SERVER['REMOTE_ADDR'] . "',\n\t\t\t\t`validationKey` = '" . $validationKey . "',\n\t\t\t\t`lang` = 'en',\n\t\t\t\t`sexe` = '',\n\t\t\t\t`date_of_birth` = '0',\n\t\t\t\t`ref_id` = 0,\n\t\t\t\t`ref_bonus` = 0,\n\t\t\t\t`ref_bonus` = 0,\n\t\t\t\t`urlaubs_modus` = 0,\n\t\t\t\t`urlaubs_until` = 0 WHERE id = '" . $id_reprise . "';"; $GLOBALS['DATABASE']->query($SQL); $validationID = $GLOBALS['DATABASE']->GetInsertID(); $vertifyURL = 'index.php?page=vertifyr&k=' . $validationKey; require 'includes/classes/Mail.class.php'; $MailSubject = t('registerMailVertifyTitle'); $MailRAW = $GLOBALS['LNG']->getTemplate('email_vaild_reg'); $MailContent = str_replace(array('{USERNAME}', '{PASSWORD}', '{GAMENAME}', '{VERTIFYURL}', '{GAMEMAIL}', '{EMAIL}', '{REGISTERIP}', '{PLANETNAME}'), array($userName, $password, Config::get('game_name') . ' - ' . Config::get('uni_name'), HTTP_PATH . $vertifyURL, Config::get('smtp_sendmail'), $mailAddress, $_SERVER['REMOTE_ADDR'], $nom_planete), $MailRAW); $headers = 'From: (EMAIL)' . "\r\n"; $headers .= 'Reply-To: (EMAIL)' . "\r\n"; $headers .= "MIME-Version: 1.0\r\n"; $headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n"; //mail($mailAddress, t('registerMailVertifyTitle', Config::get('game_name')), $MailContent, $headers); Mail::send($mailAddress, $userName, t('registerMailVertifyTitle', Config::get('game_name')), $MailContent); $this->printMessage(t('registerSendComplete')); }