|
From: <gem...@li...> - 2011-11-15 08:18:58
|
Revision: 214
http://gemstracker.svn.sourceforge.net/gemstracker/?rev=214&view=rev
Author: mennodekker
Date: 2011-11-15 08:18:52 +0000 (Tue, 15 Nov 2011)
Log Message:
-----------
No extra call needed to apply a request, can only be forgotten when switching outside Escort
Modified Paths:
--------------
trunk/library/classes/Gems/User/User.php
trunk/library/classes/GemsEscort.php
Modified: trunk/library/classes/Gems/User/User.php
===================================================================
--- trunk/library/classes/Gems/User/User.php 2011-11-14 17:51:04 UTC (rev 213)
+++ trunk/library/classes/Gems/User/User.php 2011-11-15 08:18:52 UTC (rev 214)
@@ -173,22 +173,6 @@
}
/**
- * Applies any setttings coming from the request object, e.g. processing cookies.
- *
- * @param Zend_Controller_Request_Abstract $request
- * @return Gems_User_User (continuation pattern)
- */
- public function applyRequest(Zend_Controller_Request_Abstract $request)
- {
- // MUtil_Echo::track($this->getOrganizationId(), Gems_Cookies::getOrganization($request));
- if (! $this->getOrganizationId()) {
- $this->_setVar('user_organization_id', Gems_Cookies::getOrganization($request));
- }
-
- return $this;
- }
-
- /**
* Return true if a password reset key can be created.
*
* @return boolean
@@ -332,7 +316,13 @@
*/
public function getOrganizationId()
{
- return $this->_getVar('user_organization_id');
+ $orgId = $this->_getVar('user_organization_id');
+
+ //If not set, read it from the cookie
+ if (is_null($orgId)) {
+ $orgId = Gems_Cookies::getOrganization(Zend_Controller_Front::getInstance()->getRequest());
+ }
+ return $orgId;
}
/**
Modified: trunk/library/classes/GemsEscort.php
===================================================================
--- trunk/library/classes/GemsEscort.php 2011-11-14 17:51:04 UTC (rev 213)
+++ trunk/library/classes/GemsEscort.php 2011-11-15 08:18:52 UTC (rev 214)
@@ -1434,8 +1434,7 @@
public function routeShutdown(Zend_Controller_Request_Abstract $request)
{
$loader = $this->getLoader();
- $user = $loader->getCurrentUser()
- ->applyRequest($request);
+ $user = $loader->getCurrentUser();
// MUtil_Echo::r($request->getParams(), 'params');
// MUtil_Echo::r($request->getUserParams(), 'userparams');
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|