From 2b8f6ae7ca3e8b18f80f2753d990425aa7fac820 Mon Sep 17 00:00:00 2001 From: Malf Furious Date: Thu, 10 Mar 2016 19:09:50 -0500 Subject: Add function User::setEmail() This function handles internal vars while updating a user's email address. --- app/class/user.class.php | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'app/class/user.class.php') diff --git a/app/class/user.class.php b/app/class/user.class.php index 75b769a..6c8f46f 100644 --- a/app/class/user.class.php +++ b/app/class/user.class.php @@ -100,8 +100,7 @@ class User extends Object $this->name = $username; $this->type = "user"; $this->setPassword($password); - $this->emailConf = 0; - $this->emailConfKey = $this->getBlob(); + $this->setEmail(""); $this->saveObj(); @@ -129,6 +128,16 @@ class User extends Object $this->key = $this->getKey($password, $this->salt); } + /* + * Overwrite the emailConfKey and flag, and change user's saved email address + */ + function setEmail($email) + { + $this->email = $email; + $this->emailConf = 0; + $this->emailConfKey = $this->getBlob(); + } + /* * If a user has an alias set, display it instead of their username */ -- cgit v1.2.3