Beispiel #1
0
 function Admin()
 {
     global $IN, $LANG, $SESS, $LOG, $DSP;
     // This flag determines if a user can edit categories from the publish page.
     $category_exception = ($IN->GBL('M') == 'blog_admin' and in_array($IN->GBL('P'), array('category_editor', 'edit_category', 'update_category', 'del_category_conf', 'del_category', 'cat_order')) and $IN->GBL('Z') == 1) ? TRUE : FALSE;
     if ($category_exception == FALSE and !$DSP->allowed_group('can_access_admin') and $IN->GBL('P', 'GET') != 'save_ping_servers') {
         return $DSP->no_access_message();
     }
     switch ($IN->GBL('M')) {
         case 'config_mgr':
             if (!$DSP->allowed_group('can_admin_preferences')) {
                 return $DSP->no_access_message();
             }
             switch ($IN->GBL('P')) {
                 case 'update_cfg':
                     $this->update_config_prefs();
                     break;
                 case 'member_cfg':
                     $this->member_config_manager();
                     break;
                 default:
                     $this->config_manager();
                     break;
             }
             break;
         case 'members':
             // Instantiate the member administration class
             require PATH_CP . 'cp.members' . EXT;
             $MBR = new Members();
             switch ($IN->GBL('P')) {
                 case 'view_members':
                     $MBR->view_all_members();
                     break;
                 case 'mbr_conf':
                     $MBR->member_confirm();
                     break;
                 case 'mbr_del_conf':
                     $MBR->member_delete_confirm();
                     break;
                 case 'mbr_delete':
                     $MBR->member_delete();
                     break;
                 case 'resend_act_email':
                     $MBR->resend_activation_emails();
                     break;
                 case 'member_reg_form':
                     $MBR->new_member_profile_form();
                     break;
                 case 'register_member':
                     $MBR->create_member_profile();
                     break;
                 case 'mbr_group_manager':
                     $MBR->member_group_manager();
                     break;
                 case 'edit_mbr_group':
                     $MBR->edit_member_group_form();
                     break;
                 case 'update_mbr_group':
                     $MBR->update_member_group();
                     break;
                 case 'mbr_group_del_conf':
                     $MBR->delete_member_group_conf();
                     break;
                 case 'delete_mbr_group':
                     $MBR->delete_member_group();
                     break;
                 case 'member_banning':
                     $MBR->member_banning_forms();
                     break;
                 case 'save_ban_data':
                     $MBR->update_banning_data();
                     break;
                 case 'profile_fields':
                     $MBR->custom_profile_fields();
                     break;
                 case 'edit_field':
                     $MBR->edit_profile_field_form();
                     break;
                 case 'del_field_conf':
                     $MBR->delete_profile_field_conf();
                     break;
                 case 'delete_field':
                     $MBR->delete_profile_field();
                     break;
                 case 'edit_field_order':
                     $MBR->edit_field_order_form();
                     break;
                 case 'update_field_order':
                     $MBR->update_field_order();
                     break;
                 case 'update_profile_fields':
                     $MBR->update_profile_fields();
                     break;
                 case 'member_search':
                     $MBR->member_search_form();
                     break;
                 case 'do_member_search':
                     $MBR->do_member_search();
                     break;
                 case 'ip_search':
                     $MBR->ip_search_form();
                     break;
                 case 'do_ip_search':
                     $MBR->do_ip_search();
                     break;
                 case 'member_validation':
                     $MBR->member_validation();
                     break;
                 case 'validate_members':
                     $MBR->validate_members();
                     break;
                 case 'email_console_logs':
                     $MBR->email_console_logs();
                     break;
                 case 'view_email':
                     $MBR->view_email();
                     break;
                 case 'delete_email_console':
                     $MBR->delete_email_console_messages();
                     break;
                 case 'profile_templates':
                     $MBR->profile_templates();
                     break;
                 case 'list_templates':
                     $MBR->list_templates();
                     break;
                 case 'edit_template':
                     $MBR->edit_template();
                     break;
                 case 'save_template':
                     $MBR->save_template();
                     break;
                 case 'login_as_member':
                     $MBR->login_as_member();
                     break;
                 case 'do_login_as_member':
                     $MBR->do_login_as_member();
                     break;
                 default:
                     return FALSE;
                     break;
             }
             break;
         case 'sp_templ':
             // Instantiate the specialty templates class
             require PATH_CP . 'cp.specialty_tmp' . EXT;
             $SP = new Specialty_Templates();
             switch ($IN->GBL('P')) {
                 case 'mbr_notification_tmpl':
                     $SP->mbr_notification_tmpl();
                     break;
                 case 'edit_notification_tmpl':
                     $SP->edit_notification_tmpl();
                     break;
                 case 'update_notification_tmpl':
                     $SP->update_notification_tmpl();
                     break;
                 case 'offline_tmpl':
                     $SP->offline_template();
                     break;
                 case 'update_offline_template':
                     $SP->update_offline_template();
                     break;
                 case 'user_messages_tmpl':
                     $SP->user_messages_template();
                     break;
                 case 'update_user_messages_tmpl':
                     $SP->update_user_messages_template();
                     break;
             }
             break;
         case 'site_admin':
             if (!$DSP->allowed_group('can_admin_sites')) {
                 return $DSP->no_access_message();
             }
             // Instantiate the site administration class
             require PATH_CP . 'cp.sites' . EXT;
             $SA = new SitesAdmin();
             switch ($IN->GBL('P')) {
                 case 'sites_list':
                     $SA->sites_list();
                     break;
                 case 'new_site':
                     $SA->new_site_form();
                     break;
                 case 'edit_site':
                     $SA->edit_site_form();
                     break;
                 case 'update_site':
                     $SA->update_site();
                     break;
                 case 'delete_site':
                     $SA->delete_site();
                     break;
                 case 'delete_site_confirm':
                     $SA->delete_site_confirm();
                     break;
                 default:
                     $SA->sites_list();
                     break;
             }
             break;
         case 'blog_admin':
             if ($category_exception == FALSE and !$DSP->allowed_group('can_admin_weblogs') and $IN->GBL('P', 'GET') != 'save_ping_servers') {
                 return $DSP->no_access_message();
             }
             // Instantiate the publish administration class
             require PATH_CP . 'cp.publish_ad' . EXT;
             $PA = new PublishAdmin();
             switch ($IN->GBL('P')) {
                 case 'blog_list':
                     $PA->weblog_overview();
                     break;
                 case 'new_weblog':
                     $PA->new_weblog_form();
                     break;
                 case 'blog_prefs':
                     $PA->edit_blog_form();
                     break;
                 case 'group_prefs':
                     $PA->edit_group_form();
                     break;
                 case 'create_blog':
                     $PA->update_weblog_prefs();
                     break;
                 case 'update_preferences':
                     $PA->update_weblog_prefs();
                     break;
                 case 'delete_conf':
                     $PA->delete_weblog_conf();
                     break;
                 case 'delete':
                     $PA->delete_weblog();
                     break;
                 case 'categories':
                     $PA->category_overview();
                     break;
                 case 'cat_group_editor':
                     $PA->edit_category_group_form();
                     break;
                 case 'update_cat_group':
                     $PA->update_category_group();
                     break;
                 case 'cat_group_del_conf':
                     $PA->delete_category_group_conf();
                     break;
                 case 'delete_group':
                     $PA->delete_category_group();
                     break;
                 case 'category_editor':
                     $PA->category_manager();
                     break;
                 case 'update_category':
                     $PA->update_category();
                     break;
                 case 'edit_category':
                     $PA->edit_category_form();
                     break;
                 case 'cat_order':
                     $PA->change_category_order();
                     break;
                 case 'global_cat_order':
                     $PA->global_category_order();
                     break;
                 case 'del_category_conf':
                     $PA->delete_category_confirm();
                     break;
                 case 'del_category':
                     $PA->delete_category();
                     break;
                 case 'cat_field_group_edit':
                     $PA->category_field_group_manager();
                     break;
                 case 'del_cat_field_conf':
                     $PA->delete_category_field_confirm();
                     break;
                 case 'del_cat_field':
                     $PA->delete_category_field();
                     break;
                 case 'edit_cat_field':
                     $PA->edit_category_field_form();
                     break;
                 case 'edit_cat_field_order':
                     $PA->edit_category_field_order_form();
                     break;
                 case 'ud_cat_field_order':
                     $PA->update_category_field_order();
                     break;
                 case 'update_cat_fields':
                     $PA->update_category_fields();
                     break;
                 case 'statuses':
                     $PA->status_overview();
                     break;
                 case 'status_group_editor':
                     $PA->edit_status_group_form();
                     break;
                 case 'update_status_group':
                     $PA->update_status_group();
                     break;
                 case 'status_group_del_conf':
                     $PA->delete_status_group_conf();
                     break;
                 case 'delete_status_group':
                     $PA->delete_status_group();
                     break;
                 case 'status_editor':
                     $PA->status_manager();
                     break;
                 case 'update_status':
                     $PA->update_status();
                     break;
                 case 'edit_status':
                     $PA->edit_status_form();
                     break;
                 case 'del_status_conf':
                     $PA->delete_status_confirm();
                     break;
                 case 'del_status':
                     $PA->delete_status();
                     break;
                 case 'edit_status_order':
                     $PA->edit_status_order();
                     break;
                 case 'update_status_order':
                     $PA->update_status_order();
                     break;
                 case 'custom_fields':
                     $PA->field_overview();
                     break;
                 case 'update_field_group':
                     $PA->update_field_group();
                     break;
                 case 'del_field_group_conf':
                     $PA->delete_field_group_conf();
                     break;
                 case 'delete_field_group':
                     $PA->delete_field_group();
                     break;
                 case 'field_editor':
                     $PA->field_manager();
                     break;
                 case 'edit_field':
                     $PA->edit_field_form();
                     break;
                 case 'update_weblog_fields':
                     $PA->update_weblog_fields();
                     break;
                 case 'field_group_editor':
                     $PA->edit_field_group_form();
                     break;
                 case 'del_field_conf':
                     $PA->delete_field_conf();
                     break;
                 case 'delete_field':
                     $PA->delete_field();
                     break;
                 case 'edit_field_order':
                     $PA->edit_field_order_form();
                     break;
                 case 'update_field_order':
                     $PA->update_field_order();
                     break;
                 case 'edit_fmt_buttons':
                     $PA->edit_formatting_buttons();
                     break;
                 case 'update_fmt_buttons':
                     $PA->update_formatting_buttons();
                     break;
                 case 'html_buttons':
                     $PA->html_buttons();
                     break;
                 case 'save_html_buttons':
                     $PA->save_html_buttons();
                     break;
                 case 'ping_servers':
                     $PA->ping_servers();
                     break;
                 case 'save_ping_servers':
                     $PA->save_ping_servers();
                     break;
                 case 'upload_prefs':
                     $PA->file_upload_preferences();
                     break;
                 case 'edit_upload_pref':
                     $PA->edit_upload_preferences_form();
                     break;
                 case 'update_upload_prefs':
                     $PA->update_upload_preferences();
                     break;
                 case 'del_upload_pref_conf':
                     $PA->delete_upload_preferences_conf();
                     break;
                 case 'del_upload_pref':
                     $PA->delete_upload_preferences();
                     break;
                 default:
                     return FALSE;
                     break;
             }
             break;
         case 'utilities':
             if (!$DSP->allowed_group('can_admin_utilities')) {
                 return $DSP->no_access_message();
             }
             // We handle the pMachine import via a different class,
             // so we'll test for that separately
             if ($IN->GBL('P') == 'pm_import') {
                 require PATH_CP . 'cp.pm_import' . EXT;
                 $PMI = new PM_Import();
                 return;
             }
             if ($IN->GBL('P') == 'mt_import') {
                 require PATH_CP . 'cp.mt_import' . EXT;
                 $MT = new MT_Import();
                 return;
             }
             if ($IN->GBL('P') == 'member_import') {
                 require PATH_CP . 'cp.member_import' . EXT;
                 $MI = new Member_Import();
                 return;
             }
             require PATH_CP . 'cp.utilities' . EXT;
             switch ($IN->GBL('P')) {
                 case 'view_logs':
                     $LOG->view_logs();
                     break;
                 case 'clear_cplogs':
                     $LOG->clear_cp_logs();
                     break;
                 case 'view_search_log':
                     $LOG->view_search_log();
                     break;
                 case 'view_throttle_log':
                     $LOG->view_throttle_log();
                     break;
                 case 'blacklist_ips':
                     $LOG->blacklist_ips();
                     break;
                 case 'clear_search_log':
                     $LOG->clear_search_log();
                     break;
                 case 'clear_cache_form':
                     Utilities::clear_cache_form();
                     break;
                 case 'clear_caching':
                     Utilities::clear_caching();
                     break;
                 case 'run_query':
                     Utilities::sql_manager('run_query');
                     break;
                 case 'sql_query':
                     Utilities::sql_query_form();
                     break;
                     //case 'sql_backup'			: Utilities::sql_backup();
                     //	break;
                     //case 'do_sql_backup'		: Utilities::do_sql_backup();
                     //	break;
                 //case 'sql_backup'			: Utilities::sql_backup();
                 //	break;
                 //case 'do_sql_backup'		: Utilities::do_sql_backup();
                 //	break;
                 case 'view_database':
                     Utilities::view_database();
                     break;
                 case 'table_action':
                     Utilities::run_table_action();
                     break;
                 case 'sandr':
                     Utilities::search_and_replace_form();
                     break;
                 case 'recount_stats':
                     Utilities::recount_statistics();
                     break;
                 case 'recount_prefs':
                     Utilities::recount_preferences_form();
                     break;
                 case 'set_recount_prefs':
                     Utilities::set_recount_prefs();
                     break;
                 case 'do_recount':
                     Utilities::do_recount();
                     break;
                 case 'do_stats_recount':
                     Utilities::do_stats_recount();
                     break;
                 case 'prune':
                     Utilities::data_pruning();
                     break;
                 case 'member_pruning':
                     Utilities::member_pruning();
                     break;
                 case 'prune_member_conf':
                     Utilities::prune_member_confirm();
                     break;
                 case 'prune_members':
                     Utilities::prune_members();
                     break;
                 case 'entry_pruning':
                     Utilities::entry_pruning();
                     break;
                 case 'prune_entry_conf':
                     Utilities::prune_entry_confirm();
                     break;
                 case 'prune_entries':
                     Utilities::prune_entries();
                     break;
                 case 'comment_pruning':
                     Utilities::comment_pruning();
                     break;
                 case 'prune_comment_conf':
                     Utilities::prune_comment_confirmation();
                     break;
                 case 'prune_comments':
                     Utilities::prune_comments();
                     break;
                 case 'trackback_pruning':
                     Utilities::trackback_pruning();
                     break;
                 case 'prune_trackback_conf':
                     Utilities::prune_trackback_confirmation();
                     break;
                 case 'prune_trackbacks':
                     Utilities::prune_trackbacks();
                     break;
                     /* Someday, oh someday...
                     		 case 'pm_pruning'			: Utilities::pm_pruning();
                     			break;
                     		 case 'prune_pm_conf'		: Utilities::prune_pm_confirmation();
                     			break;
                     		 case 'prune_pms'			: Utilities::prune_pms();
                     			break;
                     		 */
                 /* Someday, oh someday...
                 		 case 'pm_pruning'			: Utilities::pm_pruning();
                 			break;
                 		 case 'prune_pm_conf'		: Utilities::prune_pm_confirmation();
                 			break;
                 		 case 'prune_pms'			: Utilities::prune_pms();
                 			break;
                 		 */
                 case 'topic_pruning':
                     Utilities::topic_pruning();
                     break;
                 case 'prune_topic_conf':
                     Utilities::prune_topic_confirmation();
                     break;
                 case 'prune_topics':
                     Utilities::prune_topics();
                     break;
                 case 'run_sandr':
                     Utilities::search_and_replace();
                     break;
                 case 'php_info':
                     Utilities::php_info();
                     break;
                 case 'sql_manager':
                     Utilities::sql_info();
                     break;
                 case 'sql_status':
                     Utilities::sql_manager('status');
                     break;
                 case 'sql_sysvars':
                     Utilities::sql_manager('sysvars');
                     break;
                 case 'sql_plist':
                     Utilities::sql_manager('plist');
                     break;
                 case 'plugin_manager':
                     Utilities::plugin_manager();
                     break;
                 case 'plugin_info':
                     Utilities::plugin_info();
                     break;
                 case 'plugin_remove_conf':
                     Utilities::plugin_remove_confirm();
                     break;
                 case 'plugin_remove':
                     Utilities::plugin_remove();
                     break;
                 case 'plugin_install':
                     Utilities::plugin_install('file');
                     break;
                 case 'import_utilities':
                     Utilities::import_utilities();
                     break;
                 case 'trans_menu':
                     Utilities::translate_select();
                     break;
                 case 'translate':
                     Utilities::translate();
                     break;
                 case 'save_translation':
                     Utilities::save_translation();
                     break;
                 case 'extensions_manager':
                     Utilities::extensions_manager();
                     break;
                 case 'toggle_extension_confirm':
                     Utilities::toggle_extension_confirm();
                     break;
                 case 'toggle_extension':
                     Utilities::toggle_extension();
                     break;
                 case 'extension_settings':
                     Utilities::extension_settings();
                     break;
                 case 'save_extension_settings':
                     Utilities::save_extension_settings();
                     break;
                 default:
                     return FALSE;
                     break;
             }
             break;
         default:
             $this->admin_home_page();
             break;
     }
 }
Beispiel #2
0
 /** -----------------------------------
     /**  Ping servers
     /** -----------------------------------*/
 function my_ping_servers()
 {
     global $IN, $LANG, $FNS, $DSP;
     if (FALSE === ($id = $this->auth_id())) {
         return $DSP->no_access_message();
     }
     // Is the user authorized to access the publish page?
     // And does the user have at least one blog assigned?
     // If not, show the no access message
     if (!$DSP->allowed_group('can_access_publish') || !count($FNS->fetch_assigned_weblogs()) > 0) {
         return $DSP->no_access_message();
     }
     $message = $IN->GBL('U', 'GET') ? $DSP->qdiv('successBox', $DSP->qdiv('success', NBS . $LANG->line('pingservers_updated'))) : '';
     require PATH_CP . 'cp.publish_ad' . EXT;
     $PA = new PublishAdmin();
     $title = $LANG->line('ping_servers');
     return $this->account_wrapper($title, $title, $PA->ping_servers($message, $id));
 }