split instantiation from business logic in OfflineUser

Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
This commit is contained in:
Arthur Schiwon 2020-10-26 13:54:03 +01:00
parent 1f47b27a49
commit 8b18a11948
No known key found for this signature in database
GPG key ID: 7424F1874854DF23

View file

@ -89,7 +89,6 @@ class OfflineUser {
$this->config = $config;
$this->db = $db;
$this->mapping = $mapping;
$this->fetchDetails();
}
/**
@ -131,6 +130,9 @@ class OfflineUser {
* @return string
*/
public function getUID() {
if (!isset($this->uid)) {
$this->fetchDetails();
}
return $this->uid;
}
@ -139,6 +141,9 @@ class OfflineUser {
* @return string
*/
public function getDN() {
if (!isset($this->dn)) {
$this->fetchDetails();
}
return $this->dn;
}
@ -147,6 +152,9 @@ class OfflineUser {
* @return string
*/
public function getDisplayName() {
if (!isset($this->displayName)) {
$this->fetchDetails();
}
return $this->displayName;
}
@ -155,6 +163,9 @@ class OfflineUser {
* @return string
*/
public function getEmail() {
if (!isset($this->email)) {
$this->fetchDetails();
}
return $this->email;
}
@ -163,6 +174,9 @@ class OfflineUser {
* @return string
*/
public function getHomePath() {
if (!isset($this->homePath)) {
$this->fetchDetails();
}
return $this->homePath;
}
@ -171,6 +185,9 @@ class OfflineUser {
* @return int
*/
public function getLastLogin() {
if (!isset($this->lastLogin)) {
$this->fetchDetails();
}
return (int)$this->lastLogin;
}
@ -179,6 +196,9 @@ class OfflineUser {
* @return int
*/
public function getDetectedOn() {
if (!isset($this->foundDeleted)) {
$this->fetchDetails();
}
return (int)$this->foundDeleted;
}
@ -187,6 +207,9 @@ class OfflineUser {
* @return bool
*/
public function getHasActiveShares() {
if (!isset($this->hasActiveShares)) {
$this->fetchDetails();
}
return $this->hasActiveShares;
}