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/Item.php | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 core/namespace/User/Item.php (limited to 'core/namespace/User/Item.php') 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