From: <gem...@li...> - 2012-04-12 12:01:40
|
Revision: 614 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=614&view=rev Author: matijsdejong Date: 2012-04-12 12:01:29 +0000 (Thu, 12 Apr 2012) Log Message: ----------- 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: -------------- tags/1.5.3-rc2/library/classes/Gems/Controller/BrowseEditAction.php tags/1.5.3-rc2/library/classes/Gems/Default/OrganizationAction.php tags/1.5.3-rc2/library/classes/Gems/Upgrades.php tags/1.5.3-rc2/library/classes/Gems/User/PasswordChecker.php tags/1.5.3-rc2/library/classes/Gems/Util/RequestCache.php Modified: tags/1.5.3-rc2/library/classes/Gems/Controller/BrowseEditAction.php =================================================================== --- tags/1.5.3-rc2/library/classes/Gems/Controller/BrowseEditAction.php 2012-04-12 09:35:42 UTC (rev 613) +++ tags/1.5.3-rc2/library/classes/Gems/Controller/BrowseEditAction.php 2012-04-12 12:01:29 UTC (rev 614) @@ -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: tags/1.5.3-rc2/library/classes/Gems/Default/OrganizationAction.php =================================================================== --- tags/1.5.3-rc2/library/classes/Gems/Default/OrganizationAction.php 2012-04-12 09:35:42 UTC (rev 613) +++ tags/1.5.3-rc2/library/classes/Gems/Default/OrganizationAction.php 2012-04-12 12:01:29 UTC (rev 614) @@ -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: tags/1.5.3-rc2/library/classes/Gems/Upgrades.php =================================================================== --- tags/1.5.3-rc2/library/classes/Gems/Upgrades.php 2012-04-12 09:35:42 UTC (rev 613) +++ tags/1.5.3-rc2/library/classes/Gems/Upgrades.php 2012-04-12 12:01:29 UTC (rev 614) @@ -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: tags/1.5.3-rc2/library/classes/Gems/User/PasswordChecker.php =================================================================== --- tags/1.5.3-rc2/library/classes/Gems/User/PasswordChecker.php 2012-04-12 09:35:42 UTC (rev 613) +++ tags/1.5.3-rc2/library/classes/Gems/User/PasswordChecker.php 2012-04-12 12:01:29 UTC (rev 614) @@ -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: tags/1.5.3-rc2/library/classes/Gems/Util/RequestCache.php =================================================================== --- tags/1.5.3-rc2/library/classes/Gems/Util/RequestCache.php 2012-04-12 09:35:42 UTC (rev 613) +++ tags/1.5.3-rc2/library/classes/Gems/Util/RequestCache.php 2012-04-12 12:01:29 UTC (rev 614) @@ -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. |