本文整理汇总了PHP中HTTP::_GP方法的典型用法代码示例。如果您正苦于以下问题:PHP HTTP::_GP方法的具体用法?PHP HTTP::_GP怎么用?PHP HTTP::_GP使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HTTP
的用法示例。
在下文中一共展示了HTTP::_GP方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: send
function send()
{
$mail = HTTP::_GP('mail', '', true);
$errorMessages = array();
if (empty($mail)) {
$errorMessages[] = t('passwordErrorMailEmpty');
}
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) {
$errorMessages[] = t('registerErrorCaptcha');
}
}
if (!empty($errorMessages)) {
$message = implode("<br>\r\n", $errorMessages);
$this->printMessage($message, NULL, array(array('label' => t('passwordBack'), 'url' => 'index.php?page=lostPassword')));
}
$userID = $GLOBALS['DATABASE']->getFirstCell("SELECT id FROM " . USERS . " WHERE universe = " . $GLOBALS['UNI'] . " AND email_2 = '" . $GLOBALS['DATABASE']->escape($mail) . "';");
if (empty($userID)) {
$this->printMessage(t('passwordErrorUnknown'), NULL, array(array('label' => t('passwordBack'), 'url' => 'index.php?page=lostPassword')));
}
$hasChanged = $GLOBALS['DATABASE']->getFirstCell("SELECT COUNT(*) FROM " . LOSTPASSWORD . " WHERE userID = " . $userID . " AND time > " . (TIMESTAMP - 86400) . " AND hasChanged = 0;");
if (!empty($hasChanged)) {
$this->printMessage(t('passwordErrorOnePerDay'), NULL, array(array('label' => t('passwordBack'), 'url' => 'index.php?page=lostPassword')));
}
$validationKey = md5(uniqid());
$MailRAW = $GLOBALS['LNG']->getTemplate('email_lost_password_validation');
$MailContent = str_replace(array('{USERNAME}', '{GAMENAME}', '{VALIDURL}'), array($mail, Config::get('game_name') . ' - ' . Config::get('uni_name'), HTTP_PATH . 'index.php?page=lostPassword&mode=newPassword&u=' . $userID . '&k=' . $validationKey), $MailRAW);
require 'includes/classes/Mail.class.php';
Mail::send($mail, $mail, t('passwordValidMailTitle', Config::get('game_name')), $MailContent);
$GLOBALS['DATABASE']->query("INSERT INTO " . LOSTPASSWORD . " SET userID = " . $userID . ", `key` = '" . $validationKey . "', time = " . TIMESTAMP . ", fromIP = '" . $_SERVER['REMOTE_ADDR'] . "';");
$this->printMessage(t('passwordValidMailSend'), NULL, array(array('label' => t('passwordNext'), 'url' => 'index.php')));
}
示例2: show
function show()
{
global $USER, $PLANET, $LNG, $UNI, $CONF, $resource, $pricelist;
$mode = HTTP::_GP('y', '');
$table = "";
$range = $PLANET['hangar'] * 3 - 2;
if ($range < 0) {
$range = 0;
}
if ($mode == '1') {
$cautare = $GLOBALS['DATABASE']->query("SELECT *from " . PLANETS . " where (`der_metal` >0 OR `der_crystal` >0) AND (`system` > '" . ($PLANET['system'] - $range) . "' AND `system` < '" . ($PLANET['system'] + $range) . "') AND `galaxy` = '" . $PLANET['galaxy'] . "' and `planet_type` = '1' AND universe = " . $UNI . " ;");
$table = "<tr><th>" . $LNG['debris_action_1'] . "</th><th>" . $LNG['debris_action_2'] . "</th><th>" . $LNG['debris_action_3'] . "</th><th>" . $LNG['debris_action_4'] . "</th><th>" . $LNG['debris_action_5'] . "</th><th>" . $LNG['debris_action_6'] . "\n\t\t\t</th></tr>";
//print_r($cautare);
if ($GLOBALS['DATABASE']->numRows($cautare) > 0) {
while ($GalaxyRowPlanet = $GLOBALS['DATABASE']->fetch_array($cautare)) {
$GRecNeeded = min(ceil(($GalaxyRowPlanet['der_metal'] + $GalaxyRowPlanet['der_crystal']) / $pricelist[219]['capacity']), $PLANET[$resource[219]]);
$table .= "<tr><td>" . $GalaxyRowPlanet['galaxy'] . "</td><td>" . $GalaxyRowPlanet['system'] . "</td><td>" . $GalaxyRowPlanet['planet'] . "</td><td>" . pretty_number($GalaxyRowPlanet['der_metal']) . "</td><td>" . pretty_number($GalaxyRowPlanet['der_crystal']) . "</td><td><a href='javascript:doit(8," . $GalaxyRowPlanet['id'] . ");'>" . $LNG['debris_action_6'] . "</a></td></tr>";
}
} else {
$table .= "<tr><td colspan='6'>" . $LNG['debris_action_7'] . "</td></tr>";
}
}
$this->tplObj->assign_vars(array('range' => $range, 'debris' => $table, 'user_maxfleetsettings' => $USER['settings_fleetactions']));
$this->display("page.finddebris.default.tpl");
}
示例3: _activeUser
private function _activeUser()
{
$validationID = HTTP::_GP('i', 0);
$validationKey = HTTP::_GP('k', '');
$userData = $GLOBALS['DATABASE']->getFirstRow("SELECT * FROM " . USERS_VALID . " WHERE validationID = " . $validationID . " AND validationKey = '" . $GLOBALS['DATABASE']->escape($validationKey) . "';");
if (!isset($userData)) {
$this->printMessage(t('vertifyNoUserFound'));
}
$GLOBALS['DATABASE']->query("DELETE FROM " . USERS_VALID . " WHERE validationID = " . $validationID . ";");
list($userID, $planetID) = PlayerUtil::createPlayer($userData['universe'], $userData['userName'], $userData['password'], $userData['email'], $userData['race'], $userData['language']);
if (Config::get('mail_active', $userData['universe']) == 1) {
require 'includes/classes/Mail.class.php';
$MailSubject = t('registerMailCompleteTitle', Config::get('game_name', $userData['universe']));
$MailRAW = $GLOBALS['LNG']->getTemplate('email_reg_done');
$MailContent = str_replace(array('{USERNAME}', '{GAMENAME}', '{GAMEMAIL}'), array($userData['email'], Config::get('game_name') . ' - ' . Config::get('uni_name'), Config::get('smtp_sendmail')), $MailRAW);
try {
Mail::send($userData['email'], $userData['userName'], $MailSubject, $MailContent);
} catch (Exception $e) {
// This mail is wayne.
}
}
if (!empty($userData['referralID'])) {
$GLOBALS['DATABASE']->query("UPDATE " . USERS . " SET\n\t\t\t`ref_id`\t= " . $userData['referralID'] . ",\n\t\t\t`ref_bonus`\t= 1\n\t\t\tWHERE\n\t\t\t`id`\t\t= " . $userID . ";");
}
if (!empty($userData['externalAuthUID'])) {
$GLOBALS['DATABASE']->query("INSERT INTO " . USERS_AUTH . " SET\n\t\t\t`id`\t\t= " . $userID . ",\n\t\t\t`account`\t= '" . $GLOBALS['DATABASE']->escape($userData['externalAuthUID']) . "',\n\t\t\t`mode`\t\t= '" . $GLOBALS['DATABASE']->escape($userData['externalAuthMethod']) . "';");
}
$nameSender = t('registerWelcomePMSenderName');
$subject = t('registerWelcomePMSubject');
$message = t('registerWelcomePMText', Config::get('game_name', $userData['universe']));
SendSimpleMessage($userID, 1, TIMESTAMP, 1, $nameSender, $subject, $message);
return array('userID' => $userID, 'userName' => $userData['userName'], 'planetID' => $planetID);
}
示例4: ShowTeamspeakPage
function ShowTeamspeakPage()
{
global $LNG, $USER;
$CONF = Config::getAll(NULL, $_SESSION['adminuni']);
if ($_POST) {
$config_before = array('ts_timeout' => $CONF['ts_timeout'], 'ts_modon' => $CONF['ts_modon'], 'ts_server' => $CONF['ts_server'], 'ts_tcpport' => $CONF['ts_tcpport'], 'ts_udpport' => $CONF['ts_udpport'], 'ts_version' => $CONF['ts_version'], 'ts_login' => $CONF['ts_login'], 'ts_password' => $CONF['ts_password'], 'ts_cron_interval' => $CONF['ts_cron_interval']);
$ts_modon = isset($_POST['ts_on']) && $_POST['ts_on'] == 'on' ? 1 : 0;
$ts_server = HTTP::_GP('ts_ip', '');
$ts_tcpport = HTTP::_GP('ts_tcp', 0);
$ts_udpport = HTTP::_GP('ts_udp', 0);
$ts_timeout = HTTP::_GP('ts_to', 0);
$ts_version = HTTP::_GP('ts_v', 0);
$ts_login = HTTP::_GP('ts_login', '');
$ts_password = HTTP::_GP('ts_password', '', true);
$ts_cron_interval = HTTP::_GP('ts_cron', 0);
$config_after = array('ts_timeout' => $ts_timeout, 'ts_modon' => $ts_modon, 'ts_server' => $ts_server, 'ts_tcpport' => $ts_tcpport, 'ts_udpport' => $ts_udpport, 'ts_version' => $ts_version, 'ts_login' => $ts_login, 'ts_password' => $ts_password, 'ts_cron_interval' => $ts_cron_interval);
Config::update($config_after);
$GLOBALS['DATABASE']->query("UPDATE " . CRONJOBS . " SET isActive = " . $ts_modon . ", `lock` = NULL, nextTime = 0 WHERE name = 'teamspeak';");
$CONF = Config::getAll(NULL, $_SESSION['adminuni']);
$LOG = new Log(3);
$LOG->target = 4;
$LOG->old = $config_before;
$LOG->new = $config_after;
$LOG->save();
}
$template = new template();
$template->assign_vars(array('se_save_parameters' => $LNG['se_save_parameters'], 'ts_tcpport' => $LNG['ts_tcpport'], 'ts_serverip' => $LNG['ts_serverip'], 'ts_version' => $LNG['ts_version'], 'ts_active' => $LNG['ts_active'], 'ts_settings' => $LNG['ts_settings'], 'ts_udpport' => $LNG['ts_udpport'], 'ts_timeout' => $LNG['ts_timeout'], 'ts_server_query' => $LNG['ts_server_query'], 'ts_sq_login' => $LNG['ts_login'], 'ts_sq_pass' => $LNG['ts_pass'], 'ts_lng_cron' => $LNG['ts_cron'], 'ts_to' => $CONF['ts_timeout'], 'ts_on' => $CONF['ts_modon'], 'ts_ip' => $CONF['ts_server'], 'ts_tcp' => $CONF['ts_tcpport'], 'ts_udp' => $CONF['ts_udpport'], 'ts_v' => $CONF['ts_version'], 'ts_login' => $CONF['ts_login'], 'ts_password' => $CONF['ts_password'], 'ts_cron' => $CONF['ts_cron_interval']));
$template->show('TeamspeakPage.tpl');
}
示例5: show
function show()
{
if (empty($_POST)) {
HTTP::redirectTo('index.php');
}
$db = Database::get();
$username = HTTP::_GP('username', '', UTF8_SUPPORT);
$password = HTTP::_GP('password', '', true);
$sql = "SELECT id, password FROM %%USERS%% WHERE universe = :universe AND username = :username;";
$loginData = $db->selectSingle($sql, array(':universe' => Universe::current(), ':username' => $username));
if (isset($loginData)) {
$hashedPassword = PlayerUtil::cryptPassword($password);
if ($loginData['password'] != $hashedPassword) {
// Fallback pre 1.7
if ($loginData['password'] == md5($password)) {
$sql = "UPDATE %%USERS%% SET password = :hashedPassword WHERE id = :loginID;";
$db->update($sql, array(':hashedPassword' => $hashedPassword, ':loginID' => $loginData['id']));
} else {
HTTP::redirectTo('index.php?code=1');
}
}
$session = Session::create();
$session->userId = (int) $loginData['id'];
$session->adminAccess = 0;
$session->save();
HTTP::redirectTo('game.php');
} else {
HTTP::redirectTo('index.php?code=1');
}
}
示例6: ShowDisclamerPage
function ShowDisclamerPage()
{
global $LNG;
$config = Config::get(Universe::getEmulated());
if (!empty($_POST)) {
$config_before = array('disclamerAddress' => $config->disclamerAddress, 'disclamerPhone' => $config->disclamerPhone, 'disclamerMail' => $config->disclamerMail, 'disclamerNotice' => $config->disclamerNotice);
$disclaimerAddress = HTTP::_GP('disclaimerAddress', '', true);
$disclaimerPhone = HTTP::_GP('disclaimerPhone', '', true);
$disclaimerMail = HTTP::_GP('disclaimerMail', '', true);
$disclaimerNotice = HTTP::_GP('disclaimerNotice', '', true);
$config_after = array('disclamerAddress' => $disclaimerAddress, 'disclamerPhone' => $disclaimerPhone, 'disclamerMail' => $disclaimerMail, 'disclamerNotice' => $disclaimerNotice);
foreach ($config_after as $key => $value) {
$config->{$key} = $value;
}
$config->save();
$LOG = new Log(3);
$LOG->target = 5;
$LOG->old = $config_before;
$LOG->new = $config_after;
$LOG->save();
}
$template = new template();
$template->loadscript('../base/jquery.autosize-min.js');
$template->execscript('$(\'textarea\').autosize();');
$template->assign_vars(array('disclaimerAddress' => $config->disclamerAddress, 'disclaimerPhone' => $config->disclamerPhone, 'disclaimerMail' => $config->disclamerMail, 'disclaimerNotice' => $config->disclamerNotice, 'se_server_parameters' => $LNG['mu_disclaimer'], 'se_save_parameters' => $LNG['se_save_parameters'], 'se_disclaimerAddress' => $LNG['se_disclaimerAddress'], 'se_disclaimerPhone' => $LNG['se_disclaimerPhone'], 'se_disclaimerMail' => $LNG['se_disclaimerMail'], 'se_disclaimerNotice' => $LNG['se_disclaimerNotice']));
$template->show('DisclamerConfigBody.tpl');
}
示例7: ShowChatConfigPage
function ShowChatConfigPage()
{
global $LNG;
$config = Config::get(Universe::getEmulated());
if (!empty($_POST)) {
$config_before = array('chat_closed' => $config->chat_closed, 'chat_allowchan' => $config->chat_allowchan, 'chat_allowmes' => $config->chat_allowmes, 'chat_allowdelmes' => $config->chat_allowdelmes, 'chat_logmessage' => $config->chat_logmessage, 'chat_nickchange' => $config->chat_nickchange, 'chat_botname' => $config->chat_botname, 'chat_channelname' => $config->chat_channelname);
$chat_allowchan = isset($_POST['chat_allowchan']) && $_POST['chat_allowchan'] == 'on' ? 1 : 0;
$chat_allowmes = isset($_POST['chat_allowmes']) && $_POST['chat_allowmes'] == 'on' ? 1 : 0;
$chat_allowdelmes = isset($_POST['chat_allowdelmes']) && $_POST['chat_allowdelmes'] == 'on' ? 1 : 0;
$chat_logmessage = isset($_POST['chat_logmessage']) && $_POST['chat_logmessage'] == 'on' ? 1 : 0;
$chat_nickchange = isset($_POST['chat_nickchange']) && $_POST['chat_nickchange'] == 'on' ? 1 : 0;
$chat_closed = isset($_POST['chat_closed']) && $_POST['chat_closed'] == 'on' ? 1 : 0;
$chat_channelname = HTTP::_GP('chat_channelname', '', true);
$chat_botname = HTTP::_GP('chat_botname', '', true);
$config_after = array('chat_closed' => $chat_closed, 'chat_allowchan' => $chat_allowchan, 'chat_allowmes' => $chat_allowmes, 'chat_allowdelmes' => $chat_allowdelmes, 'chat_logmessage' => $chat_logmessage, 'chat_nickchange' => $chat_nickchange, 'chat_botname' => $chat_botname, 'chat_channelname' => $chat_channelname);
foreach ($config_after as $key => $value) {
$config->{$key} = $value;
}
$config->save();
$LOG = new Log(3);
$LOG->target = 3;
$LOG->old = $config_before;
$LOG->new = $config_after;
$LOG->save();
}
$template = new template();
$template->assign_vars(array('chat_closed' => $config->chat_closed, 'chat_allowchan' => $config->chat_allowchan, 'chat_allowmes' => $config->chat_allowmes, 'chat_logmessage' => $config->chat_logmessage, 'chat_nickchange' => $config->chat_nickchange, 'chat_botname' => $config->chat_botname, 'chat_channelname' => $config->chat_channelname, 'se_server_parameters' => $LNG['se_server_parameters'], 'se_save_parameters' => $LNG['se_save_parameters'], 'ch_closed' => $LNG['ch_closed'], 'ch_allowchan' => $LNG['ch_allowchan'], 'ch_allowmes' => $LNG['ch_allowmes'], 'ch_allowdelmes' => $LNG['ch_allowdelmes'], 'ch_logmessage' => $LNG['ch_logmessage'], 'ch_nickchange' => $LNG['ch_nickchange'], 'ch_botname' => $LNG['ch_botname'], 'ch_channelname' => $LNG['ch_channelname']));
$template->show('ChatConfigBody.tpl');
}
示例8: CallOrder
function CallOrder()
{
global $USER, $CONF, $UNI;
$this->amount = HTTP::_GP('amount', 0);
$this->cost = HTTP::_GP('cost', 0);
if (!array_key_exists($this->amount, $this->pattern)) {
message('NOT VALID VALUE', '?page=overview', 3);
exit;
}
$this->cost = $this->pattern[$this->amount];
$validationKey = md5(uniqid('2m'));
$GLOBALS['DATABASE']->query("INSERT INTO `uni1_paypal` (`id`, `player`, `amount`, `timestamp`, `price`) VALUES (NULL, '" . $USER['id'] . "', '" . $this->amount . "', '" . TIMESTAMP . "', '" . $this->cost . "');");
//SendSimpleMessage ( $USER['id'], $USER['id'], TIMESTAMP, 1, 'Payment Bot', 'To do', 'After the payment has been processed, if you didnt received your DM please send an ticket or an Private Message to "Admin"');
$this_p = new paypal_class();
$ID = $GLOBALS['DATABASE']->uniquequery("SELECT `id` FROM `uni1_paypal` WHERE `player` = '" . $USER['id'] . "' AND `amount` = '" . $this->amount . "' AND `timestamp` = '" . TIMESTAMP . "'");
$this_p->add_field('business', $this::MAIL);
$this_p->add_field('return', 'https://' . $_SERVER['HTTP_HOST'] . '/game.php?page=paypal&i=' . $validationKey . '');
$this_p->add_field('cancel_return', 'https://' . $_SERVER['HTTP_HOST'] . '/ipn.php');
$this_p->add_field('notify_url', 'https://' . $_SERVER['HTTP_HOST'] . '/ipn.php');
$this_p->add_field('item_name', $this->amount . ' Credit-User(' . $USER['username'] . ').');
$this_p->add_field('item_number', $this->amount . '_credits');
$this_p->add_field('amount', $this->cost);
//$this_p->add_field('action', $action); ?
$this_p->add_field('currency_code', 'EUR');
$this_p->add_field('custom', $USER['id'] . ',' . $validationKey);
$this_p->add_field('rm', '2');
//$this_p->dump_fields();
foreach ($this_p->fields as $name => $value) {
$field[] = array('text' => '<input type="hidden" name="' . $name . '" value="' . $value . '">');
}
$this->tplObj->assign_vars(array('fields' => $field));
$this->display('paypal_class.tpl');
}
示例9: ShowDisclamerPage
function ShowDisclamerPage()
{
global $LNG, $USER;
$CONF = Config::getAll(NULL, $_SESSION['adminuni']);
if (!empty($_POST)) {
$config_before = array('disclamerAddress' => $CONF['disclamerAddress'], 'disclamerPhone' => $CONF['disclamerPhone'], 'disclamerMail' => $CONF['disclamerMail'], 'disclamerNotice' => $CONF['disclamerNotice']);
$disclamerAddress = HTTP::_GP('disclamerAddress', '', true);
$disclamerPhone = HTTP::_GP('disclamerPhone', '', true);
$disclamerMail = HTTP::_GP('disclamerMail', '', true);
$disclamerNotice = HTTP::_GP('disclamerNotice', '', true);
$config_after = array('disclamerAddress' => $disclamerAddress, 'disclamerPhone' => $disclamerPhone, 'disclamerMail' => $disclamerMail, 'disclamerNotice' => $disclamerNotice);
Config::update($config_after);
$CONF = Config::getAll(NULL, $_SESSION['adminuni']);
$LOG = new Log(3);
$LOG->target = 5;
$LOG->old = $config_before;
$LOG->new = $config_after;
$LOG->save();
}
$template = new template();
$template->loadscript('../base/jquery.autosize-min.js');
$template->execscript('$(\'textarea\').autosize();');
$template->assign_vars(array('disclamerAddress' => $CONF['disclamerAddress'], 'disclamerPhone' => $CONF['disclamerPhone'], 'disclamerMail' => $CONF['disclamerMail'], 'disclamerNotice' => $CONF['disclamerNotice'], 'se_server_parameters' => $LNG['mu_disclamer'], 'se_save_parameters' => $LNG['se_save_parameters'], 'se_disclamerAddress' => $LNG['se_disclamerAddress'], 'se_disclamerPhone' => $LNG['se_disclamerPhone'], 'se_disclamerMail' => $LNG['se_disclamerMail'], 'se_disclamerNotice' => $LNG['se_disclamerNotice']));
$template->show('DisclamerConfigBody.tpl');
}
示例10: show
function show()
{
global $PLANET, $LNG, $resource;
$this->initTemplate();
$this->setWindow('popup');
$this->tplObj->loadscript('phalanx.js');
$Galaxy = HTTP::_GP('galaxy', 0);
$System = HTTP::_GP('system', 0);
$Planet = HTTP::_GP('planet', 0);
if (!$this->allowPhalanx($Galaxy, $System)) {
$this->printMessage($LNG['px_out_of_range']);
}
if ($PLANET[$resource[903]] < PHALANX_DEUTERIUM) {
$this->printMessage($LNG['px_no_deuterium']);
}
$db = Database::get();
$sql = "UPDATE %%PLANETS%% SET deuterium = deuterium - :phalanxDeuterium WHERE id = :planetID;";
$db->update($sql, array(':phalanxDeuterium' => PHALANX_DEUTERIUM, ':planetID' => $PLANET['id']));
$sql = "SELECT id, name, id_owner FROM %%PLANETS%% WHERE universe = :universe\n\t\tAND galaxy = :galaxy AND system = :system AND planet = :planet AND :type;";
$TargetInfo = $db->selectSingle($sql, array(':universe' => Universe::current(), ':galaxy' => $Galaxy, ':system' => $System, ':planet' => $Planet, ':type' => 1));
if (empty($TargetInfo)) {
$this->printMessage($LNG['px_out_of_range']);
}
require 'includes/classes/class.FlyingFleetsTable.php';
$fleetTableObj = new FlyingFleetsTable();
$fleetTableObj->setPhalanxMode();
$fleetTableObj->setUser($TargetInfo['id_owner']);
$fleetTableObj->setPlanet($TargetInfo['id']);
$fleetTable = $fleetTableObj->renderTable();
$this->assign(array('galaxy' => $Galaxy, 'system' => $System, 'planet' => $Planet, 'name' => $TargetInfo['name'], 'fleetTable' => $fleetTable));
$this->display('page.phalanx.default.tpl');
}
示例11: ShowLogDetail
function ShowLogDetail()
{
global $LNG;
$logid = HTTP::_GP('id', 0);
$result = $GLOBALS['DATABASE']->getFirstRow("SELECT l.*, u_a.username as admin_username FROM " . LOG . " as l LEFT JOIN " . USERS . " as u_a ON u_a.id = l.admin WHERE l.id = " . $logid . "");
$data = unserialize($result['data']);
$conf_before = array();
$conf_after = array();
foreach ($data[0] as $key => $i) {
$conf_before[$key] = $i;
}
foreach ($data[1] as $key => $i) {
$conf_after[$key] = $i;
}
$Wrapper = array('resource_multiplier' => $LNG['se_resources_producion_speed'], 'forum_url' => $LNG['se_forum_link'], 'game_speed' => $LNG['se_general_speed'], 'chat_socket_chatid_info' => $LNG['ch_socket_chatid_info'], 'chat_socket_port_info' => $LNG['ch_socket_port_info'], 'chat_socket_ip_info' => $LNG['ch_socket_ip_info'], 'chat_socket_host_info' => $LNG['ch_socket_host_info'], 'chat_socket_chatid' => $LNG['ch_socket_chatid'], 'chat_socket_port' => $LNG['ch_socket_port'], 'chat_socket_ip' => $LNG['ch_socket_ip'], 'chat_socket_host' => $LNG['ch_socket_host'], 'chat_socket_active' => $LNG['ch_socket_active'], 'chat_socket' => $LNG['ch_socket'], 'chat_closed' => $LNG['ch_closed'], 'chat_allowchan' => $LNG['ch_allowchan'], 'chat_allowmes' => $LNG['ch_allowmes'], 'chat_allowdelmes' => $LNG['ch_allowcelmes'], 'chat_logmessage' => $LNG['ch_logmessage'], 'chat_nickchange' => $LNG['ch_nickchange'], 'chat_botname' => $LNG['ch_botname'], 'chat_channelname' => $LNG['ch_channelname'], 'ts_modon' => $LNG['ts_active'], 'ts_server' => $LNG['ts_serverip'], 'ts_password' => $LNG['ts_pass'], 'ts_cron_interval' => $LNG['ts_cron'], 'stat_settings' => $LNG['cs_point_per_resources_used'], 'stat' => $LNG['cs_points_to_zero'], 'stat_update_time' => $LNG['cs_time_between_updates'], 'stat_level' => $LNG['cs_access_lvl'], 'capaktiv' => $LNG['se_recaptcha_active'], 'cappublic' => $LNG['se_recaptcha_public'], 'capprivate' => $LNG['se_recaptcha_private'], 'ga_key' => $LNG['se_google_key'], 'metal' => $LNG['tech'][901], 'crystal' => $LNG['tech'][902], 'deuterium' => $LNG['tech'][903], 'darkmatter' => $LNG['tech'][921], 'authattack' => $LNG['qe_authattack'], 'username' => $LNG['adm_username'], 'field_max' => $LNG['qe_fields']);
foreach ($conf_before as $key => $val) {
if ($key != 'universe') {
if (isset($LNG['tech'][$key])) {
$Element = $LNG['tech'][$key];
} elseif (isset($LNG['se_' . $key])) {
$Element = $LNG['se_' . $key];
} elseif (isset($LNG[$key])) {
$Element = $LNG[$key];
} elseif (isset($Wrapper[$key])) {
$Element = $Wrapper[$key];
} else {
$Element = $key;
}
$LogArray[] = array('Element' => $Element, 'old' => $Element == 'urlaubs_until' ? _date($LNG['php_tdformat'], $val) : (is_numeric($val) ? pretty_number($val) : $val), 'new' => $Element == 'urlaubs_until' ? _date($LNG['php_tdformat'], $conf_after[$key]) : (is_numeric($conf_after[$key]) ? pretty_number($conf_after[$key]) : $conf_after[$key]));
}
}
$template = new template();
$template->assign_vars(array('LogArray' => $LogArray, 'admin' => $result['admin_username'], 'target' => $result['universe'], 'id' => $result['id'], 'time' => _date($LNG['php_tdformat'], $result['time'], $USER['timezone']), 'log_info' => $LNG['log_info'], 'log_admin' => $LNG['log_admin'], 'log_time' => $LNG['log_time'], 'log_target' => $LNG['log_universe'], 'log_id' => $LNG['log_id'], 'log_element' => $LNG['log_element'], 'log_old' => $LNG['log_old'], 'log_new' => $LNG['log_new']));
$template->show("LogDetail.tpl");
}
示例12: view
function view()
{
global $USER, $LNG;
require 'includes/classes/BBCode.class.php';
$db = Database::get();
$ticketID = HTTP::_GP('id', 0);
$sql = "SELECT a.*, t.categoryID, t.status FROM %%TICKETS_ANSWER%% a INNER JOIN %%TICKETS%% t USING(ticketID) WHERE a.ticketID = :ticketID ORDER BY a.answerID;";
$answerResult = $db->select($sql, array(':ticketID' => $ticketID));
$answerList = array();
if (empty($answerResult)) {
$this->printMessage(sprintf($LNG['ti_not_exist'], $ticketID), array(array('label' => $LNG['sys_back'], 'url' => 'game.php?page=ticket')));
}
$ticket_status = 0;
foreach ($answerResult as $answerRow) {
$answerRow['time'] = _date($LNG['php_tdformat'], $answerRow['time'], $USER['timezone']);
$answerRow['message'] = BBCode::parse($answerRow['message']);
$answerList[$answerRow['answerID']] = $answerRow;
if (empty($ticket_status)) {
$ticket_status = $answerRow['status'];
}
}
$categoryList = $this->ticketObj->getCategoryList();
$this->assign(array('ticketID' => $ticketID, 'categoryList' => $categoryList, 'answerList' => $answerList, 'status' => $ticket_status));
$this->display('page.ticket.view.tpl');
}
示例13: send
function send()
{
$username = HTTP::_GP('username', '', UTF8_SUPPORT);
$mail = HTTP::_GP('mail', '', true);
$errorMessages = array();
if (empty($username)) {
$errorMessages[] = t('passwordUsernameEmpty');
}
if (empty($mail)) {
$errorMessages[] = t('passwordErrorMailEmpty');
}
if (!empty($errorMessages)) {
$message = implode("<br>\r\n", $errorMessages);
$this->printMessage($message, NULL, array(array('label' => t('passwordBack'), 'url' => 'index.php?page=lostPassword')));
}
$userID = $GLOBALS['DATABASE']->getFirstCell("SELECT id FROM " . USERS . " WHERE universe = " . $GLOBALS['UNI'] . " AND username = '" . $GLOBALS['DATABASE']->escape($username) . "' AND email_2 = '" . $GLOBALS['DATABASE']->escape($mail) . "';");
if (empty($userID)) {
$this->printMessage(t('passwordErrorUnknown'), NULL, array(array('label' => t('passwordBack'), 'url' => 'index.php?page=lostPassword')));
}
$hasChanged = $GLOBALS['DATABASE']->getFirstCell("SELECT COUNT(*) FROM " . LOSTPASSWORD . " WHERE userID = " . $userID . " AND time > " . (TIMESTAMP - 86400) . " AND hasChanged = 0;");
if (!empty($hasChanged)) {
$this->printMessage(t('passwordErrorOnePerDay'), NULL, array(array('label' => t('passwordBack'), 'url' => 'index.php?page=lostPassword')));
}
$validationKey = md5(uniqid());
$MailRAW = $GLOBALS['LNG']->getTemplate('email_lost_password_validation');
$MailContent = str_replace(array('{USERNAME}', '{GAMENAME}', '{VALIDURL}', '{IP}', '{DATE}'), array($username, Config::get('game_name') . ' - ' . Config::get('uni_name'), HTTP_PATH . 'index.php?page=lostPassword&mode=newPassword&u=' . $userID . '&k=' . $validationKey, $_SERVER['REMOTE_ADDR'], date("m.d.y")), $MailRAW);
require 'includes/classes/Mail.class.php';
$headers = "From: support@battle-fighter.org\r\n";
$headers .= "Reply-To: support@battle-fighter.org\r\n";
$headers .= "MIME-Version: 1.0\r\n";
$headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n";
mail($userData['mail'], t('passwordValidMailTitle', Config::get('game_name')), $MailContent, $headers);
$GLOBALS['DATABASE']->query("INSERT INTO " . LOSTPASSWORD . " SET userID = " . $userID . ", `key` = '" . $validationKey . "', time = " . TIMESTAMP . ", fromIP = '" . $_SERVER['REMOTE_ADDR'] . "';");
$this->printMessage(t('passwordValidMailSend'), NULL, array(array('label' => t('passwordNext'), 'url' => 'index.php')));
}
示例14: show
function show()
{
global $LNG, $USER;
$LNG->includeData(array('FLEET'));
$this->setWindow('popup');
$db = Database::get();
$RID = HTTP::_GP('raport', '');
$sql = "SELECT raport,attacker,defender FROM %%RW%% WHERE rid = :reportID;";
$reportData = $db->selectSingle($sql, array(':reportID' => $RID));
if (empty($reportData)) {
$this->printMessage($LNG['sys_raport_not_found']);
}
// empty is BC for pre r2484
$isAttacker = empty($reportData['attacker']) || in_array($USER['id'], explode(",", $reportData['attacker']));
$isDefender = empty($reportData['defender']) || in_array($USER['id'], explode(",", $reportData['defender']));
if (empty($reportData) || !$isAttacker && !$isDefender) {
$this->printMessage($LNG['sys_raport_not_found']);
}
$combatReport = unserialize($reportData['raport']);
if ($isAttacker && !$isDefender && $combatReport['result'] == 'r' && count($combatReport['rounds']) <= 2) {
$this->printMessage($LNG['sys_raport_lost_contact']);
}
$combatReport['time'] = _date($LNG['php_tdformat'], $combatReport['time'], $USER['timezone']);
$combatReport = $this->BCWrapperPreRev2321($combatReport);
$this->assign(array('Raport' => $combatReport, 'pageTitle' => $LNG['sys_mess_attack_report']));
$this->display('shared.mission.raport.tpl');
}
示例15: show
function show()
{
global $LNG;
$referralID = HTTP::_GP('ref', 0);
if (!empty($referralID)) {
$this->redirectTo('index.php?page=register&referralID=' . $referralID);
}
$universeSelect = array();
foreach (Universe::availableUniverses() as $uniId) {
$config = Config::get($uniId);
$universeSelect[$uniId] = $config->uni_name . ($config->game_disable == 0 ? $LNG['uni_closed'] : '');
}
$Code = HTTP::_GP('code', 0);
$loginCode = false;
if (isset($LNG['login_error_' . $Code])) {
$loginCode = $LNG['login_error_' . $Code];
}
$config = Config::get();
$this->assign(array('universeSelect' => $universeSelect, 'code' => $loginCode, 'descHeader' => sprintf($LNG['loginWelcome'], $config->game_name), 'descText' => sprintf($LNG['loginServerDesc'], $config->game_name), 'loginInfo' => sprintf($LNG['loginInfo'], '<a href="index.php?page=rules">' . $LNG['menu_rules'] . '</a>')));
$screenshots = array();
$directoryIterator = new DirectoryIterator('styles/resource/images/login/screens/');
foreach ($directoryIterator as $fileInfo) {
/** @var $fileInfo DirectoryIterator */
if (!$fileInfo->isFile()) {
continue;
}
$thumbnail = 'styles/resource/images/login/screens/' . $fileInfo->getFilename();
if (file_exists('styles/resource/images/login/screens/thumbnails/' . $fileInfo->getFilename())) {
$thumbnail = 'styles/resource/images/login/screens/thumbnails/' . $fileInfo->getFilename();
}
$screenshots[] = array('path' => 'styles/resource/images/login/screens/' . $fileInfo->getFilename(), 'thumbnail' => $thumbnail);
}
$this->assign(array('screenshots' => $screenshots));
$this->display('page.index.default.tpl');
}