Skip to content

Instantly share code, notes, and snippets.

@mcsee
Last active June 21, 2024 17:43
Show Gist options
  • Save mcsee/4faa40928a8ac53cca2d1381c8a2e1c2 to your computer and use it in GitHub Desktop.
Save mcsee/4faa40928a8ac53cca2d1381c8a2e1c2 to your computer and use it in GitHub Desktop.
<?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