本文整理汇总了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;
}
示例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);
}
示例3: shopp_safe_redirect
/**
* @deprecated Use Shopp::safe_redirect()
**/
function shopp_safe_redirect($location, $status = 302)
{
Shopp::safe_redirect($location, $status);
}
示例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);
}