ActionController: remove getRequestUrl

Thie removes complexity and makes redirection to login less error-
prone.
This commit is contained in:
Thomas Gelf 2014-06-22 12:23:34 +02:00
parent 9608d8254d
commit d69a6d1640
1 changed files with 1 additions and 23 deletions

View File

@ -122,12 +122,7 @@ class ActionController extends Zend_Controller_Action
$this->moduleInit(); $this->moduleInit();
$this->init(); $this->init();
} else { } else {
$url = $this->getRequestUrl(); $this->redirectToLogin(Url::fromRequest());
if ($url === 'default/index/index') {
// TODO: We need our own router :p
$url = 'dashboard';
}
$this->redirectToLogin($url);
} }
} else { } else {
$this->redirectNow(Url::fromPath('install')); $this->redirectNow(Url::fromPath('install'));
@ -369,23 +364,6 @@ class ActionController extends Zend_Controller_Action
$this->redirectNow($url); $this->redirectNow($url);
} }
/**
* Return the URI that can be used to request the current action
*
* @return string return the path to this action: <Module>/<Controller>/<Action>?<Query>
*/
public function getRequestUrl()
{
$base = $this->_request->getModuleName() . '/' .
$this->_request->getControllerName() . '/' .
$this->_request->getActionName();
// TODO: We should NOT fiddle with Querystring here in the middle of nowhere
if (isset($_SERVER['QUERY_STRING']) && $_SERVER['QUERY_STRING'] !== '') {
return $base . '?' . $_SERVER['QUERY_STRING'];
}
return $base;
}
/** /**
* Redirect to a specific url, updating the browsers URL field * Redirect to a specific url, updating the browsers URL field
* *