Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
split instantiation from business logic in OfflineUser
Signed-off-by: Arthur Schiwon <[email protected]>
  • Loading branch information
blizzz committed Oct 26, 2020
commit 71c34876a6f2039c716917fae339961f5c4f4676
25 changes: 24 additions & 1 deletion apps/user_ldap/lib/User/OfflineUser.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ public function __construct($ocName, IConfig $config, IDBConnection $db, UserMap
$this->config = $config;
$this->db = $db;
$this->mapping = $mapping;
$this->fetchDetails();
}

/**
Expand Down Expand Up @@ -132,6 +131,9 @@ public function getOCName() {
* @return string
*/
public function getUID() {
if (!isset($this->uid)) {
$this->fetchDetails();
}
return $this->uid;
}

Expand All @@ -140,6 +142,9 @@ public function getUID() {
* @return string
*/
public function getDN() {
if (!isset($this->dn)) {
$this->fetchDetails();
}
return $this->dn;
}

Expand All @@ -148,6 +153,9 @@ public function getDN() {
* @return string
*/
public function getDisplayName() {
if (!isset($this->displayName)) {
$this->fetchDetails();
}
return $this->displayName;
}

Expand All @@ -156,6 +164,9 @@ public function getDisplayName() {
* @return string
*/
public function getEmail() {
if (!isset($this->email)) {
$this->fetchDetails();
}
return $this->email;
}

Expand All @@ -164,6 +175,9 @@ public function getEmail() {
* @return string
*/
public function getHomePath() {
if (!isset($this->homePath)) {
$this->fetchDetails();
}
return $this->homePath;
}

Expand All @@ -172,6 +186,9 @@ public function getHomePath() {
* @return int
*/
public function getLastLogin() {
if (!isset($this->lastLogin)) {
$this->fetchDetails();
}
return (int)$this->lastLogin;
}

Expand All @@ -180,6 +197,9 @@ public function getLastLogin() {
* @return int
*/
public function getDetectedOn() {
if (!isset($this->foundDeleted)) {
$this->fetchDetails();
}
return (int)$this->foundDeleted;
}

Expand All @@ -188,6 +208,9 @@ public function getDetectedOn() {
* @return bool
*/
public function getHasActiveShares() {
if (!isset($this->hasActiveShares)) {
$this->fetchDetails();
}
return $this->hasActiveShares;
}

Expand Down