Last active
June 21, 2024 17:43
-
-
Save mcsee/4faa40928a8ac53cca2d1381c8a2e1c2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class AccessControlPanel { | |
private $users = []; | |
public function createRegularUser($username, $password, $email) { | |
$user = [ | |
"username" => $username, | |
"email" => $email, | |
"type" => $this->regularUserRole(), | |
"creationDate" => $this->timeSource->currentTimestamp(), | |
"needsToChangePassword" => $this->needsToChangePassword(), | |
"loginPolicy" => $this->userLoginPolicy() | |
] | |
$this->users[] = $user; | |
$this->addCreationToJournal($user); | |
} | |
public function createAdminUser($username, $password, $email) { | |
$user = [ | |
"username" => $username, | |
"email" => $email, | |
"type" => $this->regularUserRole(), | |
"creationDate" => $this->timeSource->currentTimestamp(), | |
"needsToChangePassword" => $this->needsToChangePassword(), | |
"loginPolicy" => $this->adminUserLoginPolicy() | |
] | |
$this->users[] = $user; | |
$this->addCreationToJournal($user); | |
return $user; | |
} | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment