function main($id, $mode) { global $config, $db, $user, $auth, $template, $cache; global $phpbb_root_path, $phpbb_admin_path, $phpEx; $user->add_lang('install'); $this->tpl_name = 'acp_update'; $this->page_title = 'ACP_VERSION_CHECK'; // Get current and latest version $info = htmlspecialchars(obtain_latest_version_info(request_var('versioncheck_force', false))); if (empty($info)) { trigger_error('VERSIONCHECK_FAIL', E_USER_WARNING); } $info = explode("\n", $info); $latest_version = trim($info[0]); $announcement_url = trim($info[1]); $announcement_url = strpos($announcement_url, '&') === false ? str_replace('&', '&', $announcement_url) : $announcement_url; $update_link = append_sid($phpbb_root_path . 'install/index.' . $phpEx, 'mode=update'); // next feature release $next_feature_version = $next_feature_announcement_url = false; if (isset($info[2]) && trim($info[2]) !== '') { $next_feature_version = trim($info[2]); $next_feature_announcement_url = trim($info[3]); } // Determine automatic update... $sql = 'SELECT config_value FROM ' . CONFIG_TABLE . "\n\t\t\tWHERE config_name = 'version_update_from'"; $result = $db->sql_query($sql); $version_update_from = (string) $db->sql_fetchfield('config_value'); $db->sql_freeresult($result); $current_version = !empty($version_update_from) ? $version_update_from : $config['version']; $template->assign_vars(array('S_UP_TO_DATE' => phpbb_version_compare($latest_version, $config['version'], '<='), 'S_UP_TO_DATE_AUTO' => phpbb_version_compare($latest_version, $current_version, '<='), 'S_VERSION_CHECK' => true, 'U_ACTION' => $this->u_action, 'U_VERSIONCHECK_FORCE' => append_sid($this->u_action . '&versioncheck_force=1'), 'LATEST_VERSION' => $latest_version, 'CURRENT_VERSION' => $config['version'], 'AUTO_VERSION' => $version_update_from, 'NEXT_FEATURE_VERSION' => $next_feature_version, 'UPDATE_INSTRUCTIONS' => sprintf($user->lang['UPDATE_INSTRUCTIONS'], $announcement_url, $update_link), 'UPGRADE_INSTRUCTIONS' => $next_feature_version ? $user->lang('UPGRADE_INSTRUCTIONS', $next_feature_version, $next_feature_announcement_url) : false)); }
function misc_getContent() { $miscID = request_var('miscID', 1); switch ($miscID) { case 1: default: $result = getUnitStats(); break; case 2: $result = getDefenseStats(); break; case 3: $result = getUnitsEncumbrance(); break; case 4: $result = getWondersStats(); break; case 5: $result = getBuildingsStats(); break; case 6: $result = getResourcesStats(); break; case 7: $result = getSkillStats(); } return $result; }
/** * Run tool */ function run_tool() { $this->mode = request_var('m', 'pf'); switch ($this->mode) { // Post flags case 'pf': $this->_resync_pms_posts('posts'); break; // PM flags // PM flags case 'pmf': $this->_resync_pms_posts('pms'); break; // Reports // Reports case 'rf': $this->_resync_reports(); break; // Topic flags // Topic flags case 'tf': $this->_resync_topics(); break; case 'finished': trigger_error('RESYNC_REPORT_FLAGS_FINISHED'); break; } }
public function __construct() { global $CONF, $dpath, $LNG, $db, $USER, $PLANET; $mode = request_var('mode', ''); $msg = request_var('msg', '', true); $ctype = request_var('chat_type', ''); $MessageID = request_var('id', 0); switch ($mode) { case "delete": $this->DelMeassageFromChat($MessageID); break; case "send": $this->SetMeassageInChat($ctype, $msg); break; case "call": $this->GetMessages($ctype); break; default: $template = new template(); $template->execscript("showMessage();setInterval(showMessage, 10000);"); $template->loadscript("chat.js"); if (empty($ctype)) { $PlanetRess = new ResourceUpdate(); $PlanetRess->CalcResource(); $PlanetRess->SavePlanetToDB(); } else { $template->isPopup(true); } $template->assign_vars(array('ctype' => $ctype, 'chat_send' => $LNG['chat_send'], 'chat_disc' => $LNG['chat_disc'], 'chat_message' => $LNG['chat_message'], 'chat_bbcode' => $LNG['chat_bbcode'], 'chat_fontcolor' => $LNG['chat_fontcolor'], 'chat_color_white' => $LNG['chat_color_white'], 'chat_color_blue' => $LNG['chat_color_blue'], 'chat_color_yellow' => $LNG['chat_color_yellow'], 'chat_color_green' => $LNG['chat_color_green'], 'chat_color_pink' => $LNG['chat_color_pink'], 'chat_color_red' => $LNG['chat_color_red'], 'chat_color_orange' => $LNG['chat_color_orange'], 'chat_notext' => $LNG['chat_notext'], 'chat_request_url' => $LNG['chat_request_url'], 'chat_request_url_desc' => $LNG['chat_request_url_desc'])); $template->show("chat_overview.tpl"); break; } }
function acp_page($id, &$module) { global $config, $db, $template, $user; $captcha_vars = array('recaptcha_pubkey' => 'RECAPTCHA_PUBKEY', 'recaptcha_privkey' => 'RECAPTCHA_PRIVKEY'); $module->tpl_name = 'captcha_recaptcha_acp'; $module->page_title = 'ACP_VC_SETTINGS'; $form_key = 'acp_captcha'; add_form_key($form_key); $submit = request_var('submit', ''); if ($submit && check_form_key($form_key)) { $captcha_vars = array_keys($captcha_vars); foreach ($captcha_vars as $captcha_var) { $value = request_var($captcha_var, ''); if ($value) { set_config($captcha_var, $value); } } add_log('admin', 'LOG_CONFIG_VISUAL'); trigger_error($user->lang['CONFIG_UPDATED'] . adm_back_link($module->u_action)); } else { if ($submit) { trigger_error($user->lang['FORM_INVALID'] . adm_back_link($module->u_action)); } else { foreach ($captcha_vars as $captcha_var => $template_var) { $var = isset($_REQUEST[$captcha_var]) ? request_var($captcha_var, '') : (isset($config[$captcha_var]) ? $config[$captcha_var] : ''); $template->assign_var($template_var, $var); } $template->assign_vars(array('CAPTCHA_PREVIEW' => $this->get_demo_template($id), 'CAPTCHA_NAME' => $this->get_service_name(), 'U_ACTION' => $module->u_action)); } } }
public function _home() { global $config, $user, $cache; $artist = request_var('a', ''); $redirect = request_var('r', ''); if (!empty($artist)) { redirect(s_link('acp', array($redirect, 'a' => $artist))); } $artist_select = ''; if (!$user->is('founder')) { $sql = 'SELECT ub FROM _artists_auth WHERE user_id = ?'; $artist_select = ' WHERE ub IN (' . _implode(',', sql_rowset(sql_filter($sql, $user->d('user_id')), false, 'ub')) . ') '; } $sql = 'SELECT ub, subdomain, name FROM _artists ?? ORDER BY name'; $artists = sql_rowset(sql_filter($sql, $artist_select)); foreach ($artists as $i => $row) { if (!$i) _style('artist_list'); _style('artist_list.row', array( 'URL' => s_link('acp', array($redirect, 'a' => $row['subdomain'])), 'NAME' => $row['name']) ); } return; }
public function buildpage(viewNavigation $Navigation) { global $config, $phpbb_root_path, $phpEx, $user, $template; $item_id = request_var(URI_ITEM, 0); if (!class_exists('\\bbdkp\\controller\\loot\\Loot')) { require "{$phpbb_root_path}includes/bbdkp/controller/loot/Loot.{$phpEx}"; } if (!class_exists('\\bbdkp\\controller\\members\\Members')) { require "{$phpbb_root_path}includes/bbdkp/controller/members/Members.{$phpEx}"; } if (!class_exists('\\bbdkp\\controller\\raids\\Raids')) { require "{$phpbb_root_path}includes/bbdkp/controller/raids/Raids.{$phpEx}"; } $loot = new \bbdkp\controller\loot\Loot($item_id); $purchased_items = $loot->Loothistory($loot->item_name); $title = $user->lang['ITEM'] . ' : ' . $loot->item_name; $sort_order = array(0 => array('item_date desc, item_value desc', 'item_date asc, item_value desc'), 1 => array('member_name asc, item_value desc', 'member_name desc, item_value desc'), 2 => array('item_value desc', 'item_value asc')); $current_order = $Navigation->switch_order($sort_order); foreach ($purchased_items as $key => $item) { $buyer = new \bbdkp\controller\members\Members($item['member_id']); $raid = new \bbdkp\controller\raids\Raids($item['raid_id']); $template->assign_block_vars('items_row', array('DATE' => !empty($item['item_date']) ? date('d.m.y', $item['item_date']) : ' ', 'CLASS_COLOR' => $buyer->colorcode, 'CLASS_IMAGE' => $buyer->class_image, 'RACE_IMAGE' => $buyer->race_image, 'RACE' => $buyer->member_race, 'BUYER' => $buyer->member_name, 'U_VIEW_BUYER' => append_sid("{$phpbb_root_path}dkp.{$phpEx}", "page=member&" . URI_NAMEID . '=' . $item['member_id'] . '&' . URI_DKPSYS . '=' . $item['dkpid']), 'U_VIEW_RAID' => append_sid("{$phpbb_root_path}dkp.{$phpEx}", 'page=raid&' . URI_RAID . '=' . $item['raid_id']), 'EVENT_COLOR' => $raid->event_color, 'RAID' => $raid->event_name, 'VALUE' => sprintf("%.2f", $item['item_value']), 'DECAY' => sprintf("%.2f", $item['item_decay']), 'TOTAL' => sprintf("%.2f", $item['item_net']))); unset($raid); unset($buyer); } $navlinks_array = array(array('DKPPAGE' => $user->lang['MENU_ITEMVAL'], 'U_DKPPAGE' => append_sid("{$phpbb_root_path}dkp.{$phpEx}", "page=listitems")), array('DKPPAGE' => $user->lang['MENU_VIEWITEM'], 'U_DKPPAGE' => append_sid("{$phpbb_root_path}dkp.{$phpEx}", "page=item&" . URI_ITEM . '=' . $item_id))); foreach ($navlinks_array as $name) { $template->assign_block_vars('dkpnavlinks', array('DKPPAGE' => $name['DKPPAGE'], 'U_DKPPAGE' => $name['U_DKPPAGE'])); } $template->assign_vars(array('S_SHOWDECAY' => $config['bbdkp_decay'] == '1' ? true : false, 'L_PURCHASE_HISTORY_FOR' => sprintf($user->lang['PURCHASE_HISTORY_FOR'], '<strong>' . $loot->item_name . '</strong>'), 'O_DATE' => $current_order['uri'][0], 'O_BUYER' => $current_order['uri'][1], 'O_VALUE' => $current_order['uri'][2], 'U_VIEW_ITEM' => append_sid("{$phpbb_root_path}dkp.{$phpEx}", 'page=item&' . URI_ITEM . '=' . $item_id), 'VIEWITEM_FOOTCOUNT' => sprintf($user->lang['VIEWITEM_FOOTCOUNT'], count($purchased_items)), 'S_DISPLAY_VIEWITEM' => true)); unset($purchased_items); // Output page page_header($title); }
/** _ \_/ |\ | /¯¯\ \ / /\ |¯¯) |_¯ \ / /¯¯\ | | |´¯|¯` | /¯¯\ |\ |5 ¯ /¯\ | \| \__/ \/ /--\ |¯¯\ |__ \/ \__/ |__ \_/ | | \__/ | \|Core. * @author: Copyright (C) 2011 by Brayan Narvaez (Prinick) developer of xNova Revolution * @link: http://www.xnovarevolution.con.ar * @package 2Moons * @author Slaver <*****@*****.**> * @copyright 2009 Lucky <*****@*****.**> (XGProyecto) * @copyright 2011 Slaver <*****@*****.**> (Fork/2Moons) * @license http://www.gnu.org/licenses/gpl.html GNU GPLv3 License * @version 1.3 (2011-01-21) * @link http://code.google.com/p/2moons/ * Please do not remove the credits */ function ShowFleetTraderPage() { global $USER, $PLANET, $LNG, $CONF, $pricelist, $resource; $PlanetRess = new ResourceUpdate(); $PlanetRess->CalcResource(); $CONF['trade_allowed_ships'] = explode(',', $CONF['trade_allowed_ships']); $ID = request_var('id', 0); if (!empty($ID) && in_array($ID, $CONF['trade_allowed_ships'])) { $Count = max(min(request_var('count', '0'), $PLANET[$resource[$ID]]), 0); $PLANET['metal'] = bcadd($PLANET['metal'], bcmul($Count, bcmul($pricelist[$ID]['metal'], (double) (1 - $CONF['trade_charge'])))); $PLANET['crystal'] = bcadd($PLANET['crystal'], bcmul($Count, bcmul($pricelist[$ID]['crystal'], (double) (1 - $CONF['trade_charge'])))); $PLANET['deuterium'] = bcadd($PLANET['deuterium'], bcmul($Count, bcmul($pricelist[$ID]['deuterium'], (double) (1 - $CONF['trade_charge'])))); $PLANET['norio'] = bcadd($PLANET['norio'], bcmul($Count, bcmul($pricelist[$ID]['norio'], (double) (1 - $CONF['trade_charge'])))); $USER['darkmatter'] = bcadd($USER['darkmatter'], bcmul($Count, bcmul($pricelist[$ID]['darkmatter'], (double) (1 - $CONF['trade_charge'])))); $PlanetRess->Builded[$ID] = bcadd(bcmul('-1', $Count), $PlanetRess->Builded[$ID]); } $PlanetRess->SavePlanetToDB(); $template = new template(); $template->loadscript('fleettrader.js'); $template->execscript('updateVars();'); $Cost = array(); foreach ($CONF['trade_allowed_ships'] as $ID) { $Cost[$ID] = array($PLANET[$resource[$ID]], $pricelist[$ID]['metal'], $pricelist[$ID]['crystal'], $pricelist[$ID]['deuterium'], $pricelist[$ID]['darkmatter'], $pricelist[$ID]['norio']); } $template->assign_vars(array('tech' => $LNG['tech'], 'ft_head' => $LNG['ft_head'], 'ft_count' => $LNG['ft_count'], 'ft_max' => $LNG['ft_max'], 'ft_total' => $LNG['ft_total'], 'ft_charge' => $LNG['ft_charge'], 'ft_absenden' => $LNG['ft_absenden'], 'trade_allowed_ships' => $CONF['trade_allowed_ships'], 'CostInfos' => json_encode($Cost), 'Charge' => $CONF['trade_charge'])); $template->show("fleettrader_overview.tpl"); }
/** * Assigns an image with all data to the defined template-block * * @param string $template_block Name of the template-block * @param array $image_data Array with the image-data, all columns of GALLERY_IMAGES_TABLE are needed. album_name may be additionally assigned */ public static function assign_block($template_block, &$image_data, $album_status, $display = 126, $album_user_id = -1) { global $auth, $template, $user; static $lang_loaded; if (!$lang_loaded) { $user->add_lang('mods/gallery_mcp'); $lang_loaded = true; } $st = request_var('st', 0); $sk = request_var('sk', phpbb_gallery_config::get('default_sort_key')); $sd = request_var('sd', phpbb_gallery_config::get('default_sort_dir')); $image_data['rating'] = $user->lang['NOT_RATED']; if ($image_data['image_rates']) { $image_data['rating'] = sprintf($image_data['image_rates'] == 1 ? $user->lang['RATE_STRING'] : $user->lang['RATES_STRING'], $image_data['image_rate_avg'] / 100, $image_data['image_rates']); } // Hide the result, while still rating on contests if ($image_data['image_contest']) { $image_data['rating'] = $user->lang['CONTEST_RATING_HIDDEN']; } $s_user_allowed = $image_data['image_user_id'] == $user->data['user_id'] && $album_status != phpbb_gallery_album::STATUS_LOCKED; $s_allowed_delete = phpbb_gallery::$auth->acl_check('i_delete', $image_data['image_album_id'], $album_user_id) && $s_user_allowed || phpbb_gallery::$auth->acl_check('m_delete', $image_data['image_album_id'], $album_user_id); $s_allowed_edit = phpbb_gallery::$auth->acl_check('i_edit', $image_data['image_album_id'], $album_user_id) && $s_user_allowed || phpbb_gallery::$auth->acl_check('m_edit', $image_data['image_album_id'], $album_user_id); $s_quick_mod = $s_allowed_delete || $s_allowed_edit || phpbb_gallery::$auth->acl_check('m_status', $image_data['image_album_id'], $album_user_id) || phpbb_gallery::$auth->acl_check('m_move', $image_data['image_album_id'], $album_user_id); $template->assign_block_vars($template_block, array('IMAGE_ID' => $image_data['image_id'], 'UC_IMAGE_NAME' => $display & phpbb_gallery_block::DISPLAY_IMAGENAME ? self::generate_link('image_name', phpbb_gallery_config::get('link_image_name'), $image_data['image_id'], $image_data['image_name'], $image_data['image_album_id'], false, true, "&sk={$sk}&sd={$sd}&st={$st}") : '', 'UC_THUMBNAIL' => self::generate_link('thumbnail', phpbb_gallery_config::get('link_thumbnail'), $image_data['image_id'], $image_data['image_name'], $image_data['image_album_id']), 'U_ALBUM' => $display & phpbb_gallery_block::DISPLAY_ALBUMNAME ? phpbb_gallery_url::append_sid('album', 'album_id=' . $image_data['image_album_id']) : '', 'S_UNAPPROVED' => phpbb_gallery::$auth->acl_check('m_status', $image_data['image_album_id'], $album_user_id) && $image_data['image_status'] == self::STATUS_UNAPPROVED ? true : false, 'S_LOCKED' => $image_data['image_status'] == self::STATUS_LOCKED ? true : false, 'S_REPORTED' => phpbb_gallery::$auth->acl_check('m_report', $image_data['image_album_id'], $album_user_id) && $image_data['image_reported'] ? true : false, 'ALBUM_NAME' => $display & phpbb_gallery_block::DISPLAY_ALBUMNAME ? isset($image_data['album_name']) ? utf8_strlen(htmlspecialchars_decode($image_data['album_name'])) > phpbb_gallery_config::get('shortnames') + 3 ? htmlspecialchars(utf8_substr(htmlspecialchars_decode($image_data['album_name']), 0, phpbb_gallery_config::get('shortnames')) . '...') : $image_data['album_name'] : '' : '', 'ALBUM_NAME_FULL' => $display & phpbb_gallery_block::DISPLAY_ALBUMNAME ? isset($image_data['album_name']) ? $image_data['album_name'] : '' : '', 'POSTER' => $display & phpbb_gallery_block::DISPLAY_USERNAME ? $image_data['image_contest'] && !phpbb_gallery::$auth->acl_check('m_status', $image_data['image_album_id'], $album_user_id) ? $user->lang['CONTEST_USERNAME'] : get_username_string('full', $image_data['image_user_id'], $image_data['image_username'], $image_data['image_user_colour']) : '', 'TIME' => $display & phpbb_gallery_block::DISPLAY_IMAGETIME ? $user->format_date($image_data['image_time']) : '', 'VIEW' => $display & phpbb_gallery_block::DISPLAY_IMAGEVIEWS ? $image_data['image_view_count'] : -1, 'CONTEST_RANK' => $image_data['image_contest_rank'] ? $user->lang['CONTEST_RESULT_' . $image_data['image_contest_rank']] : '', 'CONTEST_RANK_ID' => $image_data['image_contest_rank'], 'S_RATINGS' => $display & phpbb_gallery_block::DISPLAY_RATINGS ? phpbb_gallery_config::get('allow_rates') && phpbb_gallery::$auth->acl_check('i_rate', $image_data['image_album_id'], $album_user_id) ? $image_data['rating'] : '' : '', 'U_RATINGS' => phpbb_gallery_url::append_sid('image_page', 'album_id=' . $image_data['image_album_id'] . "&image_id=" . $image_data['image_id']) . '#rating', 'L_COMMENTS' => $image_data['image_comments'] == 1 ? $user->lang['COMMENT'] : $user->lang['COMMENTS'], 'S_COMMENTS' => $display & phpbb_gallery_block::DISPLAY_COMMENTS ? phpbb_gallery_config::get('allow_comments') && phpbb_gallery::$auth->acl_check('c_read', $image_data['image_album_id'], $album_user_id) ? $image_data['image_comments'] ? $image_data['image_comments'] : $user->lang['NO_COMMENTS'] : '' : '', 'U_COMMENTS' => phpbb_gallery_url::append_sid('image_page', 'album_id=' . $image_data['image_album_id'] . "&image_id=" . $image_data['image_id']) . '#comments', 'S_MOD_ACTION' => phpbb_gallery_url::append_sid('mcp', "album_id={$image_data['image_album_id']}&image_id={$image_data['image_id']}&quickmod=1", true, $user->session_id), 'S_QUICK_MOD' => $s_quick_mod, 'S_QM_MOVE' => phpbb_gallery::$auth->acl_check('m_move', $image_data['image_album_id'], $album_user_id), 'S_QM_EDIT' => $s_allowed_edit, 'S_QM_DELETE' => $s_allowed_delete, 'S_QM_REPORT' => phpbb_gallery::$auth->acl_check('m_report', $image_data['image_album_id'], $album_user_id), 'S_QM_STATUS' => phpbb_gallery::$auth->acl_check('m_status', $image_data['image_album_id'], $album_user_id), 'S_IMAGE_REPORTED' => $image_data['image_reported'], 'U_IMAGE_REPORTED' => $image_data['image_reported'] ? phpbb_gallery_url::append_sid('mcp', "mode=report_details&album_id={$image_data['image_album_id']}&option_id=" . $image_data['image_reported']) : '', 'S_STATUS_APPROVED' => $image_data['image_status'] == phpbb_gallery_image::STATUS_APPROVED, 'S_STATUS_UNAPPROVED' => $image_data['image_status'] == phpbb_gallery_image::STATUS_UNAPPROVED, 'S_STATUS_LOCKED' => $image_data['image_status'] == phpbb_gallery_image::STATUS_LOCKED, 'S_IP' => $display & phpbb_gallery_block::DISPLAY_IP && $auth->acl_get('a_') ? $image_data['image_user_ip'] : '', 'U_WHOIS' => phpbb_gallery_url::append_sid('mcp', 'mode=whois&ip=' . $image_data['image_user_ip']), 'U_REPORT' => phpbb_gallery::$auth->acl_check('m_report', $image_data['image_album_id'], $album_user_id) && $image_data['image_reported'] ? phpbb_gallery_url::append_sid('mcp', "mode=report_details&album_id={$image_data['image_album_id']}&option_id=" . $image_data['image_reported']) : '', 'U_STATUS' => phpbb_gallery::$auth->acl_check('m_status', $image_data['image_album_id'], $album_user_id) ? phpbb_gallery_url::append_sid('mcp', "mode=queue_details&album_id={$image_data['image_album_id']}&option_id=" . $image_data['image_id']) : '', 'L_STATUS' => $image_data['image_status'] == self::STATUS_UNAPPROVED ? $user->lang['APPROVE_IMAGE'] : ($image_data['image_status'] == self::STATUS_APPROVED ? $user->lang['CHANGE_IMAGE_STATUS'] : $user->lang['UNLOCK_IMAGE']), 'U_MOVE' => phpbb_gallery::$auth->acl_check('m_move', $image_data['image_album_id'], $album_user_id) ? phpbb_gallery_url::append_sid('mcp', "action=images_move&album_id={$image_data['image_album_id']}&image_id=" . $image_data['image_id'] . "&redirect=redirect") : '', 'U_EDIT' => $s_allowed_edit ? phpbb_gallery_url::append_sid('posting', "mode=image&submode=edit&album_id={$image_data['image_album_id']}&image_id=" . $image_data['image_id']) : '', 'U_DELETE' => $s_allowed_delete ? phpbb_gallery_url::append_sid('posting', "mode=image&submode=delete&album_id={$image_data['image_album_id']}&image_id=" . $image_data['image_id']) : '')); }
function main($id, $mode) { global $db, $user, $auth, $template, $sid, $cache; global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx; $link = '<br /><a href="' . append_sid("index.{$phpEx}", "i=dkp_bbtooltips&mode=bbtooltips") . '"><h3>Return to Index</h3></a>'; $user->add_lang(array('mods/dkp_tooltips')); // bbtips version $template->assign_vars(array('BBTIPS_VERS' => $config['bbdkp_plugin_bbtips_version'])); switch ($mode) { case 'bbtooltips': /*** note there are more $config entries for bbtips but they aren't user-configurable yet */ $submit1 = isset($_POST['site_submit']) ? true : false; $submit2 = isset($_POST['arm_submit']) ? true : false; $gamesites = array('wowhead' => "Wowhead"); $langlist = array('en' => "English", 'fr' => "French", 'de' => "German", 'es' => "Spanish", 'ru' => "Russian"); if ($submit1) { set_config('bbtips_maxparse', request_var('maxparse', 0), true); set_config('bbtips_lang', request_var('site_lang', ''), true); set_config('bbtips_localjs', request_var('localjs', 0), true); $cache->destroy('config'); trigger_error($user->lang['BBTOOLTIPS_SETTINGSAVED'] . $link, E_USER_NOTICE); } else { foreach ($langlist as $tt_lang => $tt_langname) { $template->assign_block_vars('site_lang_row', array('VALUE' => $tt_lang, 'SELECTED' => $tt_lang == $config['bbtips_lang'] ? ' selected="selected"' : '', 'OPTION' => $tt_langname)); } $template->assign_vars(array('F_BBTOOLTIPS' => append_sid("index.{$phpEx}", "i=dkp_bbtooltips&mode=bbtooltips&"), 'MAXPARSE' => $config['bbtips_maxparse'], 'LOCALJS_YES_CHECKED' => $config['bbtips_localjs'] == '1' ? ' checked="checked"' : '', 'LOCALJS_NO_CHECKED' => $config['bbtips_localjs'] == '0' ? ' checked="checked"' : '')); } $this->page_title = $user->lang['BBTOOLTIPS']; $this->tpl_name = 'dkp/acp_' . $mode; break; } }
function main($id, $mode) { global $db, $user, $auth, $template, $cache; global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx; add_form_key('wwh'); $user->add_lang('ucp'); $this->tpl_name = 'acp_wwh'; $this->page_title = $user->lang['WWH_TITLE']; $submit = isset($_POST['submit']) ? true : false; if ($submit) { if (!check_form_key('wwh')) { trigger_error('FORM_INVALID'); } set_config('wwh_disp_bots', request_var('wwh_disp_bots', 0)); set_config('wwh_disp_guests', request_var('wwh_disp_guests', 0)); set_config('wwh_disp_hidden', request_var('wwh_disp_hidden', 0)); set_config('wwh_disp_time', request_var('wwh_disp_time', 0)); set_config('wwh_disp_time_format', request_var('wwh_disp_time_format', 'H:i')); set_config('wwh_disp_ip', request_var('wwh_disp_ip', 0)); set_config('wwh_version', request_var('wwh_version', 0)); set_config('wwh_del_time_h', request_var('wwh_del_time_h', 0)); set_config('wwh_del_time_m', request_var('wwh_del_time_m', 0)); set_config('wwh_del_time_s', request_var('wwh_del_time_s', 0)); set_config('wwh_sort_by', request_var('wwh_sort_by', 0)); set_config('wwh_record', request_var('wwh_record', 0)); set_config('wwh_record_timestamp', request_var('wwh_record_timestamp', 'D j. M Y')); if (request_var('wwh_reset', 0) > 0) { set_config('wwh_record_ips', 1); set_config('wwh_record_time', time()); set_config('wwh_reset_time', time()); } trigger_error($user->lang['WWH_SAVED_SETTINGS'] . adm_back_link($this->u_action)); } $template->assign_vars(array('WWH_MOD_VERSION' => sprintf($user->lang['WWH_INSTALLED'], $config['wwh_mod_version']), 'WWH_DISP_BOTS' => $config['wwh_disp_bots'], 'WWH_DISP_GUESTS' => $config['wwh_disp_guests'], 'WWH_DISP_HIDDEN' => $config['wwh_disp_hidden'], 'WWH_DISP_TIME' => $config['wwh_disp_time'], 'WWH_DISP_TIME_FORMAT' => $config['wwh_disp_time_format'], 'WWH_DISP_IP' => $config['wwh_disp_ip'], 'WWH_VERSION' => $config['wwh_version'], 'WWH_DEL_TIME_H' => $config['wwh_del_time_h'], 'WWH_DEL_TIME_M' => $config['wwh_del_time_m'], 'WWH_DEL_TIME_S' => $config['wwh_del_time_s'], 'WWH_SORT_BY' => $config['wwh_sort_by'], 'WWH_RECORD' => $config['wwh_record'], 'WWH_RECORD_TIMESTAMP' => $config['wwh_record_timestamp'], 'U_ACTION' => $this->u_action)); }
function main($id, $mode) { global $db, $user, $auth, $template, $cache; global $config, $src_root_path, $src_admin_path, $phpEx; include $src_root_path . 'includes/functions_user.' . $phpEx; $user->add_lang('acp/posting'); // Set up general vars $this->tpl_name = 'acp_disallow'; $this->page_title = 'ACP_DISALLOW_USERNAMES'; $form_key = 'acp_disallow'; add_form_key($form_key); $disallow = isset($_POST['disallow']) ? true : false; $allow = isset($_POST['allow']) ? true : false; if (($allow || $disallow) && !check_form_key($form_key)) { trigger_error($user->lang['FORM_INVALID'] . adm_back_link($this->u_action), E_USER_WARNING); } if ($disallow) { $disallowed_user = str_replace('*', '%', utf8_normalize_nfc(request_var('disallowed_user', '', true))); if (!$disallowed_user) { trigger_error($user->lang['NO_USERNAME_SPECIFIED'] . adm_back_link($this->u_action), E_USER_WARNING); } $sql = 'SELECT disallow_id FROM ' . DISALLOW_TABLE . "\n\t\t\t\tWHERE disallow_username = '******'"; $result = $db->sql_query($sql); $row = $db->sql_fetchrow($result); $db->sql_freeresult($result); if ($row) { trigger_error($user->lang['DISALLOWED_ALREADY'] . adm_back_link($this->u_action), E_USER_WARNING); } $sql = 'INSERT INTO ' . DISALLOW_TABLE . ' ' . $db->sql_build_array('INSERT', array('disallow_username' => $disallowed_user)); $db->sql_query($sql); $cache->destroy('_disallowed_usernames'); $message = $user->lang['DISALLOW_SUCCESSFUL']; add_log('admin', 'LOG_DISALLOW_ADD', str_replace('%', '*', $disallowed_user)); trigger_error($message . adm_back_link($this->u_action)); } else { if ($allow) { $disallowed_id = request_var('disallowed_id', 0); if (!$disallowed_id) { trigger_error($user->lang['NO_USERNAME_SPECIFIED'] . adm_back_link($this->u_action), E_USER_WARNING); } $sql = 'DELETE FROM ' . DISALLOW_TABLE . ' WHERE disallow_id = ' . $disallowed_id; $db->sql_query($sql); $cache->destroy('_disallowed_usernames'); add_log('admin', 'LOG_DISALLOW_DELETE'); trigger_error($user->lang['DISALLOWED_DELETED'] . adm_back_link($this->u_action)); } } // Grab the current list of disallowed usernames... $sql = 'SELECT * FROM ' . DISALLOW_TABLE; $result = $db->sql_query($sql); $disallow_select = ''; while ($row = $db->sql_fetchrow($result)) { $disallow_select .= '<option value="' . $row['disallow_id'] . '">' . str_replace('%', '*', $row['disallow_username']) . '</option>'; } $db->sql_freeresult($result); $template->assign_vars(array('U_ACTION' => $this->u_action, 'S_DISALLOWED_NAMES' => $disallow_select)); }
public function _home() { global $config, $user, $cache; if (!_button()) { return false; } $topic = request_var('topic', 0); $important = request_var('important', 0); $sql = 'SELECT * FROM _forum_topics WHERE topic_id = ?'; if (!$topicdata = sql_fieldrow(sql_filter($sql, $topic))) { fatal_error(); } $sql_important = ($important) ? ', topic_important = 1' : ''; $sql = 'UPDATE _forum_topics SET topic_color = ?, topic_announce = 1' . $sql_important . ' WHERE topic_id = ?'; sql_query(sql_filter($sql, 'E1CB39', $topic)); return _pre('El tema <strong>' . $topicdata['topic_title'] . '</strong> ha sido anunciado.', true); }
/** * Wrapper for request_var() for multibtye input * * @param array $params multi-dimensional array holding the requested vars & defaults. * * @return mixed */ function process_mb_vars($params = array()) { while (list($var, $param) = @each($params)) { $data[$var] = request_var($var, $param, true); } return $data; }
function main($id, $mode) { global $db, $user, $phpbb_root_path, $config, $phpEx; // Do we have an id? No, then just exit $confirm_id = request_var('id', ''); $type = request_var('type', 0); if (!$confirm_id || !$type) { exit; } // Try and grab code for this id and session $sql = 'SELECT code, seed FROM ' . CONFIRM_TABLE . "\n\t\t\tWHERE session_id = '" . $db->sql_escape($user->session_id) . "'\n\t\t\t\tAND confirm_id = '" . $db->sql_escape($confirm_id) . "'\n\t\t\t\tAND confirm_type = {$type}"; $result = $db->sql_query($sql); $row = $db->sql_fetchrow($result); $db->sql_freeresult($result); // If we have a row then grab data else create a new id if (!$row) { exit; } if ($config['captcha_gd']) { include $phpbb_root_path . 'includes/captcha/captcha_gd.' . $phpEx; } else { include $phpbb_root_path . 'includes/captcha/captcha_non_gd.' . $phpEx; } $captcha = new captcha(); $captcha->execute($row['code'], $row['seed']); garbage_collection(); exit_handler(); }
function main($id, $mode) { global $config, $db, $user, $table_prefix, $auth, $template, $phpbb_root_path, $phpEx; define('TABLE_PREFIX', $table_prefix); require_once 'class_ulogin.php'; $uLogin = new uLogin($db); if ($config['require_activation'] == USER_ACTIVATION_DISABLE) { trigger_error('UCP_REGISTER_DISABLE'); } if (!($user_id = $uLogin->auth())) { $user_id = $uLogin->register(); } if ($user_id) { $session = $user->session_create($user_id, 0, 1); } if (!$session) { page_header($user->lang['LOGIN'], false); $template->set_filenames(array('body' => 'login_body.html')); make_jumpbox(append_sid("{$phpbb_root_path}viewforum.{$phpEx}")); page_footer(); exit; } $redirect = request_var('redirect', "{$phpbb_root_path}index.{$phpEx}"); $message = $user->lang['LOGIN_REDIRECT']; $l_redirect = $redirect === "{$phpbb_root_path}index.{$phpEx}" || $redirect === "index.{$phpEx}" ? $user->lang['RETURN_INDEX'] : $user->lang['RETURN_PAGE']; $redirect = reapply_sid($redirect); if (defined('IN_CHECK_BAN') && $session['user_row']['user_type'] != USER_FOUNDER) { return false; } $redirect = meta_refresh(3, $redirect); trigger_error($message . '<br /><br />' . sprintf($l_redirect, '<a href="' . $redirect . '">', '</a>')); }
function main($id, $mode) { global $config, $phpbb_root_path, $phpEx; global $db, $user, $auth, $template, $phpbb_container; if (!$config['allow_password_reset']) { trigger_error($user->lang('UCP_PASSWORD_RESET_DISABLED', '<a href="mailto:' . htmlspecialchars($config['board_contact']) . '">', '</a>')); } $username = request_var('username', '', true); $email = strtolower(request_var('email', '')); $submit = isset($_POST['submit']) ? true : false; if ($submit) { $sql = 'SELECT user_id, username, user_permissions, user_email, user_jabber, user_notify_type, user_type, user_lang, user_inactive_reason FROM ' . USERS_TABLE . "\n\t\t\t\tWHERE user_email_hash = '" . $db->sql_escape(phpbb_email_hash($email)) . "'\n\t\t\t\t\tAND username_clean = '" . $db->sql_escape(utf8_clean_string($username)) . "'"; $result = $db->sql_query($sql); $user_row = $db->sql_fetchrow($result); $db->sql_freeresult($result); if (!$user_row) { trigger_error('NO_EMAIL_USER'); } if ($user_row['user_type'] == USER_IGNORE) { trigger_error('NO_USER'); } if ($user_row['user_type'] == USER_INACTIVE) { if ($user_row['user_inactive_reason'] == INACTIVE_MANUAL) { trigger_error('ACCOUNT_DEACTIVATED'); } else { trigger_error('ACCOUNT_NOT_ACTIVATED'); } } // Check users permissions $auth2 = new \phpbb\auth\auth(); $auth2->acl($user_row); if (!$auth2->acl_get('u_chgpasswd')) { trigger_error('NO_AUTH_PASSWORD_REMINDER'); } $server_url = generate_board_url(); // Make password at least 8 characters long, make it longer if admin wants to. // gen_rand_string() however has a limit of 12 or 13. $user_password = gen_rand_string_friendly(max(8, mt_rand((int) $config['min_pass_chars'], (int) $config['max_pass_chars']))); // For the activation key a random length between 6 and 10 will do. $user_actkey = gen_rand_string(mt_rand(6, 10)); // Instantiate passwords manager $passwords_manager = $phpbb_container->get('passwords.manager'); $sql = 'UPDATE ' . USERS_TABLE . "\n\t\t\t\tSET user_newpasswd = '" . $db->sql_escape($passwords_manager->hash($user_password)) . "', user_actkey = '" . $db->sql_escape($user_actkey) . "'\n\t\t\t\tWHERE user_id = " . $user_row['user_id']; $db->sql_query($sql); include_once $phpbb_root_path . 'includes/functions_messenger.' . $phpEx; $messenger = new messenger(false); $messenger->template('user_activate_passwd', $user_row['user_lang']); $messenger->set_addresses($user_row); $messenger->anti_abuse_headers($config, $user); $messenger->assign_vars(array('USERNAME' => htmlspecialchars_decode($user_row['username']), 'PASSWORD' => htmlspecialchars_decode($user_password), 'U_ACTIVATE' => "{$server_url}/ucp.{$phpEx}?mode=activate&u={$user_row['user_id']}&k={$user_actkey}")); $messenger->send($user_row['user_notify_type']); meta_refresh(3, append_sid("{$phpbb_root_path}index.{$phpEx}")); $message = $user->lang['PASSWORD_UPDATED'] . '<br /><br />' . sprintf($user->lang['RETURN_INDEX'], '<a href="' . append_sid("{$phpbb_root_path}index.{$phpEx}") . '">', '</a>'); trigger_error($message); } $template->assign_vars(array('USERNAME' => $username, 'EMAIL' => $email, 'S_PROFILE_ACTION' => append_sid($phpbb_root_path . 'ucp.' . $phpEx, 'mode=sendpassword'))); $this->tpl_name = 'ucp_remind'; $this->page_title = 'UCP_REMIND'; }
function ShowNewsPage() { global $LNG, $db, $USER; if ($_GET['action'] == 'send') { $edit_id = request_var('id', 0); $title = $db->sql_escape(request_var('title', '', true)); $text = $db->sql_escape(request_var('text', '', true)); $query = $_GET['mode'] == 2 ? "INSERT INTO " . NEWS . " (`id` ,`user` ,`date` ,`title` ,`text`) VALUES ( NULL , '" . $USER['username'] . "', '" . TIMESTAMP . "', '" . $title . "', '" . $text . "');" : "UPDATE " . NEWS . " SET `title` = '" . $title . "', `text` = '" . $text . "', `date` = '" . TIMESTAMP . "' WHERE `id` = '" . $edit_id . "' LIMIT 1;"; $db->query($query); } elseif ($_GET['action'] == 'delete' && isset($_GET['id'])) { $db->query("DELETE FROM " . NEWS . " WHERE `id` = '" . request_var('id', 0) . "';"); } $query = $db->query("SELECT * FROM " . NEWS . " ORDER BY id ASC"); while ($u = $db->fetch_array($query)) { $NewsList[] = array('id' => $u['id'], 'title' => $u['title'], 'date' => date("d.m.Y H:i:s", $u['date']), 'user' => $u['user'], 'confirm' => sprintf($LNG['nws_confirm'], $u['title'])); } $template = new template(); $template->page_header(); if ($_GET['action'] == 'edit' && isset($_GET['id'])) { $News = $db->uniquequery("SELECT id, title, text FROM " . NEWS . " WHERE id = '" . $db->sql_escape($_GET['id']) . "';"); $template->assign_vars(array('mode' => 1, 'nws_head' => sprintf($LNG['nws_head_edit'], $News['title']), 'news_id' => $News['id'], 'news_title' => $News['title'], 'news_text' => $News['text'])); } elseif ($_GET['action'] == 'create') { $template->assign_vars(array('mode' => 2, 'nws_head' => $LNG['nws_head_create'])); } $template->assign_vars(array('NewsList' => $NewsList, 'button_submit' => $LNG['button_submit'], 'nws_total' => sprintf($LNG['nws_total'], count($NewsList)), 'nws_news' => $LNG['nws_news'], 'nws_id' => $LNG['nws_id'], 'nws_title' => $LNG['nws_title'], 'nws_date' => $LNG['nws_date'], 'nws_from' => $LNG['nws_from'], 'nws_del' => $LNG['nws_del'], 'nws_create' => $LNG['nws_create'], 'nws_content' => $LNG['nws_content'])); $template->show('adm/NewsPage.tpl'); }
/** * Constructor * Load the list with available plugins and assign them in the correct category */ function manage_plugin() { // Set the path $this->tool_box_path = TITANIA_ROOT . 'includes/manage_tools/'; // Create a list with tools $filelist = filelist($this->tool_box_path, '', PHP_EXT); // Need to do some sanitization on the result of filelist foreach ($filelist as $tools) { // Don't want the extension foreach ($tools as $tool) { if (in_array($tool, $this->ignore_tools)) { continue; } $this->plugin_list[] = ($pos = strpos($tool, '.' . PHP_EXT)) !== false ? substr($tool, 0, $pos) : $tool; } } // Get the requested cat and tool $this->tool_id = request_var('t', ''); // Check if they want to use a tool or not, make sure that the tool name is legal, and make sure the tool exists if (!$this->tool_id || preg_match('#([^a-zA-Z0-9_])#', $this->tool_id) || !file_exists($this->tool_box_path . $this->tool_id . '.' . PHP_EXT)) { $this->tool_id = ''; } // Make sure the form_key is set add_form_key($this->tool_id); // Assign the two menus to the template $this->gen_left_nav(); }
function main($id, $mode) { global $auth, $db, $user, $template; global $config, $phpbb_root_path, $phpEx; $action = request_var('action', array('' => '')); if (is_array($action)) { list($action, ) = each($action); } $this->page_title = 'MCP_WARN'; switch ($mode) { case 'front': mcp_warn_front_view($id, $mode); $this->tpl_name = 'mcp_warn_front'; break; case 'list': mcp_warn_list_view($id, $mode, $action); $this->tpl_name = 'mcp_warn_list'; break; case 'warn_post': mcp_warn_post_view($id, $mode, $action); $this->tpl_name = 'mcp_warn_post'; break; case 'warn_user': mcp_warn_user_view($id, $mode, $action); $this->tpl_name = 'mcp_warn_user'; break; } }
/** _ \_/ |\ | /¯¯\ \ / /\ |¯¯) |_¯ \ / /¯¯\ | | |´¯|¯` | /¯¯\ |\ |5 ¯ /¯\ | \| \__/ \/ /--\ |¯¯\ |__ \/ \__/ |__ \_/ | | \__/ | \|Core. * @author: Copyright (C) 2011 by Brayan Narvaez (Prinick) developer of xNova Revolution * @link: http://www.xnovarevolution.con.ar * @package 2Moons * @author Slaver <*****@*****.**> * @copyright 2009 Lucky <*****@*****.**> (XGProyecto) * @copyright 2011 Slaver <*****@*****.**> (Fork/2Moons) * @license http://www.gnu.org/licenses/gpl.html GNU GPLv3 License * @version 1.3 (2011-01-21) * @link http://code.google.com/p/2moons/ * Please do not remove the credits */ function ShowTopKB() { global $USER, $PLANET, $LNG, $UNI, $db, $LANG; $mode = request_var('mode', ''); $template = new template(); switch ($mode) { case "showkb": $template->isPopup(true); $LANG->includeLang(array('FLEET')); $ReportID = request_var('rid', ''); if (file_exists(ROOT_PATH . 'raports/topkb_' . $ReportID . '.php')) { require_once ROOT_PATH . 'raports/topkb_' . $ReportID . '.php'; $RaportRAW = $db->uniquequery("SELECT `angreifer`, `defender` FROM " . TOPKB . " WHERE `rid` = '" . $db->sql_escape($ReportID) . "';"); } foreach ($LNG['tech_rc'] as $id => $s_name) { $ship[] = "[ship[" . $id . "]]"; $shipname[] = $s_name; } $template->assign_vars(array('attacker' => $RaportRAW['angreifer'], 'defender' => $RaportRAW['defender'], 'report' => $raport)); $template->show("topkb_report.tpl"); break; default: $PlanetRess = new ResourceUpdate(); $PlanetRess->CalcResource(); $PlanetRess->SavePlanetToDB(); $top = $db->query("SELECT * FROM " . TOPKB . " WHERE `universe` = '" . $UNI . "' ORDER BY gesamtunits DESC LIMIT 100;"); while ($data = $db->fetch_array($top)) { $TopKBList[] = array('result' => $data['fleetresult'], 'time' => date(TDFORMAT, $data['time']), 'units' => pretty_number($data['gesamtunits']), 'rid' => $data['rid'], 'attacker' => $data['angreifer'], 'defender' => $data['defender'], 'result' => $data['fleetresult']); } $db->free_result($top); $template->assign_vars(array('tkb_units' => $LNG['tkb_units'], 'tkb_datum' => $LNG['tkb_datum'], 'tkb_owners' => $LNG['tkb_owners'], 'tkb_platz' => $LNG['tkb_platz'], 'tkb_top' => $LNG['tkb_top'], 'tkb_gratz' => $LNG['tkb_gratz'], 'tkb_legende' => $LNG['tkb_legende'], 'tkb_gewinner' => $LNG['tkb_gewinner'], 'tkb_verlierer' => $LNG['tkb_verlierer'], 'TopKBList' => $TopKBList)); $template->show("topkb_overview.tpl"); break; } }
function main($id, $mode) { global $db, $user, $auth, $template; global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx; $user->add_lang('acp/board'); $captcha_vars = array('captcha_gd_x_grid' => 'CAPTCHA_GD_X_GRID', 'captcha_gd_y_grid' => 'CAPTCHA_GD_Y_GRID', 'captcha_gd_foreground_noise' => 'CAPTCHA_GD_FOREGROUND_NOISE', 'captcha_gd' => 'CAPTCHA_GD_PREVIEWED', 'captcha_gd_wave' => 'CAPTCHA_GD_WAVE', 'captcha_gd_3d_noise' => 'CAPTCHA_GD_3D_NOISE', 'captcha_gd_fonts' => 'CAPTCHA_GD_FONTS'); if (isset($_GET['demo'])) { $captcha_vars = array_keys($captcha_vars); foreach ($captcha_vars as $captcha_var) { $config[$captcha_var] = isset($_REQUEST[$captcha_var]) ? request_var($captcha_var, 0) : $config[$captcha_var]; } if ($config['captcha_gd']) { include $phpbb_root_path . 'includes/captcha/captcha_gd.' . $phpEx; } else { include $phpbb_root_path . 'includes/captcha/captcha_non_gd.' . $phpEx; } $captcha = new captcha(); $captcha->execute(gen_rand_string(mt_rand(CAPTCHA_MIN_CHARS, CAPTCHA_MAX_CHARS)), time()); exit; } $config_vars = array('enable_confirm' => 'REG_ENABLE', 'enable_post_confirm' => 'POST_ENABLE', 'confirm_refresh' => 'CONFIRM_REFRESH', 'captcha_gd' => 'CAPTCHA_GD'); $this->tpl_name = 'acp_captcha'; $this->page_title = 'ACP_VC_SETTINGS'; $form_key = 'acp_captcha'; add_form_key($form_key); $submit = request_var('submit', ''); if ($submit && check_form_key($form_key)) { $config_vars = array_keys($config_vars); foreach ($config_vars as $config_var) { set_config($config_var, request_var($config_var, '')); } $captcha_vars = array_keys($captcha_vars); foreach ($captcha_vars as $captcha_var) { $value = request_var($captcha_var, 0); if ($value >= 0) { set_config($captcha_var, $value); } } add_log('admin', 'LOG_CONFIG_VISUAL'); trigger_error($user->lang['CONFIG_UPDATED'] . adm_back_link($this->u_action)); } else { if ($submit) { trigger_error($user->lang['FORM_INVALID'] . adm_back_link($this->u_action)); } else { $preview_image_src = append_sid(append_sid("{$phpbb_admin_path}index.{$phpEx}", "i={$id}&demo=demo")); if (@extension_loaded('gd')) { $template->assign_var('GD', true); } foreach ($config_vars as $config_var => $template_var) { $template->assign_var($template_var, isset($_REQUEST[$config_var]) ? request_var($config_var, '') : $config[$config_var]); } foreach ($captcha_vars as $captcha_var => $template_var) { $var = isset($_REQUEST[$captcha_var]) ? request_var($captcha_var, 0) : $config[$captcha_var]; $template->assign_var($template_var, $var); $preview_image_src .= "&{$captcha_var}=" . $var; } $template->assign_vars(array('CAPTCHA_PREVIEW' => $preview_image_src, 'PREVIEW' => isset($_POST['preview']))); } } }
function run_tool() { global $config, $db, $template; $step = request_var('step', 0); $begin = $this->_batch_size * $step; // Get the batch $sql = 'SELECT attach_id, physical_filename FROM ' . ATTACHMENTS_TABLE; $result = $db->sql_query_limit($sql, $this->_batch_size, $begin); $batch = $db->sql_fetchrowset($result); $db->sql_freeresult($result); if (empty($batch)) { // Nothing to do trigger_error('RESYNC_ATTACHMENTS_FINISHED'); } $delete_ids = array(); foreach ($batch as $row) { // Does the file still exists? $path = PHPBB_ROOT_PATH . $config['upload_path'] . "/{$row['physical_filename']}"; if (file_exists($path)) { // Yes, next please! continue; } $delete_ids[] = $row['attach_id']; } // Run all the queries if (!empty($delete_ids)) { $db->sql_query('DELETE FROM ' . ATTACHMENTS_TABLE . ' WHERE ' . $db->sql_in_set('attach_id', $delete_ids)); } // Next step $template->assign_var('U_BACK_TOOL', false); meta_refresh(3, append_sid(STK_INDEX, array('c' => 'admin', 't' => 'resync_attachments', 'step' => ++$step, 'submit' => true))); trigger_error('RESYNC_ATTACHMENTS_PROGRESS'); }
function ShowTeamspeakPage() { global $CONF, $LNG; if ($_POST) { if (isset($_POST['ts_on']) && $_POST['ts_on'] == 'on') { $CONF['ts_modon'] = 1; } else { $CONF['ts_modon'] = 0; } $CONF['ts_server'] = request_var('ts_ip', ''); $CONF['ts_tcpport'] = request_var('ts_tcp', 0); $CONF['ts_udpport'] = request_var('ts_udp', 0); $CONF['ts_timeout'] = request_var('ts_to', 0); $CONF['ts_version'] = request_var('ts_v', 0); update_config('ts_timeout', $CONF['ts_timeout']); update_config('ts_modon', $CONF['ts_modon']); update_config('ts_server', $CONF['ts_server']); update_config('ts_tcpport', $CONF['ts_tcpport']); update_config('ts_udpport', $CONF['ts_udpport']); update_config('ts_version', $CONF['ts_version']); } $template = new template(); $template->page_header(); $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_server_id' => $LNG['ts_server_id'], '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'])); $template->show('adm/TeamspeakPage.tpl'); }
function UpdateSession() { global $CONF, $db; if (request_var('ajax', 0) == 1) { return true; } $_SESSION['last'] = $this->GetSessionFromDB(); if (empty($_SESSION['last']) || !$this->CompareIPs($_SESSION['last']['user_ip'])) { $this->DestroySession(); redirectTo('index.php?code=2'); } $SelectPlanet = request_var('cp', 0); if (!empty($SelectPlanet)) { $IsPlanetMine = $db->uniquequery("SELECT `id` FROM " . PLANETS . " WHERE `id` = '" . $SelectPlanet . "' AND `id_owner` = '" . $_SESSION['id'] . "';"); } $_SESSION['path'] = $this->GetPath(); $_SESSION['planet'] = !empty($IsPlanetMine['id']) ? $IsPlanetMine['id'] : $_SESSION['planet']; $SQL = "UPDATE " . USERS . " as u, " . SESSION . " as s SET "; $SQL .= "u.`onlinetime` = '" . TIMESTAMP . "', "; $SQL .= "u.`user_lastip` = '" . $_SERVER['REMOTE_ADDR'] . "', "; $SQL .= "s.`user_ip` = '" . $_SERVER['REMOTE_ADDR'] . "', "; $SQL .= "s.`user_side` = '" . $db->sql_escape($_SESSION['path']) . "', "; $SQL .= "s.`user_ua` = '" . $db->sql_escape($_SERVER['HTTP_USER_AGENT']) . "', "; $SQL .= "s.`user_method` = '" . $_SERVER["REQUEST_METHOD"] . "', "; $SQL .= "s.`user_lastactivity` = '" . TIMESTAMP . "' "; $SQL .= "WHERE "; $SQL .= "u.`id` = '" . $_SESSION['id'] . "' AND s.`sess_id` = '" . session_id() . "';"; $db->query($SQL); return true; }
public function start($_update = true) { global $core; if (array_strpos($this->page, w('ext')) !== false) { $_update = false; } $this->uid = request_var($core->v('cookie_name') . '_u', 0); $this->session = request_var($core->v('cookie_name') . '_sid', ''); if (!empty($this->session) && ($this->base = $this->select($this->session, true))) { $s_ip = implode('.', array_slice(explode('.', $this->base->session_ip), 0, 4)); $b_ip = implode('.', array_slice(explode('.', $this->ip), 0, 4)); if ($b_ip == $s_ip && $this->base->session_browser == $this->browser) { // Only update session a minute or so after last update or if page changes if (time() - $this->base->session_time > 60 || $this->base->session_page != $this->page) { $sql_update = array('session_time' => time()); if ($_update) { $sql_update['session_page'] = $this->page; } $sql = 'UPDATE _sessions SET ' . sql_build('UPDATE', $sql_update) . sql_filter(' WHERE session_id = ?', $this->session); sql_query($sql); } if ($_update) { $this->base->session_page = $this->page; } if ($this->v('is_bio')) { return true; } } } // Create new session if no valid exists. return $this->session_create(false, $_update); }
function ShowSendMessagesPage() { global $USER, $LNG, $db; if ($_GET['mode'] == 'send') { switch ($USER['authlevel']) { case AUTH_MOD: $color = 'yellow'; break; case AUTH_OPS: $color = 'skyblue'; break; case AUTH_ADM: $color = 'red'; break; } $Subject = makebr(request_var('subject', '', true)); $Message = makebr(request_var('text', '', true)); if (!empty($Message) && !empty($Subject)) { require_once ROOT_PATH . 'includes/functions/BBCode.php'; $Time = TIMESTAMP; $From = '<span style="color:' . $color . ';">' . $LNG['user_level'][$USER['authlevel']] . ' ' . $USER['username'] . '</span>'; $Subject = '<span style="color:' . $color . ';">' . $Subject . '</span>'; $Message = '<span style="color:' . $color . ';font-weight:bold;">' . bbcode($Message) . '</span>'; SendSimpleMessage(0, $USER['id'], TIMESTAMP, 50, $From, $Subject, $Message, 0, $_SESSION['adminuni']); $db->query("UPDATE " . USERS . " SET `new_gmessage` = `new_gmessage` + '1', `new_message` = `new_message` + '1' WHERE `universe` = '" . $_SESSION['adminuni'] . "';"); exit($LNG['ma_message_sended']); } else { exit($LNG['ma_subject_needed']); } } $template = new template(); $template->assign_vars(array('mg_empty_text' => $LNG['mg_empty_text'], 'ma_subject' => $LNG['ma_subject'], 'ma_none' => $LNG['ma_none'], 'ma_message' => $LNG['ma_message'], 'ma_send_global_message' => $LNG['ma_send_global_message'], 'ma_characters' => $LNG['ma_characters'], 'button_submit' => $LNG['button_submit'])); $template->show('adm/SendMessagesPage.tpl'); }
public function validateAccess() { $objOrder = new Orders(); $objOrder->setCompany(request_var("company")); $objOrder->setOffice(DEFAULT_ID); $objOrder->setUserWeb(request_var("username")); $objOrder->setPassWeb(request_var("password")); $objOrder->setInitDate("01/01/2000"); $objOrder->setEndDate("01/01/2020"); $_response = $objOrder->search(); if (is_array($_response) && count($_response)) { $_response = $_response["ConsultarOrdenWebSigLabResult"]["ClsOrdenes"]; $objOrder->setOffice($_response["OficinaId"]); $objOrder->setOrderId($_response["OrdId"]); $objOrder->setTable(TEMP_TABLE_RESULTS . $objOrder->getOrderId()); $_response = $objOrder->viewResult(); if (is_array($_response) && count($_response)) { $objOrder->saveResult($_response); $header = $objOrder->generateHeader(); $menu = $objOrder->generateMenu(); $resultados = $objOrder->viewResultDetail(); $printer = $objOrder->generatePrinter(); $footer = CLIENT_FOOTER . " " . date('Y') . " - Todos los Derechos Reservados."; include "../view/lab_results.php"; } else { echo "<b>No hay detalle a mostrar.</b>"; } } }
function wonders_getContent() { global $template; // open template $template->setFile('wonder.tmpl'); $id = request_var('wondersID', 0); if (!isset($GLOBALS['wonderTypeList'][$id]) || $GLOBALS['wonderTypeList'][$id]->nodocumentation || $GLOBALS['wonderTypeList'][$id]->isTribeCaveWonder) { $wonder = $GLOBALS['wonderTypeList'][0]; } else { $wonder = $GLOBALS['wonderTypeList'][$id]; } $uaWonderTargetText = WonderTarget::getWonderTargets(); $resourceCost = array(); foreach ($wonder->resourceProductionCost as $key => $value) { if ($value != "" && $value != "0") { array_push($resourceCost, array('dbFieldName' => $GLOBALS['resourceTypeList'][$key]->dbFieldName, 'name' => $GLOBALS['resourceTypeList'][$key]->name, 'amount' => formula_parseToReadable($value))); } } $unitCost = array(); foreach ($wonder->unitProductionCost as $key => $value) { if ($value != "" && $value != "0") { array_push($unitCost, array('dbFieldName' => $GLOBALS['unitTypeList'][$key]->dbFieldName, 'name' => $GLOBALS['unitTypeList'][$key]->name, 'amount' => formula_parseToReadable($value))); } } $moreCost = array_merge($unitCost); $template->addVars(array('name' => $wonder->name, 'offensiveness' => $wonder->offensiveness, 'description' => $wonder->description, 'chance' => round(eval('return ' . formula_parseBasic($wonder->chance) . ';'), 3), 'target' => $uaWonderTargetText[$wonder->target], 'resource_cost' => $resourceCost, 'dependencies' => rules_checkDependencies($wonder), 'more_cost' => sizeof($moreCost) ? $moreCost : false)); }
/** * Load the available upgrade options */ function blog_upgrade() { global $cache, $config, $phpbb_root_path, $phpEx, $user; if (!isset($config['user_blog_version'])) { trigger_error(sprintf($user->lang['CLICK_INSTALL_BLOG'], '<a href="' . append_sid("{$phpbb_root_path}blog.{$phpEx}", 'page=install') . '">', '</a>')); } $this->selected_options = request_var('config', array('' => ''), true); if (!sizeof($this->selected_options)) { $cache_data = $cache->get('_blog_upgrade'); if ($cache_data !== false) { $this->selected_options = $cache_data; } } $dh = @opendir($phpbb_root_path . 'blog/upgrade/'); if ($dh) { while (($file = readdir($dh)) !== false) { if ($file != "upgrade.{$phpEx}" && $file != "functions.{$phpEx}" && substr($file, -(strlen($phpEx) + 1)) === '.' . $phpEx) { $name = substr($file, 0, -(strlen($phpEx) + 1)); $this->available_upgrades[$name] = array(); include $phpbb_root_path . 'blog/upgrade/' . $file; } } closedir($dh); } return true; }