diff options
author | Arthur Schiwon <blizzz@owncloud.com> | 2014-03-27 18:01:14 +0100 |
---|---|---|
committer | Arthur Schiwon <blizzz@owncloud.com> | 2014-06-03 12:59:09 +0200 |
commit | 6d64d7ec3fb64d6b2f196d4008f59b64e5a50446 (patch) | |
tree | 830c0d7dc3c9b4feb10f261d2e41df8061296062 /apps/user_ldap/lib/access.php | |
parent | d3e830e938fe85da2fd6d9912c26677034d952f7 (diff) | |
download | nextcloud-server-6d64d7ec3fb64d6b2f196d4008f59b64e5a50446.tar.gz nextcloud-server-6d64d7ec3fb64d6b2f196d4008f59b64e5a50446.zip |
LDAP: put out fetching of user meta data into a fully tested class of its own and update them (mail, quota, etc.) directly after mapping. Fixes #7785 properly on master
Diffstat (limited to 'apps/user_ldap/lib/access.php')
-rw-r--r-- | apps/user_ldap/lib/access.php | 33 |
1 files changed, 24 insertions, 9 deletions
diff --git a/apps/user_ldap/lib/access.php b/apps/user_ldap/lib/access.php index 78de14f4ee9..b952910a8c5 100644 --- a/apps/user_ldap/lib/access.php +++ b/apps/user_ldap/lib/access.php @@ -27,20 +27,21 @@ namespace OCA\user_ldap\lib; * Class Access * @package OCA\user_ldap\lib */ -class Access extends LDAPUtility { +class Access extends LDAPUtility implements user\IUserTools { public $connection; + public $userManager; //never ever check this var directly, always use getPagedSearchResultState protected $pagedSearchedSuccessful; protected $cookies = array(); - /** - * @param Connection $connection - * @param ILDAPWrapper $ldap - */ - public function __construct(Connection $connection, ILDAPWrapper $ldap) { + + public function __construct(Connection $connection, ILDAPWrapper $ldap, + user\Manager $userManager) { parent::__construct($ldap); $this->connection = $connection; + $this->userManager = $userManager; + $this->userManager->setLdapAccess($this); } /** @@ -51,9 +52,17 @@ class Access extends LDAPUtility { } /** - * reads a given attribute for an LDAP record identified by a DN - * @param string $dn the record in question - * @param string $attr the attribute that shall be retrieved + * @brief returns the Connection instance + * @return \OCA\user_ldap\lib\Connection + */ + public function getConnection() { + return $this->connection; + } + + /** + * @brief reads a given attribute for an LDAP record identified by a DN + * @param $dn the record in question + * @param $attr the attribute that shall be retrieved * if empty, just check the record's existence * @param string $filter * @return array|false an array of values on success or an empty @@ -626,6 +635,12 @@ class Access extends LDAPUtility { return false; } + if($isUser) { + //make sure that email address is retrieved prior to login, so user + //will be notified when something is shared with him + $this->userManager->get($ocname)->update(); + } + return true; } |