I am trying to use the code below to figure out if a user has accessed Drupal before, if not true is returned. However, it is not working, is there something I am missing?


global $user; 
$users = db_query("SELECT DISTINCT(uid), access FROM {users} WHERE access = %d AND uid = %s", 0, $user->uid);
$total_users = db_num_rows($users);
if ($total_users == 1)
{
	return true;
}
else { return false; }

Comments

lurit’s picture

hi jsloyer,

i'm not able to give you a solution right now.. but.. i think the reason why this is not working for you is that the access field you are checking is changed inmediatly after login ... and the login destination module may be executing this query once logged (so access is no more = 0).

ddrozdik’s picture

Issue summary: View changes
Status: Active » Closed (won't fix)

Version 5 of the module is not supported anymore.