Index: modules/user/user.module =================================================================== RCS file: /cvs/drupal/drupal/modules/user/user.module,v retrieving revision 1.745.2.20 diff -u -p -r1.745.2.20 user.module --- modules/user/user.module 17 Oct 2007 21:29:00 -0000 1.745.2.20 +++ modules/user/user.module 7 Nov 2007 12:12:27 -0000 @@ -111,6 +111,11 @@ function user_save($account, $array = ar user_module_invoke('update', $array, $account, $category); $data = unserialize(db_result(db_query('SELECT data FROM {users} WHERE uid = %d', $account->uid))); + // Consider users edited by an administrator as logged in, if they haven't + // already, so anonymous users can view the profile (if allowed). + if (empty($array['access']) && empty($account->access) && user_access('administer users')) { + $array['access'] = time(); + } foreach ($array as $key => $value) { if ($key == 'pass' && !empty($value)) { $query .= "$key = '%s', "; @@ -171,6 +176,11 @@ function user_save($account, $array = ar if (!isset($array['created'])) { // Allow 'created' to be set by hook_auth $array['created'] = time(); } + // Consider users created by an administrator as already logged in, so + // anonymous users can view the profile (if allowed). + if (empty($array['access']) && user_access('administer users')) { + $array['access'] = time(); + } // Note, we wait with saving the data column to prevent module-handled // fields from being saved there. We cannot invoke hook_user('insert') here