Site admin login problem: conflict due to rewritten /admin url

Chillstar
Chillstar's picture

Joined: 2005-09-29
Posts: 5
Posted: Mon, 2005-10-24 15:16

Hello,

I have 4 multisites running happily on my server. I updated them all to 2.01 and all went well. Over the weekend I got a message from one gallery owner asking what the username/ pwd was for the site admin. On investigation they were logging in to gallery fine, but clicking the site admin link threw up a user/ pass login box as you would get if you set restricted access using .htaccess

I realised the problem- my Cobalt server uses www.site.com/admin as a login to the server's admin GUI. The offending site is running on the root of the site so the login link is:
www.site.com/admin/?g2_return=http%3A%2F%2Fwww.site.com%2Fmain.php&g2_returnName=album"
...which is conflicting with the server's admin which is accessed by using www.any-domain-on-the-server.com/admin and the server's admin is taking precedence.

I tried another multisite which was OK, but the gallery there is running on www.site.com/gallery

I have got around the problem by asking the user to get to the site admin via:
www.site.com/main.php?g2_view=core.SiteAdmin
(they have to be logged in to gallery as an admin first).

But that's not an ideal solution and I realise there is potential for confusion. I thought I would post this in case it helps others, but also to find if there's a way to change the login link from /admin to /photoadmin to get around the conflict.

I tried changing

Quote:
RewriteCond %{THE_REQUEST} \ /admin/(\?.|\ .)
RewriteCond %{REQUEST_FILENAME} !main\.php
RewriteRule . /main.php?g2_view=core.SiteAdmin [QSA,L]

to

Quote:
RewriteCond %{THE_REQUEST} \ /photoadmin/(\?.|\ .)
RewriteCond %{REQUEST_FILENAME} !main\.php
RewriteRule . /main.php?g2_view=core.SiteAdmin [QSA,L]

without luck- I'm no expert in these things, but I can guess the above change is only half of the fix- it's translating the new link OK, but the link in the PHP needs to change too- and that's where I'm lost.

Any help appreciated,

Thx
C*

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Mon, 2005-10-24 17:34

in site admin -> url rewrite
remove or change the "Site Admin" rewrite rule (/admin)

 
Chillstar
Chillstar's picture

Joined: 2005-09-29
Posts: 5
Posted: Mon, 2005-10-24 20:13

Wow- I'm just finding my way around G2, but have to say that the dev team really do seem to have thought of everything!

Thanks- what an easy fix!

valiant, your great help in these forums and the amazing product that is Gallery 2 have just compelled me to donate- it was criminal not to...

C*

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Mon, 2005-10-24 23:06

heh, thanks :)