Commit 04dfd656d660e351270e79e6a0c86a8ca45853a6
1 parent
71c7876a
Follow user table name changes.
Add getByAuthenticationSourceAndDetails, to find users by virtue of their LDAP DN (for example). git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@4826 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing
1 changed file
with
14 additions
and
6 deletions
lib/users/User.inc
| ... | ... | @@ -46,8 +46,6 @@ class User extends KTEntity { |
| 46 | 46 | var $bEmailNotification = false; |
| 47 | 47 | /** notify user via sms (mobile phone) status */ |
| 48 | 48 | var $bSmsNotification = false; |
| 49 | - /** user's ldap identification */ | |
| 50 | - var $sLdapDn = ""; | |
| 51 | 49 | /** maxiumum concurrent sessions user may have */ |
| 52 | 50 | var $iMaxSessions = 5; |
| 53 | 51 | /** primary key of language preferred by user */ |
| ... | ... | @@ -58,6 +56,7 @@ class User extends KTEntity { |
| 58 | 56 | var $iAuthenticationSourceId = null; |
| 59 | 57 | /** authentication details so that the source knows who this user is */ |
| 60 | 58 | var $sAuthenticationDetails = null; |
| 59 | + var $sAuthenticationDetails2 = null; | |
| 61 | 60 | |
| 62 | 61 | var $_aFieldToSelect = array( |
| 63 | 62 | 'iId' => 'id', |
| ... | ... | @@ -70,11 +69,11 @@ class User extends KTEntity { |
| 70 | 69 | 'sMobile' => 'mobile', |
| 71 | 70 | 'bEmailNotification' => 'email_notification', |
| 72 | 71 | 'bSmsNotification' => 'sms_notification', |
| 73 | - 'sLdapDn' => 'ldap_dn', | |
| 74 | 72 | 'iMaxSessions' => 'max_sessions', |
| 75 | 73 | 'iLanguageID' => 'language_id', |
| 76 | 74 | 'iAuthenticationSourceId' => 'authentication_source_id', |
| 77 | - 'sAuthenticationDetails' => 'authentication_details', | |
| 75 | + 'sAuthenticationDetails' => 'authentication_details_s1', | |
| 76 | + 'sAuthenticationDetails2' => 'authentication_details_s2', | |
| 78 | 77 | ); |
| 79 | 78 | |
| 80 | 79 | var $_bUsePearError = true; |
| ... | ... | @@ -100,8 +99,6 @@ class User extends KTEntity { |
| 100 | 99 | function setEmailNotification($bNewValue) { $this->bEmailNotification = KTUtil::anyToBool($bNewValue); } |
| 101 | 100 | function getSmsNotification() { return $this->bSmsNotification; } |
| 102 | 101 | function setSmsNotification($bNewValue) { $this->bSmsNotification = $bNewValue; } |
| 103 | - function getLdapDn() { return $this->sLdapDn; } | |
| 104 | - function setLdapDn($sNewValue) { $this->sLdapDn = $sNewValue; } | |
| 105 | 102 | function getMaxSessions() { return $this->iMaxSessions; } |
| 106 | 103 | function setMaxSessions($iNewValue) { $this->iMaxSessions = $iNewValue; } |
| 107 | 104 | function getLanguageID() { return $this->iLanguageIDID; } |
| ... | ... | @@ -110,6 +107,8 @@ class User extends KTEntity { |
| 110 | 107 | function setAuthenticationSourceId($iNewValue) { $this->iAuthenticationSourceId = $iNewValue; } |
| 111 | 108 | function getAuthenticationDetails() { return $this->sAuthenticationDetails; } |
| 112 | 109 | function setAuthenticationDetails($sNewValue) { $this->sAuthenticationDetails = $sNewValue; } |
| 110 | + function getAuthenticationDetails2() { return $this->sAuthenticationDetails2; } | |
| 111 | + function setAuthenticationDetails2($sNewValue) { $this->sAuthenticationDetails2 = $sNewValue; } | |
| 113 | 112 | |
| 114 | 113 | /** |
| 115 | 114 | * Delete the current object from the database |
| ... | ... | @@ -326,4 +325,13 @@ class User extends KTEntity { |
| 326 | 325 | function &getByUserName($sUserName, $aOptions = null) { |
| 327 | 326 | return KTEntityUtil::getBy('User', 'username', $sUserName, $aOptions); |
| 328 | 327 | } |
| 328 | + | |
| 329 | + function &getByAuthenticationSourceAndDetails($oSource, $sDetails, $aOptions = null) { | |
| 330 | + $iSourceId = KTUtil::getId($oSource); | |
| 331 | + | |
| 332 | + return KTEntityUtil::getByDict('User', array( | |
| 333 | + 'authentication_source_id' => $iSourceId, | |
| 334 | + 'authentication_details_s1' => $sDetails, | |
| 335 | + ), $aOptions); | |
| 336 | + } | |
| 329 | 337 | } | ... | ... |