コード例 #1
0
ファイル: payflow-link.php プロジェクト: grlf/eyedock
 public function directAction(Am_Request $request, Zend_Controller_Response_Http $response, array $invokeArgs)
 {
     if ($request->getFiltered('INVNUM', $request->getFiltered('INVOICE')) == '') {
         $response->setRedirect($this->getRootUrl() . '/thanks');
     } else {
         parent::directAction($request, $response, $invokeArgs);
     }
 }
コード例 #2
0
ファイル: junglepay.php プロジェクト: alexanderTsig/arabic
 public function thanksAction(Am_Request $request, Zend_Controller_Response_Http $response, array $invokeArgs)
 {
     $log = $this->logRequest($request, 'POSTBACK [thanks]');
     if ($this->invoice = $this->getDi()->invoiceTable->findFirstByPublicId($request->getFiltered('referer'))) {
         $log->setInvoice($this->invoice)->update();
         $response->setRedirect($this->getReturnUrl());
         return;
     }
     throw new Am_Exception_InputError("Invoice not found");
 }
コード例 #3
0
ファイル: Abstract.php プロジェクト: Sywooch/forums
 /**
  * Renders a redirect. Most renderers will actually redirect, but some may not.
  *
  * @param integer Type of redirect. See {@link XenForo_ControllerResponse_Redirect}
  * @param string  Target to redirect to
  * @param mixed   Redirect message (unused by some redirect methods)
  * @param array   Extra redirect parameters (unused by HTML)
  *
  * @return string Empty string (nothing to display)
  */
 public function renderRedirect($redirectType, $redirectTarget, $redirectMessage = null, array $redirectParams = array())
 {
     switch ($redirectType) {
         case XenForo_ControllerResponse_Redirect::RESOURCE_CREATED:
         case XenForo_ControllerResponse_Redirect::RESOURCE_UPDATED:
         case XenForo_ControllerResponse_Redirect::SUCCESS:
             $this->_response->setRedirect($redirectTarget, 303);
             break;
         case XenForo_ControllerResponse_Redirect::RESOURCE_CANONICAL:
             $this->_response->setRedirect($redirectTarget, 307);
             break;
         case XenForo_ControllerResponse_Redirect::RESOURCE_CANONICAL_PERMANENT:
             $this->_response->setRedirect($redirectTarget, 301);
             break;
         default:
             throw new XenForo_Exception('Unknown redirect type');
     }
     $this->_needsContainer = false;
     return '';
 }
コード例 #4
0
ファイル: netbilling-form.php プロジェクト: grlf/eyedock
 public function directAction(Am_Request $request, Zend_Controller_Response_Http $response, array $invokeArgs)
 {
     if ($request->getActionName() == 'thanks') {
         if ($this->getConfig('debugLog')) {
             Am_Di::getInstance()->errorLogTable->log('NetBilling Form [response-thanks]:' . json_encode($request->getParams()));
         }
         $this->invoice = $this->getDi()->invoiceTable->findFirstByPublicId($request->getFiltered('Ecom_ConsumerOrderID'));
         $url = $request->get('Ecom_Ezic_Response_StatusCode') == 0 || $request->get('Ecom_Ezic_Response_StatusCode') == 'F' ? $this->getCancelUrl() : $this->getReturnUrl();
         $response->setRedirect($url);
     } else {
         parent::directAction($request, $response, $invokeArgs);
     }
 }
コード例 #5
0
ファイル: OpenId.php プロジェクト: jpbender/mage_virtual
 /**
  * Performs a HTTP redirection to specified URL with additional data.
  * It may generate redirected request using GET or POST HTTP method.
  * The function never returns.
  *
  * @param string $url URL to redirect to
  * @param array $params additional variable/value pairs to send
  * @param Zend_Controller_Response_Abstract $response
  * @param string $method redirection method ('GET' or 'POST')
  */
 public static function redirect($url, $params = null, Zend_Controller_Response_Abstract $response = null, $method = 'GET')
 {
     $url = Zend_OpenId::absoluteUrl($url);
     $body = "";
     if (null === $response) {
         #require_once "Zend/Controller/Response/Http.php";
         $response = new Zend_Controller_Response_Http();
     }
     if ($method == 'POST') {
         $body = "<html><body onLoad=\"document.forms[0].submit();\">\n";
         $body .= "<form method=\"POST\" action=\"{$url}\">\n";
         if (is_array($params) && count($params) > 0) {
             foreach ($params as $key => $value) {
                 $body .= '<input type="hidden" name="' . $key . '" value="' . $value . "\">\n";
             }
         }
         $body .= "<input type=\"submit\" value=\"Continue OpenID transaction\">\n";
         $body .= "</form></body></html>\n";
     } else {
         if (is_array($params) && count($params) > 0) {
             if (strpos($url, '?') === false) {
                 $url .= '?' . self::paramsToQuery($params);
             } else {
                 $url .= '&' . self::paramsToQuery($params);
             }
         }
     }
     if (!empty($body)) {
         $response->setBody($body);
     } else {
         if (!$response->canSendHeaders()) {
             $response->setBody("<script language=\"JavaScript\"" . " type=\"text/javascript\">window.location='{$url}';" . "</script>");
         } else {
             $response->setRedirect($url);
         }
     }
     $response->sendResponse();
     if (self::$exitOnRedirect) {
         exit;
     }
 }
コード例 #6
0
ファイル: Http.php プロジェクト: hazaeluz/magento_connect
 /**
  * Additionally check for session messages in several domains case
  *
  * @param string $url
  * @param int $code
  * @return Mage_Core_Controller_Response_Http
  */
 public function setRedirect($url, $code = 302)
 {
     /**
      * Use single transport object instance
      */
     if (self::$_transportObject === null) {
         self::$_transportObject = new Varien_Object();
     }
     self::$_transportObject->setUrl($url);
     self::$_transportObject->setCode($code);
     Mage::dispatchEvent('controller_response_redirect', array('response' => $this, 'transport' => self::$_transportObject));
     return parent::setRedirect(self::$_transportObject->getUrl(), self::$_transportObject->getCode());
 }
コード例 #7
0
ファイル: Storage.php プロジェクト: alexanderTsig/arabic
 public function action(array $query, $path, $url, Am_Request $request, Zend_Controller_Response_Http $response)
 {
     switch ($query['action']) {
         case 'delete-file':
             $upload = $this->getDi()->uploadTable->load($query['path']);
             $usage = $this->getDi()->uploadTable->findUsage($upload);
             if (!empty($usage)) {
                 $response->setBody($this->renderWarning($usage, $url));
             } else {
                 $upload->delete();
                 $response->setRedirect($url);
             }
             break;
         default:
             throw new Am_Exception_InputError('unknown action!');
     }
 }
コード例 #8
0
ファイル: Echeck.php プロジェクト: grlf/eyedock
 /**
  * Process "cancel recurring" request
  * @param Am_Request $request
  * @param Zend_Controller_Response_Http $response
  * @param array $invokeArgs
  */
 public function doCancelAction(Am_Request $request, Zend_Controller_Response_Http $response, array $invokeArgs)
 {
     $id = $request->getFiltered('id');
     $invoice = $this->getDi()->invoiceTable->findBySecureId($id, 'STOP' . $this->getId());
     if (!$invoice) {
         throw new Am_Exception_InputError("No invoice found [{$id}]");
     }
     if ($invoice->user_id != $this->getDi()->auth->getUserId()) {
         throw new Am_Exception_InternalError("User tried to access foreign invoice: [{$id}]");
     }
     if (method_exists($this, 'cancelInvoice')) {
         $this->cancelInvoice($invoice);
     }
     $invoice->setCancelled();
     $response->setRedirect(ROOT_SURL . '/member/payment-history');
 }
コード例 #9
0
ファイル: payforit.php プロジェクト: grlf/eyedock
 public function directAction(Am_Request $request, Zend_Controller_Response_Http $response, array $invokeArgs)
 {
     $log = $this->logRequest($request);
     switch ($request->getActionName()) {
         case 'ipn':
             // first and rebill payments or subscription cancelled
             if ($this->getConfig('debugLog')) {
                 Am_Di::getInstance()->errorLogTable->log('Payforit. Request[ipn]: ' . json_encode($request->getParams()));
             }
             if ($request->getInt('stop')) {
                 if (!in_array($request->getClientIp(), Am_Paysystem_Payforit::$serverIPs)) {
                     throw new Am_Exception_Paysystem_TransactionInvalid("Bad server IP [{$request->getClientIp()}]");
                 }
                 $invoice = Am_Di::getInstance()->invoiceTable->findFirstByPublicId($request->getFiltered('key'));
                 $invoice->setCancelled(true);
                 return;
             }
             if ($request->getFiltered('status') == 'EXPIRED') {
                 return header("HTTP/1.0 200 OK");
             }
             $transaction = new Am_Paysystem_Transaction_Payforit($this, $request, $response, $invokeArgs);
             try {
                 $transaction->process();
             } catch (Exception $e) {
                 $this->getDi()->errorLogTable->logException($e);
                 return header("HTTP/1.0 400 Bad request");
             }
             $this->invoice = $transaction->getInvoice();
             $log->setInvoice($this->invoice)->update();
             $response->setRedirect($this->getReturnUrl());
             break;
         default:
             if ($this->getConfig('debugLog')) {
                 Am_Di::getInstance()->errorLogTable->log('Payforit. Request[default]: ' . json_encode($request->getParams()));
             }
             return parent::directAction($request, $response, $invokeArgs);
             break;
     }
 }
コード例 #10
0
ファイル: twocheckout.php プロジェクト: alexanderTsig/arabic
 public function thanksAction(Am_Request $request, Zend_Controller_Response_Http $response, array $invokeArgs)
 {
     $log = $this->logRequest($request);
     $transaction = new Am_Paysystem_Transaction_Twocheckout_Thanks($this, $request, $response, $invokeArgs);
     $transaction->setInvoiceLog($log);
     try {
         $transaction->process();
     } catch (Am_Exception_Paysystem_TransactionAlreadyHandled $e) {
         // Ignore. Just show receipt.
     } catch (Exception $e) {
         throw $e;
         $this->getDi()->errorLogTable->logException($e);
         throw Am_Exception_InputError(___("Error happened during transaction handling. Please contact website administrator"));
     }
     $log->setInvoice($transaction->getInvoice())->update();
     $this->invoice = $transaction->getInvoice();
     $response->setRedirect($this->getReturnUrl());
 }
コード例 #11
0
 /**
  * Execute _initConstants.
  */
 protected function _initCheckAuth()
 {
     //Zend_Controller_Request_Abstract
     $this->bootstrap('FrontController');
     $this->_front = $this->getResource('FrontController');
     $oRouter = $this->_front->getRouter();
     $oRequest = new Zend_Controller_Request_Http();
     $oRouter->route($oRequest);
     $ssModuleName = $oRequest->getModuleName();
     $ssControllerName = $oRequest->getControllerName();
     $ssActionName = $oRequest->getActionName();
     $oAuth = Zend_Auth::getInstance();
     if (!$oAuth->hasIdentity()) {
         if ($ssControllerName != 'login') {
             $oResponse = new Zend_Controller_Response_Http();
             $oResponse->setRedirect('/login/index');
             $this->_front->setResponse($oResponse);
         }
     }
 }
コード例 #12
0
ファイル: CreditCard.php プロジェクト: grlf/eyedock
 public function cancelPaymentAction(Am_Request $request, Zend_Controller_Response_Http $response, array $invokeArgs)
 {
     $id = $request->getFiltered('id');
     if (!$id && isset($_GET['id'])) {
         $id = filterId($_GET['id']);
     }
     $invoice = $this->getDi()->invoiceTable->findFirstByPublicId($id);
     if (!$invoice) {
         throw new Am_Exception_InputError("No invoice found [{$id}]");
     }
     if ($invoice->user_id != $this->getDi()->auth->getUserId()) {
         throw new Am_Exception_InternalError("User tried to access foreign invoice: [{$id}]");
     }
     $this->invoice = $invoice;
     // find invoice and redirect to default "cancel" page
     $response->setRedirect($this->getCancelUrl());
 }
コード例 #13
0
ファイル: selectel.php プロジェクト: grlf/eyedock
 public function action(array $query, $path, $url, Am_Request $request, Zend_Controller_Response_Http $response)
 {
     switch ($query['action']) {
         case 'refresh':
             $this->getDi()->cacheFunction->clean();
             $response->setRedirect($url);
             break;
         default:
             throw new Am_Exception_InputError('unknown action!');
     }
 }