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));
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)));
<?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_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); 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', 'ajax_reset_search', '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('payload' => FILTER_SANITIZE_STRING, '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));