function main($id, $mode) { global $config, $request, $template, $user, $phpbb_log; $user->add_lang('acp/common'); $this->tpl_name = 'acp_markpostunread'; $this->page_title = $user->lang('MARKPOSTUNREAD_TITLE'); add_form_key('acp_markpostunread'); if ($request->is_set_post('submit')) { if (!check_form_key('acp_markpostunread')) { trigger_error($user->lang('FORM_INVALID') . adm_back_link($this->u_action)); } foreach ($this->settings as $setting => $default) { if (!is_null($default)) { $value = $request->variable($setting, $default, is_string($default)); if ($setting === 'enabled' && $value && !$config['load_db_lastread']) { trigger_error($user->lang('MARKPOSTUNREAD_ENABLE_FAILED') . adm_back_link($this->u_action), E_USER_WARNING); } $config->set($this->setting_prefix . $setting, $value); } } $user_id = empty($user->data) ? ANONYMOUS : $user->data['user_id']; $user_ip = empty($user->ip) ? '' : $user->ip; $phpbb_log->add('admin', $user_id, $user_ip, 'MARKPOSTUNREAD_CONFIG_UPDATED'); trigger_error($user->lang('CONFIG_UPDATED') . adm_back_link($this->u_action)); } $template_vars = array(); foreach ($this->settings as $setting => $default) { $setting_full = $this->setting_prefix . $setting; $key = strtoupper(str_replace('.', '_', $setting_full)); $template_vars[$key] = isset($config[$setting_full]) ? $config[$setting_full] : $default; } $template->assign_vars($template_vars); }
public function main($id, $mode) { global $config, $user, $template, $request; $this->tpl_name = 'acp_usermap_body'; $this->page_title = $user->lang('ACP_USERMAP_TITLE'); $user->add_lang_ext('tas2580/usermap', 'acp'); add_form_key('acp_usermap'); // Form is submitted if ($request->is_set_post('submit')) { if (!check_form_key('acp_usermap')) { trigger_error($user->lang('FORM_INVALID') . adm_back_link($this->u_action), E_USER_WARNING); } // Set the new settings to config $config->set('tas2580_usermap_lon', substr($request->variable('usermap_lon', ''), 0, 10)); $config->set('tas2580_usermap_lat', substr($request->variable('usermap_lat', ''), 0, 10)); $config->set('tas2580_usermap_zoom', $request->variable('usermap_zoom', 0)); $config->set('tas2580_usermap_map_type', $request->variable('map_type', '')); $config->set('tas2580_usermap_google_api_key', $request->variable('google_api_key', '')); $config->set('tas2580_usermap_search_distance', $request->variable('search_distance', 0)); $config->set('tas2580_usermap_map_in_viewprofile', $request->variable('map_in_viewprofile', 0)); $config->set('tas2580_usermap_distance_in_viewtopic', $request->variable('distance_in_viewtopic', 0)); $config->set('tas2580_usermap_distance_format', $request->variable('distance_format', 0)); $config->set('tas2580_usermap_max_marker', $request->variable('max_marker', 100)); trigger_error($user->lang('ACP_SAVED') . adm_back_link($this->u_action)); } // Send the curent settings to template $template->assign_vars(array('U_ACTION' => $this->u_action, 'USERMAP_LON' => $config['tas2580_usermap_lon'], 'USERMAP_LAT' => $config['tas2580_usermap_lat'], 'USERMAP_ZOOM' => $config['tas2580_usermap_zoom'], 'MAP_TYPE_SELECT' => $this->map_select($config['tas2580_usermap_map_type']), 'GOOGLE_API_KEY' => $config['tas2580_usermap_google_api_key'], 'SEARCH_DISTANCE' => $config['tas2580_usermap_search_distance'], 'MAP_IN_VIEWPROFILE' => $config['tas2580_usermap_map_in_viewprofile'], 'DISTANCE_IN_VIEWTOPIC' => $config['tas2580_usermap_distance_in_viewtopic'], 'DISTANCE_FORMAT' => $config['tas2580_usermap_distance_format'], 'MAX_MARKER' => $config['tas2580_usermap_max_marker'])); }
public function main($id, $mode) { global $phpbb_container, $table_prefix; if (!defined('CHAT_TABLE')) { $chat_table = $table_prefix . 'ajax_chat'; define('CHAT_TABLE', $chat_table); } $this->id = $id; $this->mode = $mode; // Initialization $this->auth = $phpbb_container->get('auth'); $this->config = $phpbb_container->get('config'); $this->db = $phpbb_container->get('dbal.conn'); $this->user = $phpbb_container->get('user'); $this->template = $phpbb_container->get('template'); $this->request = $phpbb_container->get('request'); $this->u_action = $this->request->variable('action', '', true); $submit = $this->request->is_set_post('submit') ? true : false; $this->form_key = 'acp_ajax_chat'; add_form_key($this->form_key); $display_vars = ['title' => 'ACP_AJAX_CHAT_TITLE', 'vars' => ['legend1' => 'AJAX_CHAT_SETTINGS', 'display_ajax_chat' => ['lang' => 'DISPLAY_AJAX_CHAT', 'validate' => 'bool', 'type' => 'radio:enabled_enabled', 'explain' => false], 'index_display_ajax_chat' => ['lang' => 'INDEX_DISPLAY_AJAX_CHAT', 'validate' => 'bool', 'type' => 'radio:enabled_enabled', 'explain' => true], 'whois_chatting' => ['lang' => 'WHOIS_CHATTING', 'validate' => 'bool', 'type' => 'radio:enabled_enabled', 'explain' => true], 'rule_ajax_chat' => ['lang' => 'RULE_AJAX_CHAT', 'validate' => 'string', 'type' => 'text:40:255', 'explain' => true], 'ajax_chat_archive_amount' => ['lang' => 'ARCHIVE_AMOUNT_AJAX_CHAT', 'validate' => 'int', 'type' => 'number:5:500', 'explain' => true], 'ajax_chat_popup_amount' => ['lang' => 'POPUP_AMOUNT_AJAX_CHAT', 'validate' => 'int', 'type' => 'number:5:150', 'explain' => true], 'ajax_chat_index_amount' => ['lang' => 'INDEX_AMOUNT_AJAX_CHAT', 'validate' => 'int', 'type' => 'number:5:150', 'explain' => true], 'ajax_chat_chat_amount' => ['lang' => 'CHAT_AMOUNT_AJAX_CHAT', 'validate' => 'int', 'type' => 'number:5:150', 'explain' => true], 'ajax_chat_time_setting' => ['lang' => 'TIME_SETTING_AJAX_CHAT', 'validate' => 'string', 'type' => 'text:10:20', 'explain' => true], 'refresh_online_chat' => ['lang' => 'REFRESH_ONLINE_CHAT', 'validate' => 'int', 'type' => 'number:0:9999', 'explain' => true], 'refresh_idle_chat' => ['lang' => 'REFRESH_IDLE_CHAT', 'validate' => 'int', 'type' => 'number:0:9999', 'explain' => true], 'refresh_offline_chat' => ['lang' => 'REFRESH_OFFLINE_CHAT', 'validate' => 'int', 'type' => 'number:0:9999', 'explain' => true], 'status_online_chat' => ['lang' => 'STATUS_ONLINE_CHAT', 'validate' => 'int', 'type' => 'number:0:9999', 'explain' => true], 'status_idle_chat' => ['lang' => 'STATUS_IDLE_CHAT', 'validate' => 'int', 'type' => 'number:0:9999', 'explain' => true], 'status_offline_chat' => ['lang' => 'STATUS_OFFLINE_CHAT', 'validate' => 'int', 'type' => 'number:0:9999', 'explain' => true], 'legend2' => 'AJAX_CHAT_LOCATION', 'location_ajax_chat_override' => ['lang' => 'LOCATION_AJAX_CHAT_OVERRIDE', 'validate' => 'bool', 'type' => 'radio:enabled_enabled', 'explain' => true], 'location_ajax_chat' => ['lang' => 'LOCATION_AJAX_CHAT', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true], 'legend3' => 'AJAX_CHAT_POSTS', 'ajax_chat_forum_posts' => ['lang' => 'FORUM_POSTS_AJAX_CHAT', 'validate' => 'bool', 'type' => 'radio:enabled_enabled', 'explain' => false], 'ajax_chat_forum_topic' => ['lang' => 'FORUM_POSTS_AJAX_CHAT_TOPIC', 'validate' => 'bool', 'type' => 'radio:enabled_enabled', 'explain' => false], 'ajax_chat_forum_reply' => ['lang' => 'FORUM_POSTS_AJAX_CHAT_REPLY', 'validate' => 'bool', 'type' => 'radio:enabled_enabled', 'explain' => false], 'ajax_chat_forum_edit' => ['lang' => 'FORUM_POSTS_AJAX_CHAT_EDIT', 'validate' => 'bool', 'type' => 'radio:enabled_enabled', 'explain' => false], 'ajax_chat_forum_quote' => ['lang' => 'FORUM_POSTS_AJAX_CHAT_QUOTE', 'validate' => 'bool', 'type' => 'radio:enabled_enabled', 'explain' => false], 'legend4' => 'AJAX_CHAT_PRUNE', 'prune_ajax_chat' => ['lang' => 'PRUNE_AJAX_CHAT', 'validate' => 'bool', 'type' => 'radio:enabled_enabled', 'explain' => true], 'prune_keep_ajax_chat' => ['lang' => 'PRUNE_KEEP_AJAX_CHAT', 'validate' => 'int', 'type' => 'number', 'explain' => false], 'prune_now' => ['lang' => 'PRUNE_NOW', 'validate' => 'bool', 'type' => 'custom', 'explain' => false, 'method' => 'prune_chat'], 'truncate_now' => ['lang' => 'TRUNCATE_NOW', 'validate' => 'bool', 'type' => 'custom', 'explain' => false, 'method' => 'truncate_chat'], 'ajax_chat_counter' => ['lang' => 'CHAT_COUNTER', 'validate' => 'bool', 'type' => 'custom', 'explain' => false, 'method' => 'chat_counter'], 'legend5' => 'ACP_SUBMIT_CHANGES']]; #region Submit if ($submit) { $submit = $this->do_submit_stuff($display_vars); // If the submit was valid, so still submitted if ($submit) { trigger_error($this->user->lang('CONFIG_UPDATED') . adm_back_link($this->u_action), E_USER_NOTICE); } } #endregion $this->generate_stuff_for_cfg_template($display_vars); // Output page template file $this->tpl_name = 'ajax_chat'; $this->page_title = $this->user->lang($display_vars['title']); }
function main($id, $mode) { global $request, $template, $user, $phpbb_container, $phpbb_root_path, $config, $phpEx; $this->request = $request; $this->config = $config; $this->user = $user; $this->phpbb_container = $phpbb_container; $this->template = $template; $this->proxy = $this->phpbb_container->get('wardormeur.phpbbwpunicorn.proxy'); $this->active = false; //required to list the wordpress roles avaialbes if (!empty($this->config['phpbbwpunicorn_wp_path'])) { $this->active = true; $this->request->enable_super_globals(); define('SHORTINIT', TRUE); require_once $this->config['phpbbwpunicorn_wp_path'] . '/wp-load.php'; require_once $this->config['phpbbwpunicorn_wp_path'] . '/wp-includes/plugin.' . $phpEx; require_once $this->config['phpbbwpunicorn_wp_path'] . '/wp-admin/includes/user.' . $phpEx; require_once $this->config['phpbbwpunicorn_wp_path'] . '/wp-includes/capabilities.' . $phpEx; $this->request->disable_super_globals(); } $this->user->add_lang('acp/groups'); $this->page_title = $this->user->lang['ACP_PWU_TITLE']; $this->tpl_name = 'phpbbwpunicorn_body'; add_form_key('unicornfart'); // Get saved settings. if ($this->request->is_set_post('submit')) { $this->save(); } $this->display(); }
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'; add_form_key('mcp_warn'); switch ($mode) { case 'front': $this->mcp_warn_front_view(); $this->tpl_name = 'mcp_warn_front'; break; case 'list': $this->mcp_warn_list_view($action); $this->tpl_name = 'mcp_warn_list'; break; case 'warn_post': $this->mcp_warn_post_view($action); $this->tpl_name = 'mcp_warn_post'; break; case 'warn_user': $this->mcp_warn_user_view($action); $this->tpl_name = 'mcp_warn_user'; break; } }
/** * Constructor * Load the list with available plugins and assign them in the correct category */ public function __construct(\phpbb\titania\controller\helper $controller_helper) { $this->controller_helper = $controller_helper; $this->phpbb_root_path = \phpbb::$root_path; $this->php_ext = \phpbb::$php_ext; // Set the path $this->tool_box_path = $this->phpbb_root_path . 'ext/phpbb/titania/includes/manage_tools/'; // Load functions_admin.php if required if (!function_exists('filelist')) { include $this->phpbb_root_path . 'includes/functions_admin.' . $this->php_ext; } // Create a list with tools $filelist = filelist($this->tool_box_path, '', $this->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, '.' . $this->php_ext)) !== false ? substr($tool, 0, $pos) : $tool; } } // Get the requested cat and tool $this->tool_id = phpbb::$request->variable('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 . '.' . $this->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 $request; $action = $request->variable('action', array('' => '')); if (is_array($action)) { list($action, ) = each($action); } $this->page_title = 'MCP_WARN'; add_form_key('mcp_warn'); switch ($mode) { case 'front': $this->mcp_warn_front_view(); $this->tpl_name = 'mcp_warn_front'; break; case 'list': $this->mcp_warn_list_view($action); $this->tpl_name = 'mcp_warn_list'; break; case 'warn_post': $this->mcp_warn_post_view($action); $this->tpl_name = 'mcp_warn_post'; break; case 'warn_user': $this->mcp_warn_user_view($action); $this->tpl_name = 'mcp_warn_user'; break; } }
public function main($id, $mode) { global $phpbb_container; // Initialization $this->config = $phpbb_container->get('config'); $this->db = $phpbb_container->get('dbal.conn'); $this->user = $phpbb_container->get('user'); $this->template = $phpbb_container->get('template'); $this->request = $phpbb_container->get('request'); $action = $this->request->variable('action', '', true); $submit = $this->request->is_set_post('submit') ? true : false; $this->form_key = 'acp_advancedpolls'; add_form_key($this->form_key); $display_vars = array('title' => 'AP_TITLE_ACP', 'vars' => array('legend1' => 'AP_GLOBAL_SETTINGS', 'wolfsblvt.advancedpolls.activate_incremental_votes' => array('lang' => 'AP_ACT_INCREMENTAL_VOTES', 'validate' => 'bool', 'type' => 'radio:enabled_disabled', 'explain' => true), 'wolfsblvt.advancedpolls.activate_closed_voting' => array('lang' => 'AP_ACT_CLOSED_VOTING', 'validate' => 'bool', 'type' => 'radio:enabled_disabled', 'explain' => true), 'wolfsblvt.advancedpolls.activate_no_vote' => array('lang' => 'AP_ACT_POLL_NO_VOTE', 'validate' => 'bool', 'type' => 'radio:enabled_disabled', 'explain' => true), 'wolfsblvt.advancedpolls.activate_poll_end' => array('lang' => 'AP_ACT_POLL_END', 'validate' => 'bool', 'type' => 'radio:enabled_disabled', 'explain' => true), 'wolfsblvt.advancedpolls.activate_notifications' => array('lang' => 'AP_ACT_POLL_NOTIFICATIONS', 'validate' => 'bool', 'type' => 'radio:enabled_disabled', 'explain' => true), 'legend2' => 'AP_PER_POLL_SETTINGS', 'wolfsblvt.advancedpolls.activate_poll_scoring' => array('lang' => 'AP_ACT_POLL_SCORING', 'validate' => 'bool', 'type' => 'radio:enabled_disabled', 'explain' => true), 'wolfsblvt.advancedpolls.default_poll_votes_change' => array('lang' => 'AP_DEFAULT_VOTES_CHANGE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), 'wolfsblvt.advancedpolls.activate_poll_votes_hide' => array('lang' => 'AP_ACT_VOTES_HIDE', 'validate' => 'bool', 'type' => 'radio:enabled_disabled', 'explain' => true), 'wolfsblvt.advancedpolls.default_poll_votes_hide' => array('lang' => 'AP_DEFAULT_VOTES_HIDE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), 'wolfsblvt.advancedpolls.activate_poll_voters_show' => array('lang' => 'AP_ACT_VOTERS_SHOW', 'validate' => 'bool', 'type' => 'radio:enabled_disabled', 'explain' => true), 'wolfsblvt.advancedpolls.default_poll_voters_show' => array('lang' => 'AP_DEFAULT_VOTERS_SHOW', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), 'wolfsblvt.advancedpolls.activate_poll_voters_limit' => array('lang' => 'AP_ACT_VOTERS_LIMIT', 'validate' => 'bool', 'type' => 'radio:enabled_disabled', 'explain' => true), 'wolfsblvt.advancedpolls.default_poll_voters_limit' => array('lang' => 'AP_DEFAULT_VOTERS_LIMIT', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), 'wolfsblvt.advancedpolls.activate_poll_show_ordered' => array('lang' => 'AP_ACT_SHOW_ORDERED', 'validate' => 'bool', 'type' => 'radio:enabled_disabled', 'explain' => true), 'wolfsblvt.advancedpolls.default_poll_show_ordered' => array('lang' => 'AP_DEFAULT_SHOW_ORDERED', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), 'legend3' => 'ACP_SUBMIT_CHANGES')); #region Submit if ($submit) { $submit = $this->do_submit_stuff($display_vars); // If the submit was valid, so still submitted if ($submit) { trigger_error($this->user->lang('CONFIG_UPDATED') . adm_back_link($this->u_action), E_USER_NOTICE); } } #endregion $this->generate_stuff_for_cfg_template($display_vars); // Output page template file $this->tpl_name = 'acp_advancedpolls'; $this->page_title = $this->user->lang($display_vars['title']); }
public function main($id, $mode) { global $config, $user, $template, $request, $db, $table_prefix; $user->add_lang_ext('tas2580/dejure', 'common'); $this->tpl_name = 'acp_dejure_body'; $this->page_title = $user->lang('ACP_DEJURE_TITLE'); add_form_key('acp_dejure'); // Form is submitted if ($request->is_set_post('submit')) { if (!check_form_key('acp_dejure')) { trigger_error($user->lang('FORM_INVALID') . adm_back_link($this->u_action), E_USER_WARNING); } // Set the new settings to config $config->set('tas2580_dejure_link_style', $request->variable('link_style', 'weit')); $config->set('tas2580_dejure_class', $request->variable('class', '')); $config->set('tas2580_dejure_buzer', $request->variable('buzer', 0)); $config->set('tas2580_dejure_cache_time', $request->variable('cache_time', 4)); $config->set('tas2580_dejure_target', $request->variable('target', '')); $sql = 'DELETE FROM ' . $table_prefix . 'dejure'; $db->sql_query($sql); trigger_error($user->lang('ACP_SAVED') . adm_back_link($this->u_action)); } // Send the curent settings to template $template->assign_vars(array('U_ACTION' => $this->u_action, 'LINK_STYLE_WEIT' => $config['tas2580_dejure_link_style'] === 'weit' ? ' selected="selected"' : '', 'LINK_STYLE_SCHMAL' => $config['tas2580_dejure_link_style'] === 'schmal' ? ' selected="selected"' : '', 'CLASS' => $config['tas2580_dejure_class'], 'TARGET' => $config['tas2580_dejure_target'], 'BUZER' => $config['tas2580_dejure_buzer'] == 1 ? ' checked="checked"' : '', 'CACHE_TIME' => $config['tas2580_dejure_cache_time'])); }
function main($id, $mode) { global $db, $template, $user; phpbb_gallery::init(); $user->add_lang(array('mods/gallery_acp', 'mods/gallery')); $this->tpl_name = 'gallery_main'; add_form_key('acp_gallery'); $submode = request_var('submode', ''); switch ($mode) { case 'overview': $title = 'ACP_GALLERY_OVERVIEW'; $this->page_title = $user->lang[$title]; $this->overview(); break; case 'import_images': $title = 'ACP_IMPORT_ALBUMS'; $this->page_title = $user->lang[$title]; $this->import(); break; case 'cleanup': $title = 'ACP_GALLERY_CLEANUP'; $this->page_title = $user->lang[$title]; $this->cleanup(); break; default: trigger_error('NO_MODE', E_USER_ERROR); break; } }
function main($id, $mode) { global $db, $user, $auth, $template, $cache, $request; global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx; $this->config = $config; $this->request = $request; $user->add_lang('acp/common'); $user->add_lang_ext('vinny/shareon', 'acp/info_acp_shareon'); $this->tpl_name = 'acp_shareon'; $this->page_title = $user->lang['SHARE_ON_MOD']; add_form_key('acp_shareon'); if ($request->is_set_post('submit')) { if (!check_form_key('acp_shareon')) { trigger_error('FORM_INVALID'); } $config->set('so_status', $request->variable('so_status', true)); $config->set('so_type', $request->variable('so_type', true)); $config->set('so_facebook', $request->variable('so_facebook', true)); $config->set('so_twitter', $request->variable('so_twitter', true)); $config->set('so_tuenti', $request->variable('so_tuenti', true)); $config->set('so_sonico', $request->variable('so_sonico', true)); $config->set('so_friendfeed', $request->variable('so_friendfeed', true)); $config->set('so_digg', $request->variable('so_digg', true)); $config->set('so_reddit', $request->variable('so_reddit', true)); $config->set('so_delicious', $request->variable('so_delicious', true)); $config->set('so_vk', $request->variable('so_vk', true)); $config->set('so_tumblr', $request->variable('so_tumblr', true)); $config->set('so_google', $request->variable('so_google', true)); trigger_error($user->lang['SO_SAVED'] . adm_back_link($this->u_action)); } $template->assign_vars(array('SO_STATUS' => !empty($this->config['so_status']) ? true : false, 'SO_TYPE' => !empty($this->config['so_type']) ? true : false, 'SO_FACEBOOK' => !empty($this->config['so_facebook']) ? true : false, 'SO_TWITTER' => !empty($this->config['so_twitter']) ? true : false, 'SO_TUENTI' => !empty($this->config['so_tuenti']) ? true : false, 'SO_SONICO' => !empty($this->config['so_sonico']) ? true : false, 'SO_FRIENDFEED' => !empty($this->config['so_friendfeed']) ? true : false, 'SO_DIGG' => !empty($this->config['so_digg']) ? true : false, 'SO_REDDIT' => !empty($this->config['so_reddit']) ? true : false, 'SO_DELICIOUS' => !empty($this->config['so_delicious']) ? true : false, 'SO_VK' => !empty($this->config['so_vk']) ? true : false, 'SO_TUMBLR' => !empty($this->config['so_tumblr']) ? true : false, 'SO_GOOGLE' => !empty($this->config['so_google']) ? true : false, 'U_ACTION' => $this->u_action)); }
function main($id, $mode) { global $config, $request, $template, $user, $phpbb_log; $user->add_lang('acp/common'); $this->tpl_name = 'acp_postnumbers'; $this->page_title = $user->lang('POSTNUMBERS_TITLE'); add_form_key('acp_postnumbers'); if ($request->is_set_post('submit')) { if (!check_form_key('acp_postnumbers')) { trigger_error($user->lang('FORM_INVALID') . adm_back_link($this->u_action)); } $config->set('kasimi.postnumbers.enabled.viewtopic', $request->variable('postnumbers_enabled_viewtopic', 0)); $config->set('kasimi.postnumbers.enabled.review_reply', $request->variable('postnumbers_enabled_review_reply', 0)); $config->set('kasimi.postnumbers.enabled.review_mcp', $request->variable('postnumbers_enabled_review_mcp', 0)); $config->set('kasimi.postnumbers.skip_nonapproved', $request->variable('postnumbers_skip_nonapproved', 0)); $config->set('kasimi.postnumbers.display_ids', $request->variable('postnumbers_display_ids', 0)); $config->set('kasimi.postnumbers.clipboard', $request->variable('postnumbers_clipboard', 0)); $config->set('kasimi.postnumbers.bold', $request->variable('postnumbers_bold', 0)); $user_id = empty($user->data) ? ANONYMOUS : $user->data['user_id']; $user_ip = empty($user->ip) ? '' : $user->ip; $phpbb_log->add('admin', $user_id, $user_ip, 'POSTNUMBERS_CONFIG_UPDATED'); trigger_error($user->lang('CONFIG_UPDATED') . adm_back_link($this->u_action)); } $template->assign_vars(array('POSTNUMBERS_VERSION' => isset($config['kasimi.postnumbers.version']) ? $config['kasimi.postnumbers.version'] : 'X.Y.Z', 'POSTNUMBERS_ENABLED_VIEWTOPIC' => isset($config['kasimi.postnumbers.enabled.viewtopic']) ? $config['kasimi.postnumbers.enabled.viewtopic'] : 0, 'POSTNUMBERS_ENABLED_REVIEW_REPLY' => isset($config['kasimi.postnumbers.enabled.review_reply']) ? $config['kasimi.postnumbers.enabled.review_reply'] : 0, 'POSTNUMBERS_ENABLED_REVIEW_MCP' => isset($config['kasimi.postnumbers.enabled.review_mcp']) ? $config['kasimi.postnumbers.enabled.review_mcp'] : 0, 'POSTNUMBERS_SKIP_NONAPPROVED' => isset($config['kasimi.postnumbers.skip_nonapproved']) ? $config['kasimi.postnumbers.skip_nonapproved'] : 0, 'POSTNUMBERS_DISPLAY_IDS' => isset($config['kasimi.postnumbers.display_ids']) ? $config['kasimi.postnumbers.display_ids'] : 0, 'POSTNUMBERS_CLIPBOARD' => isset($config['kasimi.postnumbers.clipboard']) ? $config['kasimi.postnumbers.clipboard'] : 0, 'POSTNUMBERS_BOLD' => isset($config['kasimi.postnumbers.bold']) ? $config['kasimi.postnumbers.bold'] : 0, 'U_ACTION' => $this->u_action)); }
public function main($id, $mode) { global $config, $user, $template, $request; $user->add_lang_ext('tas2580/usermap', 'acp'); $user->add_lang_ext('tas2580/usermap', 'country_codes'); $this->user = $user; add_form_key('acp_usermap'); switch ($mode) { case 'settings': $this->tpl_name = 'acp_usermap_settings'; $this->page_title = $user->lang('ACP_USERMAP_TITLE'); // Form is submitted if ($request->is_set_post('submit')) { if (!check_form_key('acp_usermap')) { trigger_error($user->lang('FORM_INVALID') . adm_back_link($this->u_action), E_USER_WARNING); } // Set the new settings to config $config->set('tas2580_usermap_lon', substr($request->variable('usermap_lon', ''), 0, 10)); $config->set('tas2580_usermap_lat', substr($request->variable('usermap_lat', ''), 0, 10)); $config->set('tas2580_usermap_zoom', $request->variable('usermap_zoom', 0)); $config->set('tas2580_usermap_map_type', $request->variable('map_type', '')); $config->set('tas2580_usermap_google_api_key', $request->variable('google_api_key', '')); $config->set('tas2580_usermap_bing_api_key', $request->variable('bing_api_key', '')); $config->set('tas2580_usermap_search_distance', $request->variable('search_distance', 0)); $config->set('tas2580_usermap_map_in_viewprofile', $request->variable('map_in_viewprofile', 0)); $config->set('tas2580_usermap_distance_in_viewtopic', $request->variable('distance_in_viewtopic', 0)); $config->set('tas2580_usermap_distance_format', $request->variable('distance_format', 0)); $config->set('tas2580_usermap_max_marker', $request->variable('max_marker', 100)); $config->set('tas2580_usermap_input_method', $request->variable('input_method', 'zip')); $config->set('tas2580_usermap_force_on_register', $request->variable('force_on_register', 0)); $config->set('tas2580_usermap_show_on_register', $request->variable('show_on_register', 0)); $config->set('tas2580_usermap_display_coordinates', $request->variable('display_coordinates', 0)); $config->set('tas2580_usermap_default_country', $request->variable('default_country', '')); trigger_error($user->lang('ACP_SAVED') . adm_back_link($this->u_action)); } // Send the curent settings to template $template->assign_vars(array('U_ACTION' => $this->u_action, 'USERMAP_LON' => $config['tas2580_usermap_lon'], 'USERMAP_LAT' => $config['tas2580_usermap_lat'], 'USERMAP_ZOOM' => $config['tas2580_usermap_zoom'], 'MAP_TYPE_SELECT' => $this->map_select($config['tas2580_usermap_map_type']), 'GOOGLE_API_KEY' => $config['tas2580_usermap_google_api_key'], 'BING_API_KEY' => $config['tas2580_usermap_bing_api_key'], 'SEARCH_DISTANCE' => $config['tas2580_usermap_search_distance'], 'MAP_IN_VIEWPROFILE' => $config['tas2580_usermap_map_in_viewprofile'], 'DISTANCE_IN_VIEWTOPIC' => $config['tas2580_usermap_distance_in_viewtopic'], 'DISTANCE_FORMAT' => $config['tas2580_usermap_distance_format'], 'MAX_MARKER' => $config['tas2580_usermap_max_marker'], 'INPUT_METHOD' => $config['tas2580_usermap_input_method'], 'SHOW_ON_REGISTER' => $config['tas2580_usermap_show_on_register'], 'FORCE_ON_REGISTER' => $config['tas2580_usermap_force_on_register'], 'DISPLAY_COORDINATES' => $config['tas2580_usermap_display_coordinates'], 'COUNTRY_SELECT' => $this->country_code_select($config['tas2580_usermap_default_country']))); break; case 'things': $this->tpl_name = 'acp_usermap_things'; $this->page_title = $user->lang('ACP_USERMAP_TITLE'); // Form is submitted if ($request->is_set_post('submit')) { if (!check_form_key('acp_usermap')) { trigger_error($user->lang('FORM_INVALID') . adm_back_link($this->u_action), E_USER_WARNING); } // Set the new settings to config $config->set('tas2580_usermap_thing_name', $request->variable('thing_name', '', true)); $config->set('tas2580_usermap_allow_bbcode', $request->variable('allow_bbcode', '', true)); $config->set('tas2580_usermap_allow_smilies', $request->variable('allow_smilies', '', true)); $config->set('tas2580_usermap_allow_urls', $request->variable('allow_urls', '', true)); $config->set('tas2580_usermap_allow_img', $request->variable('allow_img', '', true)); $config->set('tas2580_usermap_allow_flash', $request->variable('allow_flash', '', true)); trigger_error($user->lang('ACP_SAVED') . adm_back_link($this->u_action)); } // Send the curent settings to template $template->assign_vars(array('U_ACTION' => $this->u_action, 'THING_NAME' => $config['tas2580_usermap_thing_name'], 'ALLOW_BBCODE' => $config['tas2580_usermap_allow_bbcode'], 'ALLOW_SMILIES' => $config['tas2580_usermap_allow_smilies'], 'ALLOW_URL' => $config['tas2580_usermap_allow_urls'], 'ALLOW_IMG' => $config['tas2580_usermap_allow_img'], 'ALLOW_FLASH' => $config['tas2580_usermap_allow_flash'])); break; } }
function main($id, $mode) { global $db, $user, $auth, $template, $cache; global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx; $user->add_lang('acp/common'); $this->tpl_name = 'acp_shareon'; $this->page_title = $user->lang['SHARE_ON_MOD']; add_form_key('acp_shareon'); // Version Check $config['SHAREON_VERSION'] = isset($config['SHAREON_VERSION']) ? $config['SHAREON_VERSION'] : '2.2.0'; $submit = isset($_POST['submit']) ? true : false; if ($submit) { if (!check_form_key('acp_shareon')) { trigger_error('FORM_INVALID'); } set_config('so_status', request_var('so_status', true)); set_config('so_position', request_var('so_position', true)); set_config('so_type', request_var('so_type', true)); set_config('so_facebook', request_var('so_facebook', true)); set_config('so_twitter', request_var('so_twitter', true)); set_config('so_tuenti', request_var('so_tuenti', true)); set_config('so_sonico', request_var('so_sonico', true)); set_config('so_friendfeed', request_var('so_friendfeed', true)); set_config('so_orkut', request_var('so_orkut', true)); set_config('so_digg', request_var('so_digg', true)); set_config('so_reddit', request_var('so_reddit', true)); set_config('so_delicious', request_var('so_delicious', true)); set_config('so_vk', request_var('so_vk', true)); set_config('so_tumblr', request_var('so_tumblr', true)); set_config('so_google', request_var('so_google', true)); set_config('so_myspace', request_var('so_myspace', true)); trigger_error($user->lang['SO_SAVED'] . adm_back_link($this->u_action)); } $template->assign_vars(array('SO_STATUS' => !empty($config['so_status']) ? true : false, 'SO_POSITION' => !empty($config['so_position']) ? true : false, 'SO_TYPE' => !empty($config['so_type']) ? true : false, 'SO_FACEBOOK' => !empty($config['so_facebook']) ? true : false, 'SO_TWITTER' => !empty($config['so_twitter']) ? true : false, 'SO_TUENTI' => !empty($config['so_tuenti']) ? true : false, 'SO_SONICO' => !empty($config['so_sonico']) ? true : false, 'SO_FRIENDFEED' => !empty($config['so_friendfeed']) ? true : false, 'SO_ORKUT' => !empty($config['so_orkut']) ? true : false, 'SO_DIGG' => !empty($config['so_digg']) ? true : false, 'SO_REDDIT' => !empty($config['so_reddit']) ? true : false, 'SO_DELICIOUS' => !empty($config['so_delicious']) ? true : false, 'SO_VK' => !empty($config['so_vk']) ? true : false, 'SO_TUMBLR' => !empty($config['so_tumblr']) ? true : false, 'SO_GOOGLE' => !empty($config['so_google']) ? true : false, 'SO_MYSPACE' => !empty($config['so_myspace']) ? true : false, 'U_ACTION' => $this->u_action, 'SHAREON_VERSION' => $config['SHAREON_VERSION'], 'S_VERSION_UP_TO_DATE' => $this->shareon_version_compare($config['SHAREON_VERSION']))); }
function main($id, $mode) { global $auth, $db, $user, $template, $request; global $config, $phpbb_root_path, $phpEx; $action = $request->variable('action', array('' => '')); if (is_array($action)) { list($action, ) = each($action); } $this->page_title = 'MCP_WARN'; add_form_key('mcp_warn'); $user->add_lang_ext('rxu/AdvancedWarnings', 'warnings'); switch ($mode) { case 'front': $this->mcp_warn_front_view(); $this->tpl_name = 'mcp_warn_front'; break; case 'list': $this->mcp_warn_list_view($action); $this->tpl_name = 'mcp_rxu_warnings_warn_list'; break; case 'warn_post': $this->mcp_warn_post_view($action); $this->tpl_name = 'mcp_rxu_warnings_warn_post'; break; case 'warn_user': $this->mcp_warn_user_view($action); $this->tpl_name = 'mcp_rxu_warnings_warn_user'; break; } }
public function main($id, $mode) { global $config, $user, $template, $request; $user->add_lang_ext('tas2580/paypal', 'common'); switch ($mode) { case 'settings': $this->tpl_name = 'acp_paypal_body'; $this->page_title = $user->lang('ACP_PAYPAL_TITLE'); add_form_key('acp_paypal'); // Form is submitted if ($request->is_set_post('submit')) { if (!check_form_key('acp_paypal')) { trigger_error($user->lang('FORM_INVALID') . adm_back_link($this->u_action), E_USER_WARNING); } $config->set('paypal_email', $request->variable('paypal_email', '')); $config->set('paypal_default_item', $request->variable('paypal_default_item', '')); $config->set('paypal_description', $request->variable('paypal_description', '')); trigger_error($user->lang('ACP_SAVED') . adm_back_link($this->u_action)); } $template->assign_vars(array('U_ACTION' => $this->u_action, 'PAYPAL_EMAIL' => isset($config['paypal_email']) ? $config['paypal_email'] : '', 'PAYPAL_DEFAULT_ITEM' => isset($config['paypal_default_item']) ? $config['paypal_default_item'] : '', 'PAYPAL_DESCRIPTION' => isset($config['paypal_description']) ? $config['paypal_description'] : '')); break; case 'items': $this->tpl_name = 'acp_paypal_items_body'; $this->page_title = $user->lang('ACP_PAYPAL_ITEMS'); break; } }
function main($id, $mode) { global $user, $config, $request, $template; add_form_key('wwh'); $user->add_lang('ucp'); $this->tpl_name = 'acp_wwh'; $this->page_title = $user->lang['WWH_TITLE']; $submit = $request->is_set_post('submit'); if ($submit) { if (!check_form_key('wwh')) { trigger_error('FORM_INVALID'); } $config->set('wwh_disp_bots', $request->variable('wwh_disp_bots', 0)); $config->set('wwh_disp_guests', $request->variable('wwh_disp_guests', 0)); $config->set('wwh_disp_hidden', $request->variable('wwh_disp_hidden', 0)); $config->set('wwh_disp_time', $request->variable('wwh_disp_time', 0)); $config->set('wwh_disp_time_format', $request->variable('wwh_disp_time_format', 'H:i')); $config->set('wwh_disp_ip', $request->variable('wwh_disp_ip', 0)); $config->set('wwh_version', $request->variable('wwh_version', 0)); $config->set('wwh_del_time_h', $request->variable('wwh_del_time_h', 0)); $config->set('wwh_del_time_m', $request->variable('wwh_del_time_m', 0)); $config->set('wwh_del_time_s', $request->variable('wwh_del_time_s', 0)); $config->set('wwh_sort_by', $request->variable('wwh_sort_by', 0)); $config->set('wwh_record', $request->variable('wwh_record', 0)); $config->set('wwh_record_timestamp', $request->variable('wwh_record_timestamp', 'D j. M Y')); if ($request->variable('wwh_reset', 0) > 0) { $config->set('wwh_record_ips', 1); $config->set('wwh_record_time', time()); $config->set('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; 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']))); } } }
/** * @param string $list_name whitelist or blacklist * @param string $u_action phpbb acp-u_action */ private function manage_list($u_action, $list_name) { $list_name_upper = strtoupper($list_name); // Define the name of the form for use as a form key $form_name = 'topictags'; add_form_key($form_name); $errors = array(); if ($this->request->is_set_post('submit')) { if (!check_form_key($form_name)) { trigger_error('FORM_INVALID'); } $this->config->set(prefixes::CONFIG . '_' . $list_name . '_enabled', $this->request->variable(prefixes::CONFIG . '_' . $list_name . '_enabled', 0)); $list = rawurldecode(base64_decode($this->request->variable(prefixes::CONFIG . '_' . $list_name, ''))); if (!empty($list)) { $list = json_decode($list, true); $tags = array(); for ($i = 0, $size = sizeof($list); $i < $size; $i++) { $tags[] = $list[$i]['text']; } $list = json_encode($tags); } // store the list $this->config_text->set(prefixes::CONFIG . '_' . $list_name, $list); trigger_error($this->user->lang('TOPICTAGS_' . $list_name_upper . '_SAVED') . adm_back_link($u_action)); } // display $list = $this->config_text->get(prefixes::CONFIG . '_' . $list_name); $list = base64_encode(rawurlencode($list)); $this->template->assign_vars(array('TOPICTAGS_VERSION' => $this->user->lang('TOPICTAGS_INSTALLED', $this->config[prefixes::CONFIG . '_version']), 'TOPICTAGS_' . $list_name_upper . '_ENABLED' => $this->config[prefixes::CONFIG . '_' . $list_name . '_enabled'], 'TOPICTAGS_' . $list_name_upper => $list, 'S_RH_TOPICTAGS_INCLUDE_NG_TAGS_INPUT' => true, 'S_RH_TOPICTAGS_INCLUDE_CSS' => true, 'TOPICTAGS_CONVERT_SPACE_TO_MINUS' => $this->config[prefixes::CONFIG . '_convert_space_to_minus'] ? 'true' : 'false', 'S_ERROR' => sizeof($errors) ? true : false, 'ERROR_MSG' => implode('<br />', $errors), 'U_ACTION' => $u_action)); }
public function main($id, $mode) { global $config, $user, $template, $request, $phpbb_container, $phpbb_root_path, $phpEx; $user->add_lang_ext('tas2580/mobilenotifier', 'common'); $wa = $phpbb_container->get('tas2580.mobilenotifier.src.helper'); $this->tpl_name = 'acp_mobilenotifier_body'; $this->page_title = $user->lang('ACP_MOBILENOTIFIER_TITLE'); add_form_key('acp_mobilenotifier'); // Form is submitted if ($request->is_set_post('submit')) { if (!check_form_key('acp_mobilenotifier')) { trigger_error($user->lang('FORM_INVALID') . adm_back_link($this->u_action), E_USER_WARNING); } $config->set('whatsapp_sender', $request->variable('sender', '')); $config->set('whatsapp_password', $request->variable('password', '')); $config->set('whatsapp_status', $request->variable('status', '')); $config->set('whatsapp_default_cc', $request->variable('default_cc', '')); $wa->update_status($config['whatsapp_status']); if ($request->file('image')) { include_once $phpbb_root_path . 'includes/functions_upload.' . $phpEx; $upload = new \fileupload(); $upload->set_allowed_extensions(array('jpg', 'png', 'gif')); $file = $upload->form_upload('image'); if ($file->filename) { $wa->update_picture($file->filename); } } trigger_error($user->lang('ACP_SAVED') . adm_back_link($this->u_action)); } $template->assign_vars(array('WA_VERSION' => WA_VER, 'U_ACTION' => $this->u_action, 'SENDER' => isset($config['whatsapp_sender']) ? $config['whatsapp_sender'] : '', 'PASSWORD' => isset($config['whatsapp_password']) ? $config['whatsapp_password'] : '', 'STATUS' => isset($config['whatsapp_status']) ? $config['whatsapp_status'] : '', 'CC_SELECT' => $wa->cc_select(isset($config['whatsapp_default_cc']) ? $config['whatsapp_default_cc'] : ''))); }
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)); } } }
/** * Main ACP module * * @param int $id * @param string $mode * @access public */ public function main($id, $mode) { $this->tpl_name = 'acp_topic_preview'; $this->page_title = $this->user->lang('TOPIC_PREVIEW'); $form_key = 'acp_topic_preview'; add_form_key($form_key); if ($this->request->is_set_post('submit')) { if (!check_form_key($form_key)) { trigger_error($this->user->lang('FORM_INVALID') . adm_back_link($this->u_action), E_USER_WARNING); } $this->config->set('topic_preview_limit', abs($this->request->variable('topic_preview_limit', 0))); // abs() no negative values $this->config->set('topic_preview_width', abs($this->request->variable('topic_preview_width', 0))); // abs() no negative values $this->config->set('topic_preview_delay', abs($this->request->variable('topic_preview_delay', 0))); // abs() no negative values $this->config->set('topic_preview_drift', $this->request->variable('topic_preview_drift', 0)); $this->config->set('topic_preview_avatars', $this->request->variable('topic_preview_avatars', 0)); $this->config->set('topic_preview_last_post', $this->request->variable('topic_preview_last_post', 0)); $this->config->set('topic_preview_strip_bbcodes', $this->request->variable('topic_preview_strip_bbcodes', '')); $styles = $this->get_styles(); foreach ($styles as $row) { $this->set_style_theme($row['style_id'], $this->request->variable('style_' . $row['style_id'], '')); } trigger_error($this->user->lang('CONFIG_UPDATED') . adm_back_link($this->u_action)); } $styles = $this->get_styles(); foreach ($styles as $row) { $this->template->assign_block_vars('styles', array('STYLE_ID' => $row['style_id'], 'STYLE_THEME' => $this->user->lang('TOPIC_PREVIEW_THEME', $row['style_name']), 'STYLE_THEME_EXPLAIN' => $this->user->lang('TOPIC_PREVIEW_THEME_EXPLAIN', $row['style_name']), 'THEME_OPTIONS' => $this->theme_options($row['topic_preview_theme']))); } $this->template->assign_vars(array('TOPIC_PREVIEW_LIMIT' => $this->config['topic_preview_limit'], 'TOPIC_PREVIEW_WIDTH' => $this->config['topic_preview_width'], 'TOPIC_PREVIEW_DELAY' => $this->config['topic_preview_delay'], 'TOPIC_PREVIEW_DRIFT' => $this->config['topic_preview_drift'], 'S_TOPIC_PREVIEW_AVATARS' => $this->config['topic_preview_avatars'], 'S_TOPIC_PREVIEW_LAST_POST' => $this->config['topic_preview_last_post'], 'TOPIC_PREVIEW_STRIP' => $this->config['topic_preview_strip_bbcodes'], 'U_ACTION' => $this->u_action)); }
function acp_page($id, &$module) { global $db, $user, $auth, $template, $phpbb_log, $request; global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx; $user->add_lang('acp/board'); $config_vars = array('enable_confirm' => 'REG_ENABLE', 'enable_post_confirm' => 'POST_ENABLE', 'confirm_refresh' => 'CONFIRM_REFRESH', 'captcha_gd' => 'CAPTCHA_GD'); $module->tpl_name = 'captcha_gd_acp'; $module->page_title = 'ACP_VC_SETTINGS'; $form_key = 'acp_captcha'; add_form_key($form_key); $submit = $request->variable('submit', ''); if ($submit && check_form_key($form_key)) { $captcha_vars = array_keys($this->captcha_vars); foreach ($captcha_vars as $captcha_var) { $value = $request->variable($captcha_var, 0); if ($value >= 0) { $config->set($captcha_var, $value); } } $phpbb_log->add('admin', $user->data['user_id'], $user->ip, '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 ($this->captcha_vars as $captcha_var => $template_var) { $var = isset($_REQUEST[$captcha_var]) ? $request->variable($captcha_var, 0) : $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)); } } }
function main($id, $mode) { global $db, $user, $auth, $template, $cache, $phpbb_log, $request; global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx; include $phpbb_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('*', '%', $request->variable('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']; $phpbb_log->add('admin', $user->data['user_id'], $user->ip, 'LOG_DISALLOW_ADD', false, array(str_replace('%', '*', $disallowed_user))); trigger_error($message . adm_back_link($this->u_action)); } else { if ($allow) { $disallowed_id = $request->variable('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'); $phpbb_log->add('admin', $user->data['user_id'], $user->ip, '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)); }
function main($id, $mode) { global $db, $user, $auth, $template, $cache, $request; global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx; $this->tpl_name = 'acp_countdown_config'; $this->page_title = $user->lang['COUNTDOWN_CONFIG']; add_form_key('acp_countdown_config'); $submit = $request->is_set_post('submit'); if ($submit) { if (!check_form_key('acp_countdown_config')) { trigger_error('FORM_INVALID'); } $config->set('countdown_enable', $request->variable('countdown_enable', 0)); $config->set('countdown_testmode', $request->variable('countdown_testmode', 0)); $config->set('countdown_direction', $request->variable('countdown_direction', 0)); $config->set('countdown_date', $request->variable('countdown_date', '')); $config->set('countdown_offset_enable', $request->variable('countdown_offset_enable', 0)); $config->set('countdown_offset', $request->variable('countdown_offset', '')); $config->set('countdown_year', $request->variable('countdown_year', 0)); $config->set('countdown_month', $request->variable('countdown_month', 0)); $config->set('countdown_text', utf8_normalize_nfc($request->variable('countdown_text', '', true))); $config->set('countdown_complete', utf8_normalize_nfc($request->variable('countdown_complete', '', true))); trigger_error($user->lang['COUNTDOWN_CONFIG_SAVED'] . adm_back_link($this->u_action)); } $template->assign_vars(array('COUNTDOWN_VERSION' => isset($config['countdown_version']) ? $config['countdown_version'] : '', 'COUNTDOWN_ENABLE' => !empty($config['countdown_enable']) ? true : false, 'COUNTDOWN_TESTMODE' => !empty($config['countdown_testmode']) ? true : false, 'COUNTDOWN_DIRECTION' => !empty($config['countdown_direction']) ? true : false, 'COUNTDOWN_DATE' => isset($config['countdown_date']) ? $config['countdown_date'] : '', 'COUNTDOWN_OFFSET_ENABLE' => !empty($config['countdown_offset_enable']) ? true : false, 'COUNTDOWN_OFFSET' => isset($config['countdown_offset']) ? $config['countdown_offset'] : '', 'COUNTDOWN_YEAR' => !empty($config['countdown_year']) ? true : false, 'COUNTDOWN_MONTH' => !empty($config['countdown_month']) ? true : false, 'COUNTDOWN_TEXT' => isset($config['countdown_text']) ? $config['countdown_text'] : '', 'COUNTDOWN_COMPLETE' => isset($config['countdown_complete']) ? $config['countdown_complete'] : '', 'U_ACTION' => $this->u_action)); }
/** * Main ACP module * * @access public */ public function main() { global $phpbb_container; // Load a template from adm/style for our ACP page $this->tpl_name = 'acp_phpbb_ideas'; // Set the page title for our ACP page $this->page_title = 'ACP_PHPBB_IDEAS_SETTINGS'; $language = $phpbb_container->get('language'); $request = $phpbb_container->get('request'); // Get an instance of the admin controller $admin_controller = $phpbb_container->get('phpbb.ideas.admin.controller'); // Add the phpBB Ideas ACP lang file $language->add_lang('phpbb_ideas_acp', 'phpbb/ideas'); // Make the $u_action url available in the admin controller $admin_controller->set_page_url($this->u_action); // Create a form key for preventing CSRF attacks add_form_key('acp_phpbb_ideas_settings'); // Apply Ideas configuration settings if ($request->is_set_post('submit')) { $admin_controller->set_config_options(); } // Set Ideas forum options and registered usergroup forum permissions if ($request->is_set_post('ideas_forum_setup')) { $admin_controller->set_ideas_forum_options(); } // Display/set ACP configuration settings $admin_controller->display_options(); }
function main($id, $mode) { global $phpbb_container, $user, $template, $config, $request; $this->phpbb_container = $phpbb_container; $this->user = $user; $this->template = $template; $this->config = $config; $this->request = $request; $this->log = $this->phpbb_container->get('log'); $this->tpl_name = 'acp_codebox_plus'; $this->page_title = $this->user->lang('CODEBOX_PLUS_TITLE'); add_form_key('o0johntam0o/acp_codebox_plus'); if ($this->request->is_set_post('submit')) { if (!check_form_key('o0johntam0o/acp_codebox_plus')) { trigger_error('FORM_INVALID'); } $this->config->set('codebox_plus_syntax_highlighting', $request->variable('codebox_plus_syntax_highlighting', 0)); $this->config->set('codebox_plus_expanded', $request->variable('codebox_plus_expanded', 0)); $this->config->set('codebox_plus_download', $request->variable('codebox_plus_download', 0)); $this->config->set('codebox_plus_login_required', $request->variable('codebox_plus_login_required', 0)); $this->config->set('codebox_plus_prevent_bots', $request->variable('codebox_plus_prevent_bots', 0)); $this->config->set('codebox_plus_captcha', $request->variable('codebox_plus_captcha', 0)); $this->config->set('codebox_plus_max_attempt', $request->variable('codebox_plus_max_attempt', 0)); $this->log->add('admin', $this->user->data['user_id'], $this->user->ip, 'CODEBOX_PLUS_LOG_MSG'); trigger_error($this->user->lang('CODEBOX_PLUS_SAVED') . adm_back_link($this->u_action)); } $this->template->assign_vars(array('U_ACTION' => $this->u_action, 'S_CODEBOX_PLUS_VERSION' => isset($this->config['codebox_plus_version']) ? $this->config['codebox_plus_version'] : 0, 'S_CODEBOX_PLUS_SYNTAX_HIGHLIGHTING' => isset($this->config['codebox_plus_syntax_highlighting']) ? $this->config['codebox_plus_syntax_highlighting'] : 0, 'S_CODEBOX_PLUS_EXPANDED' => isset($this->config['codebox_plus_expanded']) ? $this->config['codebox_plus_expanded'] : 0, 'S_CODEBOX_PLUS_DOWNLOAD' => isset($this->config['codebox_plus_download']) ? $this->config['codebox_plus_download'] : 0, 'S_CODEBOX_PLUS_LOGIN_REQUIRED' => isset($this->config['codebox_plus_login_required']) ? $this->config['codebox_plus_login_required'] : 0, 'S_CODEBOX_PLUS_PREVENT_BOTS' => isset($this->config['codebox_plus_prevent_bots']) ? $this->config['codebox_plus_prevent_bots'] : 0, 'S_CODEBOX_PLUS_CAPTCHA' => isset($this->config['codebox_plus_captcha']) ? $this->config['codebox_plus_captcha'] : 0, 'S_CODEBOX_PLUS_MAX_ATTEMPT' => isset($this->config['codebox_plus_max_attempt']) ? $this->config['codebox_plus_max_attempt'] : 0)); }
/** * 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(); }
public function main($id, $mode) { global $config, $request, $template, $user; $this->config = $config; $this->request = $request; $this->template = $template; $this->user = $user; // Add the common lang file $this->user->add_lang(array('acp/common')); // Add the board snowstormlights ACP lang file $this->user->add_lang_ext('prosk8er/snowstormlights', 'info_acp_snowstorm_lights'); // Load a template from adm/style for our ACP page $this->tpl_name = 'snowstorm_lights'; // Set the page title for our ACP page $this->page_title = $user->lang['ACP_SNOWSTORM_LIGHTS']; // Define the name of the form for use as a form key $form_key = 'acp_snowstorm_lights'; add_form_key($form_key); // If form is submitted or previewed if ($this->request->is_set_post('submit')) { // Test if form key is valid if (!check_form_key($form_key)) { trigger_error('FORM_INVALID'); } // Store the config enable/disable state $scl_enabled = $this->request->variable('scl_enabled', 0); $this->config->set('scl_enabled', $scl_enabled); $snow_enabled = $request->variable('snow_enabled', 0); $this->config->set('snow_enabled', $snow_enabled); // Output message to user for the update trigger_error($this->user->lang('SNOWSTORM_LIGHTS_SAVED') . adm_back_link($this->u_action)); } // Output data to the template $this->template->assign_vars(array('SCL_ENABLED' => isset($this->config['scl_enabled']) ? $this->config['scl_enabled'] : '', 'SNOW_ENABLED' => isset($this->config['snow_enabled']) ? $this->config['snow_enabled'] : '', 'U_ACTION' => $this->u_action)); }
function main($id, $mode) { global $config, $user, $template, $request; $this->tpl_name = 'acp_linkmenu_config'; $this->page_title = $user->lang['ACP_LINKMENU_SETTINGS']; add_form_key('acp_linkmenu_config'); $submit = $request->is_set_post('submit'); if ($submit) { if (!check_form_key('acp_linkmenu_config')) { trigger_error('FORM_INVALID'); } $config->set('linkmenu_enable', $request->variable('linkmenu_enable', 0)); $config->set('linkmenu_enable_first', $request->variable('linkmenu_enable_first', 0)); $config->set('linkmenu_name_field_first', utf8_normalize_nfc($request->variable('linkmenu_name_field_first', '', true))); $config->set('linkmenu_text_field_first', utf8_normalize_nfc($request->variable('linkmenu_text_field_first', '', true))); $config->set('linkmenu_enable_second', $request->variable('linkmenu_enable_second', 0)); $config->set('linkmenu_name_field_second', utf8_normalize_nfc($request->variable('linkmenu_name_field_second', '', true))); $config->set('linkmenu_text_field_second', utf8_normalize_nfc($request->variable('linkmenu_text_field_second', '', true))); $config->set('linkmenu_enable_third', $request->variable('linkmenu_enable_third', 0)); $config->set('linkmenu_name_field_third', utf8_normalize_nfc($request->variable('linkmenu_name_field_third', '', true))); $config->set('linkmenu_text_field_third', utf8_normalize_nfc($request->variable('linkmenu_text_field_third', '', true))); trigger_error($user->lang['ACP_LINKMENU_CONFIG_SAVED'] . adm_back_link($this->u_action)); } $template->assign_vars(array('ACP_LINKMENU_VERSION' => isset($config['linkmenu_version']) ? $config['linkmenu_version'] : '', 'ACP_LINKMENU_ENABLE' => !empty($config['linkmenu_enable']) ? true : false, 'ACP_LINKMENU_ENABLE_FIRST' => !empty($config['linkmenu_enable_first']) ? true : false, 'LINKMENU_NAME_FIELD_FIRST' => isset($config['linkmenu_name_field_first']) ? $config['linkmenu_name_field_first'] : '', 'LINKMENU_TEXT_FIELD_FIRST' => isset($config['linkmenu_text_field_first']) ? $config['linkmenu_text_field_first'] : '', 'ACP_LINKMENU_ENABLE_SECOND' => !empty($config['linkmenu_enable_second']) ? true : false, 'LINKMENU_NAME_FIELD_SECOND' => isset($config['linkmenu_name_field_second']) ? $config['linkmenu_name_field_second'] : '', 'LINKMENU_TEXT_FIELD_SECOND' => isset($config['linkmenu_text_field_second']) ? $config['linkmenu_text_field_second'] : '', 'ACP_LINKMENU_ENABLE_THIRD' => !empty($config['linkmenu_enable_third']) ? true : false, 'LINKMENU_NAME_FIELD_THIRD' => isset($config['linkmenu_name_field_third']) ? $config['linkmenu_name_field_third'] : '', 'LINKMENU_TEXT_FIELD_THIRD' => isset($config['linkmenu_text_field_third']) ? $config['linkmenu_text_field_third'] : '', 'U_ACTION' => $this->u_action)); }