From 2ba6d86d55f3cfe7ddc8cd6a012268d9f94a86a5 Mon Sep 17 00:00:00 2001 From: Alexander Walther Date: Thu, 4 Apr 2024 21:19:30 +0200 Subject: [PATCH 1/3] =?UTF-8?q?Getter/Setter=20f=C3=BCr=20`ycom=5Fuser`=20?= =?UTF-8?q?und=20`ycom=5Fgroup`=20erg=C3=A4nzt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/ycom_user.php | 152 +++++++++++++++++++++++++++++++ plugins/group/lib/ycom_group.php | 9 ++ 2 files changed, 161 insertions(+) diff --git a/lib/ycom_user.php b/lib/ycom_user.php index 56527e6..f323955 100644 --- a/lib/ycom_user.php +++ b/lib/ycom_user.php @@ -96,4 +96,156 @@ public function increaseLoginTries(): self $this->setValue('login_tries', $this->getValue('login_tries') + 1); return $this; } + + + /* Login */ + /** @api */ + public function getLogin() : mixed { + return $this->getValue("login"); + } + /** @api */ + public function setLogin(mixed $value) : self { + $this->setValue("login", $value); + return $this; + } + + /* E-Mail */ + /** @api */ + public function getEmail() : mixed { + return $this->getValue("email"); + } + /** @api */ + public function setEmail(mixed $value) : self { + $this->setValue("email", $value); + return $this; + } + + /* Passwort */ + /** @api */ + public function setPassword(mixed $value) : self { + $this->setValue("password", $value); + return $this; + } + + /* Vorname */ + /** @api */ + public function getFirstname() : mixed { + return $this->getValue("firstname"); + } + /** @api */ + public function setFirstname(mixed $value) : self { + $this->setValue("firstname", $value); + return $this; + } + + /* Name */ + /** @api */ + public function getName() : mixed { + return $this->getValue("name"); + } + /** @api */ + public function setName(mixed $value) : self { + $this->setValue("name", $value); + return $this; + } + + /* Status */ + /** @api */ + public function getStatus() : mixed { + return $this->getValue("status"); + } + /** @api */ + public function setStatus(mixed $value) : self { + $this->setValue("status", $value); + return $this; + } + + /* Aktivierungsschlüssel */ + /** @api */ + public function getActivationKey() : mixed { + return $this->getValue("activation_key"); + } + /** @api */ + public function setActivationKey(mixed $value) : self { + $this->setValue("activation_key", $value); + return $this; + } + + /* Nutzungsbedingungen bestätigt */ + /** @api */ + public function getTermsofuseAccepted(bool $asBool = false) : mixed { + if($asBool) { + return (bool) $this->getValue("termsofuse_accepted"); + } + return $this->getValue("termsofuse_accepted"); + } + /** @api */ + public function setTermsofuseAccepted(int $value = 1) : self { + $this->setValue("termsofuse_accepted", $value); + return $this; + } + + /* Neues Passwort muss gesetzt werden */ + /** @api */ + public function getNewPasswordRequired(bool $asBool = false) : mixed { + if($asBool) { + return (bool) $this->getValue("new_password_required"); + } + return $this->getValue("new_password_required"); + } + /** @api */ + public function setNewPasswordRequired(int $value = 1) : self { + $this->setValue("new_password_required", $value); + return $this; + } + + /* Letzte Aktion */ + /** @api */ + public function getLastActionTime() : ?string { + return $this->getValue("last_action_time"); + } + /** @api */ + public function setLastActionTime(string $value) : self { + $this->setValue("last_action_time", $value); + return $this; + } + + /* Letzter erfolgreicher Login */ + /** @api */ + public function getLastLoginTime() : ?string { + return $this->getValue("last_login_time"); + } + /** @api */ + public function setLastLoginTime(string $value) : self { + $this->setValue("last_login_time", $value); + return $this; + } + + /* Kündigungszeitpunkt */ + /** @api */ + public function getTerminationTime() : ?string { + return $this->getValue("termination_time"); + } + /** @api */ + public function setTerminationTime(string $value) : self { + $this->setValue("termination_time", $value); + return $this; + } + + /* Login Fehlversuche */ + /** @api */ + public function getLoginTries() : ?int { + return $this->getValue("login_tries"); + } + /** @api */ + public function setLoginTries(int $value) : self { + $this->setValue("login_tries", $value); + return $this; + } + + /* Gruppen */ + /** @api */ + public function getYcomGroups() : ?rex_yform_manager_dataset { + return $this->getRelatedDataset("ycom_groups"); + } } diff --git a/plugins/group/lib/ycom_group.php b/plugins/group/lib/ycom_group.php index b79576d..030957a 100644 --- a/plugins/group/lib/ycom_group.php +++ b/plugins/group/lib/ycom_group.php @@ -74,4 +74,13 @@ public function getName(): string { return $this->getValue('name'); } + + /** @api */ + public function setName(mixed $value) : self + { + $this->setValue("name", $value); + return $this; + } + + } From f9f5c2866703d25c94df98765d1bf855e7cf2ac0 Mon Sep 17 00:00:00 2001 From: Alexander Walther Date: Thu, 29 Aug 2024 17:36:58 +0200 Subject: [PATCH 2/3] Update lib/ycom_user.php --- lib/ycom_user.php | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/lib/ycom_user.php b/lib/ycom_user.php index f323955..b03051f 100644 --- a/lib/ycom_user.php +++ b/lib/ycom_user.php @@ -173,14 +173,11 @@ public function setActivationKey(mixed $value) : self { /* Nutzungsbedingungen bestätigt */ /** @api */ - public function getTermsofuseAccepted(bool $asBool = false) : mixed { - if($asBool) { - return (bool) $this->getValue("termsofuse_accepted"); - } - return $this->getValue("termsofuse_accepted"); + public function getTermsofuseAccepted() : bool { + return (bool) $this->getValue("termsofuse_accepted"); } /** @api */ - public function setTermsofuseAccepted(int $value = 1) : self { + public function setTermsofuseAccepted(bool $value = true) : self { $this->setValue("termsofuse_accepted", $value); return $this; } From 7c4e64104f1a49f644d9b480c019bfebd78750d2 Mon Sep 17 00:00:00 2001 From: Alexander Walther Date: Thu, 29 Aug 2024 17:38:02 +0200 Subject: [PATCH 3/3] Update ycom_user.php --- lib/ycom_user.php | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/lib/ycom_user.php b/lib/ycom_user.php index b03051f..3a34051 100644 --- a/lib/ycom_user.php +++ b/lib/ycom_user.php @@ -184,14 +184,11 @@ public function setTermsofuseAccepted(bool $value = true) : self { /* Neues Passwort muss gesetzt werden */ /** @api */ - public function getNewPasswordRequired(bool $asBool = false) : mixed { - if($asBool) { - return (bool) $this->getValue("new_password_required"); - } - return $this->getValue("new_password_required"); + public function getNewPasswordRequired() : bool { + return (bool) $this->getValue("new_password_required"); } /** @api */ - public function setNewPasswordRequired(int $value = 1) : self { + public function setNewPasswordRequired(bool $value = true) : self { $this->setValue("new_password_required", $value); return $this; }