function spa_block_admin() { global $wp_roles, $current_user; # Is this the admin interface? if (strstr(strtolower($_SERVER['REQUEST_URI']), '/wp-admin/') && !strstr(strtolower($_SERVER['REQUEST_URI']), 'async-upload.php') && !strstr(strtolower($_SERVER['REQUEST_URI']), 'admin-ajax.php')) { # get the user level and required level to access admin pages $sfblock = sp_get_option('sfblockadmin'); if ($sfblock['blockadmin'] && !empty($sfblock['blockroles'])) { $role_matches = array_intersect_key($sfblock['blockroles'], array_flip($current_user->roles)); $access = in_array(1, $role_matches); # block admin if required $is_moderator = sp_get_member_item($current_user->ID, 'moderator'); if (!sp_current_user_can('SPF Manage Options') && !sp_current_user_can('SPF Manage Forums') && !sp_current_user_can('SPF Manage Components') && !sp_current_user_can('SPF Manage User Groups') && !sp_current_user_can('SPF Manage Permissions') && !sp_current_user_can('SPF Manage Tags') && !sp_current_user_can('SPF Manage Users') && !sp_current_user_can('SPF Manage Profiles') && !sp_current_user_can('SPF Manage Admins') && !sp_current_user_can('SPF Manage Toolbox') && !$is_moderator && !$access) { if ($sfblock['blockprofile']) { $redirect = sp_url('profile'); } else { $redirect = $sfblock['blockredirect']; } wp_redirect($redirect, 302); } } } }
<?php /* Simple:Press Admin Profiles $LastChangedDate: 2014-06-20 20:47:00 -0700 (Fri, 20 Jun 2014) $ $Rev: 11582 $ */ if (preg_match('#' . basename(__FILE__) . '#', $_SERVER['PHP_SELF'])) { die('Access denied - you cannot directly call this file'); } # Check Whether User Can Manage Profiles if (!sp_current_user_can('SPF Manage Profiles')) { spa_etext('Access denied - you do not have permission'); die; } global $spStatus; include_once SF_PLUGIN_DIR . '/admin/panel-profiles/spa-profiles-display.php'; include_once SF_PLUGIN_DIR . '/admin/panel-profiles/support/spa-profiles-prepare.php'; include_once SF_PLUGIN_DIR . '/admin/library/spa-tab-support.php'; if ($spStatus != 'ok') { include_once SPLOADINSTALL; die; } global $adminhelpfile; $adminhelpfile = 'admin-profiles'; # -------------------------------------------------------------------- $tab = isset($_GET['tab']) ? $_GET['tab'] : 'options'; spa_panel_header(); spa_render_profiles_panel($tab); spa_panel_footer();
spa_admin_ahah_support(); global $spStatus; if ($spStatus != 'ok') { echo $spStatus; die; } include_once SF_PLUGIN_DIR . '/admin/panel-forums/spa-forums-display.php'; include_once SF_PLUGIN_DIR . '/admin/panel-forums/support/spa-forums-prepare.php'; include_once SF_PLUGIN_DIR . '/admin/panel-forums/support/spa-forums-save.php'; include_once SF_PLUGIN_DIR . '/admin/library/spa-tab-support.php'; global $adminhelpfile; $adminhelpfile = 'admin-forums'; # -------------------------------------------------------------------- # ---------------------------------- # Check Whether User Can Manage Forums if (!sp_current_user_can('SPF Manage Forums')) { spa_etext('Access denied - you do not have permission'); die; } if (isset($_GET['loadform'])) { spa_render_forums_container($_GET['loadform']); die; } if (isset($_GET['saveform'])) { if ($_GET['saveform'] == 'creategroup') { echo spa_save_forums_create_group(); die; } if ($_GET['saveform'] == 'createforum') { echo spa_save_forums_create_forum(); die;
<?php /* Simple:Press Component Specials $LastChangedDate: 2014-06-20 20:47:00 -0700 (Fri, 20 Jun 2014) $ $Rev: 11582 $ */ if (preg_match('#' . basename(__FILE__) . '#', $_SERVER['PHP_SELF'])) { die('Access denied - you cannot directly call this file'); } spa_admin_ahah_support(); # Check Whether User Can Manage Components if (!sp_current_user_can('SPF Manage Components')) { spa_etext('Access denied - you do not have permission'); die; } global $spPaths; $action = $_GET['action']; if ($action == 'del_rank') { $key = sp_esc_int($_GET['key']); # remove the forum rank $sql = 'DELETE FROM ' . SFMETA . " WHERE meta_type='forum_rank' AND meta_id='{$key}'"; spdb_query($sql); } if ($action == 'del_specialrank') { $key = sp_esc_int($_GET['key']); $specialRank = sp_get_sfmeta('special_rank', false, $key); # remove members rank first spdb_query('DELETE FROM ' . SFSPECIALRANKS . ' WHERE special_rank="' . $specialRank[0]['meta_key'] . '"'); # remove the forum rank
function sp_process_template() { global $spVars, $spGlobals, $spThisUser, $spNewPosts; # grab the pageview, checking to see if its a search page $pageview = $spVars['pageview']; # determine page template to load switch ($pageview) { case 'group': $tempName = sp_process_group_view(); break; case 'forum': $tempName = sp_process_forum_view(); break; case 'topic': $tempName = sp_process_topic_view(); break; case 'search': $tempName = sp_process_search_view(); break; case 'members': $tempName = sp_process_members_view(); break; case 'profileedit': $tempName = sp_process_profileedit_view(); break; case 'profileshow': $tempName = sp_process_profileshow_view(); break; case 'newposts': $tempName = sp_process_newposts_view(); break; default: $tempName = sp_process_default_view($pageview); break; } # allow plugins/themes access to the template name $tempName = apply_filters('sph_TemplateName', $tempName, $pageview); # allow output prior to SP display do_action('sph_BeforeDisplayStart', $pageview, $tempName); # SP display starts here # Any control data item inspection needed if (sp_current_user_can('SPF Manage Toolbox') && !empty($spThisUser->inspect)) { sp_display_inspector('control', ''); } # forum top anchor echo '<a id="spForumTop"></a>'; # Define the main forum container echo "\n\n<!-- Simple:Press display start -->\n\n"; echo '<div id="spMainContainer">'; # Create the sliding panel div needed for mobile display echo "<div id='spMobilePanel'></div>"; # allow output before the SP display do_action('sph_AfterDisplayStart', $pageview, $tempName); # load the pageview template if valid sp_load_template($tempName); # allow output after the SP display do_action('sph_BeforeDisplayEnd', $pageview, $tempName); # Display any queued messages sp_render_queued_notification(); echo '</div>'; echo "\n\n<!-- Simple:Press display end -->\n\n"; # forum bottom anchor echo '<a id="spForumBottom"></a>'; # SP display ends here # allow output after the SP display do_action('sph_AfterDisplayEnd', $pageview, $tempName); # Post display processing sp_post_display_processing($pageview); }
<?php /* Simple:Press Admin User Groups $LastChangedDate: 2014-06-20 20:47:00 -0700 (Fri, 20 Jun 2014) $ $Rev: 11582 $ */ if (preg_match('#' . basename(__FILE__) . '#', $_SERVER['PHP_SELF'])) { die('Access denied - you cannot directly call this file'); } # Check Whether User Can Manage User Groups if (!sp_current_user_can('SPF Manage User Groups')) { spa_etext('Access denied - you do not have permission'); die; } global $spStatus; include_once SF_PLUGIN_DIR . '/admin/panel-usergroups/spa-usergroups-display.php'; include_once SF_PLUGIN_DIR . '/admin/panel-usergroups/support/spa-usergroups-prepare.php'; include_once SF_PLUGIN_DIR . '/admin/library/spa-tab-support.php'; if ($spStatus != 'ok') { include_once SPLOADINSTALL; die; } global $adminhelpfile; $adminhelpfile = 'admin-usergroups'; # -------------------------------------------------------------------- $tab = isset($_GET['tab']) ? $_GET['tab'] : 'usergroups'; spa_panel_header(); spa_render_usergroups_panel($tab); spa_panel_footer();
spa_admin_ahah_support(); global $spStatus; if ($spStatus != 'ok') { echo $spStatus; die; } include_once SF_PLUGIN_DIR . '/admin/panel-options/spa-options-display.php'; include_once SF_PLUGIN_DIR . '/admin/panel-options/support/spa-options-prepare.php'; include_once SF_PLUGIN_DIR . '/admin/panel-options/support/spa-options-save.php'; include_once SF_PLUGIN_DIR . '/admin/library/spa-tab-support.php'; global $adminhelpfile; $adminhelpfile = 'admin-options'; # -------------------------------------------------------------------- # ---------------------------------- # Check Whether User Can Manage Options if (!sp_current_user_can('SPF Manage Options')) { spa_etext('Access denied - you do not have permission'); die; } if (isset($_GET['loadform'])) { spa_render_options_container($_GET['loadform']); die; } if (isset($_GET['saveform'])) { switch ($_GET['saveform']) { case 'global': echo spa_save_global_data(); break; case 'display': echo spa_save_display_data(); break;
<?php /* Simple:Press Admin Themes $LastChangedDate: 2014-06-20 20:47:00 -0700 (Fri, 20 Jun 2014) $ $Rev: 11582 $ */ if (preg_match('#' . basename(__FILE__) . '#', $_SERVER['PHP_SELF'])) { die('Access denied - you cannot directly call this file'); } # Check Whether User Can Manage Admins global $spStatus; if (!sp_current_user_can('SPF Manage Themes')) { spa_etext('Access denied - you do not have permission'); die; } include_once SF_PLUGIN_DIR . '/admin/panel-themes/spa-themes-display.php'; include_once SF_PLUGIN_DIR . '/admin/panel-themes/support/spa-themes-prepare.php'; include_once SF_PLUGIN_DIR . '/admin/panel-themes/support/spa-themes-save.php'; include_once SF_PLUGIN_DIR . '/admin/library/spa-tab-support.php'; if ($spStatus != 'ok') { include_once SPLOADINSTALL; die; } global $adminhelpfile; $adminhelpfile = 'admin-themes'; # -------------------------------------------------------------------- $tab = isset($_GET['tab']) ? $_GET['tab'] : 'theme-list'; spa_panel_header(); spa_render_themes_panel($tab);
function spa_setup_admin_menu() { global $sfadminpanels, $sfactivepanels, $sfatooltips; # Get correct tooltips file $lang = spa_get_language_code(); if (empty($lang)) { $lang = 'en'; } $ttpath = SPHELP . 'admin/tooltips/admin-menu-tips-' . $lang . '.php'; if (file_exists($ttpath) == false) { $ttpath = SPHELP . 'admin/tooltips/admin-menu-tips-en.php'; } if (file_exists($ttpath)) { include_once $ttpath; } $sfadminpanels = $sfactivepanels = array(); /** * admin panel array elements * 0 - panel name * 1 - spf capability to view * 2 - admin file * 3 - tool tip * 4 - icon * 5 - loader function * 6 - subpanels * 7 - display in wp admin left side menu (should be false for user plugins) */ $forms = array(spa_text('Manage Groups And Forums') => array('forums' => 'sfreloadfb'), spa_text('Order Groups and Forums') => array('ordering' => 'sfreloadfo'), spa_text('Create New Group') => array('creategroup' => ''), spa_text('Create New Forum') => array('createforum' => ''), spa_text('Custom Icons') => array('customicons' => 'sfreloadci'), spa_text('Featured Images') => array('featuredimages' => 'sfreloadfi'), spa_text('Add Global Permission Set') => array('globalperm' => ''), spa_text('Delete All Permission Sets') => array('removeperms' => ''), spa_text('Merge Forums') => array('mergeforums' => 'sfreloadmf'), spa_text('Global RSS Settings') => array('globalrss' => 'sfreloadfd')); $sfadminpanels[] = array(spa_text('Forums'), 'SPF Manage Forums', '/panel-forums/spa-forums.php', $sfatooltips['forums'], 'icon-Forums', SFHOMEURL . 'index.php?sp_ahah=forums-loader&sfnonce=' . wp_create_nonce('forum-ahah'), $forms, true); $sfactivepanels['forums'] = 0; $forms = array(spa_text('Global Settings') => array('global' => 'sfreloadog'), spa_text('General Display Settings') => array('display' => ''), spa_text('Content Settings') => array('content' => ''), spa_text('Member Settings') => array('members' => 'sfreloadms'), spa_text('Email Settings') => array('email' => '')); $sfadminpanels[] = array(spa_text('Options'), 'SPF Manage Options', '/panel-options/spa-options.php', $sfatooltips['options'], 'icon-Options', SFHOMEURL . 'index.php?sp_ahah=options-loader&sfnonce=' . wp_create_nonce('forum-ahah'), $forms, true); $sfactivepanels['options'] = 1; $forms = array(spa_text('Smileys') => array('smileys' => 'sfreloadsm'), spa_text('Login And Registration') => array('login' => ''), spa_text('SEO') => array('seo' => 'sfreloadse'), spa_text('Forum Ranks') => array('forumranks' => 'sfreloadfr'), spa_text('Custom Messages') => array('messages' => '')); $sfadminpanels[] = array(spa_text('Components'), 'SPF Manage Components', '/panel-components/spa-components.php', $sfatooltips['components'], 'icon-Components', SFHOMEURL . 'index.php?sp_ahah=components-loader&sfnonce=' . wp_create_nonce('forum-ahah'), $forms, true); $sfactivepanels['components'] = 2; $forms = array(spa_text('Manage User Groups') => array('usergroups' => 'sfreloadub'), spa_text('Create New User Group') => array('createusergroup' => ''), spa_text('Map Users to User Group') => array('mapusers' => 'sfreloadmu')); $sfadminpanels[] = array(spa_text('User Groups'), 'SPF Manage User Groups', '/panel-usergroups/spa-usergroups.php', $sfatooltips['usergroups'], 'icon-UserGroups', SFHOMEURL . 'index.php?sp_ahah=usergroups-loader&sfnonce=' . wp_create_nonce('forum-ahah'), $forms, true); $sfactivepanels['usergroups'] = 3; $forms = array(spa_text('Manage Permissions Sets') => array('permissions' => 'sfreloadpb'), spa_text('Add New Permission Set') => array('createperm' => ''), spa_text('Reset Permissions') => array('resetperms' => ''), spa_text('Add New Authorization') => array('newauth' => '')); $sfadminpanels[] = array(spa_text('Permissions'), 'SPF Manage Permissions', '/panel-permissions/spa-permissions.php', $sfatooltips['permissions'], 'icon-Permissions', SFHOMEURL . 'index.php?sp_ahah=permissions-loader&sfnonce=' . wp_create_nonce('forum-ahah'), $forms, true); $sfactivepanels['permissions'] = 4; $forms = array(spa_text('Page and Permalink') => array('page' => 'sfreloadpp'), spa_text('Storage Locations') => array('storage' => 'sfreloadsl'), spa_text('Language Translations') => array('language' => 'sfreloadla')); $sfadminpanels[] = array(spa_text('Integration'), 'SPF Manage Integration', '/panel-integration/spa-integration.php', $sfatooltips['integration'], 'icon-Integration', SFHOMEURL . 'index.php?sp_ahah=integration-loader&sfnonce=' . wp_create_nonce('forum-ahah'), $forms, true); $sfactivepanels['integration'] = 5; $forms = array(spa_text('Profile Options') => array('options' => ''), spa_text('Profile Tabs & Menus') => array('tabsmenus' => 'sfreloadptm'), spa_text('Avatars') => array('avatars' => 'sfreloadav')); $sfadminpanels[] = array(spa_text('Profiles'), 'SPF Manage Profiles', '/panel-profiles/spa-profiles.php', $sfatooltips['profiles'], 'icon-Profiles', SFHOMEURL . 'index.php?sp_ahah=profiles-loader&sfnonce=' . wp_create_nonce('forum-ahah'), $forms, true); $sfactivepanels['profiles'] = 6; if (sp_current_user_can('SPF Manage Admins')) { $forms = array(spa_text('Your Admin Options') => array('youradmin' => 'sfreloadao'), spa_text('Global Admin Options') => array('globaladmin' => ''), spa_text('Manage Admins') => array('manageadmin' => 'sfreloadma')); } else { $forms = array(spa_text('Your Admin Options') => array('youradmin' => 'sfreloadao')); } $sfadminpanels[] = array(spa_text('Admins'), 'SPF Manage Admins', '/panel-admins/spa-admins.php', $sfatooltips['admins'], 'icon-Admins', SFHOMEURL . 'index.php?sp_ahah=admins-loader&sfnonce=' . wp_create_nonce('forum-ahah'), $forms, true); $sfactivepanels['admins'] = 7; $forms = array(spa_text('Member Information') => array('member-info' => '')); $sfadminpanels[] = array(spa_text('Users'), 'SPF Manage Users', '/panel-users/spa-users.php', $sfatooltips['users'], 'icon-Users', SFHOMEURL . 'index.php?sp_ahah=users-loader&sfnonce=' . wp_create_nonce('forum-ahah'), $forms, true); $sfactivepanels['users'] = 8; $forms = array(spa_text('Available Plugins') => array('plugin-list' => 'sfreloadpl')); if (!is_multisite() || is_super_admin()) { $forms[spa_text('Plugin Uploader')] = array('plugin-upload' => ''); } $sfadminpanels[] = array(spa_text('Plugins'), 'SPF Manage Plugins', '/panel-plugins/spa-plugins.php', $sfatooltips['plugins'], 'icon-Plugins', SFHOMEURL . 'index.php?sp_ahah=plugins-loader&sfnonce=' . wp_create_nonce('forum-ahah'), $forms, true); $sfactivepanels['plugins'] = 9; $forms = array(spa_text('Available Themes') => array('theme-list' => 'sfreloadtlist'), spa_text('Mobile Phone Theme') => array('mobile' => 'sfreloadmlist'), spa_text('Mobile Tablet Theme') => array('tablet' => 'sfreloadtablist')); if (!is_multisite() || is_super_admin()) { $forms[spa_text('Theme Editor')] = array('editor' => 'sfreloadttedit'); $forms[spa_text('Theme Uploader')] = array('theme-upload' => ''); } $sfadminpanels[] = array(spa_text('Themes'), 'SPF Manage Themes', '/panel-themes/spa-themes.php', $sfatooltips['themes'], 'icon-Themes', SFHOMEURL . 'index.php?sp_ahah=themes-loader&sfnonce=' . wp_create_nonce('forum-ahah'), $forms, true); $sfactivepanels['themes'] = 10; $forms = array(spa_text('Toolbox') => array('toolbox' => ''), spa_text('Housekeeping') => array('housekeeping' => 'sfreloadhk'), spa_text('Data Inspector') => array('inspector' => ''), spa_text('CRON Inspector') => array('cron' => 'sfcron'), spa_text('Error Log') => array('errorlog' => 'sfreloadel'), spa_text('Environment') => array('environment' => ''), spa_text('Install Log') => array('log' => ''), spa_text('Change Log') => array('changelog' => ''), spa_text('Uninstall') => array('uninstall' => '')); $sfadminpanels[] = array(spa_text('Toolbox'), 'SPF Manage Toolbox', '/panel-toolbox/spa-toolbox.php', $sfatooltips['toolbox'], 'icon-Toolbox', SFHOMEURL . 'index.php?sp_ahah=toolbox-loader&sfnonce=' . wp_create_nonce('forum-ahah'), $forms, true); $sfactivepanels['toolbox'] = 11; # allow plugins to alter the admin menus $sfadminpanels = apply_filters('sf_admin_panels', $sfadminpanels); $sfactivepanels = apply_filters('sf_admin_activepanels', $sfactivepanels); }
function spa_save_plugin_list_actions() { check_admin_referer('forum-adminform_plugins', 'forum-adminform_plugins'); if (!sp_current_user_can('SPF Manage Plugins')) { spa_etext('Access denied - you do not have permission'); die; } if (empty($_POST['checked'])) { return spa_text('Error - no plugins selected'); } $action = ''; if (isset($_POST['action']) && $_POST['action'] != -1) { $action = $_POST['action']; } if (isset($_POST['action2']) && $_POST['action2'] != -1) { $action = $_POST['action2']; } switch ($action) { case 'activate-selected': $activate = false; foreach ($_POST['checked'] as $plugin) { $plugin = sp_filter_name_save($plugin); if (!sp_is_plugin_active($plugin)) { $activate = true; sp_activate_sp_plugin($plugin); } } if ($activate) { $msg = spa_text('Selected plugins activated'); } else { $msg = spa_text('All selected plugins already active'); } break; case 'deactivate-selected': $deactivate = false; foreach ($_POST['checked'] as $plugin) { $plugin = sp_filter_name_save($plugin); if (sp_is_plugin_active($plugin)) { $deactivate = true; sp_deactivate_sp_plugin($plugin); } } if ($deactivate) { $msg = spa_text('Selected plugins deactivated'); } else { $msg = spa_text('All selected plugins already deactived'); } break; case 'delete-selected': $active = false; foreach ($_POST['checked'] as $plugin) { $plugin = sp_filter_name_save($plugin); if (!sp_is_plugin_active($plugin)) { sp_delete_sp_plugin($plugin); } else { $active = true; } } if ($active) { $msg = spa_text('Selected plugins deleted but any active plugins were not deleted'); } else { $msg = spa_text('Selected plugins deleted'); } break; default: $msg = spa_text('Error - no action selected'); break; } return $msg; }
<?php /* Simple:Press Admin Ahah call for language downloads $LastChangedDate: 2014-06-21 04:47:00 +0100 (Sat, 21 Jun 2014) $ $Rev: 11582 $ */ if (preg_match('#' . basename(__FILE__) . '#', $_SERVER['PHP_SELF'])) { die('Access denied - you cannot directly call this file'); } spa_admin_ahah_support(); # ---------------------------------- # Check Whether User Can Manage Integration if (!sp_current_user_can('SPF Manage Integration')) { spa_etext('Access denied - you do not have permission'); die; } if (isset($_GET['item'])) { $item = $_GET['item']; spa_download_language_file($item); die; } function spa_download_language_file($item) { global $spPaths; $langCode = $_GET['langcode']; $homeName = $_GET['textdom']; if (isset($_GET['name'])) { $itemName = $_GET['name']; }
function sp_do_theme_upload() { if (!sp_current_user_can('SPF Manage Themes')) { spa_etext('Access denied - you do not have permission'); die; } check_admin_referer('forum-theme_upload', 'forum-theme_upload'); include_once SPBOOT . 'admin/spa-admin-updater-class.php'; $file_upload = new File_Upload_Upgrader('themezip', 'package'); require_once ABSPATH . 'wp-admin/admin-header.php'; $title = sprintf(spa_text('Uploading SP Theme from uploaded file: %s'), basename($file_upload->filename)); $nonce = 'theme-upload'; $url = add_query_arg(array('package' => $file_upload->id), 'update.php?action=upload-sp-theme'); $type = 'upload'; $upgrader = new SP_Theme_Upgrader(new SP_Theme_Installer_Skin(compact('type', 'title', 'nonce', 'url'))); $result = $upgrader->install($file_upload->package); if ($result || is_wp_error($result)) { $file_upload->cleanup(); } # double check if we deleted the upload file and output message if not if (file_exists($file_upload->package)) { echo sprintf(spa_text('Notice: Unable to remove the uploaded theme zip archive: %s'), $file_upload->package); } include ABSPATH . 'wp-admin/admin-footer.php'; }
function sp_barebones_options_form() { if (!sp_current_user_can('SPF Manage Themes')) { spa_etext('Access denied - you do not have permission'); die; } include_once SPBBADMIN . 'sp-barebones-activate.php'; sp_barebones_setup(true); ?> <style type="text/css"> .color-picker { height: 50px; } </style> <script type="text/javascript"> jQuery(document).ready(function($) { var colorPickers = $('.color-picker'); for (e in colorPickers) { if (colorPickers[e].id != undefined) { var colorPickerID = colorPickers[e].id; $('#' + colorPickerID + '-color').farbtastic('#' + colorPickerID); } } $('.fabox').hide(); $('.color-picker').click(function() { $(this).parent().find('.fabox').fadeIn(); }); $(document).mousedown(function() { $('.fabox').each(function() { var display = $(this).css('display'); if (display == 'block') $(this).fadeOut(); }); }); }); function spjLoadTestView(url, title) { var aWidth = (window.innerWidth-80); var aHeight = (window.innerHeight-80); spjDialogAjax(this, url, title, aWidth, aHeight, 'center'); } </script> <?php include_once SF_STORE_DIR . '/' . 'sp-custom-settings/sp-barebones-test-settings.php'; spa_paint_options_init(); spa_paint_open_tab(__('Barebones Custom Theme Settings', 'spBarebones'), true); echo '<br /><div class="sfoptionerror" style="font-size: 13px;">'; $url = SFHOMEURL . "index.php?sp_ahah=help&file=admin-themes&item=custom-options&sfnonce=" . wp_create_nonce('forum-ahah'); echo "<input type='button' value='Help' class='button-primary' style='float:right;' onclick='spjDialogAjax(this, \"{$url}\", \"Simple:Press Help\", 600, 0, 0);' />"; echo "<span style='font-weight:bold';'>"; spa_etext('Before using this customiser we strongly recommend you click on the help button and familiarise yourself with how it works to avoid inadvertently altering your live forum display'); echo "</span>"; echo '.<br />'; echo '</div>'; echo "</div>"; echo '<div class="sp-half-form">'; spa_paint_open_panel(); spa_paint_open_fieldset('', false, '', false); ?> <div> <div style="width: 49.5%; float:left;"> <p>Standard and general unlinked text</p> <input id="C1" class="color-picker" type="text" value="<?php echo $ops['C1']; ?> " name="C1" style="width:60%;font-weight:bold;float:left;" /> <div class="clearleft"></div> <div id="C1-color" class="fabox" style="margin: 0px auto; width: 195px; float:left;"></div> <div class="clearboth"></div> </div> </div> <?php spa_paint_close_fieldset(); spa_paint_close_panel(); spa_paint_open_panel(); spa_paint_open_fieldset('', false, '', false); ?> <div> <div style="width: 49.5%; float:left;"> <p>Main Headings and<br />Footer Background</p> <input id="C3" class="color-picker" type="text" value="<?php echo $ops['C3']; ?> " name="C3" style="width:60%;font-weight:bold;float:left;" /> <div class="clearleft"></div> <div id="C3-color" class="fabox" style="margin: 0px auto; width: 195px; float:left;"></div> </div> <div style="width: 49.5%; float:left;"> <p>Title rows in<br />index listings</p> <input id="C4" class="color-picker" type="text" value="<?php echo $ops['C4']; ?> " name="C4" style="width:60%;font-weight:bold;float:left;" /> <div class="clearleft"></div> <div id="C4-color" class="fabox" style="margin: 0px auto; width: 195px; float:left;"></div> </div> <div class="clearboth"></div><hr> </div> <div> <div style="width: 49.5%; float:left;"> <p>Background of odd rows<br />in index listings</p> <input id="C2" class="color-picker" type="text" value="<?php echo $ops['C2']; ?> " name="C2" style="width:60%;font-weight:bold;float:left;" /> <div class="clearleft"></div> <div id="C2-color" class="fabox" style="margin: 0px auto; width: 195px; float:left;"></div> </div> <div style="width: 49.5%; float:right;"> <p>Background of even rows<br />in index listings</p> <input id="C6" class="color-picker" type="text" value="<?php echo $ops['C6']; ?> " name="C6" style="width:60%;font-weight:bold;float:left;" /> <div class="clearleft"></div> <div id="C6-color" class="fabox" style="margin: 0px auto; width: 195px; float:left;"></div> </div> <div class="clearboth"></div> </div> <?php spa_paint_close_fieldset(); spa_paint_close_panel(); spa_paint_open_panel(); spa_paint_open_fieldset('', false, '', false); spa_paint_input(__('Font Family(s) in CSS format', 'spBarebones'), 'FN', $ops['FN']); spa_paint_input(__('Base Font Size (as percentage value)', 'spBarebones'), 'F1', $ops['F1']); spa_paint_close_fieldset(); spa_paint_close_panel(); spa_paint_tab_right_cell(); spa_paint_open_panel(); spa_paint_open_fieldset('', false, '', false); ?> <div> <div style="width: 49.5%; float:left;"> <p>Icon Glyphs</p> <input id="C7" class="color-picker" type="text" value="<?php echo $ops['C7']; ?> " name="C7" style="width:60%;font-weight:bold; float:left;" /> <div class="clearleft"></div> <div id="C7-color" class="fabox" style="margin: 0px auto; width: 195px; float:left;"></div> </div> <div style="width: 49.5%; float:right;"> <p>Icon Glyphs Hover</p> <input id="C8" class="color-picker" type="text" value="<?php echo $ops['C8']; ?> " name="C8" style="width:60%;font-weight:bold; float:left;" /> <div class="clearleft"></div> <div id="C8-color" class="fabox" style="margin: 0px auto; width: 195px; float:left;"></div> </div> <div class="clearboth"></div> </div> <?php spa_paint_close_fieldset(); spa_paint_close_panel(); spa_paint_open_panel(); spa_paint_open_fieldset('', false, '', false); ?> <div> <div style="width: 49.5%; float:left;"> <p>Primary <br />Link text labels</p> <input id="C5" class="color-picker" type="text" value="<?php echo $ops['C5']; ?> " name="C5" style="width:60%;font-weight:bold;float:left;" /> <div class="clearleft"></div> <div id="C5-color" class="fabox" style="margin: 0px auto; width: 195px; float:left;"></div> </div> <div style="width: 49.5%; float:left;"> <p>Primary <br />Link text hover</p> <input id="C9" class="color-picker" type="text" value="<?php echo $ops['C9']; ?> " name="C9" style="width:60%;font-weight:bold;float:left;" /> <div class="clearleft"></div> <div id="C9-color" class="fabox" style="margin: 0px auto; width: 195px; float:left;"></div> </div> <div class="clearboth"></div><hr> </div> <div> <div style="width: 49.5%; float:left;"> <p>Secondary <br />Link text labels</p> <input id="C10" class="color-picker" type="text" value="<?php echo $ops['C10']; ?> " name="C10" style="width:60%;font-weight:bold;float:left;" /> <div class="clearleft"></div> <div id="C10-color" class="fabox" style="margin: 0px auto; width: 195px; float:left;"></div> </div> <div style="width: 49.5%; float:left;"> <p>Secondary <br />Link text hover</p> <input id="C11" class="color-picker" type="text" value="<?php echo $ops['C11']; ?> " name="C11" style="width:60%;font-weight:bold;float:left;" /> <div class="clearleft"></div> <div id="C11-color" class="fabox" style="margin: 0px auto; width: 195px; float:left;"></div> </div> <div class="clearboth"></div> </div> <?php spa_paint_close_fieldset(); spa_paint_close_panel(); spa_paint_close_container(); }
if ($spStatus != 'ok') { echo $spStatus; die; } include_once SF_PLUGIN_DIR . '/admin/panel-plugins/spa-plugins-display.php'; include_once SF_PLUGIN_DIR . '/admin/panel-plugins/support/spa-plugins-prepare.php'; include_once SF_PLUGIN_DIR . '/admin/panel-plugins/support/spa-plugins-save.php'; include_once SF_PLUGIN_DIR . '/admin/library/spa-tab-support.php'; global $adminhelpfile; $adminhelpfile = 'admin-plugins'; # -------------------------------------------------------------------- # ---------------------------------- # Check Whether User Can Manage Plugins # dont check for admin panels loaded/saved by plugins - the plugins api will do that if (isset($_GET['loadform']) && $_GET['loadform'] != 'plugin' || isset($_GET['saveform']) && $_GET['saveform'] != 'plugin') { if (!sp_current_user_can('SPF Manage Plugins')) { spa_etext('Access denied - you do not have permission'); die; } } if (isset($_GET['loadform'])) { spa_render_plugins_container($_GET['loadform']); die; } if (isset($_GET['saveform'])) { if ($_GET['saveform'] == 'list') { echo spa_save_plugin_list_actions(); die; } if ($_GET['saveform'] == 'activation') { echo spa_save_plugin_activation();
function spa_render_sidemenu() { global $sfadminpanels, $spThisUser, $spDevice; $target = 'sfmaincontainer'; $image = SFADMINIMAGES; $upgrade = admin_url('admin.php?page=' . SPINSTALLPATH); if (isset($_GET['tab']) ? $formid = sp_esc_str($_GET['tab']) : ($formid = '')) { } if ($spDevice == 'mobile') { echo '<div id="spaMobileAdmin">' . "\n"; echo '<select class="wp-core-ui" onchange="location = this.options[this.selectedIndex].value;">' . "\n"; foreach ($sfadminpanels as $index => $panel) { if (sp_current_user_can($panel[1]) || $panel[0] == 'Admins' && ($spThisUser->admin || $spThisUser->moderator)) { echo '<optgroup label="' . $panel[0] . '">' . "\n"; foreach ($panel[6] as $label => $data) { foreach ($data as $formid => $reload) { # ignore user plugin data for menu if ($formid == 'admin' || $formid == 'save' || $formid == 'form') { continue; } $id = ''; if ($reload != '') { $id = ' id="' . esc_attr($reload) . '"'; } else { $id = ' id="acc' . esc_attr($formid) . '"'; } $sel = ''; if (isset($_GET['tab'])) { if ($_GET['tab'] == 'plugin') { if (isset($_GET['admin']) && isset($data['admin']) && $_GET['admin'] == $data['admin']) { $sel = ' selected="selected" '; } } else { if ($_GET['tab'] == $formid) { $sel = ' selected="selected" '; } } } echo "<option {$id} {$sel}"; $admin = !empty($data['admin']) ? '&admin=' . $data['admin'] : ''; $save = !empty($data['save']) ? '&save=' . $data['save'] : ''; $form = !empty($data['form']) ? '&form=' . $data['form'] : ''; if (empty($admin)) { $base = SFHOMEURL . 'wp-admin/admin.php?page=simple-press/admin'; } else { $base = SFHOMEURL . 'wp-admin/admin.php?page=simple-press/admin/panel-plugins/spa-plugins.php'; $panel[2] = ''; } $http = $base . $panel[2] . '&tab=' . $formid . $admin . $save . $form; echo 'value="' . $http . '">' . $label . '</option>' . "\n"; } } echo '</optgroup>' . "\n"; } } echo '</select>' . "\n"; echo '<a class="button button-secondary" href="' . sp_url() . '">' . spa_text('Go To Forum') . '</a>'; echo '</div>' . "\n"; } else { echo '<div id="sfsidepanel">' . "\n"; echo '<div id="sfadminmenu">' . "\n"; foreach ($sfadminpanels as $index => $panel) { if (sp_current_user_can($panel[1]) || $panel[0] == 'Admins' && ($spThisUser->admin || $spThisUser->moderator)) { $pName = str_replace(' ', '', $panel[0]); echo '<div class="sfsidebutton" id="sfacc' . $pName . '">' . "\n"; echo '<div class="" title="' . esc_attr($panel[3]) . '"><span class="spa' . $panel[4] . '"></span><a href="#">' . $panel[0] . '</a></div>' . "\n"; echo '</div>' . "\n"; echo '<div class="sfmenublock">' . "\n"; foreach ($panel[6] as $label => $data) { foreach ($data as $formid => $reload) { # ignore user plugin data for menu if ($formid == 'admin' || $formid == 'save' || $formid == 'form') { continue; } echo '<div class="sfsideitem">' . "\n"; $id = ''; if ($reload != '') { $id = ' id="' . esc_attr($reload) . '"'; } else { $id = ' id="acc' . esc_attr($formid) . '"'; } $base = esc_js($panel[5]); $admin = !empty($data['admin']) ? $data['admin'] : ''; $save = !empty($data['save']) ? $data['save'] : ''; $form = !empty($data['form']) ? $data['form'] : ''; ?> <a<?php echo $id; ?> href="#" onclick="spjLoadForm('<?php echo $formid; ?> ', '<?php echo $base; ?> ', '<?php echo $target; ?> ', '<?php echo $image; ?> ', '', 'sfopen', '<?php echo $upgrade; ?> ', '<?php echo esc_js($admin); ?> ', '<?php echo esc_js($save); ?> ', '<?php echo $form; ?> ', '<?php echo $reload; ?> ');"><?php echo $label; ?> </a><?php echo "\n"; ?> <?php } echo '</div>' . "\n"; } echo '</div>' . "\n"; } } echo '</div>' . "\n"; # Help link $site = SFHOMEURL . 'index.php?sp_ahah=troubleshooting&sfnonce=' . wp_create_nonce('forum-ahah'); echo '<br /><input type="button" id="spHelp" class="button-primary" value="' . spa_text('Simple:Press Help and Troubleshooting') . '" onclick="spjTroubleshooting(\'' . $site . '\', \'' . $target . '\');" />' . "\n"; echo '</div>' . "\n"; } }
} spa_admin_ahah_support(); global $spStatus; if ($spStatus != 'ok') { echo $spStatus; die; } include_once SF_PLUGIN_DIR . '/admin/panel-permissions/spa-permissions-display.php'; include_once SF_PLUGIN_DIR . '/admin/panel-permissions/support/spa-permissions-prepare.php'; include_once SF_PLUGIN_DIR . '/admin/panel-permissions/support/spa-permissions-save.php'; include_once SF_PLUGIN_DIR . '/admin/library/spa-tab-support.php'; global $adminhelpfile; $adminhelpfile = 'admin-permissions'; # ---------------------------------- # Check Whether User Can Manage Forums if (!sp_current_user_can('SPF Manage Permissions')) { spa_etext('Access denied - you do not have permission'); die; } if (isset($_GET['loadform'])) { spa_render_permissions_container($_GET['loadform']); die; } if (isset($_GET['saveform'])) { if ($_GET['saveform'] == 'addperm') { echo spa_save_permissions_new_role(); die; } if ($_GET['saveform'] == 'editperm') { echo spa_save_permissions_edit_role(); die;
if ($spStatus != 'ok') { echo $spStatus; die; } include_once SF_PLUGIN_DIR . '/admin/panel-admins/spa-admins-display.php'; include_once SF_PLUGIN_DIR . '/admin/panel-admins/support/spa-admins-prepare.php'; include_once SF_PLUGIN_DIR . '/admin/panel-admins/support/spa-admins-save.php'; include_once SF_PLUGIN_DIR . '/admin/library/spa-tab-support.php'; global $adminhelpfile; $adminhelpfile = 'admin-admins'; # -------------------------------------------------------------------- # ---------------------------------- # Check Whether User Can Manage Options global $spThisUser; $modchk = ($spThisUser->admin || $spThisUser->moderator) && (isset($_GET['saveform']) && $_GET['saveform'] == 'youradmin' || isset($_GET['loadform']) && $_GET['loadform'] == 'youradmin'); if (!sp_current_user_can('SPF Manage Admins') && !$modchk) { spa_etext('Access denied - you do not have permission'); die; } if (isset($_GET['loadform'])) { spa_render_admins_container($_GET['loadform']); die; } if (isset($_GET['saveform'])) { if ($_GET['saveform'] == 'youradmin') { echo spa_save_admins_your_options_data(); die; } if ($_GET['saveform'] == 'globaladmin') { echo spa_save_admins_global_options_data(); die;
spa_admin_ahah_support(); global $spStatus; if ($spStatus != 'ok') { echo $spStatus; die; } include_once SF_PLUGIN_DIR . '/admin/panel-toolbox/spa-toolbox-display.php'; include_once SF_PLUGIN_DIR . '/admin/panel-toolbox/support/spa-toolbox-prepare.php'; include_once SF_PLUGIN_DIR . '/admin/panel-toolbox/support/spa-toolbox-save.php'; include_once SF_PLUGIN_DIR . '/admin/library/spa-tab-support.php'; global $adminhelpfile; $adminhelpfile = 'admin-toolbox'; # -------------------------------------------------------------------- # ---------------------------------- # Check Whether User Can Manage Options if (!sp_current_user_can('SPF Manage Toolbox')) { spa_etext('Access denied - you do not have permission'); die; } if (isset($_GET['loadform'])) { spa_render_toolbox_container($_GET['loadform']); die; } if (isset($_GET['saveform'])) { if ($_GET['saveform'] == 'toolbox') { echo spa_save_toolbox_data(); die; } if ($_GET['saveform'] == 'uninstall') { echo spa_save_uninstall_data(); die;
function sp_add_admin_panel($name, $capability, $tooltop, $icon, $subpanels, $position = '') { global $sfadminpanels, $sfactivepanels; # make sure the current user has capability to see this panel if (!sp_current_user_can($capability)) { return false; } # make sure the panel doesnt already exist if (array_key_exists($name, $sfadminpanels)) { return false; } # fix up the subpanels formids from user names $forms = array(); foreach ($subpanels as $index => $subpanel) { $forms[$index] = array('plugin' => $subpanel['id'], 'admin' => $subpanel['admin'], 'save' => $subpanel['save'], 'form' => $subpanel['form']); } $num_panels = count($sfactivepanels); if (empty($position) || ($position < 0 || $position > $num_panels)) { $position = $num_panels; } # okay, lets add the new panel $panel_data = array($name, $capability, 'simple-press/admin/panel-plugins/spa-plugins.php', $tooltop, $icon, SFHOMEURL . 'index.php?sp_ahah=plugins-loader&sfnonce=' . wp_create_nonce('forum-ahah'), $forms, false); array_splice($sfadminpanels, $position, 0, array($panel_data)); # and update the active panels list $new = array_keys($sfactivepanels); array_splice($new, $position, 0, $name); $sfactivepanels = array_flip($new); return true; }
<?php /* Simple:Press Admin ADmins $LastChangedDate: 2014-06-20 20:47:00 -0700 (Fri, 20 Jun 2014) $ $Rev: 11582 $ */ if (preg_match('#' . basename(__FILE__) . '#', $_SERVER['PHP_SELF'])) { die('Access denied - you cannot directly call this file'); } # Check Whether User Can Manage Admins global $spStatus; if (!sp_current_user_can('SPF Manage Admins') && !$spThisUser->admin && !$spThisUser->moderator) { spa_etext('Access denied - you do not have permission'); die; } include_once SF_PLUGIN_DIR . '/admin/panel-admins/spa-admins-display.php'; include_once SF_PLUGIN_DIR . '/admin/panel-admins/support/spa-admins-prepare.php'; include_once SF_PLUGIN_DIR . '/admin/library/spa-tab-support.php'; if ($spStatus != 'ok') { include_once SPLOADINSTALL; die; } global $adminhelpfile; $adminhelpfile = 'admin-admins'; # -------------------------------------------------------------------- $tab = isset($_GET['tab']) ? $_GET['tab'] : 'youradmin'; spa_panel_header(); spa_render_admins_panel($tab); spa_panel_footer();