Details
-
Bug
-
Resolution: Fixed
-
None
-
Medium
-
The initial page of the translate5 instance does not redirect to the login page if a maintenance is scheduled.
-
-
Description
problem
While upgrading the DB on the server I discovered a problem on using PHP HTTP headers.
We are using a mixture of techniques to send HTTP headers. Sometimes the Zend functions for that
$this->_response->setHeader('x-translate5-maintenance-message', $maintenanceMessage);
and sometimes bare php (main index.phtml, redirecting to the login page for example):
header('Location: '.APPLICATION_RUNDIR.'/editor');
Now that produces the following problem:
the above used "Location" header is normally producing implicitly a HTTP/1.1 302 Found header.
But since we set a header via the Zend Tools, the Zend Response is overwriting that with a HTTP/1.1 200 OKFinally the browser receives the Location Header, but does not make a redirect due the HTTP 200.The result in translate5 is, as soon as a maintenance is scheduled (which is delivering the maintenance date and message via X header to the browsers) user navigating to "/" can not login anymore, since the redirect from "/" to "/editor" does not work anymore.So either we fix the Zend package here - probably shardj won't take over the fix then - or we should not use bare php header calls - at least for location headers.
solution
replace all
header('Location: ...
in phtml files (in the project and in all client-specific overrides of them in mittagqi_meta)
with
Zend_Controller_Front::getInstance()->getResponse()->setRedirect( ... );
(basically ... is the url APPLICATION_RUNDIR.'/editor')