From f270bc774776dd5733ed4d76095281fa9210bac2 Mon Sep 17 00:00:00 2001 From: Malf Furious Date: Thu, 10 Mar 2016 19:18:19 -0500 Subject: Add function User::confirmEmailKey() Validates the users supposed email key. If correct, sets the users emailConf flag. --- app/class/user.class.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'app') diff --git a/app/class/user.class.php b/app/class/user.class.php index 6c8f46f..7d8519e 100644 --- a/app/class/user.class.php +++ b/app/class/user.class.php @@ -119,6 +119,18 @@ class User extends Object return $key == $this->key; } + /* + * Validate the email confirmation key for a user, returns true if correct, false otherwise. On success, $this->emailConf is also set to 1 + */ + function confirmEmailKey($key) + { + if ($key != $this->emailConfKey) + return false; + + $this->emailConf = 1; + return true; + } + /* * Overwrite the salt and key for this user, given a new plaintext password */ -- cgit v1.2.3