当前位置: 首页>>代码示例>>PHP>>正文


PHP Shopp::safe_redirect方法代码示例

本文整理汇总了PHP中Shopp::safe_redirect方法的典型用法代码示例。如果您正苦于以下问题:PHP Shopp::safe_redirect方法的具体用法?PHP Shopp::safe_redirect怎么用?PHP Shopp::safe_redirect使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Shopp的用法示例。


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

示例1: cart

 /**
  * Handles shopping cart requests
  *
  * @author Jonathan Davis
  * @since 1.1
  *
  * @return void
  **/
 public function cart()
 {
     if (isset($_REQUEST['shopping']) && 'reset' == strtolower($_REQUEST['shopping'])) {
         ShoppShopping()->reset();
         Shopp::redirect(Shopp::url());
     }
     if (empty($_REQUEST['cart'])) {
         return true;
     }
     do_action('shopp_cart_request');
     if (isset($_REQUEST['checkout'])) {
         Shopp::redirect(Shopp::url(false, 'checkout', $this->security()));
     }
     if (isset($_REQUEST['ajax'])) {
         $Cart = ShoppOrder()->Cart;
         $Cart->totals();
         $Cart->ajax();
     }
     $redirect = false;
     if (isset($_REQUEST['redirect'])) {
         $redirect = $_REQUEST['redirect'];
     }
     switch ($redirect) {
         case 'checkout':
             Shopp::redirect(Shopp::url(false, $redirect, ShoppOrder()->security()));
             break;
         default:
             if (!empty($_REQUEST['redirect'])) {
                 Shopp::safe_redirect($_REQUEST['redirect']);
             } else {
                 Shopp::redirect(Shopp::url(false, 'cart'));
             }
     }
     exit;
 }
开发者ID:BlessySoftwares,项目名称:anvelocom,代码行数:43,代码来源:Storefront.php

示例2: redirect

 /**
  * Handle login redirects
  *
  * @author Jonathan Davis
  * @since 1.2
  *
  * @return void
  **/
 public function redirect()
 {
     $redirect = false;
     $secure = ShoppOrder()->security();
     if (isset($_REQUEST['redirect']) && !empty($_REQUEST['redirect'])) {
         if (ShoppPages()->exists($_REQUEST['redirect'])) {
             $redirect = Shopp::url(false, $_REQUEST['redirect'], $secure);
         } else {
             $redirect = $_REQUEST['redirect'];
         }
     }
     if (!$redirect) {
         $redirect = apply_filters('shopp_login_redirect', Shopp::url(false, 'account', $secure));
     }
     Shopp::safe_redirect($redirect);
 }
开发者ID:forthrobot,项目名称:inuvik,代码行数:24,代码来源:Login.php

示例3: shopp_safe_redirect

/**
 * @deprecated Use Shopp::safe_redirect()
 **/
function shopp_safe_redirect($location, $status = 302)
{
    Shopp::safe_redirect($location, $status);
}
开发者ID:BlessySoftwares,项目名称:anvelocom,代码行数:7,代码来源:Core.php

示例4: unlock

 /**
  * Unlock an encrypted session
  *
  * This queues up a redirect to bounce the browser back to an
  * HTTPS url with an unlock request.
  *
  * When the unlock request is received, sensitive payment
  * credentials are destroyed and the session is saved
  * unencrypted. The browser is then redirected back to
  * the original HTTP request.
  *
  * @since 1.3.6
  *
  * @return void
  */
 public function unlock()
 {
     // Intercept unlock requests to unencrypt the session
     if (!empty($_REQUEST['unlock'])) {
         ShoppOrder()->securecard();
         $this->secured(false);
         Shopp::safe_redirect($_REQUEST['unlock'], 307);
         exit;
     }
     // When no secure key is available, bounce to SSL and back to unlock the session
     add_action('shopp_init', array($this, 'bouncer'), 100);
 }
开发者ID:forthrobot,项目名称:inuvik,代码行数:27,代码来源:Shopping.php


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