aboutsummaryrefslogtreecommitdiff
path: root/Psso/AuthProvider
diff options
context:
space:
mode:
authorwinter Sparkles2026-08-09 15:44:18 +0100
committerwinter Sparkles2026-08-09 15:44:18 +0100
commit96387025da63025894f6259f7eebed0fc6fc53ac (patch)
treea83d73eeb7ec419b24ff78291634503d4ebceec1 /Psso/AuthProvider
parentc8998ccdff070d7c73a634e031a041260b87c3b1 (diff)
implement the rest of login process incl. cookie redirects and 'next'
Diffstat (limited to 'Psso/AuthProvider')
-rw-r--r--Psso/AuthProvider/ConfigFile.php21
1 files changed, 19 insertions, 2 deletions
diff --git a/Psso/AuthProvider/ConfigFile.php b/Psso/AuthProvider/ConfigFile.php
index 688c193..e9b45ce 100644
--- a/Psso/AuthProvider/ConfigFile.php
+++ b/Psso/AuthProvider/ConfigFile.php
@@ -1,9 +1,10 @@
<?php
namespace Psso\AuthProvider;
-use Psso\{AuthProvider, AuthInterface};
+use Psso\AuthProvider;
+use Psso\AuthInterface\{Groups, Password, UserExists, UserExtra};
class ConfigFile extends AuthProvider
-implements AuthInterface\Password, AuthInterface\UserExists {
+implements Password, UserExists, UserExtra, Groups {
public function validatePassword(
string $username,
#[\SensitiveParameter] string $password
@@ -18,4 +19,20 @@ implements AuthInterface\Password, AuthInterface\UserExists {
public function userExists(string $username): bool {
return isset($this->config['users'][$username]);
}
+
+ public function userGroups(string $username): array {
+ $gstr = $this->config['users'][$username]['groups'] ?? '';
+ $groups = [];
+ for ($ng = strtok($gstr, ' '); $ng !== false; $ng = strtok(' '))
+ $groups[] = $ng;
+ return $groups;
+ }
+
+ public function userDisplayName(string $username): ?string {
+ return $this->config['users'][$username]['name'] ?? null;
+ }
+
+ public function userEmailAddress(string $username): ?string {
+ return $this->config['users'][$username]['email'] ?? null;
+ }
}