From b0b096489393d505e105ba74b09a72afcfb7c1cf Mon Sep 17 00:00:00 2001 From: marcus Date: Wed, 13 Aug 2008 10:43:57 +0000 Subject: Fixes #238: Problem was caused by authenticate not having the user email validated flag set. Introduced new flag ->admin_created to distinguish between the two types. git-svn-id: https://code.elgg.org/elgg/trunk@1883 36083f99-b078-4883-b0ff-0f9b5a30f544 --- actions/useradd.php | 7 +++---- engine/lib/sessions.php | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/actions/useradd.php b/actions/useradd.php index f7a96b037..b59dc36b1 100644 --- a/actions/useradd.php +++ b/actions/useradd.php @@ -35,12 +35,11 @@ ) && ($guid = register_user($username, $password, $name, $email, true)) ) { + $new_user = get_entity($guid); if (($guid) && ($admin)) - { - - $new_user = get_entity($guid); $new_user->admin = 'yes'; - } + + $new_user->admin_created = true; system_message(sprintf(elgg_echo("adduser:ok"),$CONFIG->sitename)); } else { diff --git a/engine/lib/sessions.php b/engine/lib/sessions.php index 54cd6169e..f909ae60f 100644 --- a/engine/lib/sessions.php +++ b/engine/lib/sessions.php @@ -78,7 +78,7 @@ if ($user = get_user_by_username($credentials['username'])) { // Let admins log in without validating their email, but normal users must have validated their email - if ((!$user->admin) && (!$user->validated_email)) + if ((!$user->admin) && (!$user->validated_email) && (!$user->admin_created)) return false; if ($user->password == generate_user_password($user, $credentials['password'])) { -- cgit v1.2.3