Trying to log in via http://myURL.net/user. Now I've had the same password for this particular drupal site for almost three years and it's always worked, until now. When I enter the admin user and password it takes me to http://myURL.net/user/1 and I get the following error:

"Access denied
You are not authorized to access this page."

Back to http://myURL.net/user. >> Request New Password >> "Further instructions have been sent to your e-mail address."

Receive email, click on the link, takes me to http://myURL.net/user/password with the following message:

"You have tried to use a one-time login link which has either been used or is no longer valid. Please request a new one using the form below."

Enter user name in hit the "email new password" button. Email arrives, click on the link, sends me back to http://myURL.net/user/password with the following message: "You have tried to use a one-time login link which has either been used or is no longer valid. Please request a new one using the form below."

I don't know why after almost three years my password stopped working. It happened after I upgraded to 6.17. I'd like to change or reset the password but it doesn't appear to want to let me. I logged into the database to make sure the Admin account was still there and sure enough it is. I even tried running update.php by setting the update on settings.php to TRUE. Ran the update to see if that helped but it didn't.

Any ideas? Thanks.

Comments

alexkessler’s picture

If you can access your database I would suggest to overwrite the current admin password.
You find the password in the 'users' table. It's a md5 hash, so you can either use a small php script
to generate the password or use google search "md5 generator".

fuquam’s picture

Thanks MrKatz. I can access the database. I tried a MD5 generator, per your suggestions, and sure enough my password is correct. So now I'm thinking my permissions must be screwed up. I'm still getting "Access denied. You are not authorized to access this page."
I'm the only user, status is 1. I don't know how to change permissions without being logged in if in fact that is the problem. At least I know my password is correct. Anything else you can think of? Thanks for the MD5 advice. At least I know how to manually change a password now.

So everything in my original post still applies just now I know my password is correct.

alexkessler’s picture

Do you have any node access modules installed ?
I had something similar a few days ago, when I was playing with the Domain Access module.

fuquam’s picture

You know I don't think I do. I have the domain access module on another website but have never had problems with it. Node Type Filter is the closest node access module I have but that's not really for access.

If I can just get into the admin section at least I should be able to check permissions but I can't get into anything. I can access the database manually but that's it. I'm looking for a sql command to reset permissions without completely screwing up everything. Once I made my menus disappear by accident.

With all Drupal sites I like to create a new user type called administrator so I can separate permissions between authenticated and admins. Such is the case here. I'm guessing that somehow all the administrator permissions have been turned off somehow. I find this odd since I am the only user for this site.

alexkessler’s picture

As far as i know, It's not possible to turn off user 1 permissions. You also can't set user 1 permissions
in the backend.

Is this domain a kind of subdomain via domain access?

If it isn't and you want reset your permissions, I would try something like this:
http://api.drupal.org/api/function/user_access/6

fuquam’s picture

I've had this particular site running on drupal for almost three years. Same user and password. It's not a subdomain.

The user module has the following line of code starting on line 505:

// User #1 has all privileges:
  if ($account->uid == 1) {
    return TRUE;
  }

By all accounts the uid 1 is the admin and should be able to access content and the admin section. I wonder if I need to manually flush the cache somewhere. I'll try to changing reset to TRUE.

alexkessler’s picture

You can flush the cache inside the database. Just empty all database tables named (starting with) cache,
but I recommend to make a backup first.

mrbuom’s picture

I got the same problem when I upgraded from 6.17 to 6.19 and I don't know how to fix it :(

mrbuom’s picture

Maybe the problem comes from the $cookie_domain option. I disable it and now I can access to my website

fuquam’s picture

Is that in the settings.php file?

violinjeff’s picture

I had the same problem on v6 that I couldn't log in as admin without getting the 'you are unauthorised to view this page' message.
I repaired the 'sessions' table in the database and it then worked!
Jeff