本文整理汇总了PHP中Mage_Core_Controller_Varien_Action::getResponse方法的典型用法代码示例。如果您正苦于以下问题:PHP Mage_Core_Controller_Varien_Action::getResponse方法的具体用法?PHP Mage_Core_Controller_Varien_Action::getResponse怎么用?PHP Mage_Core_Controller_Varien_Action::getResponse使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mage_Core_Controller_Varien_Action
的用法示例。
在下文中一共展示了Mage_Core_Controller_Varien_Action::getResponse方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getRedirectionUrl
protected function getRedirectionUrl(Mage_Core_Controller_Varien_Action $controller)
{
$headers = $controller->getResponse()->getHeaders();
$redirectLocation = "";
foreach ($headers as $item) {
if ($item['name'] == 'Location') {
$redirectLocation = $item['value'];
}
}
return $redirectLocation;
}
示例2: authenticate
/**
* Authenticate controller action by login customer
*
* @param Mage_Core_Controller_Varien_Action $action
* @param bool $loginUrl
* @return bool
*/
public function authenticate(Mage_Core_Controller_Varien_Action $action, $loginUrl = null)
{
if ($this->isLoggedIn()) {
return true;
}
$this->setBeforeAuthUrl(Mage::getUrl('*/*/*', array('_current' => true)));
if (isset($loginUrl)) {
$action->getResponse()->setRedirect($loginUrl);
} else {
$action->setRedirectWithCookieCheck(Mage_Customer_Helper_Data::ROUTE_ACCOUNT_LOGIN, Mage::helper('customer')->getLoginUrlParams());
}
return false;
}
示例3: authenticate
/**
* Authenticate controller action by login customer
*
* @param Mage_Core_Controller_Varien_Action $action
* @return bool
*/
public function authenticate(Mage_Core_Controller_Varien_Action $action, $loginUrl = null)
{
if (!$this->isLoggedIn()) {
$this->setBeforeAuthUrl(AO::getUrl('*/*/*', array('_current' => true)));
if (is_null($loginUrl)) {
$loginUrl = AO::helper('customer')->getLoginUrl();
}
$action->getResponse()->setRedirect($loginUrl);
return false;
}
return true;
}
示例4: redirectToProductUrl
/**
* @param Mage_Core_Controller_Varien_Action
* @param Mage_Catalog_Model_Product
*/
protected function redirectToProductUrl(Mage_Core_Controller_Varien_Action $controllerAction, Mage_Catalog_Model_Product $product)
{
$controllerAction->getResponse()->setRedirect($product->getProductUrl());
}
示例5: testNoCookiesAction
/**
* @magentoAppIsolation enabled
*/
public function testNoCookiesAction()
{
$this->assertEmpty($this->_model->getResponse()->getBody());
$this->_model->noCookiesAction();
$this->assertNotEmpty($this->_model->getResponse()->getBody());
}
示例6: authenticate
/**
* Authenticate controller action by login customer
*
* @param Mage_Core_Controller_Varien_Action $action
* @param bool $loginUrl
* @return bool
*/
public function authenticate(Mage_Core_Controller_Varien_Action $action, $loginUrl = null)
{
if (!$this->_getSession()->isLoggedIn()) {
if ($action->getRequest()->isAjax()) {
$this->_getSession()->setBeforeVendorAuthUrl(Mage::getUrl('*/vendor/', array('_current' => true, '_secure' => true, '_nosid' => true)));
} else {
$oAuthUrl = Mage::getUrl('*/*/*', array('_current' => true, '_secure' => true, '_nosid' => true));
$this->_getSession()->setBeforeVendorAuthUrl($oAuthUrl);
}
if (is_null($loginUrl)) {
if (Mage::getConfig()->getModuleConfig('Ced_CsVendorPanel')->is('active', 'true')) {
$url = 'csmarketplace/account/login';
} else {
$url = 'customer/account/login';
}
$loginUrl = Mage::getUrl($url, array('_secure' => Mage::app()->getFrontController()->getRequest()->isSecure(), '_nosid' => true));
}
if ($action->getRequest()->isAjax()) {
$ajaxResponse = array();
$ajaxResponse['ajaxExpired'] = true;
$ajaxResponse['ajaxRedirect'] = $loginUrl;
$action->getResponse()->setBody(json_encode($ajaxResponse));
return;
}
$action->getResponse()->setRedirect($loginUrl);
return false;
}
if ($this->_getSession()->isLoggedIn() && Mage::helper('csmarketplace')->authenticate($this->_getSession()->getCustomerId())) {
$vendor = Mage::getModel('csmarketplace/vendor')->loadByCustomerId($this->_getSession()->getCustomerId());
if ($vendor && $vendor->getId()) {
$this->_getSession()->setData('vendor_id', $vendor->getId());
$this->_getSession()->setData('vendor', $vendor);
Mage::dispatchEvent('ced_csmarketplace_vendor_authenticate_after', array('session' => $this->_getSession()));
}
}
Mage::dispatchEvent('ced_csmarketplace_vendor_acl_check', array('current' => $this, 'action' => $action));
return $this->_allowedResource;
}
示例7: authenticate
public function authenticate(Mage_Core_Controller_Varien_Action $action, $loginUrl = null)
{
if (!$this->isLoggedIn()) {
$this->setBeforeAuthUrl(Mage::getUrl('*/*/*', array('_current' => true)));
if (is_null($loginUrl)) {
$loginUrl = Mage::getUrl('udropship/vendor/login');
}
$action->getResponse()->setRedirect($loginUrl);
return false;
}
return true;
}