From 52b077a48c743ba4d08ac00520a0bf1ef6deef5f Mon Sep 17 00:00:00 2001 From: Thomas Lange Date: Fri, 24 Feb 2017 21:27:59 +0100 Subject: Initial commit. --- core/namespace/User/Attribute.php | 24 ++++++++++++++++++++++++ core/namespace/User/Exception.php | 5 +++++ core/namespace/User/Factory.php | 13 +++++++++++++ core/namespace/User/Item.php | 36 ++++++++++++++++++++++++++++++++++++ 4 files changed, 78 insertions(+) create mode 100644 core/namespace/User/Attribute.php create mode 100644 core/namespace/User/Exception.php create mode 100644 core/namespace/User/Factory.php create mode 100644 core/namespace/User/Item.php (limited to 'core/namespace/User') diff --git a/core/namespace/User/Attribute.php b/core/namespace/User/Attribute.php new file mode 100644 index 0000000..b161fa9 --- /dev/null +++ b/core/namespace/User/Attribute.php @@ -0,0 +1,24 @@ + \ No newline at end of file diff --git a/core/namespace/User/Exception.php b/core/namespace/User/Exception.php new file mode 100644 index 0000000..b5bcad0 --- /dev/null +++ b/core/namespace/User/Exception.php @@ -0,0 +1,5 @@ + \ No newline at end of file diff --git a/core/namespace/User/Factory.php b/core/namespace/User/Factory.php new file mode 100644 index 0000000..80e6b49 --- /dev/null +++ b/core/namespace/User/Factory.php @@ -0,0 +1,13 @@ + \ No newline at end of file diff --git a/core/namespace/User/Item.php b/core/namespace/User/Item.php new file mode 100644 index 0000000..129d8f9 --- /dev/null +++ b/core/namespace/User/Item.php @@ -0,0 +1,36 @@ +Attribute->get('slug')}/"); + } + + return \Application::getUserURL("{$this->Attribute->get('id')}/"); + } + + #=============================================================================== + # Return unique pseudo GUID + #=============================================================================== + public function getGUID(): string { + foreach(['id', 'time_insert'] as $attribute) { + $attributes[] = $this->Attribute->get($attribute); + } + + return sha1(implode(NULL, $attributes)); + } + + #=============================================================================== + # Compare plaintext password with hashed password from database + #=============================================================================== + public function comparePassword($password): bool { + return password_verify($password, $this->Attribute->get('password')); + } +} +?> \ No newline at end of file -- cgit v1.2.3