Take the 2-minute tour ×
Drupal Answers is a question and answer site for Drupal developers and administrators. It's 100% free, no registration required.

I have to change a website, but I cannot log in. The problem is, that the login page does not appears in any way. I get a 403 error when accessing /user. That should come from a change that I did in the past to deactivate the login page at all. Even I cannot remember what I did or (last conclusion), the database has an error and the login page does not appear.

I setup a new Drupal installation with the same version, but I cannot see any significant difference of the folders.

Is there a hack to activate for a moment to allow anonymous user act as an administrator?

I am using Drupal 6.19.

Querying the database, I get the following.

    drupal=> SELECT path FROM menu_router WHERE path LIKE '%user%';
     user/login
     user/password
     user/register
     user/autocomplete
     admin/user
     user/%
     user/%/view
     user/login/lightbox2
     user/login/thickbox
     admin/user/rules
     admin/help/user
     user/%/contact
     user/%/delete
     admin/user/permissions
     admin/user/roles
     admin/user/settings
     admin/user/user
     user/%/edit
     admin/user/rules/list
     admin/user/user/list
     user/%/edit/account
     admin/user/rules/add
     admin/user/user/create
     admin/user/rules/check
     admin/user/roles/edit
     admin/user/rules/edit
     admin/user/rules/delete
     admin/views/ajax/autocomplete/user
     user/reset/%/%/%
    (30 rows)
share|improve this question
    
If it's a database problem, you can try clearing the cache with drush cc all and hope that the problem resolvs itself. –  Letharion May 22 '12 at 9:15
    
I tried this already, no success. –  PeterMmm May 22 '12 at 9:23
2  
Then I think we can rule out "database has an error". Does the user paths get registered? What is the output of SELECT path FROM menu_router WHERE path LIKE "%user%";? If any module denies access to the login form, try disabling any non-core modules with drush, clear the cache again, and see if that helps. –  Letharion May 22 '12 at 9:49
    
just shooting in the dark here.. but is there a difference in page_callback, page_arguments, access_callback, access_argumentsand include_file between stock drupal (which uses core user module) installation and the troubled installation for entry user/login.. maybe using drush uli to try login to site might help do some damage control.. –  optimusprime619 Oct 28 '13 at 5:00
add comment

4 Answers

You could :

  • dump the DB + files on a local test server
  • remove all non core modules
  • reset the password of on of the user inside the user table

Don't do this on production if possible.

See http://drupal.org/node/44164

share|improve this answer
add comment

Try accessing user/logout, and then log in the usual way.

share|improve this answer
add comment

Since you followed answers to this Disable login at all ,may be you already set this FALSE! You checked this?

function mymodule_form_alter(&$form, &$form_state, $form_id) {
  if ($form_id == 'user_login') {
    $form['#access'] = FALSE;
  }
}
share|improve this answer
add comment

There is hack to logged into site if you do not have admin details of the site. I I do not prefer this method but as you have disabled the login form, then it would be good solution for you.

There is {sessions} table in Drupal database which stored the sessions of the user into site. You can follow the below step:

  • Empty the {sessions} table in your database.
  • Visit the site as anonymous user
  • Check {sessions} table in database and you will find the entry in table for the anonymous user. There is '0' value is saved in uid column of database table.
  • Edit uid column and modify value from 0 to 1.

Kindly see that it's not standard solution to login into site.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.