4 Commits
Author SHA1 Message Date
mcndave 8d648e88c8 - WIP on package manager 2026-07-16 14:13:22 -04:00
mcndave 61db8fcc95 Merge branch 'master' of https://git.mcnd.ca/mcndave/ulmus-user 2026-07-16 13:28:36 -04:00
mcndave 6ddf358f41 - Added Ulmus version dependencies 2026-07-16 13:28:17 -04:00
mcndave 33ff1b5b8c - User now has a reverse fullname parameter
- forgetMe() defined as void
2026-07-14 16:49:44 -04:00
3 changed files with 11 additions and 6 deletions

No files matched your search

+3 -3
View File
@@ -10,12 +10,12 @@
} }
], ],
"require": { "require": {
"mcnd/ulmus": "dev-master" "mcnd/ulmus": "^1.0 || ^2.0"
}, },
"repositories": [ "repositories": [
{ {
"type": "vcs", "type": "composer",
"url": "https://git.mcnd.ca/mcNdave/ulmus.git" "url": "https://git.mcnd.ca/api/packages/mcndave/composer"
} }
], ],
"autoload": { "autoload": {
+6 -2
View File
@@ -80,9 +80,13 @@ abstract class User implements UserInterface {
return password_verify($password, $this->password ?? null); return password_verify($password, $this->password ?? null);
} }
public function fullName() : string public function fullname(bool $reverse = false) : string
{ {
return trim( ( $this->firstName ?? "" ) . " " . ( $this->lastName ?? "" ) ); if (! $this->isLoaded() ) {
return "???";
}
return trim($reverse ? "{$this->lastName}, {$this->firstName}" : "{$this->firstName} {$this->lastName}");
} }
public function loggedIn(?bool $set = null): bool public function loggedIn(?bool $set = null): bool
+2 -1
View File
@@ -37,7 +37,8 @@ class Authenticate {
return null; return null;
} }
public function forgetMe() { public function forgetMe() : void
{
$this->cookie->delete("user.id"); $this->cookie->delete("user.id");
$this->session->destroy(); $this->session->destroy();
} }