From: <gem...@li...> - 2012-04-12 12:34:43
|
Revision: 615 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=615&view=rev Author: matijsdejong Date: 2012-04-12 12:34:32 +0000 (Thu, 12 Apr 2012) Log Message: ----------- Merged revision(s) 614 from tags/1.5.3-rc2: At organization level Url_base was not always shown Upgrades showed warning Password checker had security leak in that username was show during password reset BrowseEditAction did not pass empty parameters on correctly, so moved filter on empty values from RequestCache ........ Modified Paths: -------------- trunk/library/classes/Gems/Controller/BrowseEditAction.php trunk/library/classes/Gems/Default/OrganizationAction.php trunk/library/classes/Gems/Upgrades.php trunk/library/classes/Gems/User/PasswordChecker.php trunk/library/classes/Gems/Util/RequestCache.php Property Changed: ---------------- trunk/ trunk/library/ Property changes on: trunk ___________________________________________________________________ Modified: svn:mergeinfo - /branches/1.5.0-pulse:306-430,467 /branches/1.5.x:426-455,458-472,475-481 /tags/1.5.0beta1:305 /tags/1.5.1:485,489,509-510 /tags/1.5.3-rc2:612 + /branches/1.5.0-pulse:306-430,467 /branches/1.5.x:426-455,458-472,475-481 /tags/1.5.0beta1:305 /tags/1.5.1:485,489,509-510 /tags/1.5.3-rc2:612,614 Property changes on: trunk/library ___________________________________________________________________ Modified: svn:mergeinfo - /branches/1.5.0-pulse/library:306-344,346,467 /branches/1.5.x/library:426-455,458-472,475-481 /branches/newUser:113-150 /branches/newUser2:175-207 /branches/userloader:259-324 /tags/1.5.0beta1/library:305 /tags/1.5.1/library:485,489,509-510,534 /tags/1.5.3-rc2/library:612 + /branches/1.5.0-pulse/library:306-344,346,467 /branches/1.5.x/library:426-455,458-472,475-481 /branches/newUser:113-150 /branches/newUser2:175-207 /branches/userloader:259-324 /tags/1.5.0beta1/library:305 /tags/1.5.1/library:485,489,509-510,534 /tags/1.5.3-rc2/library:612,614 Modified: trunk/library/classes/Gems/Controller/BrowseEditAction.php =================================================================== --- trunk/library/classes/Gems/Controller/BrowseEditAction.php 2012-04-12 12:01:29 UTC (rev 614) +++ trunk/library/classes/Gems/Controller/BrowseEditAction.php 2012-04-12 12:34:32 UTC (rev 615) @@ -597,9 +597,10 @@ * @param boolean $includeDefaults Include the default values (yes for filtering, no for urls * @param string $sourceAction The action to get the cache from if not the current one. * @param boolean $readonly Optional, tell the cache not to store any new values + * @param boolean $filterEmpty Optional, filter empty values from cache * @return array */ - public function getCachedRequestData($includeDefaults = true, $sourceAction = null, $readonly = false) + public function getCachedRequestData($includeDefaults = true, $sourceAction = null, $readonly = false, $filterEmpty = true) { if (! $this->requestCache) { $this->requestCache = $this->util->getRequestCache($sourceAction, $readonly); @@ -614,6 +615,16 @@ if ($includeDefaults) { $data = $data + $this->getDefaultSearchData(); } + if ($filterEmpty) { + // Clean up empty values + // + // We do this here because empty values can be valid filters that overrule the default + foreach ($data as $key => $value) { + if ((is_array($value) && empty($value)) || (is_string($value) && 0 === strlen($value))) { + unset($data[$key]); + } + } + } return $data; } @@ -964,7 +975,7 @@ $table->setOnEmpty(sprintf($this->_('Unknown %s.'), $this->getTopic(1))); $table->setRepeater($repeater); $table->tfrow($this->createMenuLinks($this->menuShowIncludeLevel), array('class' => 'centerAlign')); - + if ($menuItem = $this->findAllowedMenuItem('edit')) { $table->tbody()->onclick = array('location.href=\'', $menuItem->toHRefAttribute($this->getRequest()), '\';'); } Modified: trunk/library/classes/Gems/Default/OrganizationAction.php =================================================================== --- trunk/library/classes/Gems/Default/OrganizationAction.php 2012-04-12 12:01:29 UTC (rev 614) +++ trunk/library/classes/Gems/Default/OrganizationAction.php 2012-04-12 12:34:32 UTC (rev 615) @@ -119,15 +119,15 @@ 'label', $this->_('Style'), 'multiOptions', MUtil_Lazy::call(array($this->escort, 'getStyles')) ); - $model->setIfExists('gor_url_base', - 'label', $this->_("Default url's"), - 'size', 50, - 'description', sprintf($this->_("Always switch to this organization when %s is accessed from one of these space separated url's. The first is used for mails."), $this->project->getName()) - ); - if ($detailed) { - $model->setIfExists('gor_url_base', 'filter', 'TrailingSlash'); - } } + $model->setIfExists('gor_url_base', + 'label', $this->_("Default url's"), + 'size', 50, + 'description', sprintf($this->_("Always switch to this organization when %s is accessed from one of these space separated url's. The first is used for mails."), $this->project->getName()) + ); + if ($detailed) { + $model->setIfExists('gor_url_base', 'filter', 'TrailingSlash'); + } $model->set( 'gor_iso_lang', 'label', $this->_('Language'), 'multiOptions', $this->util->getLocalized()->getLanguages(), 'default', 'nl' Modified: trunk/library/classes/Gems/Upgrades.php =================================================================== --- trunk/library/classes/Gems/Upgrades.php 2012-04-12 12:01:29 UTC (rev 614) +++ trunk/library/classes/Gems/Upgrades.php 2012-04-12 12:34:32 UTC (rev 615) @@ -55,10 +55,10 @@ //Now set the context $this->setContext('gems'); //And add our patches - $this->register('Upgrade143to15', 'Upgrade from 1.4.3 to 1.5.0'); - $this->register('Upgrade15to151', 'Upgrade from 1.5.0 to 1.5.1'); - $this->register('Upgrade151to152', 'Upgrade from 1.5.1 to 1.5.2'); - $this->register('Upgrade152to153', 'Upgrade from 1.5.2 to 1.5.3'); + $this->register(array($this, 'Upgrade143to150'), 'Upgrade from 1.4.3 to 1.5.0'); + $this->register(array($this, 'Upgrade150to151'), 'Upgrade from 1.5.0 to 1.5.1'); + $this->register(array($this, 'Upgrade151to152'), 'Upgrade from 1.5.1 to 1.5.2'); + $this->register(array($this, 'Upgrade152to153'), 'Upgrade from 1.5.2 to 1.5.3'); } @@ -67,7 +67,7 @@ * 1. execute db patches 42 and 43 * 2. create new tables */ - public function Upgrade143to15() + public function Upgrade143to150() { $this->_batch->addTask('Db_ExecutePatch', 42); $this->_batch->addTask('Db_ExecutePatch', 43); @@ -90,7 +90,7 @@ /** * To upgrade to 1.5.1 just execute patchlevel 44 */ - public function Upgrade15to151() + public function Upgrade150to151() { $this->_batch->addTask('Db_ExecutePatch', 44); Modified: trunk/library/classes/Gems/User/PasswordChecker.php =================================================================== --- trunk/library/classes/Gems/User/PasswordChecker.php 2012-04-12 12:01:29 UTC (rev 614) +++ trunk/library/classes/Gems/User/PasswordChecker.php 2012-04-12 12:34:32 UTC (rev 615) @@ -185,7 +185,7 @@ $lpwd = strtolower($password); if ((false !== strpos($lpwd, strtolower($this->user->getLoginName()))) || (null === $password)) { - $this->_addError(sprintf($this->translate->_('should not contain your login name "%s"'), $this->user->getLoginName())); + $this->_addError($this->translate->_('should not contain your login name')); } } } Modified: trunk/library/classes/Gems/Util/RequestCache.php =================================================================== --- trunk/library/classes/Gems/Util/RequestCache.php 2012-04-12 12:01:29 UTC (rev 614) +++ trunk/library/classes/Gems/Util/RequestCache.php 2012-04-12 12:34:32 UTC (rev 615) @@ -270,7 +270,7 @@ unset($params[$key]); } } - // MUtil_Echo::r($params); + // MUtil_Echo::track($params); $this->setProgramParams($params); @@ -290,19 +290,13 @@ } /** - * Ste the keys stored fot this cache + * Set the keys stored fot this cache * * @param array $programParams * @return Gems_Util_RequestCache (continuation pattern) */ public function setProgramParams(array $programParams) { - foreach ($programParams as $key => $value) { - if ((is_array($value) && empty($value)) || (is_string($value) && 0 === strlen($value))) { - unset($programParams[$key]); - } - } - // Store result $this->_programParams = $programParams; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |