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


PHP Tools::redirect方法代码示例

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


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

示例1: preProcess

 public function preProcess()
 {
     parent::preProcess();
     $customer = new Customer((int) self::$cookie->id_customer);
     if ($idAdd = Tools::getValue('add')) {
         $res = Db::getInstance()->ExecuteS("insert into ps_wishlist(id_customer, id_product) values(" . self::$cookie->id_customer . ", " . $idAdd . ")");
         Tools::captureActivity(PSTAT_ADD_WL, $idAdd);
         Tools::redirect('wishlist.php');
     }
     if ($idDelete = Tools::getValue('delete')) {
         $res = Db::getInstance()->ExecuteS("delete from ps_wishlist where id_customer = " . self::$cookie->id_customer . " and id_product = " . $idDelete);
         Tools::captureActivity(PSTAT_DEL_WL, $idDelete);
         Tools::redirect('wishlist.php');
     }
     $sql = "select id_product from ps_wishlist where id_customer = " . self::$cookie->id_customer;
     $res = Db::getInstance()->ExecuteS($sql);
     if ($res) {
         $productIds = array();
         foreach ($res as $row) {
             $productIds[] = $row['id_product'];
         }
         $total_found = 0;
         try {
             $wishlist_products = SolrSearch::getProductsForIDs($productIds, $total_found, 1, 100);
             self::$smarty->assign('wishlist_products', $wishlist_products);
         } catch (Exception $e) {
         }
     }
 }
开发者ID:priyankajsr19,项目名称:indusdiva2,代码行数:29,代码来源:WishListController.php

示例2: displayProcess

function displayProcess($payerID)
{
    global $cookie;
    $cookie->paypal_token = strval($cookie->paypal_token);
    $cookie->paypal_payer_id = $payerID;
    Tools::redirect('order.php?step=1&back=paypal');
}
开发者ID:greench,项目名称:prestashop,代码行数:7,代码来源:submit.php

示例3: postProcess

 public function postProcess()
 {
     $cart = $this->context->cart;
     if ($cart->id_customer == 0 || $cart->id_address_delivery == 0 || $cart->id_address_invoice == 0 || !$this->module->active) {
         Tools::redirect('index.php?controller=order&step=1');
     }
     // Check that this payment option is still available in case the customer changed his address just before the end of the checkout process
     $authorized = false;
     foreach (Module::getPaymentModules() as $module) {
         if ($module['name'] == 'cheque') {
             $authorized = true;
             break;
         }
     }
     if (!$authorized) {
         die($this->module->l('This payment method is not available.', 'validation'));
     }
     $customer = new Customer($cart->id_customer);
     if (!Validate::isLoadedObject($customer)) {
         Tools::redirect('index.php?controller=order&step=1');
     }
     $currency = $this->context->currency;
     $total = (double) $cart->getOrderTotal(true, Cart::BOTH);
     $mailVars = array('{cheque_name}' => Configuration::get('CHEQUE_NAME'), '{cheque_address}' => Configuration::get('CHEQUE_ADDRESS'), '{cheque_address_html}' => str_replace("\n", '<br />', Configuration::get('CHEQUE_ADDRESS')));
     $this->module->validateOrder((int) $cart->id, Configuration::get('PS_OS_CHEQUE'), $total, $this->module->displayName, NULL, $mailVars, (int) $currency->id, false, $customer->secure_key);
     Tools::redirect('index.php?controller=order-confirmation&id_cart=' . (int) $cart->id . '&id_module=' . (int) $this->module->id . '&id_order=' . $this->module->currentOrder . '&key=' . $customer->secure_key);
 }
开发者ID:dev-lav,项目名称:htdocs,代码行数:27,代码来源:validation.php

示例4: postProcess

 /**
  * @see FrontController::postProcess()
  */
 public function postProcess()
 {
     $cart = $this->context->cart;
     if ($cart->id_customer == 0 || $cart->id_address_delivery == 0 || $cart->id_address_invoice == 0 || !$this->module->active) {
         Tools::redirect('index.php?controller=order&step=1');
     }
     // Check that this payment option is still available in case the customer changed his address just before the end of the checkout process
     $authorized = false;
     foreach (Module::getPaymentModules() as $module) {
         if ($module['name'] == 'bankpermata') {
             $authorized = true;
             break;
         }
     }
     if (!$authorized) {
         die($this->module->getTranslator()->trans('This payment method is not available.', array(), 'Modules.BankPermata.Shop'));
     }
     $customer = new Customer($cart->id_customer);
     if (!Validate::isLoadedObject($customer)) {
         Tools::redirect('index.php?controller=order&step=1');
     }
     $currency = $this->context->currency;
     $total = (double) $cart->getOrderTotal(true, Cart::BOTH);
     $mailVars = array('{bankpermata_owner}' => Configuration::get('BANK_PERMATA_OWNER'), '{bankpermata_details}' => nl2br(Configuration::get('BANK_PERMATA_DETAILS')), '{bankpermata_address}' => nl2br(Configuration::get('BANK_PERMATA_ADDRESS')));
     $this->module->validateOrder($cart->id, Configuration::get('PS_OS_BANKPERMATA'), $total, $this->module->displayName, NULL, $mailVars, (int) $currency->id, false, $customer->secure_key);
     Tools::redirect('index.php?controller=order-confirmation&id_cart=' . $cart->id . '&id_module=' . $this->module->id . '&id_order=' . $this->module->currentOrder . '&key=' . $customer->secure_key);
 }
开发者ID:prestanesia,项目名称:bankpermata,代码行数:30,代码来源:validation.php

示例5: preProcess

 public function preProcess()
 {
     parent::preProcess();
     if (self::$cookie->isLogged()) {
         Tools::redirect('history.php');
     }
 }
开发者ID:greench,项目名称:prestashop,代码行数:7,代码来源:GuestTrackingController.php

示例6: preProcess

 public function preProcess()
 {
     if (!Tools::hasFunction('admin_list')) {
         Tools::redirect('index.php');
     }
     $this->brandNavi[] = array("name" => "Admin List", "url" => $this->php_self);
     $idList = $_POST['idlist'] == '' ? '' : $_POST['idlist'];
     if (Tools::isSubmit("delete")) {
         if (is_array($idList)) {
             foreach ($idList as $aid) {
                 Member::DeleteMember($aid);
             }
         }
         exit;
     } else {
         if (Tools::isSubmit("del_permanent")) {
             if (is_array($idList)) {
                 foreach ($idList as $aid) {
                     Member::DeleteMemberPermanent($aid);
                 }
             }
             exit;
         } else {
             if (Tools::isSubmit("undel")) {
                 if (is_array($idList)) {
                     foreach ($idList as $aid) {
                         Member::UnDeleteMember($aid);
                     }
                 }
                 exit;
             }
         }
     }
 }
开发者ID:khuyennd,项目名称:dev-tasagent,代码行数:34,代码来源:AdminListController.php

示例7: preProcess

 public function preProcess()
 {
     parent::preProcess();
     $this->id_cart = (int) Tools::getValue('id_cart', 0);
     /* check if the cart has been made by a Guest customer, for redirect link */
     if (Cart::isGuestCartByCartId($this->id_cart)) {
         $redirectLink = 'guest-tracking.php';
     } else {
         $redirectLink = 'history.php';
     }
     $this->id_module = (int) Tools::getValue('id_module', 0);
     $this->id_order = Order::getOrderByCartId((int) $this->id_cart);
     $this->secure_key = Tools::getValue('key', false);
     if (!$this->id_order or !$this->id_module or !$this->secure_key or empty($this->secure_key)) {
         Tools::redirect($redirectLink . (Tools::isSubmit('slowvalidation') ? '?slowvalidation' : ''));
     }
     $order = new Order((int) $this->id_order);
     if (!Validate::isLoadedObject($order) or $order->id_customer != self::$cookie->id_customer or $this->secure_key != $order->secure_key) {
         Tools::redirect($redirectLink);
     }
     $module = Module::getInstanceById((int) $this->id_module);
     if ($order->payment != $module->displayName) {
         Tools::redirect($redirectLink);
     }
 }
开发者ID:nicolasjeol,项目名称:hec-ecommerce,代码行数:25,代码来源:OrderConfirmationController.php

示例8: postProcess

 /**
  * This method is called when the customer goes back to shop, after he made a payment.
  * The customer will redirected either to the order confirmation page or to an error page
  * @return mixed
  */
 public function postProcess()
 {
     require_once dirname(__FILE__) . '/../../api/loader.php';
     $alipay = new Alipay();
     $payment_response = new PaymentResponse();
     $payment_response->getPostData();
     if ($payment_response->getTradeStatus() == 'TRADE_FINISHED') {
         $payment_response->setIdModule($this->module->id);
         if (!$payment_response->processResponse()) {
             $errors = $payment_response->getErrors();
             if ($errors) {
                 foreach ($errors as $error) {
                     $this->errors[] = $error;
                 }
                 return $this->setTemplate('error.tpl');
             }
         }
         if ($payment_response->getIdOrder()) {
             $params = array('id_cart' => $payment_response->getIdCart(), 'id_module' => $payment_response->getIdModule(), 'id_order' => $payment_response->getIdOrder(), 'key' => $payment_response->getSecureKey());
             $s = $this->context->link->getModuleLink('alipay', 'confirmation', $params);
             Tools::redirect($s);
         } else {
             $this->context->smarty->assign($payment_response->getTplVars());
             return $this->setTemplate('check_order.tpl');
         }
     }
     $this->errors[] = $alipay->l('An error occured.
     Please contact the merchant to have more informations');
     return $this->setTemplate('error.tpl');
 }
开发者ID:mathieuesteban,项目名称:alipay,代码行数:35,代码来源:confirmation.php

示例9: postProcess

 /**
  * @see FrontController::postProcess()
  */
 public function postProcess()
 {
     $cart = $this->context->cart;
     if ($cart->id_customer == 0 || $cart->id_address_delivery == 0 || $cart->id_address_invoice == 0 || !$this->module->active) {
         Tools::redirect('index.php?controller=order&step=1');
     }
     // Check that this payment option is still available in case the customer changed his address just before the end of the checkout process
     $authorized = false;
     foreach (Module::getPaymentModules() as $module) {
         if ($module['name'] == 'swipp') {
             $authorized = true;
             break;
         }
     }
     if (!$authorized) {
         die($this->module->l('This payment method is not available.', 'validation'));
     }
     $customer = new Customer($cart->id_customer);
     if (!Validate::isLoadedObject($customer)) {
         Tools::redirect('index.php?controller=order&step=1');
     }
     $currency = $this->context->currency;
     $total = (double) $cart->getOrderTotal(true, Cart::BOTH);
     $mailVars = array('{swipp_phone}' => Configuration::get('SWIPP_PHONE'), '{swipp_owner}' => Configuration::get('SWIPP_OWNER'), '{swipp_payment_dkk}' => Tools::displayPrice($this->module->__getPriceDkk($cart), (int) Currency::getIdByIsoCode('DKK')));
     $this->module->validateOrder($cart->id, Configuration::get('SWIPP_PAYMENT_STATE'), $total, $this->module->displayName, NULL, $mailVars, (int) $currency->id, false, $customer->secure_key);
     Tools::redirect('index.php?controller=order-confirmation&id_cart=' . $cart->id . '&id_module=' . $this->module->id . '&id_order=' . $this->module->currentOrder . '&key=' . $customer->secure_key);
 }
开发者ID:Onasusweb,项目名称:swipp-prestashop,代码行数:30,代码来源:validation.php

示例10: displayMain

 public function displayMain()
 {
     global $smarty, $link, $cookie;
     if ($cookie->logged) {
         Tools::redirect($link->getPage('MyaccountView'));
     }
     if (Tools::isSubmit('loginSubmit')) {
         if (Tools::getRequest('email') && Tools::getRequest('passwd')) {
             $user = new User();
             if ($user->getByEmail(Tools::getRequest('email'), Tools::getRequest('passwd'))) {
                 $user->logined();
                 if (Tools::G("step") == 2) {
                     Tools::redirect($link->getPage('CheckoutView'));
                 } else {
                     Tools::redirect($link->getPage('MyaccountView'));
                 }
             } else {
                 $smarty->assign('errors', $user->_errors);
             }
         } else {
             $smarty->assign('errors', 'invalid email password combination');
         }
     }
     return $smarty->fetch('login.tpl');
 }
开发者ID:yiuked,项目名称:tmcart,代码行数:25,代码来源:LoginView.php

示例11: initContent

 public function initContent()
 {
     $payu = new PayU();
     $id_cart = Tools::getValue('id_cart');
     $id_payu_session = $this->context->cookie->__get('payu_order_id');
     if (Tools::getValue('error')) {
         Tools::redirect('order.php?error=' . Tools::getValue('error'), __PS_BASE_URI__, null, 'HTTP/1.1 301 Moved Permanently');
     }
     $payu->id_cart = $id_cart;
     $payu->payu_order_id = $id_payu_session;
     $order_payment = $payu->getOrderPaymentBySessionId($payu->payu_order_id);
     $id_order = (int) $order_payment['id_order'];
     $payu->id_cart = (int) $order_payment['id_cart'];
     // if order not validated yet
     $cart_id = $payu->id_cart;
     if ($id_order == 0 && $order_payment['status'] == PayU::PAYMENT_STATUS_NEW) {
         $cart = new Cart($payu->id_cart);
         $cart_id = $cart->id;
         $payu->validateOrder($cart->id, (int) Configuration::get('PAYU_PAYMENT_STATUS_PENDING'), $cart->getOrderTotal(true, Cart::BOTH), $payu->displayName, 'PayU cart ID: ' . $cart_id . ', sessionId: ' . $payu->payu_order_id, null, (int) $cart->id_currency, false, $cart->secure_key, Context::getContext()->shop->id ? new Shop((int) Context::getContext()->shop->id) : null);
         $payu->id_order = $payu->current_order = $payu->{'currentOrder'};
         $payu->updateOrderPaymentStatusBySessionId(PayU::PAYMENT_STATUS_INIT);
     }
     $id_order = $payu->getOrderIdBySessionId($id_payu_session);
     if (!empty($id_order)) {
         $payu->id_order = $id_order;
         $payu->updateOrderData();
     }
     Tools::redirect('index.php?controller=order-confirmation&id_cart=' . $cart_id, __PS_BASE_URI__, null, 'HTTP/1.1 301 Moved Permanently');
 }
开发者ID:bonekost,项目名称:plugin_prestashop,代码行数:29,代码来源:success.php

示例12: accessRestriction

 private function accessRestriction()
 {
     if ($this->access_restriction && !Auth::getUser()) {
         Tools::redirect($this->context->link->getPageLink('auth'));
     }
     $this->smarty->assign('user', Auth::getUser());
 }
开发者ID:jessylenne,项目名称:sf2-technical-test,代码行数:7,代码来源:AuthenticatedController.php

示例13: postProcess

 public function postProcess()
 {
     $this->context->smarty->assign(array("cfmmsg_flag" => Tools::getValue("cfmmsg_flag")));
     if (Tools::isSubmit("submitSellerAccount")) {
         AgileMultipleSeller::createSellerAccount(new Customer(self::$cookie->id_customer));
         Tools::redirect(self::$link->getModuleLink("agilemultipleseller", "sellersummary", array("cfmmsg_flag" => 1), true));
     }
     if (Tools::getValue("submitRequest") == "B2T") {
         $zbdpzet = "errmsg";
         ${${"GLOBALS"}["uswhdzhd"]} = AgileMultipleSeller::convert_balance_to_token(self::$cookie->id_customer, (double) Tools::getValue("amount_to_convert"), $this->l('CHANGE BALANCE TO TOKENS'));
         if (!empty(${$zbdpzet})) {
             $this->errors[] = ${${"GLOBALS"}["uswhdzhd"]};
             return;
         }
         Tools::redirect(self::$link->getModuleLink("agilemultipleseller", "sellersummary", array("cfmmsg_flag" => 1), true));
     }
     if (Tools::getValue("submitRequest") == "MPR") {
         ${${"GLOBALS"}["uswhdzhd"]} = AgileMultipleSeller::make_fund_request(self::$cookie->id_customer, (double) Tools::getValue("amount_to_convert"), $this->l('MAKE FUND REQUEST'));
         if (!empty(${${"GLOBALS"}["uswhdzhd"]})) {
             $this->errors[] = ${${"GLOBALS"}["uswhdzhd"]};
             return;
         }
         Tools::redirect(self::$link->getModuleLink("agilemultipleseller", "sellersummary", array("cfmmsg_flag" => 1), true));
     }
     if (Tools::getValue("submitRequest") == "T2B") {
         ${"GLOBALS"}["jjycov"] = "errmsg";
         ${${"GLOBALS"}["jjycov"]} = AgileMultipleSeller::convert_tokens_to_balance(self::$cookie->id_customer, (double) Tools::getValue("tokens_to_convert"), $this->l('CHANGE TOKENS TO BALANCE'));
         if (!empty(${${"GLOBALS"}["uswhdzhd"]})) {
             $this->errors[] = ${${"GLOBALS"}["uswhdzhd"]};
             return;
         }
         Tools::redirect(self::$link->getModuleLink("agilemultipleseller", "sellersummary", array("cfmmsg_flag" => 1), true));
     }
 }
开发者ID:evilscripts,项目名称:gy,代码行数:34,代码来源:sellersummary.php

示例14: displayMain

 public function displayMain()
 {
     global $smarty, $link, $cookie;
     $errors = false;
     if (!$cookie->logged || !User::checkPassword($cookie->id_user, $cookie->passwd)) {
         Tools::redirect($link->getPage('userView'));
     }
     $referer = Tools::Q('referer') ? $link->getPage(Tools::Q('referer')) : $link->getPage('MyAddressesView');
     if ($id_address = Tools::Q('id')) {
         $address = new Address((int) $id_address);
         if (Tools::isSubmit('saveAddress')) {
             $address->copyFromPost();
             if ($address->update()) {
                 Tools::redirect($referer);
             } else {
                 $errors = $address->_errors;
             }
         }
         $smarty->assign('address', $address);
     } elseif (Tools::isSubmit('saveAddress')) {
         $address = new Address();
         $address->copyFromPost();
         $address->id_user = $cookie->id_user;
         if ($address->add()) {
             Tools::redirect($referer);
         } else {
             $errors = $address->_errors;
         }
     }
     $countrys = Country::loadData(1, 1000, 'position', 'asc', array('active' => true));
     $smarty->assign(array('referer' => Tools::Q('referer'), 'countrys' => $countrys, 'errors' => $errors));
     return $smarty->fetch('address.tpl');
 }
开发者ID:yiuked,项目名称:tmcart,代码行数:33,代码来源:AddressView.php

示例15: postProcess

 /**
  * @see FrontController::postProcess()
  */
 public function postProcess()
 {
     $oplata = new Oplata();
     if ($_POST['order_status'] == OplataCls::ORDER_DECLINED) {
         $this->errors[] = Tools::displayError('Order declined');
     }
     $settings = array('merchant_id' => $oplata->getOption('merchant'), 'secret_key' => $oplata->getOption('secret_key'));
     $isPaymentValid = OplataCls::isPaymentValid($settings, $_POST);
     if ($isPaymentValid !== true) {
         $this->errors[] = Tools::displayError($isPaymentValid);
     }
     $cart = $this->context->cart;
     if ($cart->id_customer == 0 || $cart->id_address_delivery == 0 || $cart->id_address_invoice == 0 || !$this->module->active) {
         Tools::redirect('index.php?controller=order&step=1');
     }
     $customer = new Customer($cart->id_customer);
     if (!Validate::isLoadedObject($customer)) {
         Tools::redirect('index.php?controller=order&step=1');
     }
     if (empty($this->errors)) {
         list($orderId, ) = explode(OplataCls::ORDER_SEPARATOR, $_POST['order_id']);
         $history = new OrderHistory();
         $history->id_order = $orderId;
         $history->changeIdOrderState((int) Configuration::get('PS_OS_PAYMENT'), $orderId);
         $history->addWithemail(true, array('order_name' => $orderId));
         Tools::redirect('index.php?controller=order-confirmation&id_cart=' . $cart->id . '&id_module=' . $this->module->id . '&id_order=' . $this->module->currentOrder . '&key=' . $customer->secure_key);
     }
 }
开发者ID:venya,项目名称:prestashop,代码行数:31,代码来源:result.php


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