/** * checks whether a user is actually mapped * @param string $ocName the username as used in ownCloud * @throws \Exception * @return true */ protected function confirmUserIsMapped($ocName) { $dn = $this->mapping->getDNByName($ocName); if ($dn === false) { throw new \Exception('The given user is not a recognized LDAP user.'); } return true; }
/** * reads the user details */ protected function fetchDetails() { $properties = array('displayName' => 'user_ldap', 'uid' => 'user_ldap', 'homePath' => 'user_ldap', 'email' => 'settings', 'lastLogin' => 'login'); foreach ($properties as $property => $app) { $this->{$property} = $this->config->getUserValue($this->ocName, $app, $property, ''); } $dn = $this->mapping->getDNByName($this->ocName); $this->dn = $dn !== false ? $dn : ''; $this->determineShares(); }