function indexAction() { $this->view->title = ___('Fix aMember Pro License Key'); $this->view->msg = Am_License::getInstance()->check(); $form = new Am_Form_Admin_FixLicense(); $form->setDataSources(array($this->getRequest(), $form->getDsDefaults())); if ($form->isSubmitted() && $form->validate()) { $vars = $form->getValue(); Am_Config::saveValue('license', $vars['license']); Am_Config::saveValue('root_url', $vars['root_url']); Am_Config::saveValue('root_surl', $vars['root_surl']); return $this->redirectLocation($this->getFullUrl()); } $this->view->form = $form; $this->view->display('admin/fixlicense.phtml'); }
public function initFront() { Zend_Controller_Action_HelperBroker::addPrefix('Am_Controller_Action_Helper'); $front = Zend_Controller_Front::getInstance(); $front->setParam('di', $this->di); $front->setParam('noViewRenderer', true); $front->throwExceptions(true); $front->addModuleDirectory(APPLICATION_PATH); $front->setRequest(new Am_Request()); $front->getRequest()->setBaseUrl(); // if baseUrl has not been automatically detected, // try to get it from configured root URLs // it may not help in case of domain name mismatch // then RewriteBase is only the option! if (null == $front->getRequest()->getBaseUrl()) { if ($u = $this->guessBaseUrl()) { $front->getRequest()->setBaseUrl($u); } } if (!$front->getPlugin('Am_Controller_Plugin')) { $front->registerPlugin(new Am_Controller_Plugin($this->di), 90); } if (!defined('REL_ROOT_URL')) { $relRootUrl = $front->getRequest()->getBaseUrl(); // filter it for additional safety $relRootUrl = preg_replace('|[^a-zA-Z0-9.\\/_+-~]|', '', $relRootUrl); define('REL_ROOT_URL', $relRootUrl); } $this->addRoutes($front->getRouter()); Am_License::getInstance()->init($this); }
public function initFront() { Zend_Controller_Action_HelperBroker::addPrefix('Am_Controller_Action_Helper'); $front = Zend_Controller_Front::getInstance(); $front->setParam('di', $this->di); $front->setParam('noViewRenderer', true); $front->throwExceptions(true); $front->addModuleDirectory(APPLICATION_PATH); $front->setRequest(new Am_Request()); if (!$front->getPlugin('Am_Controller_Plugin')) { $front->registerPlugin(new Am_Controller_Plugin($this->di), 90); } if (!defined('REL_ROOT_URL')) { $relRootUrl = $front->getRequest()->getBaseUrl(); // filter it for additional safety $relRootUrl = preg_replace('|[^a-zA-Z0-9.\\/_+-~]|', '', $relRootUrl); define('REL_ROOT_URL', $relRootUrl); } $this->addRoutes($front->getRouter()); Am_License::getInstance()->init($this); }