function anonymous_user_unblock_test_user_load

Implements hook_user_load().

File

modules/user/tests/anonymous_user_unblock_test.module, line 11

Code

function anonymous_user_unblock_test_user_load($users) {
    foreach ($users as $user) {
        if ($user->uid == 0) {
            // Try to fool user_save() into unblocking the anonymous user.
            // See https://www.drupal.org/comment/14722637.
            $user->is_new = FALSE;
            $user->original = clone $user;
        }
    }
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.