summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorGábor Hojtsy <gabor@hojtsy.hu>2007-11-06 12:20:14 +0000
committerGábor Hojtsy <gabor@hojtsy.hu>2007-11-06 12:20:14 +0000
commit69da830ceda0f4e8bf692fbc744d1e2b86947da2 (patch)
treeb1c2593e9af32610ac4f3d238cd5db7816cc93f0 /modules
parentbfd7c0f1f97d6504091d3d7a97e609e2a26d7de9 (diff)
downloadbrdo-69da830ceda0f4e8bf692fbc744d1e2b86947da2.tar.gz
brdo-69da830ceda0f4e8bf692fbc744d1e2b86947da2.tar.bz2
#171117 by JirkaRybka: set access time for admin created or edited accounts so they are exempt from the spam protection we have for accounts never logged in
Diffstat (limited to 'modules')
-rw-r--r--modules/user/user.module10
1 files changed, 10 insertions, 0 deletions
diff --git a/modules/user/user.module b/modules/user/user.module
index d34259531..4c458d765 100644
--- a/modules/user/user.module
+++ b/modules/user/user.module
@@ -203,6 +203,11 @@ function user_save($account, $array = array(), $category = 'account') {
user_module_invoke('update', $array, $account, $category);
$query = '';
$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', ";
@@ -269,6 +274,11 @@ function user_save($account, $array = array(), $category = 'account') {
if (!isset($array['created'])) { // Allow 'created' to be set by the caller
$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