function wp_portability_kit()
{
    if (!user_can_access_admin_page()) {
        return false;
    }
    if (isset($_REQUEST['_wpnonce'])) {
        if (function_exists('check_admin_referer')) {
            check_admin_referer('wordpress-portability-kit');
        }
    }
    global $task;
    switch ($task) {
        case 'upkit':
            wpk_create_kit();
            break;
        case 'downkit':
            wpk_unpack_kit();
            break;
        case 'restore':
            wpk_restore_kit();
            break;
        default:
            wpk_show_kit_start();
            break;
    }
}
Пример #2
0
function surveys_options()
{
    if (function_exists('current_user_can') && !current_user_can('manage_options')) {
        die(__("Cheatin' uh?", 'surveys'));
    }
    if (!user_can_access_admin_page()) {
        wp_die(__('You do not have sufficient permissions to access this page.', 'surveys'));
    }
    require ABSPATH . '/wp-content/plugins/surveys/options.php';
}
Пример #3
0
function eventr_options()
{
    if (function_exists('current_user_can') && !current_user_can('manage_options')) {
        die(t('Cheatin’ uh?'));
    }
    if (!user_can_access_admin_page()) {
        wp_die(__('You do not have sufficient permissions to access this page.', 'eventr'));
    }
    require ABSPATH . '/wp-content/plugins/eventr/options.php';
}
Пример #4
0
        global $menu_order, $default_menu_order;
        $a = $a[2];
        $b = $b[2];
        if (isset($menu_order[$a]) && !isset($menu_order[$b])) {
            return -1;
        } elseif (!isset($menu_order[$a]) && isset($menu_order[$b])) {
            return 1;
        } elseif (isset($menu_order[$a]) && isset($menu_order[$b])) {
            if ($menu_order[$a] == $menu_order[$b]) {
                return 0;
            }
            return $menu_order[$a] < $menu_order[$b] ? -1 : 1;
        } else {
            return $default_menu_order[$a] <= $default_menu_order[$b] ? -1 : 1;
        }
    }
    usort($menu, 'sort_menu');
    unset($menu_order, $default_menu_order);
}
// Remove the last menu item if it is a separator.
$last_menu_key = array_keys($menu);
$last_menu_key = array_pop($last_menu_key);
if (!empty($menu) && 'wp-menu-separator' == $menu[$last_menu_key][4]) {
    unset($menu[$last_menu_key]);
}
unset($last_menu_key);
if (!user_can_access_admin_page()) {
    do_action('admin_page_access_denied');
    wp_die(__('You do not have sufficient permissions to access this page.'));
}
$menu = add_menu_classes($menu);
Пример #5
0
function grpdocs_assembly_options() {
	if ( function_exists('current_user_can') && !current_user_can('manage_options') ) die(t('An error occurred.'));
	if (! user_can_access_admin_page()) wp_die('You do not have sufficient permissions to access this page');

	require(ABSPATH. 'wp-content/plugins/groupdocs-assembly/options.php');
}
 function user_level_check()
 {
     if (!user_can_access_admin_page()) {
         redirect_header(wp_siteurl() . '/wp-admin/', 5, _LANG_P_CHEATING_ERROR);
     }
 }
Пример #7
0
function gde_options()
{
    if (!current_user_can('manage_options')) {
        wp_die('You don\'t have access to this page.');
    }
    if (!user_can_access_admin_page()) {
        wp_die(__('You do not have sufficient permissions to access this page', 'google-document-embedder'));
    }
    require GDE_PLUGIN_DIR . 'options.php';
    add_action('in_admin_footer', 'gde_admin_footer');
}
function wp_automatic_upgrade()
{
    if (!user_can_access_admin_page()) {
        return false;
    }
    if (isset($_REQUEST['_wpnonce'])) {
        if (function_exists('check_admin_referer')) {
            check_admin_referer('wordpress_automatic_upgrade');
        }
    }
    global $task;
    switch ($task) {
        case 'start':
            show_upgrade_start();
            break;
        case 'files':
            wpau_backup_files();
            break;
        case 'skipfiles':
            wpau_skip_backup_files();
            break;
        case 'backupdbopt':
            wpau_backup_db_options();
            break;
        case 'skipbackupdbopt':
            wpau_skip_backup_db();
            break;
        case 'backupdb':
            wpau_backup_db();
            break;
        case 'newversionoption':
            wpau_show_new_version_forms();
            break;
        case 'getlatestfiles':
            wpau_get_latest_version();
            break;
        case 'maintmode':
            wpau_site_down();
            break;
        case 'de-plugin':
            wpau_deactivate_plugins();
            break;
        case 'upgrade':
            wpau_upgrade_installation();
            break;
        case 'updatedb':
            wpau_update_database();
            break;
        case 're-plugin':
            wpau_reactivate_plugins();
            break;
        case 'cleanup':
            wpau_cleanup();
            break;
        case 'done':
            wpau_show_backup_log();
            break;
        case 'logs':
            wpau_show_log();
            break;
        case 'prelimopts':
            wpau_prelim_opts_and_sanatize();
            break;
        case 'skiptask':
            wpau_skip_task();
        default:
            wpau_run_prelims();
            break;
    }
}
Пример #9
0
function watu_options()
{
    if (function_exists('current_user_can') && !current_user_can('manage_options')) {
        die(__("Your are not allowed to to perform this operation", 'watu'));
    }
    if (!user_can_access_admin_page()) {
        wp_die(__('You do not have sufficient permissions to access this page', 'watu'));
    }
    require ABSPATH . '/wp-content/plugins/watu/options.php';
}
 /**
  * This is for a future release.
  * It should be called through ajax and rebuild cache for all posts in that are cached
  * 
  * @author Panagiotis Vagenas <*****@*****.**>
  * @since 1.0.0
  */
 public function rebuildCache()
 {
     if (!user_can_access_admin_page() || !current_user_can('manage_options')) {
         echo json_encode(false);
         die;
     }
     // This may take a while so set time limit to 0
     set_time_limit(0);
     erpPROPaths::requireOnce(erpPROPaths::$erpPRODBActions);
     erpPROPaths::requireOnce(erpPROPaths::$erpPROMainOpts);
     erpPROPaths::requireOnce(erpPROPaths::$erpProRelated);
     $db = erpPRODBActions::getInstance();
     $mainOpts = new erpPROMainOpts();
     $rel = erpProRelated::get_instance($mainOpts);
     $allCached = $db->getUniqueIds();
     $db->emptyRelTable();
     $plugin = easyRelatedPostsPRO::get_instance();
     global $wpdb, $wp_actions;
     foreach ($allCached as $key => $value) {
         $pid = (int) $value['pid'];
         if ($plugin->isInExcludedPostTypes($pid) || $plugin->isInExcludedTaxonomies($pid)) {
             continue;
         }
         $rel->doRating($pid);
     }
     echo json_encode(true);
     die;
 }
Пример #11
0
/**
* aa_pp_admin_header()
*
* @return
*/
function aa_pp_admin_header()
{
    global $wpdb, $aa_PP, $aa_SIDS;
    if (!user_can_access_admin_page()) {
        wp_die(__('You do not have sufficient permissions to access this page.'));
    }
    if (!current_user_can(8)) {
        wp_die(__("You are not allowed to be here without upload permissions"));
    }
    $aa_PP = get_option('askapache_password_protect');
    $aa_SIDS = get_option('askapache_password_protect_sids');
    @set_time_limit(60);
    @set_magic_quotes_runtime(0);
}