From cc7737162891a0a7712350b0ada84d29e23938c9 Mon Sep 17 00:00:00 2001 From: marcus Date: Fri, 1 Aug 2008 12:54:19 +0000 Subject: Changed so that validated_email flag written as null user. Refs #190. Also confirms fix and closes #104. git-svn-id: https://code.elgg.org/elgg/trunk@1649 36083f99-b078-4883-b0ff-0f9b5a30f544 --- engine/lib/entities.php | 2 +- engine/lib/users.php | 17 +++++++++++++++-- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/engine/lib/entities.php b/engine/lib/entities.php index a46b4ce54..6110b0db7 100644 --- a/engine/lib/entities.php +++ b/engine/lib/entities.php @@ -1660,7 +1660,7 @@ if ($entity = get_entity($entity_guid)) { $return = null; - + if ($metadata->owner_guid == 0) $return = true; if (is_null($return)) $return = can_edit_entity($entity_guid, $user_guid); diff --git a/engine/lib/users.php b/engine/lib/users.php index 8a427f0f2..fe7c67e0f 100644 --- a/engine/lib/users.php +++ b/engine/lib/users.php @@ -788,6 +788,19 @@ return md5($user_guid . $email_address . $CONFIG->site->url); // Note I bind to site URL, this is important on multisite! } + /** + * Set the email validation status for a user. + * + * @param int $user_guid The user + * @param bool $status The status + */ + function set_email_validation_status($user_guid, $status) + { + $user_guid = (int)$user_guid; + + return create_metadata($user_guid, 'validated_email', $status,'', 0, 2); + } + /** * Send out a validation request for a given user. * This function assumes that a user has already been created and that the email address has been @@ -806,7 +819,7 @@ if (($user) && ($user instanceof ElggUser)) { // Clear existing status - $user->validated_email = false; + set_email_validation_status($user_guid, false); // Work out validate link $link = $CONFIG->site->url . "action/email/confirm?u=$user_guid&c=" . generate_email_validation_code($user_guid, $user->email); @@ -831,7 +844,7 @@ $valid = ($code == generate_email_validation_code($user_guid, $user->email)); if ($valid) - $user->validated_email = true; + set_email_validation_status($user_guid, true); return $valid; } -- cgit v1.2.3