1

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)
4
  • 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.. Oct 28 '13 at 5:00
1

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

1

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.

1
  • 1
    Or use drush, drush uli gives you a temporarily link to log in even if login form is not working.
    – hkoosha
    Oct 25 '14 at 8:02
0

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

0

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;
  }
}
0

Try and access the password reset page (/user/password), or, alternatively, use drush uli from the command line. Both will provide you with a reset link (the first by mail, so you should have functioning mail sending on the server), that will bypass the login page but get you a logged in session. Of course, whether this works completely depends on how thorough you were trying to prevent people from logging in.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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