當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。