I can log in fine as the administrator on /?q=user, but the login block on /?q=admin does not work!
Watchdog logs an 'Access denied' error.
Looking closer with an HTTP proxy, this form is POSTing to a different place (/?destination=admin) then the /user page.

I've tried clearing cookies etc. to no avail.

Here is a dump of the session:
Request:
POST /?destination=admin HTTP/1.1
...
Cookie: PHPSESSID=n2r8da56k7au7q2gkonl3sbf86
Content-Type: application/x-www-form-urlencoded
Content-Length: 65

name=administrator&pass=[passwd]&op=Log+in&form_id=user_login_block

Response:
HTTP/1.1 200 OK
Date: Sun, 20 May 2007 01:48:17 GMT
Server: Apache/2.2.4 (Win32) PHP/5.2.1 mod_perl/2.0.3 Perl/v5.8.8
X-Powered-By: PHP/5.2.1
Expires: Sun, 19 Nov 1978 05:00:00 GMT
Last-Modified: Sun, 20 May 2007 01:48:17 GMT
Cache-Control: no-store, no-cache, must-revalidate
Cache-Control: post-check=0, pre-check=0
Transfer-Encoding: chunked
Content-Type: text/html; charset=utf-8

[the contents of the front page follow, and the url is http::/site.com/?destination=admin]

Comments

xmacinfo’s picture

I've seen you post a few days ago.

Login block and admin section are mutually exclusive. You need to be connected in order to display the admin screens. So you won't be able to have a login block on the admin screens.

To log in you must either use the login block available for anonymous users, or use the path /?q=user or /?q=user/login. Once connected, access to the admin screen will work.

slippyd’s picture

xmacinfo, you don't seem to get it. Drupal, by default when installed has a log in form on /admin. If this form is not intended to work, then why is it there?

Also, you mention that you have to make the login block available to anonymous users. First, if in our set-ups it's not available to anonymous users, then why does it show up? Usually if a user doesn't have access to something, it disappears, not breaks.

Second, if the solution is making the login block available to anonymous users, how does one do that? There is nothing about login blocks on the /admin/user/access page.

thandavapati’s picture

Both options that you suggested are not working for me. @xmacinfo

ksenzee’s picture

If I'm logged out of my site, and I go to site.com/admin, I get "access denied" and a login block in the sidebar. If I try using that block to log in -- as I should be able to -- I get sent to site.com/?destination=admin, and I'm not logged in.

munzirtaha’s picture

It happened to me exactly as you describe, ksenzee. I found it happened after I used a proxy server in my browser. So, I removed it and it worked. Your mileage may vary.

Munzir Taha

ksenzee’s picture

It must be something else in my case because I'm not using a proxy. But thanks for the idea.

munzirtaha’s picture

I guess it could be a caching issue. Please, try to clear the cache and all the data stored in your browser. Also, test with a different browser.

Munzir Taha

Mike_Waters’s picture

I have cleared cache, cookies, everything. The login block on the /admin page simply does not work.
What follows is the results of an HTTP debug of the POST process, attempting to use the /admin login block to log into a site as Administrator (i.e. entering valid login data into the /admin login block and clicking the 'Submit' button). Private data is replaced with 'xxx'. Note that Drupal (5.1) returns a 200/OK to the request!!!:

REQUEST
POST /?destination=admin HTTP/1.1
Host: test.xxx.com
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.6) Gecko/20070725 Firefox/2.0.0.6
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300
Proxy-Connection: keep-alive
Referer: http://test.xxx.com/admin
Cookie: PHPSESSID=2ilahng28qc14rk0jmo008mu36;
Content-Type: application/x-www-form-urlencoded
Content-Length: 65

name=administrator&pass=xxx&op=Log+in&form_id=user_login_block

RESPONSE
HTTP/1.1 200 OK
Date: Sat, 01 Sep 2007 02:30:06 GMT
Server: Apache/2.2.4 (Win32) PHP/5.2.1 mod_perl/2.0.3 Perl/v5.8.8
X-Powered-By: PHP/5.2.1
Expires: Sun, 19 Nov 1978 05:00:00 GMT
Last-Modified: Sat, 01 Sep 2007 02:30:06 GMT
Cache-Control: no-store, no-cache, must-revalidate
Cache-Control: post-check=0, pre-check=0
Vary: Accept-Encoding
Content-Encoding: gzip
Content-Length: 7822
Content-Type: text/html; charset=utf-8

... HTML code for http://test.drugsettlement.com/?destination=admin (basically, the front page) follows the response headers...

Mike_Waters’s picture

Oh shoot, I left out an 'xxx'. Well, please don't DOS the site or flame the heck out of me ;)

jgj’s picture

I'm having the same issue (login block on site.com/admin returning site.com/?destination=admin rather than admin section) and i've been working around it by going to site.com/node/add and logging in using the block that shows there. it returns the correct page (node/add) and i get logged in, and from there i can enter the admin section. i'm using Drupal 5.7 on a PHP 5 LAMP server

darthf1’s picture

A workaround for this issue, is to add the login form to the frontpage. More info here.

Is there a fix for this problem, because i dont want the login form to be visible on the frontpage. I'm on drupal 6.19