• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP force_ssl_login函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中force_ssl_login函数的典型用法代码示例。如果您正苦于以下问题:PHP force_ssl_login函数的具体用法?PHP force_ssl_login怎么用?PHP force_ssl_login使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了force_ssl_login函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: jr_process_login_form

function jr_process_login_form()
{
    global $posted;
    if (isset($_REQUEST['redirect_to'])) {
        $redirect_to = $_REQUEST['redirect_to'];
    } else {
        $redirect_to = admin_url();
    }
    if (is_ssl() && force_ssl_login() && !force_ssl_admin() && 0 !== strpos($redirect_to, 'https') && 0 === strpos($redirect_to, 'http')) {
        $secure_cookie = false;
    } else {
        $secure_cookie = '';
    }
    $user = wp_signon('', $secure_cookie);
    $redirect_to = apply_filters('login_redirect', $redirect_to, isset($_REQUEST['redirect_to']) ? $_REQUEST['redirect_to'] : '', $user);
    if (!is_wp_error($user)) {
        if (user_can($user, 'manage_options')) {
            $redirect_to = admin_url();
        }
        wp_safe_redirect($redirect_to);
        exit;
    }
    $errors = $user;
    return $errors;
}
开发者ID:besimhu,项目名称:legacy,代码行数:25,代码来源:login-process.php


示例2: pmpro_besecure

function pmpro_besecure()
{
    global $besecure, $post;
    //check the post option
    if (!is_admin() && !empty($post->ID) && !$besecure) {
        $besecure = get_post_meta($post->ID, "besecure", true);
    }
    //if forcing ssl on admin, be secure in admin and login page
    if (!$besecure && force_ssl_admin() && (is_admin() || pmpro_is_login_page())) {
        $besecure = true;
    }
    //if forcing ssl on login, be secure on the login page
    if (!$besecure && force_ssl_login() && pmpro_is_login_page()) {
        $besecure = true;
    }
    $besecure = apply_filters("pmpro_besecure", $besecure);
    $use_ssl = pmpro_getOption("use_ssl");
    if ($use_ssl == 1) {
        if ($besecure && (empty($_SERVER['HTTPS']) || $_SERVER['HTTPS'] == "off" || $_SERVER['HTTPS'] == "false")) {
            //need to be secure
            wp_redirect("https://" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']);
            exit;
        } elseif (!$besecure && !empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != "off" && $_SERVER['HTTPS'] != "false") {
            //don't need to be secure
            wp_redirect("http://" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']);
            exit;
        }
    }
}
开发者ID:mathieuhays,项目名称:paid-memberships-pro,代码行数:29,代码来源:https.php


示例3: pmpro_login_redirect

function pmpro_login_redirect($redirect_to, $request, $user)
{
    global $wpdb;
    //is a user logging in?
    if (!empty($user->ID)) {
        //logging in, let's figure out where to send them
        if (pmpro_isAdmin($user->ID)) {
            //admins go to dashboard
            $redirect_to = get_bloginfo("url") . "/wp-admin/";
        } elseif (strpos($redirect_to, "checkout") !== false) {
            //if the redirect url includes the word checkout, leave it alone
        } elseif ($wpdb->get_var("SELECT membership_id FROM {$wpdb->pmpro_memberships_users} WHERE status = 'active' AND user_id = '" . $user->ID . "' LIMIT 1")) {
            //if logged in and a member, send to wherever they were going
        } else {
            //not a member, send to subscription page
            $redirect_to = pmpro_url("levels");
        }
    } else {
        //not logging in (login form) so return what was given
    }
    //let's strip the https if force_ssl_login is set, but force_ssl_admin is not
    if (force_ssl_login() && !force_ssl_admin()) {
        $redirect_to = str_replace("https:", "http:", $redirect_to);
    }
    return apply_filters("pmpro_login_redirect_url", $redirect_to, $request, $user);
}
开发者ID:Tanya-atsocial,项目名称:paid-memberships-pro,代码行数:26,代码来源:login.php


示例4: app_process_login_form

function app_process_login_form()
{
    global $posted;
    if (isset($_REQUEST['redirect_to'])) {
        $redirect_to = $_REQUEST['redirect_to'];
    } else {
        $redirect_to = admin_url();
    }
    if (is_ssl() && force_ssl_login() && !force_ssl_admin() && 0 !== strpos($redirect_to, 'https') && 0 === strpos($redirect_to, 'http')) {
        $secure_cookie = false;
    } else {
        $secure_cookie = '';
    }
    $user = wp_signon('', $secure_cookie);
    $redirect_to = apply_filters('login_redirect', $redirect_to, isset($_REQUEST['redirect_to']) ? $_REQUEST['redirect_to'] : '', $user);
    if (!is_wp_error($user)) {
        // automatically redirect admins to the WP back-end
        if (user_can($user, 'manage_options')) {
            $redirect_to = admin_url('admin.php?page=admin-options.php');
        }
        // otherwise redirect them to the hidden post url
        wp_safe_redirect($redirect_to);
        exit;
    }
    $errors = $user;
    return $errors;
}
开发者ID:ugurbastan,项目名称:swe-574-group4,代码行数:27,代码来源:login-process.php


示例5: set_url_scheme

 /**
  * Sets the URL to https or http, depending on availability and related WP config settings/APIs.
  *
  * @since 4.2
  *
  * @param $url string
  *
  * @return string
  */
 public function set_url_scheme($url)
 {
     $current_user = get_current_user();
     if (function_exists('force_ssl_admin') && force_ssl_admin() || function_exists('force_ssl_login') && force_ssl_login() || function_exists('force_ssl_content') && force_ssl_content() || function_exists('is_ssl') && is_ssl() || !empty($current_user->use_ssl)) {
         return set_url_scheme($url, 'https');
     }
     return set_url_scheme($url, 'http');
 }
开发者ID:kraftbj,项目名称:Press-This,代码行数:17,代码来源:press-this.php


示例6: wc_yotpo_redirect

function wc_yotpo_redirect()
{
    if (get_option('wc_yotpo_just_installed', false)) {
        delete_option('wc_yotpo_just_installed');
        wp_redirect(is_ssl() || force_ssl_admin() || force_ssl_login() ? str_replace('http:', 'https:', admin_url('admin.php?page=woocommerce-yotpo-settings-page')) : str_replace('https:', 'http:', admin_url('admin.php?page=woocommerce-yotpo-settings-page')));
        exit;
    }
}
开发者ID:brian3t,项目名称:orchidmate,代码行数:8,代码来源:wc_yotpo.php


示例7: woocommerce_sidebar_login_ajax_process

/**
 * Process ajax login
 *
 * @access public
 * @return void
 */
function woocommerce_sidebar_login_ajax_process()
{
    check_ajax_referer('woocommerce-sidebar-login-action', 'security');
    // Get post data
    $creds = array();
    $creds['user_login'] = esc_attr($_REQUEST['user_login']);
    $creds['user_password'] = esc_attr($_REQUEST['user_password']);
    $creds['remember'] = 'forever';
    $redirect_to = esc_attr($_REQUEST['redirect_to']);
    // Check for Secure Cookie
    $secure_cookie = '';
    // If the user wants ssl but the session is not ssl, force a secure cookie.
    if (!force_ssl_admin()) {
        $user_name = sanitize_user($creds['user_login']);
        if ($user = get_user_by('login', $user_name)) {
            if (get_user_option('use_ssl', $user->ID)) {
                $secure_cookie = true;
                force_ssl_admin(true);
            }
        }
    }
    if (force_ssl_admin()) {
        $secure_cookie = true;
    }
    if ($secure_cookie == '' && force_ssl_login()) {
        $secure_cookie = false;
    }
    // Login
    $user = wp_signon($creds, $secure_cookie);
    // Redirect filter
    if ($secure_cookie && strstr($redirect_to, 'wp-admin')) {
        $redirect_to = str_replace('http:', 'https:', $redirect_to);
    }
    // Result
    $result = array();
    if (!is_wp_error($user)) {
        $result['success'] = 1;
        $result['redirect'] = $redirect_to;
    } else {
        $result['success'] = 0;
        if ($user->errors) {
            foreach ($user->errors as $error) {
                $result['error'] = $error[0];
                break;
            }
        } else {
            $result['error'] = __('Please enter your username and password to login.', 'woocommerce');
        }
    }
    header('content-type: application/json; charset=utf-8');
    echo $_GET['callback'] . '(' . json_encode($result) . ')';
    die;
}
开发者ID:vjdesign,项目名称:fontaine,代码行数:59,代码来源:woocommerce-ajax.php


示例8: woocommerce_sidebar_login_ajax_process

function woocommerce_sidebar_login_ajax_process()
{
    check_ajax_referer('woocommerce-sidebar-login-action', 'security');
    // Get post data
    $creds = array();
    $creds['user_login'] = esc_attr($_POST['user_login']);
    $creds['user_password'] = esc_attr($_POST['user_password']);
    $creds['remember'] = 'forever';
    $redirect_to = esc_attr($_POST['redirect_to']);
    // Check for Secure Cookie
    $secure_cookie = '';
    // If the user wants ssl but the session is not ssl, force a secure cookie.
    if (!empty($_POST['log']) && !force_ssl_admin()) {
        $user_name = sanitize_user($_POST['log']);
        if ($user = get_user_by('login', $user_name)) {
            if (get_user_option('use_ssl', $user->ID)) {
                $secure_cookie = true;
                force_ssl_admin(true);
            }
        }
    }
    if (!$secure_cookie && is_ssl() && force_ssl_login() && !force_ssl_admin() && 0 !== strpos($redirect_to, 'https') && 0 === strpos($redirect_to, 'http')) {
        $secure_cookie = false;
    }
    // Login
    $user = wp_signon($creds, $secure_cookie);
    // Redirect filter
    if ($secure_cookie && false !== strpos($redirect_to, 'wp-admin')) {
        $redirect_to = preg_replace('|^http://|', 'https://', $redirect_to);
    }
    // Result
    $result = array();
    if (!is_wp_error($user)) {
        $result['success'] = 1;
        $result['redirect'] = $redirect_to;
    } else {
        $result['success'] = 0;
        foreach ($user->errors as $error) {
            $result['error'] = $error[0];
            break;
        }
    }
    echo json_encode($result);
    die;
}
开发者ID:bidhanbaral,项目名称:fotodep_store,代码行数:45,代码来源:woocommerce-ajax.php


示例9: run

 /**
  */
 public function run()
 {
     if ($this->getIsOption('disable_file_editing', 'Y')) {
         if (!defined('DISALLOW_FILE_EDIT')) {
             define('DISALLOW_FILE_EDIT', true);
         }
         add_filter('user_has_cap', array($this, 'disableFileEditing'), 0, 3);
     }
     $sWpVersionMask = $this->getOption('mask_wordpress_version');
     if (!empty($sWpVersionMask)) {
         global $wp_version;
         $wp_version = $sWpVersionMask;
         // 			add_filter( 'bloginfo', array( $this, 'maskWordpressVersion' ), 1, 2 );
         // 			add_filter( 'bloginfo_url', array( $this, 'maskWordpressVersion' ), 1, 2 );
     }
     if (false && $this->getOption('action_reset_auth_salts') == 'Y') {
         add_action('init', array($this, 'resetAuthKeysSalts'), 1);
     }
     if ($this->getIsOption('force_ssl_login', 'Y') && function_exists('force_ssl_login')) {
         if (!defined('FORCE_SSL_LOGIN')) {
             define('FORCE_SSL_LOGIN', true);
         }
         force_ssl_login(true);
     }
     if ($this->getIsOption('force_ssl_admin', 'Y') && function_exists('force_ssl_admin')) {
         if (!defined('FORCE_SSL_ADMIN')) {
             define('FORCE_SSL_ADMIN', true);
         }
         force_ssl_admin(true);
     }
     if ($this->getIsOption('hide_wordpress_generator_tag', 'Y')) {
         remove_action('wp_head', 'wp_generator');
     }
     if ($this->getIsOption('block_author_discovery', 'Y')) {
         // jump in right before add_action( 'template_redirect', 'redirect_canonical' );
         add_action('wp', array($this, 'interceptCanonicalRedirects'), 9);
     }
     if ($this->getIsOption('disable_xmlrpc', 'Y')) {
         add_filter('xmlrpc_enabled', '__return_false', 1000);
     }
 }
开发者ID:Wikipraca,项目名称:Wikipraca-WikiSquare,代码行数:43,代码来源:lockdown.php


示例10: site_url

 function site_url($path = '', $scheme = null)
 {
     // should the list of allowed schemes be maintained elsewhere?
     $orig_scheme = $scheme;
     if (!in_array($scheme, array('http', 'https'))) {
         if ('login_post' == $scheme && (force_ssl_login() || force_ssl_admin())) {
             $scheme = 'https';
         } elseif ('login' == $scheme && force_ssl_admin()) {
             $scheme = 'https';
         } elseif ('admin' == $scheme && force_ssl_admin()) {
             $scheme = 'https';
         } else {
             $scheme = is_ssl() ? 'https' : 'http';
         }
     }
     $url = str_replace('http://', "{$scheme}://", get_option('siteurl'));
     if (!empty($path) && is_string($path) && strpos($path, '..') === false) {
         $url .= '/' . ltrim($path, '/');
     }
     return apply_filters('site_url', $url, $path, $orig_scheme);
 }
开发者ID:slaFFik,项目名称:l10n-ru,代码行数:21,代码来源:compat.php


示例11: process_form

 function process_form()
 {
     $this->error = new WP_Error();
     if (is_user_logged_in()) {
         do_action('app_login');
     }
     if (!isset($_POST['login'])) {
         return;
     }
     if (empty($_POST['log'])) {
         $this->error->add('empty_username', __('<strong>ERROR</strong>: The username field is empty.', APP_TD));
     }
     if (empty($_POST['pwd'])) {
         $this->error->add('empty_password', __('<strong>ERROR</strong>: The password field is empty.', APP_TD));
     }
     if ($this->error->get_error_code()) {
         return;
     }
     if (isset($_REQUEST['redirect_to'])) {
         $redirect_to = $_REQUEST['redirect_to'];
     } else {
         $redirect_to = admin_url('index.php');
     }
     if (is_ssl() && force_ssl_login() && !force_ssl_admin() && 0 !== strpos($redirect_to, 'https') && 0 === strpos($redirect_to, 'http')) {
         $secure_cookie = false;
     } else {
         $secure_cookie = '';
     }
     $user = wp_signon('', $secure_cookie);
     $redirect_to = apply_filters('login_redirect', $redirect_to, isset($_REQUEST['redirect_to']) ? $_REQUEST['redirect_to'] : '', $user);
     if (!is_wp_error($user)) {
         wp_safe_redirect($redirect_to);
         exit;
     }
     $this->error = $user;
 }
开发者ID:TopLineMediaTeam,项目名称:horseshow,代码行数:36,代码来源:views-login.php


示例12: calculate_instructions_url

 protected function calculate_instructions_url($refresh = 'n')
 {
     return add_query_arg(array('garedirect' => urlencode($this->get_login_url()), 'gaorigin' => urlencode((is_ssl() || force_ssl_login() || force_ssl_admin() ? 'https://' : 'http://') . $_SERVER['HTTP_HOST'] . '/'), 'ganotms' => is_multisite() ? 'false' : 'true', 'gar' => urlencode($refresh), 'utm_source' => 'Admin%20Instructions', 'utm_medium' => 'freemium', 'utm_campaign' => 'Freemium'), $this->get_wpglogincom_baseurl());
 }
开发者ID:ankitatechie,项目名称:heroku-deployment,代码行数:4,代码来源:core_google_apps_login.php


示例13: network_site_url

/**
 * Retrieve the site url for the current network.
 *
 * Returns the site url with the appropriate protocol,  'https' if
 * is_ssl() and 'http' otherwise. If $scheme is 'http' or 'https', is_ssl() is
 * overridden.
 *
 * @package WordPress
 * @since 3.0.0
 *
 * @param string $path Optional. Path relative to the site url.
 * @param string $scheme Optional. Scheme to give the site url context. Currently 'http','https', 'login', 'login_post', or 'admin'.
 * @return string Site url link with optional path appended.
*/
function network_site_url($path = '', $scheme = null)
{
    global $current_site;
    if (!is_multisite()) {
        return site_url($path, $scheme);
    }
    $orig_scheme = $scheme;
    if (!in_array($scheme, array('http', 'https'))) {
        if (('login_post' == $scheme || 'rpc' == $scheme) && (force_ssl_login() || force_ssl_admin())) {
            $scheme = 'https';
        } elseif ('login' == $scheme && force_ssl_admin()) {
            $scheme = 'https';
        } elseif ('admin' == $scheme && force_ssl_admin()) {
            $scheme = 'https';
        } else {
            $scheme = is_ssl() ? 'https' : 'http';
        }
    }
    $url = $scheme . '://' . $current_site->domain . $current_site->path;
    if (!empty($path) && is_string($path) && strpos($path, '..') === false) {
        $url .= ltrim($path, '/');
    }
    return apply_filters('network_site_url', $url, $path, $orig_scheme);
}
开发者ID:vpatrinica,项目名称:jfdesign,代码行数:38,代码来源:link-template.php


示例14: set_url_scheme

/**
 * Set the scheme for a URL
 *
 * @since 3.4.0
 *
 * @param string $url Absolute url that includes a scheme
 * @param string $scheme Optional. Scheme to give $url. Currently 'http', 'https', 'login', 'login_post', 'admin', or 'relative'.
 * @return string $url URL with chosen scheme.
 */
function set_url_scheme($url, $scheme = null)
{
    $orig_scheme = $scheme;
    if (!in_array($scheme, array('http', 'https', 'relative'))) {
        if (('login_post' == $scheme || 'rpc' == $scheme) && (force_ssl_login() || force_ssl_admin())) {
            $scheme = 'https';
        } elseif ('login' == $scheme && force_ssl_admin()) {
            $scheme = 'https';
        } elseif ('admin' == $scheme && force_ssl_admin()) {
            $scheme = 'https';
        } else {
            $scheme = is_ssl() ? 'https' : 'http';
        }
    }
    if ('relative' == $scheme) {
        $url = preg_replace('#^.+://[^/]*#', '', $url);
    } else {
        $url = preg_replace('#^.+://#', $scheme . '://', $url);
    }
    return apply_filters('set_url_scheme', $url, $scheme, $orig_scheme);
}
开发者ID:mostafiz93,项目名称:PrintfScanf,代码行数:30,代码来源:link-template.php


示例15: bb_set_auth_cookie

 function bb_set_auth_cookie($user_id, $remember = false, $schemes = false)
 {
     global $wp_auth_object;
     if ($remember) {
         $expiration = $expire = time() + 1209600;
     } else {
         $expiration = time() + 172800;
         $expire = 0;
     }
     if (true === $schemes) {
         $schemes = array('secure_auth', 'logged_in');
     } elseif (!is_array($schemes)) {
         $schemes = array();
         if (force_ssl_login() || force_ssl_admin()) {
             $schemes[] = 'secure_auth';
         }
         if (!(force_ssl_login() && force_ssl_admin())) {
             $schemes[] = 'auth';
         }
         $schemes[] = 'logged_in';
     }
     $schemes = array_unique($schemes);
     foreach ($schemes as $scheme) {
         $wp_auth_object->set_auth_cookie($user_id, $expiration, $expire, $scheme);
     }
 }
开发者ID:abc2mit,项目名称:abc2mit.github.io,代码行数:26,代码来源:functions.bb-pluggable.php


示例16: is_ssl_required_to_visit_site

 /**
  * This method checks to see if SSL is required by the site in
  * order to visit it in some way other than only setting the
  * https value in the home or siteurl values.
  *
  * @since 3.2
  * @return boolean
  **/
 private function is_ssl_required_to_visit_site()
 {
     $ssl = is_ssl();
     if (force_ssl_login()) {
         $ssl = true;
     } else {
         if (force_ssl_admin()) {
             $ssl = true;
         }
     }
     return $ssl;
 }
开发者ID:annbransom,项目名称:techishowl_prod_backup,代码行数:20,代码来源:class.jetpack.php


示例17: is_ssl_required_to_visit_site

 /**
  * This method checks to see if SSL is required by the site in
  * order to visit it in some way other than only setting the
  * https value in the home or siteurl values.
  *
  * @since 3.2
  * @return boolean
  **/
 private function is_ssl_required_to_visit_site()
 {
     global $wp_version;
     $ssl = is_ssl();
     if (version_compare($wp_version, '4.4-alpha', '<=') && force_ssl_login()) {
         // force_ssl_login deprecated WP 4.4.
         $ssl = true;
     } else {
         if (force_ssl_admin()) {
             $ssl = true;
         }
     }
     return $ssl;
 }
开发者ID:StefanBonilla,项目名称:CoupSoup,代码行数:22,代码来源:class.jetpack.php


示例18: bb_force_ssl_user_forms

function bb_force_ssl_user_forms($force = '')
{
    bb_log_deprecated('function', __FUNCTION__, 'force_ssl_login');
    return force_ssl_login($force);
}
开发者ID:nxtclass,项目名称:NXTClass,代码行数:5,代码来源:functions.bb-deprecated.php


示例19: geodir_user_signup


//.........这里部分代码省略.........
                            }
                        }
                        $error_message = $errors->get_error_message($error_code);
                    }
                    global $geodir_signup_error;
                    $geodir_signup_error = $error_message;
                }
                if (!is_wp_error($errors)) {
                    $_POST['log'] = $user_login;
                    $_POST['pwd'] = $errors[1];
                    $_POST['testcookie'] = 1;
                    $secure_cookie = '';
                    // If the user wants ssl but the session is not ssl, force a secure cookie.
                    if (!empty($_POST['log'])) {
                        $user_name = sanitize_user($_POST['log']);
                        if ($user = get_user_by('email', $user_name)) {
                            if (get_user_option('use_ssl', $user->ID)) {
                                $secure_cookie = true;
                                force_ssl_admin(true);
                            }
                        }
                    }
                    $redirect_to = $_REQUEST['redirect_to'];
                    if (!isset($_REQUEST['redirect_to']) || $_REQUEST['redirect_to'] == '') {
                        if (isset($_SERVER['HTTP_REFERER']) && strstr($_SERVER['HTTP_REFERER'], home_url())) {
                            $redirect_to = $_SERVER['HTTP_REFERER'];
                        } else {
                            $redirect_to = home_url();
                        }
                    }
                    if (isset($_REQUEST['redirect_add_listing']) && $_REQUEST['redirect_add_listing'] != '') {
                        $redirect_to = $_REQUEST['redirect_add_listing'];
                    }
                    if (!$secure_cookie && is_ssl() && force_ssl_login() && !force_ssl_admin() && 0 !== strpos($redirect_to, 'https') && 0 === strpos($redirect_to, 'http')) {
                        $secure_cookie = false;
                    }
                    $user = wp_signon('', $secure_cookie);
                    $requested_redirect_to = isset($_REQUEST['redirect_add_listing']) && $_REQUEST['redirect_add_listing'] != '' ? $_REQUEST['redirect_add_listing'] : (isset($_REQUEST['redirect_to']) ? $_REQUEST['redirect_to'] : '');
                    /**
                     * Filter the login redirect URL.
                     *
                     * @since 1.4.9
                     * @param string $redirect_to The redirect destination URL.
                     * @param string $requested_redirect_to The requested redirect destination URL passed as a parameter.
                     * @param WP_User|WP_Error $user WP_User object if login was successful, WP_Error object otherwise.
                     */
                    $redirect_to = apply_filters('login_redirect', $redirect_to, $requested_redirect_to, $user);
                    if (!is_wp_error($user)) {
                        wp_safe_redirect($redirect_to);
                        exit;
                    }
                    exit;
                }
            }
            break;
        case 'login':
        default:
            $secure_cookie = '';
            if (!empty($_POST['log'])) {
                $user_name = sanitize_user($_POST['log']);
                if ($user = get_user_by('login', $user_name)) {
                    if (get_user_option('use_ssl', $user->ID)) {
                        $secure_cookie = true;
                        force_ssl_admin(true);
                    }
                } elseif ($user = get_user_by('email', $user_name)) {
开发者ID:kkoppenhaver,项目名称:geodirectory,代码行数:67,代码来源:signup_function.php


示例20: settings

        /**
         * Settings page in admin panel
         *
         * @param none
         * @return void
         */
        function settings()
        {
            if (!current_user_can('manage_options')) {
                wp_die(__('You do not have sufficient permissions to access this page.'));
            }
            if ($_SERVER['REQUEST_METHOD'] === 'POST') {
                $errors = array();
                foreach ($this->options_default as $key => $default) {
                    if (!array_key_exists($key, $_POST) && $default == 0) {
                        $_POST[$key] = 0;
                        update_option($key, $_POST[$key]);
                    } else {
                        if ($key == 'espresso-https_sharedssl_host') {
                            if (isset($_POST[$key])) {
                                $url = parse_url($_POST[$key]);
                            }
                            if (sizeof($url) > 1) {
                                $_POST[$key] = 'https://' . $url['host'] . @$url['path'];
                                if (substr($_POST[$key], -1, 1) == '/') {
                                    $_POST[$key] = substr($_POST[$key], 0, strlen($_POST[$key]) - 1);
                                }
                            } else {
                                if ($_POST['espresso-https_sharedssl'] == 1) {
                                    $errors[] = '<strong>Shared SSL Host</strong> - Invalid host.';
                                    update_option('espresso-https_sharedssl', 0);
                                }
                            }
                        } else {
                            if ($key == 'espresso-https_sharedssl_admin') {
                                if (force_ssl_admin() || force_ssl_login()) {
                                    $errors[] = '<strong>Shared SSL Admin</strong> - FORCE_SSL_ADMIN and FORCE_SSL_LOGIN can not be set to true in your wp-config.php.';
                                    $_POST[$key] = 0;
                                }
                            } else {
                                if ($key == 'espresso-https_externalurls' && @ini_get('allow_url_fopen') != 1) {
                                    $errors[] = '<strong>External HTTPS Elements</strong> - PHP configuration error: allow_url_fopen must be enabled.';
                                    $_POST[$key] = 0;
                                } else {
                                    if ($key == 'espresso-https_disable_autohttps' && version_compare(get_bloginfo('version'), '3.0', '<')) {
                                        $_POST[$key] = 0;
                                    }
                                }
                            }
                        }
                        update_option($key, $_POST[$key]);
                    }
                }
                if (array_key_exists('ajax', $_POST)) {
                    while (@ob_end_clean()) {
                    }
                    ob_start();
                    if (sizeof($errors) > 0) {
                        echo "<div class=\"error below-h2 fade\" id=\"message\">\n\t<ul>\n";
                        foreach ($errors as $error) {
                            echo "\t\t<li><p>" . $error . "</p></li>\n";
                        }
                        echo "\t</ul>\n</div>\n";
                    } else {
                        echo "<div class=\"updated below-h2 fade\" id=\"message\"><p>" . __('Settings saved.', 'event_espresso') . "</p></div>\n";
                    }
                    exit;
                }
            }
            ?>

<div class="wrap">
		<div id="icon-options-event" class="icon32"> </div>
		<h2><?php 
            _e('Event Espresso HTTPS Settings', 'event_espresso');
            ?>
</h2>

<?php 
            if ($_SERVER['REQUEST_METHOD'] === 'POST') {
                if (sizeof($errors) > 0) {
                    echo "<div class=\"error below-h2 fade\" id=\"message\">\n\t<ul>\n";
                    foreach ($errors as $error) {
                        echo "\t\t<li><p>" . $error . "</p></li>\n";
                    }
                    echo "\t</ul>\n</div>\n";
                } else {
                    echo "\t\t<div class=\"updated below-h2 fade\" id=\"message\"><p>" . __('Settings saved.', 'event_espresso') . "</p></div>\n";
                }
            } else {
                echo "\t<div id=\"message-wrap\"><div id=\"message-body\"></div></div>\n";
            }
            //do_action('espresso_right_column');
            ?>

	<div id="eehttps-main">
		<div id="post-body">
        
			<form name="form" id="espresso-https" action="admin.php?page=espresso_https" method="post">
			<?php 
//.........这里部分代码省略.........
开发者ID:macconsultinggroup,项目名称:WordPress,代码行数:101,代码来源:espresso-https.php



注:本文中的force_ssl_login函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP foreachRow函数代码示例发布时间:2022-05-15
下一篇:
PHP force_ssl_content函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap