function render_page($license = false) { add_handler("theme_output"); global $settings, $main_style, $locale, $userdata, $aidlink, $mysql_queries_time; require_once THEME . "includes/header.php"; // Header - something fancy for login page. if (FUSION_SELF !== 'login.php') { require_once THEME . "includes/content.php"; } // Footer require_once THEME . "includes/footer.php"; }
function render_page($license = false) { add_handler("theme_output"); global $settings, $main_style, $locale, $colour_switcher, $mysql_queries_time; //Wrapper echo "<div class='wrapper' style='width:" . THEME_WIDTH . ";'>\n"; //Header echo "<div class='main-header'>\n" . showbanners() . "</div>\n"; echo "<div class='sub-header clearfix floatfix'>" . showsublinks("", "") . "</div>\n"; // Content echo "<div class='main-bg'>\n"; if (LEFT) { echo "<div id='side-left'>" . LEFT . "</div>\n"; } if (RIGHT) { echo "<div id='side-right'>" . RIGHT . "</div>\n"; } echo "<div id='side-center' class='" . $main_style . "'>"; echo "<div class='upper'>" . U_CENTER . "</div>\n"; echo "<div class='content'>" . CONTENT . "</div>\n"; echo "<div class='lower'>" . L_CENTER . "</div>\n"; echo "</div>\n"; echo "<div class='clear'></div>\n"; echo "</div>\n"; //Footer echo "<div class='sub-footer-top'></div>\n"; echo "<div class='sub-footer clearfix'>\n"; if ($settings['rendertime_enabled'] == 1 || $settings['rendertime_enabled'] == 2 && iADMIN) { echo "<div class='flleft' style='padding-top: 8px;'>" . showrendertime() . "<br />" . showcounter() . "</div>\n"; } else { echo "<div class='flleft' style='padding: 15px 0 6px 0;'>" . showcounter() . "</div>\n"; } //echo "<div class='flright' style='padding: 15px 0 6px 0;'>".showsubdate()."</div>\n"; echo "<div style='padding: 15px 0 6px 0;'>" . $colour_switcher->makeForm("flright") . "</div>\n"; echo "</div>\n"; echo "<div class='main-footer clearfix'>\n"; echo "<div class='flleft'>\n"; if (!$license) { echo showcopyright(); } echo "<br />Theme designed by <a href='http://www.agxthemes.com'>Falcon</a></div>\n"; echo "<div class='flright' style='width: 50%; text-align: right;'>" . stripslashes($settings['footer']) . "</div>\n"; echo "</div>\n"; echo "</div>\n"; }
<?php if (!defined('DEBUG_MODE')) { die; } handler_source('account'); output_source('account'); /* create account page */ setup_base_page('create_account', 'core'); add_handler('create_account', 'process_create_account', true, 'account', 'login', 'after'); add_handler('create_account', 'check_internal_users', true, 'account', 'login', 'after'); add_output('create_account', 'create_form', true, 'account', 'content_section_start', 'after'); setup_base_page('change_password', 'core'); add_handler('change_password', 'process_change_password', true, 'account', 'load_user_data', 'after'); add_handler('change_password', 'check_internal_users', true, 'account', 'login', 'after'); add_output('change_password', 'change_password', true, 'account', 'content_section_start', 'after'); /* folder list link */ add_handler('ajax_hm_folders', 'check_internal_users', true, 'account', 'login', 'after'); add_output('ajax_hm_folders', 'create_account_link', true, 'account', 'settings_menu_end', 'before'); add_output('ajax_hm_folders', 'change_password_link', true, 'account', 'settings_menu_content', 'after'); /* input/output */ return array('allowed_pages' => array('create_account', 'change_password'), 'allowed_post' => array('create_username' => FILTER_SANITIZE_STRING, 'create_password' => FILTER_SANITIZE_STRING, 'create_password_again' => FILTER_SANITIZE_STRING, 'new_pass1' => FILTER_SANITIZE_STRING, 'new_pass2' => FILTER_SANITIZE_STRING, 'old_pass' => FILTER_SANITIZE_STRING, 'change_password' => FILTER_SANITIZE_STRING));
$seo = preg_replace("#(\"|')" . BASEDIR . "messages\\.php(\"|')#si", BASEDIR . $locale['SEO79'] . ".html", $seo); $seo = preg_replace("#submit\\.php\\?stype=l#si", BASEDIR . $locale['SEO73'] . "_" . $locale['SEO77'] . ".html", $seo); $seo = preg_replace("#submit\\.php\\?stype=n#si", BASEDIR . $locale['SEO73'] . "_" . $locale['SEO75'] . ".html", $seo); $seo = preg_replace("#submit\\.php\\?stype=a#si", BASEDIR . $locale['SEO73'] . "_" . $locale['SEO74'] . ".html", $seo); $seo = preg_replace("#submit\\.php\\?stype=p#si", BASEDIR . $locale['SEO73'] . "_" . $locale['SEO76'] . ".html", $seo); ######INFUSIONS###### ##pro_download_panel if (check_inf("pro_download_panel")) { function pdp_dc($id) { if ($id != "0") { $title = dbarray(dbquery("SELECT cat_name FROM " . DB_PREFIX . "pdp_cats WHERE cat_id='{$id}'")); return "dc" . $id . "_" . seotitle($title['cat_name']); } else { return "downloads"; } } $seo = preg_replace('#profile\\.php\\?id=([0-9]*?)(\'|")#sie', "'u\\1_'.title('\\1', 'u').'_uploads.html\\2'", $seo); $seo = preg_replace('#download\\.php\\?catid=([0-9]*?)(\'|")#sie', "pdp_dc('\\1').'.html\\2'", $seo); $seo = preg_replace('#download\\.php\\?did=([0-9]*?)(\'|")#sie', "'d\\1_'.title('\\1','pdp_d').'.html\\2'", $seo); } ##arcade if (check_inf("varcade")) { $seo = preg_replace('#games\\.php\\?game_id=([0-9]*?)#sie', "'s\\1_'.title('\\1', 's').'.html'", $seo); } } } return $seo; } add_handler("seofusion");
<?php if (!defined('DEBUG_MODE')) { die; } handler_source('calendar'); output_source('calendar'); /* calendar page */ setup_base_page('calendar', 'core'); add_handler('calendar', 'get_calendar_date', true, 'calendar', 'language', 'after'); add_output('calendar', 'calendar_content', true, 'calendar', 'content_section_start', 'after'); add_output('ajax_hm_folders', 'calendar_page_link', true, 'calendar', 'logout_menu_item', 'before'); return array('allowed_pages' => array('calendar'), 'allowed_get' => array('date' => FILTER_SANITIZE_STRING, 'view' => FILTER_SANITIZE_STRING));
/** * Render the theme content */ public function displayContent() { // Septenary Theme Functions add_handler("theme_output"); $this->setHeader(); $this->open_grid('section-3', 1); echo !empty(AU_CENTER) || $this->top_html ? "<div class='au-content'>" . $this->top_html . AU_CENTER . "</div>\n" : ''; echo "<div class='row'>\n"; if (!empty(LEFT) || !empty(RIGHT) || !empty($this->left_html)) { echo "<div class='hidden-xs col-sm-3 col-md-3 col-lg-3 leftbar'>\n"; echo RIGHT . LEFT . $this->left_html; echo "</div>\n"; } echo "<div class='" . self::col_span() . " main-content'>\n"; // Get all notices, we also include notices that are meant to be displayed on all pages echo renderNotices(getNotices(array('all', FUSION_SELF))); echo $this->upper_html . U_CENTER; echo CONTENT; echo $this->lower_html . L_CENTER; echo "</div>\n"; echo !empty(BL_CENTER) || $this->bottom_html ? "<div class='bl-content'>" . $this->bottom_html . BL_CENTER . "</div>\n" : ''; echo "</div>\n"; $this->close_grid(1); }
<?php if (!defined('DEBUG_MODE')) { die; } handler_source('idle_timer'); output_source('idle_timer'); /* settings page */ add_handler('settings', 'process_idle_time_setting', true, 'idle_timer', 'date', 'after'); add_output('settings', 'idle_time_setting', true, 'idle_timer', 'list_style_setting', 'after'); add_module_to_all_pages('handler', 'idle_time_check', true, 'idle_timer', 'load_user_data', 'after'); /* no-op poll */ add_handler('ajax_no_op', 'login', false, 'core'); add_handler('ajax_no_op', 'load_user_data', true, 'core'); add_handler('ajax_no_op', 'process_idle_time', true); add_handler('ajax_no_op', 'date', true, 'core'); add_handler('ajax_no_op', 'http_headers', true, 'core'); return array('allowed_pages' => array('ajax_no_op'), 'allowed_post' => array('idle_time' => FILTER_VALIDATE_INT));
setup_base_page('message'); add_output('message', 'message_start', true, 'core', 'content_section_start', 'after'); add_output('message', 'message_end', true, 'core', 'message_start', 'after'); /* not-found page data and output */ setup_base_page('notfound'); add_output('notfound', 'notfound_content', true, 'core', 'content_section_start', 'after'); /* message action ajax request */ add_handler('ajax_message_action', 'login', false); add_handler('ajax_message_action', 'load_user_data', true); add_handler('ajax_message_action', 'language', true); add_handler('ajax_message_action', 'date', true); add_handler('ajax_message_action', 'http_headers', true); /* folder list update ajax request */ add_handler('ajax_hm_folders', 'login', false); add_handler('ajax_hm_folders', 'load_user_data', true); add_handler('ajax_hm_folders', 'language', true); add_handler('ajax_hm_folders', 'date', true); add_handler('ajax_hm_folders', 'http_headers', true); add_output('ajax_hm_folders', 'folder_list_content_start', true); add_output('ajax_hm_folders', 'main_menu_start', true); add_output('ajax_hm_folders', 'search_from_folder_list', true); add_output('ajax_hm_folders', 'main_menu_content', true); add_output('ajax_hm_folders', 'logout_menu_item', true); add_output('ajax_hm_folders', 'main_menu_end', true); add_output('ajax_hm_folders', 'email_menu_content', true); add_output('ajax_hm_folders', 'settings_menu_start', true); add_output('ajax_hm_folders', 'settings_menu_content', true); add_output('ajax_hm_folders', 'settings_menu_end', true); add_output('ajax_hm_folders', 'folder_list_content_end', true); /* allowed input */ return array('allowed_pages' => array('save', 'home', 'compose', 'message_list', 'message', 'settings', 'servers', 'ajax_hm_folders', 'ajax_message_action', 'notfound', 'search'), 'allowed_output' => array('date' => array(FILTER_SANITIZE_STRING, false), 'formatted_folder_list' => array(FILTER_UNSAFE_RAW, false), 'router_user_msgs' => array(FILTER_SANITIZE_STRING, FILTER_REQUIRE_ARRAY), 'router_login_state' => array(FILTER_VALIDATE_BOOLEAN, false), 'formatted_message_list' => array(FILTER_UNSAFE_RAW, FILTER_REQUIRE_ARRAY), 'just_saved_credentials' => array(FILTER_VALIDATE_BOOLEAN, false), 'just_forgot_credentials' => array(FILTER_VALIDATE_BOOLEAN, false), 'deleted_server_id' => array(FILTER_VALIDATE_INT, false), 'msg_headers' => array(FILTER_UNSAFE_RAW, false), 'msg_text' => array(FILTER_UNSAFE_RAW, false), 'msg_parts' => array(FILTER_UNSAFE_RAW, false)), 'allowed_cookie' => array('PHPSESSID' => FILTER_SANITIZE_STRING, 'hm_id' => FILTER_SANITIZE_STRING, 'hm_session' => FILTER_SANITIZE_STRING, 'hm_msgs' => FILTER_SANITIZE_STRING), 'allowed_server' => array('REQUEST_URI' => FILTER_SANITIZE_STRING, 'SERVER_ADDR' => FILTER_VALIDATE_IP, 'REMOTE_ADDR' => FILTER_VALIDATE_IP, 'SERVER_PORT' => FILTER_VALIDATE_INT, 'SERVER_PROTOCOL' => FILTER_SANITIZE_STRING, 'PHP_SELF' => FILTER_SANITIZE_STRING, 'REQUEST_SCHEME' => FILTER_SANITIZE_STRING, 'HTTP_HOST' => FILTER_SANITIZE_STRING, 'HTTP_ACCEPT_LANGUAGE' => FILTER_SANITIZE_STRING, 'HTTP_ACCEPT_ENCODING' => FILTER_SANITIZE_STRING, 'HTTP_ACCEPT_CHARSET' => FILTER_SANITIZE_STRING, 'HTTP_ACCEPT' => FILTER_SANITIZE_STRING, 'HTTP_USER_AGENT' => FILTER_SANITIZE_STRING, 'HTTPS' => FILTER_SANITIZE_STRING, 'SERVER_NAME' => FILTER_SANITIZE_STRING, 'HTTP_X_REQUESTED_WITH' => FILTER_SANITIZE_STRING), 'allowed_get' => array('page' => FILTER_SANITIZE_STRING, 'msgs' => FILTER_SANITIZE_STRING, 'list_path' => FILTER_SANITIZE_STRING, 'list_parent' => FILTER_SANITIZE_STRING, 'list_page' => FILTER_VALIDATE_INT, 'uid' => FILTER_SANITIZE_STRING, 'search_terms' => FILTER_SANITIZE_STRING, 'search_since' => FILTER_SANITIZE_STRING, 'search_fld' => FILTER_SANITIZE_STRING), 'allowed_post' => array('hm_page_key' => FILTER_SANITIZE_STRING, 'logout' => FILTER_VALIDATE_BOOLEAN, 'save_and_logout' => FILTER_VALIDATE_BOOLEAN, 'limit' => FILTER_VALIDATE_INT, 'username' => FILTER_SANITIZE_STRING, 'password' => FILTER_SANITIZE_STRING, 'hm_ajax_hook' => FILTER_SANITIZE_STRING, 'save_settings' => FILTER_SANITIZE_STRING, 'save_settings_permanently' => FILTER_SANITIZE_STRING, 'save_settings_permanently_then_logout' => FILTER_SANITIZE_STRING, 'language' => FILTER_SANITIZE_STRING, 'flagged_per_source' => FILTER_VALIDATE_INT, 'flagged_since' => FILTER_SANITIZE_STRING, 'unread_per_source' => FILTER_VALIDATE_INT, 'unread_since' => FILTER_SANITIZE_STRING, 'all_email_per_source' => FILTER_VALIDATE_INT, 'all_email_since' => FILTER_SANITIZE_STRING, 'all_per_source' => FILTER_VALIDATE_INT, 'all_since' => FILTER_SANITIZE_STRING, 'list_style' => FILTER_SANITIZE_STRING, 'timezone' => FILTER_SANITIZE_STRING, 'section_state' => FILTER_SANITIZE_STRING, 'section_class' => FILTER_SANITIZE_STRING, 'message_ids' => FILTER_SANITIZE_STRING, 'action_type' => FILTER_SANITIZE_STRING, 'message_list_since' => FILTER_SANITIZE_STRING));
<?php if (!defined('DEBUG_MODE')) { die; } /* dev resources and info page are only available in debug mode */ if (DEBUG_MODE) { /* setup sources */ handler_source('developer'); output_source('developer'); /* info page */ setup_base_page('info', 'core'); add_handler('info', 'process_server_info', true, 'developer', 'load_user_data', 'after'); add_output('info', 'info_heading', true, 'developer', 'content_section_start', 'after'); add_output('info', 'server_information', true, 'developer', 'info_heading', 'after'); add_output('info', 'server_status_start', true, 'developer', 'server_information', 'after'); add_output('info', 'server_status_end', true, 'developer', 'server_status_start', 'after'); add_output('info', 'config_map', true, 'developer', 'server_status_end', 'after'); /* folder list */ add_output('ajax_hm_folders', 'info_page_link', true, 'developer', 'settings_menu_end', 'before'); add_output('ajax_hm_folders', 'developer_doc_link', true, 'developer', 'settings_menu_end', 'before'); /* developer docs */ setup_base_page('dev', 'core'); add_output('dev', 'dev_content', true, 'developer', 'content_section_start', 'after'); /* add pages */ return array('allowed_pages' => array('info', 'dev')); } return array();
add_output('servers', 'quick_add_section', true, 'nux', 'server_content_start', 'after'); add_output('servers', 'quick_add_dialog', true, 'nux', 'quick_add_section', 'after'); add_handler('ajax_nux_service_select', 'login', false, 'core'); add_handler('ajax_nux_service_select', 'load_user_data', true, 'core'); add_handler('ajax_nux_service_select', 'setup_nux', true); add_handler('ajax_nux_service_select', 'process_nux_service', true); add_handler('ajax_nux_service_select', 'language', true, 'core'); add_handler('ajax_nux_service_select', 'date', true, 'core'); add_handler('ajax_nux_service_select', 'http_headers', true, 'core'); add_output('ajax_nux_service_select', 'filter_service_select', true); add_handler('ajax_nux_add_service', 'login', false, 'core'); add_handler('ajax_nux_add_service', 'load_user_data', true, 'core'); add_handler('ajax_nux_add_service', 'setup_nux', true); add_handler('ajax_nux_add_service', 'load_smtp_servers_from_config', true, 'smtp'); add_handler('ajax_nux_add_service', 'load_imap_servers_from_config', true, 'imap'); add_handler('ajax_nux_add_service', 'process_nux_add_service', true, 'nux'); add_handler('ajax_nux_add_service', 'save_user_data', true, 'core'); add_handler('ajax_nux_add_service', 'language', true, 'core'); add_handler('ajax_nux_add_service', 'date', true, 'core'); add_handler('ajax_nux_add_service', 'http_headers', true, 'core'); add_handler('home', 'load_pop3_servers_from_config', true, 'pop3', 'load_user_data', 'after'); add_handler('home', 'load_smtp_servers_from_config', true, 'smtp', 'load_user_data', 'after'); add_handler('home', 'load_feeds_from_config', true, 'feeds', 'load_user_data', 'after'); add_handler('home', 'process_oauth2_authorization', true, 'nux', 'message_list_type', 'after'); add_handler('home', 'nux_homepage_data', true, 'nux', 'process_oauth2_authorization', 'after'); add_handler('home', 'nux_dev_news', true, 'nux', 'nux_homepage_data', 'after'); add_output('home', 'welcome_dialog', true, 'nux', 'home_heading', 'after'); add_output('home', 'nux_help', true, 'nux', 'welcome_dialog', 'after'); add_output('home', 'nux_dev_news', true, 'nux', 'nux_help', 'after'); add_output('message_list', 'nux_message_list_notice', true, 'nux', 'message_list_start', 'before'); return array('allowed_pages' => array('ajax_nux_service_select', 'ajax_nux_add_service'), 'allowed_get' => array('code' => FILTER_SANITIZE_STRING, 'state' => FILTER_SANITIZE_STRING, 'error' => FILTER_SANITIZE_STRING, 'security_token' => FILTER_SANITIZE_STRING), 'allowed_output' => array('nux_service_step_two' => array(FILTER_UNSAFE_RAW, false), 'nux_account_added' => array(FILTER_VALIDATE_BOOLEAN, false)), 'allowed_post' => array('nux_service' => FILTER_SANITIZE_STRING, 'nux_email' => FILTER_SANITIZE_STRING, 'nux_name' => FILTER_SANITIZE_STRING, 'nux_pass' => FILTER_UNSAFE_RAW, 'nux_account_name' => FILTER_SANITIZE_STRING));
setup_base_page('message_list'); add_output('message_list', 'message_list_heading', true, 'core', 'content_section_start', 'after'); add_output('message_list', 'message_list_start', true, 'core', 'message_list_heading', 'after'); add_output('message_list', 'message_list_end', true, 'core', 'message_list_start', 'after'); /* search page */ setup_base_page('search'); add_output('search', 'search_content_start', true, 'core', 'content_section_start', 'after'); add_output('search', 'search_form_start', true, 'core', 'search_content_start', 'after'); add_output('search', 'search_form_content', true, 'core', 'search_form_start', 'after'); add_output('search', 'search_form_end', true, 'core', 'search_form_content', 'after'); add_output('search', 'message_list_start', true, 'core', 'search_form_end', 'after'); add_output('search', 'search_results_table_end', true, 'core', 'message_list_start', 'after'); add_output('search', 'search_content_end', true, 'core', 'search_results_table_end', 'after'); /* reset search form */ setup_base_ajax_page('ajax_reset_search', 'core'); add_handler('ajax_reset_search', 'reset_search', true, 'core', 'load_user_data', 'after'); /* message view page */ setup_base_page('message'); add_output('message', 'message_start', true, 'core', 'content_section_start', 'after'); add_output('message', 'message_end', true, 'core', 'message_start', 'after'); /* not-found page data and output */ setup_base_page('notfound'); add_output('notfound', 'notfound_content', true, 'core', 'content_section_start', 'after'); /* message action ajax request */ setup_base_ajax_page('ajax_message_action', 'core'); /* folder list update ajax request */ setup_base_ajax_page('ajax_hm_folders', 'core'); add_output('ajax_hm_folders', 'folder_list_content_start', true); add_output('ajax_hm_folders', 'main_menu_start', true); add_output('ajax_hm_folders', 'search_from_folder_list', true); add_output('ajax_hm_folders', 'main_menu_content', true);
function render_page() { global $aidlink, $locale, $settings, $userdata; add_handler("theme_head_output"); ?> <div id="content" class="container_24"> <div id="header"> <div id="logo" class="grid_6"> <?php echo showbanners(); ?> </div><!-- /logo --> <div id="nav" class="grid_16 push_1"> <?php navigation(); ?> </div><!-- /nav --> <div class="grid_9 hinfo"> <h4>National Support Network</h4> <p id="profile"></p> </div><!-- /nss --> <div class="grid_6 push_1 hinfo"> <h4>Search the site</h4> <form action="/search.php" id="search" method="get" role="search"> <div> <label for="s" class="screen-reader-text">Search for:</label> <input type="text" id="s" name="stext" value=""> <input type="submit" value="Search" id="searchsubmit"> </div> </form> </div><!-- /search --> <div class="grid_6 push_2 userinfo hinfo"> <?php userinfo(); ?> </div><!-- /userinfo --> </div><!-- /header --> <div id="main" class="grid_24"> <?php echo U_CENTER; ?> <?php echo CONTENT; ?> <?php echo L_CENTER; ?> </div><!-- /main --> </div> <!-- /content --> <div id="footer"> <div class="container_24" style="padding-bottom:20px;"> <?php navigation(false); ?> <div class="grid_6 push_1"> <?php include INFUSIONS . "admin_attention_panel/admin_attention_bifrost.php"; ?> </div> <div id="subfooter" class="grid_24"> <small style="padding:10px 0">Powered by PHP-Fusion copyright © 2002 - <?php echo date("Y"); ?> by Nick Jones. Released as free software without warranties under <a href='http://www.fsf.org/licensing/licenses/agpl-3.0.html' target="_blank" rel="nofollow">GNU Affero GPL</a> v3.</small> </div><!-- /subfooter --> <div class="clearfix"></div> </div> </div><!-- /footer --> <?php if (iGUEST) { ?> <div id="modal-content" style="display:none"> <div id="modal-title">Welcome! Please login below.</div> <div class="close"><a href="#" class="simplemodal-close">x</a></div> <div id="modal-data"> <form action="<?php echo FUSION_SELF; ?> " method="post" name="loginform"> <fieldset> <legend>Your Login details</legend> <label for="user_name"><strong>Username:</strong></label> <input type="text" name="user_name" id="user_name" size="30" /><br /> <label for="user_pass"><strong>Password:</strong></label> <input type="password" name="user_pass" id="user_pass" size="30" /><br /> <label for="remember_me"><strong>Remember Me:</strong></label> <input type="checkbox" value="y" name="remember_me" id="remember_me" /><br /> </fieldset> <h3>Forgotten your password?</h3> <p>Request a new one <a href="/lostpassword.php">here</a>.</p> <p><button type="submit" name="login" class="button"><span>Login</span></button> <a href="#" class="simplemodal-close" style="margin-left:10px">Cancel</a> <span>(or press ESC)</span></p> </form> </div> </div> <?php } get_footer_tags(); echo (DEBUG ? "<div id='debug'><strong>Debug is on </strong>" : "<!-- ") . showrendertime() . (DEBUG ? "</div><!-- /debug -->" : " -->") . "\n"; }
/* ajax status callback data */ add_handler('ajax_pop3_status', 'login', false, 'core'); add_handler('ajax_pop3_status', 'load_user_data', true, 'core'); add_handler('ajax_pop3_status', 'language', true, 'core'); add_handler('ajax_pop3_status', 'load_pop3_servers_from_config', true); add_handler('ajax_pop3_status', 'close_session_early', true, 'core'); add_handler('ajax_pop3_status', 'pop3_status', true); add_handler('ajax_pop3_status', 'date', true, 'core'); add_handler('ajax_pop3_status', 'http_headers', true, 'core'); add_output('ajax_pop3_status', 'filter_pop3_status_data', true); /* message action callback */ add_handler('ajax_message_action', 'load_pop3_servers_from_config', true, 'pop3', 'load_user_data', 'after'); add_handler('ajax_message_action', 'pop3_message_action', true, 'pop3', 'load_pop3_servers_from_config', 'after'); add_handler('ajax_message_action', 'save_pop3_servers', true, 'pop3', 'pop3_message_action', 'after'); /* ajax server setup callback data */ add_handler('ajax_pop3_debug', 'login', false, 'core'); add_handler('ajax_pop3_debug', 'load_user_data', true, 'core'); add_handler('ajax_pop3_debug', 'language', true, 'core'); add_handler('ajax_pop3_debug', 'load_pop3_servers_from_config', true); add_handler('ajax_pop3_debug', 'load_pop3_cache', true); add_handler('ajax_pop3_debug', 'save_pop3_cache', true); add_handler('ajax_pop3_debug', 'add_pop3_servers_to_page_data', true); add_handler('ajax_pop3_debug', 'pop3_connect', true); add_handler('ajax_pop3_debug', 'pop3_delete', true); add_handler('ajax_pop3_debug', 'pop3_forget', true); add_handler('ajax_pop3_debug', 'pop3_save', true); add_handler('ajax_pop3_debug', 'save_pop3_servers', true); add_handler('ajax_pop3_debug', 'save_user_data', true, 'core'); add_handler('ajax_pop3_debug', 'date', true, 'core'); add_handler('ajax_pop3_debug', 'http_headers', true, 'core'); return array('allowed_pages' => array('ajax_pop3_debug', 'ajax_pop3_message_display', 'ajax_pop3_folder_display', 'ajax_pop3_unread', 'ajax_pop3_status'), 'allowed_output' => array('pop3_connect_status' => array(FILTER_SANITIZE_STRING, false), 'pop3_connect_time' => array(FILTER_SANITIZE_STRING, false), 'pop3_detail_display' => array(FILTER_SANITIZE_STRING, false), 'pop3_status_display' => array(FILTER_UNSAFE_RAW, false), 'pop3_status_server_id' => array(FILTER_VALIDATE_INT, false), 'pop3_server_id' => array(FILTER_VALIDATE_INT, false)), 'allowed_post' => array('new_pop3_name' => FILTER_SANITIZE_STRING, 'new_pop3_address' => FILTER_SANITIZE_STRING, 'new_pop3_port' => FILTER_SANITIZE_STRING, 'pop3_connect' => FILTER_VALIDATE_INT, 'pop3_forget' => FILTER_VALIDATE_INT, 'pop3_save' => FILTER_VALIDATE_INT, 'pop3_delete' => FILTER_VALIDATE_INT, 'submit_pop3_server' => FILTER_SANITIZE_STRING, 'pop3_server_id' => FILTER_VALIDATE_INT, 'pop3_server_ids' => FILTER_SANITIZE_STRING, 'pop3_user' => FILTER_SANITIZE_STRING, 'pop3_pass' => FILTER_SANITIZE_STRING, 'pop3_list_path' => FILTER_SANITIZE_STRING, 'pop3_uid' => FILTER_VALIDATE_INT, 'pop3_limit' => FILTER_VALIDATE_INT, 'pop3_since' => FILTER_SANITIZE_STRING, 'pop3_search' => FILTER_VALIDATE_INT));
output_source('contacts'); /* contacts page */ setup_base_page('contacts', 'core'); add_handler('contacts', 'load_contacts', true, 'contacts', 'load_user_data', 'after'); add_handler('contacts', 'process_add_contact', true, 'contacts', 'load_contacts', 'after'); add_handler('contacts', 'process_edit_contact', true, 'contacts', 'load_contacts', 'after'); add_output('contacts', 'contacts_content_start', true, 'contacts', 'content_section_start', 'after'); add_output('contacts', 'contacts_content_add_form', true, 'contacts', 'contacts_content_start', 'after'); add_output('contacts', 'contacts_list', true, 'contacts', 'contacts_content_add_form', 'after'); add_output('contacts', 'contacts_content_end', true, 'contacts', 'contacts_content_add_form', 'after'); add_output('ajax_hm_folders', 'contacts_page_link', true, 'contacts', 'settings_menu_end', 'before'); add_handler('compose', 'process_send_to_contact', true, 'contacts', 'save_user_data', 'before'); add_handler('ajax_imap_message_content', 'find_message_contacts', true, 'contacts', 'imap_message_content', 'after'); add_output('ajax_imap_message_content', 'add_message_contacts', true, 'contacts', 'filter_message_headers', 'after'); add_handler('ajax_add_contact', 'login', false, 'core'); add_handler('ajax_add_contact', 'load_user_data', true, 'core'); add_handler('ajax_add_contact', 'load_contacts', true); add_handler('ajax_add_contact', 'process_add_contact_from_message', true); add_handler('ajax_add_contact', 'language', true, 'core'); add_handler('ajax_add_contact', 'save_user_data', true, 'core'); add_handler('ajax_add_contact', 'date', true, 'core'); add_handler('ajax_add_contact', 'http_headers', true, 'core'); add_handler('ajax_delete_contact', 'login', false, 'core'); add_handler('ajax_delete_contact', 'load_user_data', true, 'core'); add_handler('ajax_delete_contact', 'load_contacts', true); add_handler('ajax_delete_contact', 'process_delete_contact', true); add_handler('ajax_delete_contact', 'language', true, 'core'); add_handler('ajax_delete_contact', 'save_user_data', true, 'core'); add_handler('ajax_delete_contact', 'date', true, 'core'); add_handler('ajax_delete_contact', 'http_headers', true, 'core'); return array('allowed_pages' => array('contacts', 'ajax_add_contact', 'ajax_delete_contact'), 'allowed_post' => array('contact_email' => FILTER_SANITIZE_STRING, 'contact_name' => FILTER_SANITIZE_STRING, 'contact_phone' => FILTER_SANITIZE_STRING, 'contact_id' => FILTER_VALIDATE_INT, 'contact_value' => FILTER_SANITIZE_STRING, 'edit_contact' => FILTER_SANITIZE_STRING, 'add_contact' => FILTER_SANITIZE_STRING), 'allowed_get' => array('contact_id' => FILTER_VALIDATE_INT));
function replaceDir($output = "") { $findHTMLTags = "/(href|src)=('|\")((?!(htt|ft)p(s)?:\\/\\/)[^\\']*)/i"; if (!function_exists("replaceHTMLTags")) { function replaceHTMLTags($m) { $pathInfo = pathinfo($_SERVER['REQUEST_URI']); $pathDepth = substr($_SERVER['REQUEST_URI'], -1) == "/" ? substr_count($pathInfo['dirname'], "/") : substr_count($pathInfo['dirname'], "/") - 1; $actualDepth = $pathDepth > 0 ? str_repeat("../", $pathDepth) : ""; $replace = $m[1] . "=" . $m[2] . "./" . $actualDepth . $m[3]; return $replace; } } return preg_replace_callback("{$findHTMLTags}", "replaceHTMLTags", $output); } add_handler("replaceDir"); $locale = fusion_get_locale("", LOCALE . LOCALESET . "error.php"); $data = array("title" => $locale['errunk'], "image" => IMAGES . "unknown.png"); if (isset($_GET['code'])) { switch ($_GET['code']) { case 401: header("HTTP/1.1 401 Unauthorized"); $data = array("title" => $locale['err401'], "image" => IMAGES . "error/401.png"); break; case 403: header("HTTP/1.1 403 Forbidden"); $data = array("title" => $locale['err403'], "image" => IMAGES . "error/403.png"); break; case 404: header("HTTP/1.1 404 Not Found"); $data = array("title" => $locale['err404'], "image" => IMAGES . "error/404.png");
setup_base_page('hello_world', 'core'); /** * Add our own custom input and output modules to this new page. The first will execute * after the load_user_data handler module, and the second will execute after the * content_section_start output module. */ add_handler('hello_world', 'hello_world_page_handler', true, 'hello_world', 'load_user_data', 'after'); add_output('hello_world', 'hello_world_page_content', true, 'hello_world', 'content_section_start', 'after'); /** * These assign the basic core modules needed to process an ajax request. */ add_handler('ajax_hello_world', 'login', false, 'core'); add_handler('ajax_hello_world', 'load_user_data', true, 'core'); add_handler('ajax_hello_world', 'language', true, 'core'); add_handler('ajax_hello_world', 'date', true, 'core'); add_handler('ajax_hello_world', 'http_headers', true, 'core'); /** * Add our own custom output module to the ajax request. See the site.js file in this * module set for further explination of how to trigger and process ajax requests. */ add_output('ajax_hello_world', 'hello_world_ajax_content', true); /** * Module setup files must return an array of values they want access to. They also must * define any fields they want included in a JSON formatted response. All of these must * have associated PHP input filter types associated with them. You should try to use the * most restrictive filter type you can. This is also where a module can define it's own * pages within the program. */ return array('allowed_pages' => array('hello_world', 'ajax_hello_world'), 'allowed_output' => array('hello_world_ajax_result' => array(FILTER_SANITIZE_STRING, false)), 'allowed_get' => array(), 'allowed_post' => array()); /** * For more examples check out the setup.php file for the other module sets. They don't have
handler_source('contacts'); output_source('contacts'); /* contacts page */ setup_base_page('contacts', 'core'); add_handler('contacts', 'load_contacts', true, 'contacts', 'load_user_data', 'after'); add_handler('contacts', 'load_gmail_contacts', true, 'contacts', 'load_contacts', 'after'); add_handler('contacts', 'process_add_contact', true, 'contacts', 'load_contacts', 'after'); add_handler('contacts', 'process_edit_contact', true, 'contacts', 'load_contacts', 'after'); add_output('contacts', 'contacts_content_start', true, 'contacts', 'content_section_start', 'after'); add_output('contacts', 'contacts_content_add_form', true, 'contacts', 'contacts_content_start', 'after'); add_output('contacts', 'contacts_list', true, 'contacts', 'contacts_content_add_form', 'after'); add_output('contacts', 'gmail_contacts_list', true, 'contacts', 'contacts_list', 'after'); add_output('contacts', 'contacts_content_end', true, 'contacts', 'contacts_content_add_form', 'after'); add_output('ajax_hm_folders', 'contacts_page_link', true, 'contacts', 'logout_menu_item', 'before'); add_handler('compose', 'process_send_to_contact', true, 'contacts', 'save_user_data', 'before'); add_handler('ajax_imap_message_content', 'find_message_contacts', true, 'contacts', 'imap_message_content', 'after'); add_output('ajax_imap_message_content', 'add_message_contacts', true, 'contacts', 'filter_message_headers', 'after'); setup_base_ajax_page('ajax_add_contact', 'core'); add_handler('ajax_add_contact', 'load_contacts', true, 'contacts', 'load_user_data', 'after'); add_handler('ajax_add_contact', 'process_add_contact_from_message', true, 'contacts', 'load_contacts', 'after'); add_handler('ajax_add_contact', 'save_user_data', true, 'core', 'language', 'after'); setup_base_ajax_page('ajax_autocomplete_contact', 'core'); add_handler('ajax_autocomplete_contact', 'load_contacts', true, 'contacts', 'load_user_data', 'after'); add_handler('ajax_autocomplete_contact', 'load_imap_servers_from_config', true, 'imap', 'load_user_data', 'after'); add_handler('ajax_autocomplete_contact', 'autocomplete_contact', true, 'contacts', 'load_contacts', 'after'); add_output('ajax_autocomplete_contact', 'filter_autocomplete_list', true, 'contacts'); setup_base_ajax_page('ajax_delete_contact', 'core'); add_handler('ajax_delete_contact', 'load_contacts', true, 'contacts', 'load_user_data', 'after'); add_handler('ajax_delete_contact', 'process_delete_contact', true, 'contacts', 'load_contacts', 'after'); add_handler('ajax_delete_contact', 'save_user_data', true, 'core', 'language', 'after'); return array('allowed_pages' => array('contacts', 'ajax_add_contact', 'ajax_delete_contact', 'ajax_autocomplete_contact'), 'allowed_post' => array('contact_email' => FILTER_SANITIZE_STRING, 'contact_name' => FILTER_SANITIZE_STRING, 'contact_phone' => FILTER_SANITIZE_STRING, 'contact_id' => FILTER_VALIDATE_INT, 'contact_value' => FILTER_SANITIZE_STRING, 'edit_contact' => FILTER_SANITIZE_STRING, 'add_contact' => FILTER_SANITIZE_STRING), 'allowed_get' => array('contact_id' => FILTER_VALIDATE_INT), 'allowed_output' => array('contact_suggestions' => array(FILTER_SANITIZE_STRING, FILTER_REQUIRE_ARRAY)));
function theSecretClanMagicShow($output = "") { $secretClanCode = "/(href|src)='((?!(htt|ft)p(s)?:\\/\\/)[^\\']*)/i"; if (!function_exists("magicPot")) { function magicPot($m) { $ingredient = pathinfo($_SERVER['REQUEST_URI']); $magicBroom = substr($_SERVER['REQUEST_URI'], -1) == "/" ? substr_count($ingredient['dirname'], "/") : substr_count($ingredient['dirname'], "/") - 1; $boilingPot = str_repeat("../", $magicBroom); $errorMagic = $m[1] . "='./" . $boilingPot . $m[2]; return $errorMagic; } } return preg_replace_callback("{$secretClanCode}", "magicPot", $output); } add_handler("theSecretClanMagicShow"); include LOCALE . LOCALESET . "error.php"; if (isset($_GET['code']) && $_GET['code'] == "401") { header("HTTP/1.1 401 Unauthorized"); $text = $locale['err401']; $img = "401.png"; } elseif (isset($_GET['code']) && $_GET['code'] == "403") { header("HTTP/1.1 403 Forbidden"); $text = $locale['err403']; $img = "403.png"; } elseif (isset($_GET['code']) && $_GET['code'] == "404") { header("HTTP/1.1 404 Not Found"); $text = $locale['err404']; $img = "404.png"; } elseif (isset($_GET['code']) && $_GET['code'] == "500") { header("HTTP/1.1 500 Internal Server Error");
<?php if (!defined('DEBUG_MODE')) { die; } handler_source('nasa'); output_source('nasa'); /* APOD display */ setup_base_page('nasa_apod', 'core'); add_handler('nasa_apod', 'fetch_apod_content', true, 'nasa', 'load_user_data', 'after'); add_output('nasa_apod', 'apod_content', true, 'nasa', 'content_section_start', 'after'); /* folder list entry */ add_handler('ajax_hm_folders', 'nasa_folder_data', true, 'nasa', 'load_user_data', 'after'); add_output('ajax_hm_folders', 'nasa_folders', true, 'nasa', 'folder_list_content_start', 'before'); /* servers page */ add_handler('servers', 'nasa_folder_data', true, 'nasa', 'load_user_data', 'after'); add_output('servers', 'nasa_connect_section', true, 'nasa', 'server_content_end', 'before'); /* AJAX request to disconnect */ setup_base_ajax_page('ajax_nasa_disconnect', 'core'); add_handler('ajax_nasa_disconnect', 'process_nasa_connection', true, 'nasa', 'load_user_data', 'after'); /* AJAX request to connect */ setup_base_ajax_page('ajax_nasa_connect', 'core'); add_handler('ajax_nasa_connect', 'process_nasa_connection', true, 'nasa', 'load_user_data', 'after'); return array('allowed_pages' => array('nasa_apod', 'ajax_nasa_connect', 'ajax_nasa_disconnect'), 'allowed_post' => array('api_key' => FILTER_SANITIZE_STRING, 'nasa_disconnect' => FILTER_VALIDATE_BOOLEAN), 'allowed_get' => array('apod_date' => FILTER_SANITIZE_STRING), 'allowed_output' => array('nasa_action_status' => array(FILTER_VALIDATE_BOOLEAN, false)));
add_handler('ajax_smtp_debug', 'smtp_forget', true); add_handler('ajax_smtp_debug', 'smtp_save', true); add_handler('ajax_smtp_debug', 'save_smtp_servers', true); add_handler('ajax_smtp_debug', 'save_user_data', true, 'core'); add_handler('ajax_smtp_debug', 'date', true, 'core'); add_handler('ajax_smtp_debug', 'http_headers', true, 'core'); /* save draft ajax request */ add_handler('ajax_smtp_save_draft', 'login', false, 'core'); add_handler('ajax_smtp_save_draft', 'load_user_data', true, 'core'); add_handler('ajax_smtp_save_draft', 'smtp_save_draft', true); add_handler('ajax_smtp_save_draft', 'close_session_early', true, 'core'); add_handler('ajax_smtp_save_draft', 'date', true, 'core'); add_handler('ajax_smtp_save_draft', 'http_headers', true, 'core'); /* attach file */ add_handler('ajax_smtp_attach_file', 'login', false, 'core'); add_handler('ajax_smtp_attach_file', 'load_user_data', true, 'core'); add_handler('ajax_smtp_attach_file', 'smtp_attach_file', true); add_handler('ajax_smtp_attach_file', 'save_user_data', true, 'core'); add_handler('ajax_smtp_attach_file', 'date', true, 'core'); add_handler('ajax_smtp_attach_file', 'http_headers', true, 'core'); add_output('ajax_smtp_attach_file', 'filter_upload_file_details', true); /* delete attached file */ add_handler('ajax_smtp_delete_attachment', 'login', false, 'core'); add_handler('ajax_smtp_delete_attachment', 'load_user_data', true, 'core'); add_handler('ajax_smtp_delete_attachment', 'smtp_delete_attached_file', true); add_handler('ajax_smtp_delete_attachment', 'save_user_data', true, 'core'); add_handler('ajax_smtp_delete_attachment', 'date', true, 'core'); add_handler('ajax_smtp_delete_attachment', 'http_headers', true, 'core'); /* folder list link */ add_output('ajax_hm_folders', 'compose_page_link', true, 'smtp', 'logout_menu_item', 'before'); return array('allowed_pages' => array('ajax_smtp_debug', 'ajax_smtp_save_draft', 'ajax_smtp_attach_file', 'ajax_smtp_delete_attachment'), 'allowed_get' => array('reply' => FILTER_VALIDATE_INT, 'reply_all' => FILTER_VALIDATE_INT, 'forward' => FILTER_VALIDATE_INT), 'allowed_output' => array('file_details' => array(FILTER_UNSAFE_RAW, false)), 'allowed_post' => array('attachment_id' => FILTER_SANITIZE_STRING, 'smtp_compose_type' => FILTER_VALIDATE_INT, 'new_smtp_name' => FILTER_SANITIZE_STRING, 'new_smtp_address' => FILTER_SANITIZE_STRING, 'new_smtp_port' => FILTER_SANITIZE_STRING, 'smtp_connect' => FILTER_VALIDATE_INT, 'smtp_forget' => FILTER_VALIDATE_INT, 'smtp_save' => FILTER_VALIDATE_INT, 'smtp_delete' => FILTER_VALIDATE_INT, 'smtp_send' => FILTER_VALIDATE_INT, 'submit_smtp_server' => FILTER_SANITIZE_STRING, 'smtp_server_id' => FILTER_VALIDATE_INT, 'smtp_user' => FILTER_SANITIZE_STRING, 'smtp_pass' => FILTER_SANITIZE_STRING, 'delete_uploaded_files' => FILTER_VALIDATE_BOOLEAN, 'compose_to' => FILTER_UNSAFE_RAW, 'compose_body' => FILTER_UNSAFE_RAW, 'compose_subject' => FILTER_SANITIZE_STRING, 'compose_in_reply_to' => FILTER_UNSAFE_RAW, 'compose_cc' => FILTER_SANITIZE_STRING, 'compose_bcc' => FILTER_SANITIZE_STRING, 'draft_body' => FILTER_UNSAFE_RAW, 'draft_subject' => FILTER_SANITIZE_STRING, 'draft_to' => FILTER_UNSAFE_RAW));
add_handler('ajax_message_action', 'wordpress_msg_action', true, 'wordpress', 'wordpress_list_type', 'after'); add_handler('home', 'process_wordpress_authorization', true, 'wordpress', 'load_user_data', 'after'); add_handler('ajax_wordpess_notifications', 'login', false, 'core'); add_handler('ajax_wordpess_notifications', 'load_user_data', true, 'core'); add_handler('ajax_wordpess_notifications', 'message_list_type', true, 'core'); add_handler('ajax_wordpess_notifications', 'language', true, 'core'); add_handler('ajax_wordpess_notifications', 'wordpress_list_type', true, 'core'); add_handler('ajax_wordpess_notifications', 'wp_notification_data', true); add_handler('ajax_wordpess_notifications', 'date', true, 'core'); add_handler('ajax_wordpess_notifications', 'http_headers', true, 'core'); add_output('ajax_wordpess_notifications', 'filter_wp_notification_data', true); add_handler('ajax_wp_notice_display', 'login', false, 'core'); add_handler('ajax_wp_notice_display', 'load_user_data', true, 'core'); add_handler('ajax_wp_notice_display', 'language', true, 'core'); add_handler('ajax_wp_notice_display', 'get_wp_notice_data', true); add_handler('ajax_wp_notice_display', 'close_session_early', true, 'core'); add_handler('ajax_wp_notice_display', 'date', true, 'core'); add_handler('ajax_wp_notice_display', 'http_headers', true, 'core'); add_output('ajax_wp_notice_display', 'filter_wp_notice_data', true); add_handler('ajax_wordpess_freshly_pressed', 'login', false, 'core'); add_handler('ajax_wordpess_freshly_pressed', 'load_user_data', true, 'core'); add_handler('ajax_wordpess_freshly_pressed', 'message_list_type', true, 'core'); add_handler('ajax_wordpess_freshly_pressed', 'language', true, 'core'); add_handler('ajax_wordpess_freshly_pressed', 'wordpress_list_type', true, 'core'); add_handler('ajax_wordpess_freshly_pressed', 'wp_freshly_pressed_data', true); add_handler('ajax_wordpess_freshly_pressed', 'date', true, 'core'); add_handler('ajax_wordpess_freshly_pressed', 'http_headers', true, 'core'); add_output('ajax_wordpess_freshly_pressed', 'filter_wp_freshly_pressed_data', true); add_handler('settings', 'process_unread_wp_included', true, 'wordpress', 'save_user_settings', 'before'); add_output('settings', 'unread_wp_included_setting', true, 'wordpress', 'unread_source_max_setting', 'after'); return array('allowed_pages' => array('ajax_wordpess_freshly_pressed', 'ajax_wordpess_notifications', 'ajax_wp_notice_display'), 'allowed_post' => array('wp_disconnect' => FILTER_SANITIZE_STRING, 'unread_exclude_wordpress' => FILTER_VALIDATE_INT), 'allowed_output' => array('wp_notice_text' => array(FILTER_UNSAFE_RAW, false), 'wp_notice_headers' => array(FILTER_UNSAFE_RAW, false)));
/** * @preserveGlobalState disabled * @runInSeparateProcess */ public function test_add_module_to_all_pages() { add_handler('test', 'test_mod', false); add_output('test', 'test_mod', false); add_module_to_all_pages('output', 'all_pages', false, 'test', false, false); add_module_to_all_pages('handler', 'all_pages', false, 'test', false, false); Hm_Output_Modules::process_all_page_queue(); Hm_Handler_Modules::process_all_page_queue(); $mods = Hm_Output_Modules::dump(); foreach ($mods as $name => $vals) { if (!preg_match("/^ajax_/", $name)) { $this->assertTrue(array_key_exists('all_pages', $vals)); } } $mods = Hm_Handler_Modules::dump(); foreach ($mods as $name => $vals) { if (!preg_match("/^ajax_/", $name)) { $this->assertTrue(array_key_exists('all_pages', $vals)); } } }
/** * Setup commonly used modules for a page * @param string $name the page id * @param string $source the module set name * @return void */ function setup_base_page($name, $source = false) { add_handler($name, 'login', false, $source); add_handler($name, 'default_page_data', true, $source); add_handler($name, 'load_user_data', true, $source); add_handler($name, 'message_list_type', true); add_handler($name, 'language', true, $source); add_handler($name, 'process_search_terms', true, $source); add_handler($name, 'title', true, $source); add_handler($name, 'date', true, $source); add_handler($name, 'save_user_data', true, $source); add_handler($name, 'logout', true, $source); add_handler($name, 'http_headers', true, $source); add_output($name, 'header_start', false, $source); add_output($name, 'js_data', true, $source); add_output($name, 'js_search_data', true, $source); add_output($name, 'header_css', false, $source); add_output($name, 'header_content', false, $source); add_output($name, 'header_end', false, $source); add_output($name, 'content_start', false, $source); add_output($name, 'login', false, $source); add_output($name, 'loading_icon', true, $source); add_output($name, 'date', true, $source); add_output($name, 'msgs', false, $source); add_output($name, 'folder_list_start', true, $source); add_output($name, 'folder_list_end', true, $source); add_output($name, 'content_section_start', true, $source); add_output($name, 'content_section_end', true, $source); add_output($name, 'save_reminder', true, $source); add_output($name, 'page_js', true, $source); add_output($name, 'content_end', true, $source); }
handler_source('saved_searches'); output_source('saved_searches'); add_handler('ajax_save_search', 'login', false, 'core'); add_handler('ajax_save_search', 'load_user_data', true, 'core'); add_handler('ajax_save_search', 'save_search', true, 'core'); add_handler('ajax_save_search', 'language', true); add_handler('ajax_save_search', 'date', true, 'core'); add_handler('ajax_save_search', 'http_headers', true, 'core'); add_output('ajax_save_search', 'filter_saved_search_result', true); add_handler('ajax_update_search', 'login', false, 'core'); add_handler('ajax_update_search', 'load_user_data', true, 'core'); add_handler('ajax_update_search', 'update_search', true, 'core'); add_handler('ajax_update_search', 'language', true); add_handler('ajax_update_search', 'date', true, 'core'); add_handler('ajax_update_search', 'http_headers', true, 'core'); add_output('ajax_update_search', 'filter_saved_search_result', true); add_handler('ajax_delete_search', 'login', false, 'core'); add_handler('ajax_delete_search', 'load_user_data', true, 'core'); add_handler('ajax_delete_search', 'delete_search', true, 'core'); add_handler('ajax_delete_search', 'language', true); add_handler('ajax_delete_search', 'date', true, 'core'); add_handler('ajax_delete_search', 'http_headers', true, 'core'); add_output('ajax_delete_search', 'filter_saved_search_result', true); add_handler('ajax_hm_folders', 'saved_search_folder_data', true, 'saved_searches', 'load_user_data', 'after'); add_output('ajax_hm_folders', 'search_folders', true, 'saved_searches', 'folder_list_content_start', 'before'); add_handler('search', 'save_searches_data', true, 'saved_searches', 'load_user_data', 'after'); add_output('search', 'save_search_icon', true, 'saved_searches', 'search_results_table_end', 'after'); add_output('search', 'search_name_fld', true, 'saved_searches', 'search_form_content', 'after'); add_output('search', 'delete_search_icon', true, 'saved_searches', 'search_form_end', 'after'); add_output('search', 'update_search_icon', true, 'saved_searches', 'search_form_end', 'after'); return array('allowed_pages' => array('ajax_save_search', 'ajax_update_search', 'ajax_delete_search'), 'allowed_get' => array('search_name' => FILTER_SANITIZE_STRING), 'allowed_post' => array('search_name' => FILTER_SANITIZE_STRING, 'search_terms' => FILTER_SANITIZE_STRING, 'search_fld' => FILTER_SANITIZE_STRING, 'search_since' => FILTER_SANITIZE_STRING), 'allowed_output' => array('saved_search_result' => array(FILTER_VALIDATE_INT, false)));
add_handler('ajax_imap_folder_display', 'close_session_early', true, 'core'); add_output('ajax_imap_folder_display', 'filter_folder_page', true); /* search results */ setup_base_ajax_page('ajax_imap_search', 'core'); add_handler('ajax_imap_search', 'message_list_type', true, 'core'); add_handler('ajax_imap_search', 'imap_message_list_type', true); add_handler('ajax_imap_search', 'load_imap_servers_from_config', true); add_handler('ajax_imap_search', 'imap_oauth2_token_check', true); add_handler('ajax_imap_search', 'close_session_early', true, 'core'); add_handler('ajax_imap_search', 'imap_search', true); add_output('ajax_imap_search', 'filter_imap_search', true); /* combined inbox */ setup_base_ajax_page('ajax_imap_combined_inbox', 'core'); add_handler('ajax_imap_combined_inbox', 'message_list_type', true, 'core'); add_handler('ajax_imap_combined_inbox', 'imap_message_list_type', true); add_handler('ajax_imap_combined_inbox', 'load_imap_servers_from_config', true); add_handler('ajax_imap_combined_inbox', 'imap_oauth2_token_check', true); add_handler('ajax_imap_combined_inbox', 'close_session_early', true, 'core'); add_handler('ajax_imap_combined_inbox', 'imap_combined_inbox', true); add_output('ajax_imap_combined_inbox', 'filter_combined_inbox', true); /* all email section */ setup_base_ajax_page('ajax_imap_all_email', 'core'); add_handler('ajax_imap_all_email', 'message_list_type', true, 'core'); add_handler('ajax_imap_all_email', 'imap_message_list_type', true); add_handler('ajax_imap_all_email', 'load_imap_servers_from_config', true); add_handler('ajax_imap_all_email', 'imap_oauth2_token_check', true); add_handler('ajax_imap_all_email', 'close_session_early', true, 'core'); add_handler('ajax_imap_all_email', 'imap_combined_inbox', true); add_output('ajax_imap_all_email', 'filter_all_email', true); /* allowed input */ return array('allowed_pages' => array('ajax_imap_debug', 'ajax_imap_status', 'ajax_imap_unread', 'ajax_imap_flagged', 'ajax_imap_folder_expand', 'ajax_imap_folder_display', 'ajax_imap_combined_inbox', 'ajax_imap_search', 'ajax_unread_count', 'ajax_imap_message_content', 'ajax_imap_save_folder_state', 'ajax_imap_message_action', 'ajax_imap_delete_message', 'ajax_imap_flag_message', 'ajax_imap_update_combined_source', 'ajax_imap_mark_as_read'), 'allowed_output' => array('imap_connect_status' => array(FILTER_SANITIZE_STRING, false), 'imap_connect_time' => array(FILTER_SANITIZE_STRING, false), 'imap_detail_display' => array(FILTER_UNSAFE_RAW, false), 'imap_status_display' => array(FILTER_UNSAFE_RAW, false), 'imap_status_server_id' => array(FILTER_VALIDATE_INT, false), 'imap_expanded_folder_path' => array(FILTER_SANITIZE_STRING, false), 'imap_expanded_folder_formatted' => array(FILTER_UNSAFE_RAW, false), 'imap_server_ids' => array(FILTER_SANITIZE_STRING, false), 'imap_server_id' => array(FILTER_VALIDATE_INT, false), 'combined_inbox_server_ids' => array(FILTER_SANITIZE_STRING, false), 'page_links' => array(FILTER_UNSAFE_RAW, false), 'imap_delete_error' => array(FILTER_VALIDATE_BOOLEAN, false)), 'allowed_get' => array('imap_server_id' => FILTER_VALIDATE_INT, 'imap_download_message' => FILTER_VALIDATE_BOOLEAN, 'imap_msg_part' => FILTER_SANITIZE_STRING), 'allowed_post' => array('server_port' => FILTER_VALIDATE_INT, 'server' => FILTER_SANITIZE_STRING, 'username' => FILTER_SANITIZE_STRING, 'password' => FILTER_SANITIZE_STRING, 'imap_server_id' => FILTER_VALIDATE_INT, 'imap_server_ids' => FILTER_SANITIZE_STRING, 'imap_user' => FILTER_SANITIZE_STRING, 'imap_pass' => FILTER_SANITIZE_STRING, 'imap_delete' => FILTER_SANITIZE_STRING, 'imap_connect' => FILTER_SANITIZE_STRING, 'imap_remember' => FILTER_VALIDATE_INT, 'imap_folder_ids' => FILTER_SANITIZE_STRING, 'imap_forget' => FILTER_SANITIZE_STRING, 'imap_save' => FILTER_SANITIZE_STRING, 'submit_imap_server' => FILTER_SANITIZE_STRING, 'new_imap_address' => FILTER_SANITIZE_STRING, 'new_imap_hidden' => FILTER_VALIDATE_BOOLEAN, 'new_imap_port' => FILTER_VALIDATE_INT, 'new_imap_name' => FILTER_SANITIZE_STRING, 'tls' => FILTER_VALIDATE_BOOLEAN, 'folder' => FILTER_SANITIZE_STRING, 'force_update' => FILTER_VALIDATE_BOOLEAN, 'imap_folder_state' => FILTER_UNSAFE_RAW, 'imap_msg_uid' => FILTER_VALIDATE_INT, 'imap_msg_part' => FILTER_SANITIZE_STRING, 'imap_prefetch' => FILTER_VALIDATE_BOOLEAN, 'hide_imap_server' => FILTER_VALIDATE_BOOLEAN, 'imap_flag_state' => FILTER_SANITIZE_STRING, 'combined_source_state' => FILTER_VALIDATE_INT, 'list_path' => FILTER_SANITIZE_STRING));
add_handler('message', 'add_feeds_to_page_data', true, 'feeds', 'load_feeds_from_config', 'after'); /* message view */ add_handler('ajax_feed_item_content', 'login', false, 'core'); add_handler('ajax_feed_item_content', 'load_user_data', true, 'core'); add_handler('ajax_feed_item_content', 'language', true, 'core'); add_handler('ajax_feed_item_content', 'load_feeds_from_config', true); add_handler('ajax_feed_item_content', 'feed_item_content', true); add_handler('ajax_feed_item_content', 'save_feeds', true); add_handler('ajax_feed_item_content', 'date', true, 'core'); add_handler('ajax_feed_item_content', 'http_headers', true, 'core'); add_output('ajax_feed_item_content', 'filter_feed_item_content', true); add_handler('ajax_feed_debug', 'login', false, 'core'); add_handler('ajax_feed_debug', 'load_user_data', true, 'core'); add_handler('ajax_feed_debug', 'language', true, 'core'); add_handler('ajax_feed_debug', 'load_feeds_from_config', true); add_handler('ajax_feed_debug', 'delete_feed', true); add_handler('ajax_feed_debug', 'feed_connect', true); add_handler('ajax_feed_debug', 'save_feeds', true); add_handler('ajax_feed_debug', 'save_user_data', true, 'core'); add_handler('ajax_feed_debug', 'date', true, 'core'); add_handler('ajax_feed_debug', 'http_headers', true, 'core'); add_handler('ajax_feed_status', 'login', false, 'core'); add_handler('ajax_feed_status', 'load_user_data', true, 'core'); add_handler('ajax_feed_status', 'language', true, 'core'); add_handler('ajax_feed_status', 'load_feeds_from_config', true); add_handler('ajax_feed_status', 'close_session_early', true, 'core'); add_handler('ajax_feed_status', 'feed_status', true); add_handler('ajax_feed_status', 'date', true, 'core'); add_handler('ajax_feed_status', 'http_headers', true, 'core'); add_output('ajax_feed_status', 'filter_feed_status_data', true); return array('allowed_pages' => array('ajax_feed_combined_inbox', 'ajax_feed_list_display', 'ajax_feed_item_content', 'ajax_feed_combined', 'ajax_feed_debug', 'ajax_feed_status'), 'allowed_output' => array('feed_connect_status' => array(FILTER_SANITIZE_STRING, false), 'feed_connect_time' => array(FILTER_SANITIZE_STRING, false), 'feed_detail_display' => array(FILTER_UNSAFE_RAW, false), 'feed_status_display' => array(FILTER_UNSAFE_RAW, false), 'feed_status_server_id' => array(FILTER_VALIDATE_INT, false), 'feed_server_ids' => array(FILTER_SANITIZE_STRING, false), 'feed_msg_headers' => array(FILTER_UNSAFE_RAW, false), 'feed_msg_text' => array(FILTER_UNSAFE_RAW, false)), 'allowed_post' => array('feed_id' => FILTER_VALIDATE_INT, 'delete_feed' => FILTER_VALIDATE_INT, 'feed_connect' => FILTER_VALIDATE_INT, 'feed_server_ids' => FILTER_SANITIZE_STRING, 'submit_feed' => FILTER_SANITIZE_STRING, 'new_feed_name' => FILTER_SANITIZE_STRING, 'feed_delete' => FILTER_VALIDATE_INT, 'new_feed_address' => FILTER_SANITIZE_STRING, 'unread_exclude_feeds' => FILTER_VALIDATE_INT, 'feed_list_path' => FILTER_SANITIZE_STRING, 'feed_uid' => FILTER_SANITIZE_STRING, 'feed_since' => FILTER_SANITIZE_STRING, 'feed_limit' => FILTER_VALIDATE_INT, 'feed_search' => FILTER_VALIDATE_INT));
add_handler('servers', 'load_smtp_servers_from_config', true, 'smtp', 'language', 'after'); add_handler('servers', 'process_add_smtp_server', true, 'smtp', 'load_smtp_servers_from_config', 'after'); add_handler('servers', 'add_smtp_servers_to_page_data', true, 'smtp', 'process_add_smtp_server', 'after'); add_handler('servers', 'save_smtp_servers', true, 'smtp', 'add_smtp_servers_to_page_data', 'after'); add_output('servers', 'add_smtp_server_dialog', true, 'smtp', 'server_content_start', 'after'); add_output('servers', 'display_configured_smtp_servers', true, 'smtp', 'add_smtp_server_dialog', 'after'); add_handler('settings', 'process_compose_type', true, 'smtp', 'save_user_settings', 'before'); add_output('settings', 'compose_type_setting', true, 'smtp', 'start_general_settings', 'after'); /* ajax server setup callback data */ add_handler('ajax_smtp_debug', 'login', false, 'core'); add_handler('ajax_smtp_debug', 'load_user_data', true, 'core'); add_handler('ajax_smtp_debug', 'load_smtp_servers_from_config', true); add_handler('ajax_smtp_debug', 'add_smtp_servers_to_page_data', true); add_handler('ajax_smtp_debug', 'smtp_connect', true); add_handler('ajax_smtp_debug', 'smtp_delete', true); add_handler('ajax_smtp_debug', 'smtp_forget', true); add_handler('ajax_smtp_debug', 'smtp_save', true); add_handler('ajax_smtp_debug', 'save_smtp_servers', true); add_handler('ajax_smtp_debug', 'save_user_data', true, 'core'); add_handler('ajax_smtp_debug', 'date', true, 'core'); add_handler('ajax_smtp_debug', 'http_headers', true, 'core'); /* save draft ajax request */ add_handler('ajax_smtp_save_draft', 'login', false, 'core'); add_handler('ajax_smtp_save_draft', 'load_user_data', true, 'core'); add_handler('ajax_smtp_save_draft', 'smtp_save_draft', true); add_handler('ajax_smtp_save_draft', 'close_session_early', true, 'core'); add_handler('ajax_smtp_save_draft', 'date', true, 'core'); add_handler('ajax_smtp_save_draft', 'http_headers', true, 'core'); /* folder list link */ add_output('ajax_hm_folders', 'compose_page_link', true, 'smtp', 'logout_menu_item', 'before'); return array('allowed_pages' => array('ajax_smtp_debug', 'ajax_smtp_save_draft'), 'allowed_get' => array('reply' => FILTER_VALIDATE_INT, 'forward' => FILTER_VALIDATE_INT), 'allowed_post' => array('smtp_compose_type_setting' => FILTER_VALIDATE_INT, 'new_smtp_name' => FILTER_SANITIZE_STRING, 'new_smtp_address' => FILTER_SANITIZE_STRING, 'new_smtp_port' => FILTER_SANITIZE_STRING, 'smtp_connect' => FILTER_VALIDATE_INT, 'smtp_forget' => FILTER_VALIDATE_INT, 'smtp_save' => FILTER_VALIDATE_INT, 'smtp_delete' => FILTER_VALIDATE_INT, 'smtp_send' => FILTER_VALIDATE_INT, 'submit_smtp_server' => FILTER_SANITIZE_STRING, 'smtp_server_id' => FILTER_VALIDATE_INT, 'smtp_user' => FILTER_SANITIZE_STRING, 'smtp_pass' => FILTER_SANITIZE_STRING, 'compose_to' => FILTER_UNSAFE_RAW, 'compose_body' => FILTER_UNSAFE_RAW, 'compose_subject' => FILTER_SANITIZE_STRING, 'draft_body' => FILTER_UNSAFE_RAW, 'draft_subject' => FILTER_SANITIZE_STRING, 'draft_to' => FILTER_UNSAFE_RAW));
<?php if (!defined('DEBUG_MODE')) { die; } handler_source('themes'); output_source('themes'); add_module_to_all_pages('handler', 'load_theme', true, 'themes', 'load_user_data', 'after'); add_module_to_all_pages('output', 'theme_css', true, 'themes', 'header_css', 'after'); add_handler('ajax_hm_folders', 'load_theme', true, 'themes', 'load_user_data', 'after'); add_handler('ajax_imap_folder_expand', 'load_theme', true, 'themes', 'load_user_data', 'after'); add_handler('settings', 'process_theme_setting', true, 'themes', 'save_user_settings', 'before'); add_output('settings', 'theme_setting', true, 'feeds', 'language_setting', 'after'); return array('allowed_post' => array('theme_setting' => FILTER_SANITIZE_STRING));