From: <gem...@li...> - 2011-11-21 10:57:23
|
Revision: 249 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=249&view=rev Author: michieltcs Date: 2011-11-21 10:57:14 +0000 (Mon, 21 Nov 2011) Log Message: ----------- Inspired by r247 Revision Links: -------------- http://gemstracker.svn.sourceforge.net/gemstracker/?rev=247&view=rev Modified Paths: -------------- trunk/library/classes/Gems/User/UserLoader.php Modified: trunk/library/classes/Gems/User/UserLoader.php =================================================================== --- trunk/library/classes/Gems/User/UserLoader.php 2011-11-21 10:23:53 UTC (rev 248) +++ trunk/library/classes/Gems/User/UserLoader.php 2011-11-21 10:57:14 UTC (rev 249) @@ -115,8 +115,8 @@ if (! $this->session instanceof Zend_Session_Namespace) { $this->session = new Zend_Session_Namespace('gems.' . GEMS_PROJECT_NAME . '.session'); - $idleTimeout = ($this->project->session['idleTimeout'] ? $this->project->session['idleTimeout'] : 1800); - + $idleTimeout = $this->project->getSessionTimeout(); + $this->session->setExpirationSeconds($idleTimeout); $extras['session'] = $this->session; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2011-12-15 14:04:41
|
Revision: 357 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=357&view=rev Author: mennodekker Date: 2011-12-15 14:04:32 +0000 (Thu, 15 Dec 2011) Log Message: ----------- Allow userloader to report the available UserDefinitions so projects can extend and replace with or add their own (not used yet) Modified Paths: -------------- trunk/library/classes/Gems/User/UserLoader.php Modified: trunk/library/classes/Gems/User/UserLoader.php =================================================================== --- trunk/library/classes/Gems/User/UserLoader.php 2011-12-15 11:34:17 UTC (rev 356) +++ trunk/library/classes/Gems/User/UserLoader.php 2011-12-15 14:04:32 UTC (rev 357) @@ -1,5 +1,4 @@ <?php - /** * Copyright (c) 2011, Erasmus MC * All rights reserved. @@ -49,10 +48,11 @@ /** * User class constants */ - const USER_NOLOGIN = 'NoLogin'; - const USER_OLD_STAFF = 'OldStaffUser'; - const USER_PROJECT = 'ProjectUser'; - const USER_STAFF = 'StaffUser'; + const USER_NOLOGIN = 'NoLogin'; + const USER_OLD_STAFF = 'OldStaffUser'; + const USER_PROJECT = 'ProjectUser'; + const USER_RESPONDENT = 'RespondentUser'; + const USER_STAFF = 'StaffUser'; /** * Allows sub classes of Gems_Loader_LoaderAbstract to specify the subdirectory where to look for. @@ -86,6 +86,11 @@ protected $session; /** + * @var Zend_Translate_Adapter + */ + protected $translate; + + /** * There can be only one, current user that is. * * @var Gems_User_User @@ -126,6 +131,34 @@ } /** + * Get userclass / description array of available UserDefinitions for respondents + * + * @return array + */ + public function getAvailableRespondentDefinitions() + { + $definitions = array( + self::USER_RESPONDENT => $this->translate->_('Db storage') + ); + + return $definitions; + } + + /** + * Get userclass / description array of available UserDefinitions for staff + * + * @return array + */ + public function getAvailableStaffDefinitions() + { + $definitions = array( + self::USER_STAFF => $this->translate->_('Db storage') + ); + + return $definitions; + } + + /** * Get the currently loggin in user * * @return Gems_User_User This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2012-03-28 09:37:04
|
Revision: 569 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=569&view=rev Author: matijsdejong Date: 2012-03-28 09:36:53 +0000 (Wed, 28 Mar 2012) Log Message: ----------- Bug changed all users to RespondentUser Modified Paths: -------------- trunk/library/classes/Gems/User/UserLoader.php Modified: trunk/library/classes/Gems/User/UserLoader.php =================================================================== --- trunk/library/classes/Gems/User/UserLoader.php 2012-03-28 09:27:38 UTC (rev 568) +++ trunk/library/classes/Gems/User/UserLoader.php 2012-03-28 09:36:53 UTC (rev 569) @@ -170,7 +170,7 @@ // Update class definition if it already exists if ($login_id = $this->db->fetchOne($select)) { $where = implode(' ', $select->getPart(Zend_Db_Select::WHERE)); - $this->db->update('gems__user_logins', $values); + $this->db->update('gems__user_logins', $values, $where); } else { $values['gul_login'] = $login_name; @@ -503,6 +503,7 @@ // MUtil_Echo::track($defName, $login_name, $userOrganization, $values); $values = $this->ensureDefaultUserValues($values, $definition, $defName); + MUtil_Echo::track($values, $userName, $userOrganization, $defName); return $this->_loadClass('User', true, array($values, $definition)); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2012-05-21 09:00:55
|
Revision: 694 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=694&view=rev Author: mennodekker Date: 2012-05-21 09:00:49 +0000 (Mon, 21 May 2012) Log Message: ----------- Fixed apc cache slam Modified Paths: -------------- trunk/library/classes/Gems/User/UserLoader.php Modified: trunk/library/classes/Gems/User/UserLoader.php =================================================================== --- trunk/library/classes/Gems/User/UserLoader.php 2012-05-20 19:48:24 UTC (rev 693) +++ trunk/library/classes/Gems/User/UserLoader.php 2012-05-21 09:00:49 UTC (rev 694) @@ -349,6 +349,7 @@ static $urls; if (! is_array($urls)) { + $urls = array(); if ($this->cache) { $cacheId = GEMS_PROJECT_NAME . '__' . get_class($this) . '__organizations_url'; $urls = $this->cache->load($cacheId); @@ -356,14 +357,15 @@ $cacheId = false; } - if (! $urls) { + // When we don't use cache or cache reports 'false' for a miss or expiration + // then try to reload the data + if ($cacheId === false || $urls === false) { try { $data = $this->db->fetchPairs("SELECT gor_id_organization, gor_url_base FROM gems__organizations WHERE gor_active=1 AND gor_url_base IS NOT NULL"); } catch (Zend_Db_Exception $zde) { // Table might not be filled $data = array(); } - $urls = array(); foreach ($data as $orgId => $urlsBase) { foreach (explode(' ', $urlsBase) as $url) { if ($url) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2012-05-23 08:01:39
|
Revision: 697 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=697&view=rev Author: mennodekker Date: 2012-05-23 08:01:27 +0000 (Wed, 23 May 2012) Log Message: ----------- Now really fixing apc cache slam Modified Paths: -------------- trunk/library/classes/Gems/User/UserLoader.php Modified: trunk/library/classes/Gems/User/UserLoader.php =================================================================== --- trunk/library/classes/Gems/User/UserLoader.php 2012-05-21 13:24:59 UTC (rev 696) +++ trunk/library/classes/Gems/User/UserLoader.php 2012-05-23 08:01:27 UTC (rev 697) @@ -349,7 +349,6 @@ static $urls; if (! is_array($urls)) { - $urls = array(); if ($this->cache) { $cacheId = GEMS_PROJECT_NAME . '__' . get_class($this) . '__organizations_url'; $urls = $this->cache->load($cacheId); @@ -360,6 +359,7 @@ // When we don't use cache or cache reports 'false' for a miss or expiration // then try to reload the data if ($cacheId === false || $urls === false) { + $urls = array(); try { $data = $this->db->fetchPairs("SELECT gor_id_organization, gor_url_base FROM gems__organizations WHERE gor_active=1 AND gor_url_base IS NOT NULL"); } catch (Zend_Db_Exception $zde) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2012-07-13 11:32:42
|
Revision: 843 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=843&view=rev Author: mennodekker Date: 2012-07-13 11:32:36 +0000 (Fri, 13 Jul 2012) Log Message: ----------- Add some documentation about the way the userclass is selected and modified select to include the order by field Modified Paths: -------------- trunk/library/classes/Gems/User/UserLoader.php Modified: trunk/library/classes/Gems/User/UserLoader.php =================================================================== --- trunk/library/classes/Gems/User/UserLoader.php 2012-07-13 10:27:56 UTC (rev 842) +++ trunk/library/classes/Gems/User/UserLoader.php 2012-07-13 11:32:36 UTC (rev 843) @@ -556,12 +556,20 @@ { $select = $this->db->select(); + /** + * tolerance field: + * 1 - login and organization match + * 2 - login found in an organization with access to the requested organization + * 3 - login found in another organization without rights to the requested organiation + * (could be allowed due to privilege with rights to ALL organizations) + */ $select->from('gems__user_logins', array("gul_user_class", 'gul_id_organization', 'gul_login')) ->from('gems__organizations', array()) + ->columns(new Zend_Db_Expr("CASE WHEN gor_id_organization = gul_id_organization THEN 1 WHEN gor_accessible_by LIKE CONCAT('%:', gul_id_organization, ':%') THEN 2 ELSE 3 END AS tolerance")) ->where('gor_active = 1') ->where('gul_can_login = 1') ->where('gor_id_organization = ?', $organization) - ->order("CASE WHEN gor_id_organization = gul_id_organization THEN 1 WHEN gor_accessible_by LIKE CONCAT('%:', gul_id_organization, ':%') THEN 2 ELSE 3 END"); + ->order('tolerance'); $ids[] = 'gul_login'; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2012-07-13 14:30:35
|
Revision: 845 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=845&view=rev Author: mennodekker Date: 2012-07-13 14:30:28 +0000 (Fri, 13 Jul 2012) Log Message: ----------- Fixed #544: Duplicate logins could lead to problems when logging in to other organization dev: needs a message in changelog.txt Modified Paths: -------------- trunk/library/classes/Gems/User/UserLoader.php Modified: trunk/library/classes/Gems/User/UserLoader.php =================================================================== --- trunk/library/classes/Gems/User/UserLoader.php 2012-07-13 13:43:15 UTC (rev 844) +++ trunk/library/classes/Gems/User/UserLoader.php 2012-07-13 14:30:28 UTC (rev 845) @@ -56,6 +56,16 @@ const USER_STAFF = 'StaffUser'; /** + * When true a user is allowed to login to a different organization then the + * one that provides an account. See GetUserClassSelect for the possible options + * but be aware that duplicate accounts could lead to problems. To avoid + * problems you can always use the organization switch AFTER login. + * + * @var boolean + */ + public $allowLoginOnOtherOrganization = false; + + /** * When true Respondent members can use their e-mail address as login name * @var boolean */ @@ -502,8 +512,11 @@ $select = $this->getUserClassSelect($login_name, $organization); if ($row = $this->db->fetchRow($select, null, Zend_Db::FETCH_NUM)) { - // MUtil_Echo::track($row); - return $this->loadUser($row[0], $row[1], $row[2]); + MUtil_Echo::track($row); + if ($row[3] == 1 || $this->allowLoginOnOtherOrganization === true) { + // MUtil_Echo::track($row); + return $this->loadUser($row[0], $row[1], $row[2]); + } } } catch (Zend_Db_Exception $e) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2012-07-13 14:40:02
|
Revision: 846 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=846&view=rev Author: mennodekker Date: 2012-07-13 14:39:56 +0000 (Fri, 13 Jul 2012) Log Message: ----------- Fixed #544: Duplicate logins could lead to problems when logging in to other organization dev: debug statement Modified Paths: -------------- trunk/library/classes/Gems/User/UserLoader.php Modified: trunk/library/classes/Gems/User/UserLoader.php =================================================================== --- trunk/library/classes/Gems/User/UserLoader.php 2012-07-13 14:30:28 UTC (rev 845) +++ trunk/library/classes/Gems/User/UserLoader.php 2012-07-13 14:39:56 UTC (rev 846) @@ -512,7 +512,6 @@ $select = $this->getUserClassSelect($login_name, $organization); if ($row = $this->db->fetchRow($select, null, Zend_Db::FETCH_NUM)) { - MUtil_Echo::track($row); if ($row[3] == 1 || $this->allowLoginOnOtherOrganization === true) { // MUtil_Echo::track($row); return $this->loadUser($row[0], $row[1], $row[2]); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gem...@li...> - 2013-03-19 08:15:12
|
Revision: 1193 http://sourceforge.net/p/gemstracker/code/1193 Author: mennodekker Date: 2013-03-19 08:15:06 +0000 (Tue, 19 Mar 2013) Log Message: ----------- Fix for when no project admin defined in project.ini Modified Paths: -------------- trunk/library/classes/Gems/User/UserLoader.php Modified: trunk/library/classes/Gems/User/UserLoader.php =================================================================== --- trunk/library/classes/Gems/User/UserLoader.php 2013-03-18 18:04:19 UTC (rev 1192) +++ trunk/library/classes/Gems/User/UserLoader.php 2013-03-19 08:15:06 UTC (rev 1193) @@ -514,7 +514,7 @@ protected function getUserClass($login_name, $organization) { //First check for project user, as this one can run without a db - if ($this->isProjectUser($login_name)) { + if (!is_null($login_name) && $this->isProjectUser($login_name)) { return $this->loadUser(self::USER_PROJECT, $organization, $login_name); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |