diff options
-rw-r--r-- | engine/lib/entities.php | 2 | ||||
-rw-r--r-- | 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 @@ -789,6 +789,19 @@ } /** + * 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 * saved in the email field in the database. @@ -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; } |