Logging in problem

ajh

Joined: 2003-07-17
Posts: 3
Posted: Tue, 2003-08-05 20:16

I've seen this problem on the forums elsewhere, but I haven't yet seen an adequate response. The problem is that the first time you visit the gallery and try and log in, when you have a valid user name and password, it loops back into the login window, looking as if you are not logged in.

In fact, if you then cancel the login window and refresh the main window, you find that you are in fact logged in and the albums, options etc you are entitled to see are displayed.

Looking into the code, there is a piece of Javascript that is meant to get executed by login.php which does the above automatically (main window refresh and close login window). However it is reliant on a property of the login window called 'opener' which contains the reference to the main window which is then refreshed.

Looking at the code in util.php which is where the Javascript that generates the call to popup the login window resides (in popup_js), it looks as if the 'opener' property is set after the call to create the login window. I assume that this then causes the refresh code in login.php to fail as 'opener' is undefined.

Of course, once you return from login successfully by closing and manually refreshing, 'opener' does get set, so the next time you go to log in, the popup works as designed.

Unless I'm mistaken about how it works, this would seem to be a coding bug that would prevent login from working.

Any comments or ideas as to how to get round it. Basically I can't work out how to set the 'opener' property of the new window before it gets popped up, and by then it's too late

Adam

Gallery URL: www.pixolet.co.uk/gallery
Gallery version: 1.3.4
Apache version: 1.3.27
PHP version: 4.2.3
Graphics Toolkit: netpbm
Operating system: Linux
Web browser/version (if applicable): IE6

 
joan
joan's picture

Joined: 2002-10-21
Posts: 3473
Posted: Wed, 2003-08-06 08:25
ajh wrote:
Unless I'm mistaken about how it works, this would seem to be a coding bug that would prevent login from working.

Nice analysis, but of course, generally, login does work!

So the problem is one related to your site. Have you read FAQ c.8?

**EDITED** Oops. Wrong FAQ! fixed now.

 
ajh

Joined: 2003-07-17
Posts: 3
Posted: Wed, 2003-08-06 12:02

Clarification: login does work - it just doesn't look like it.

Yup - read c.8 - it isn't that problem - after all, it does actually log in, it just doesn't look as if it has. Reading through the posts, there seems to be a number of people who have the same problem - and the general response is "go read the FAQ". It looks to me as if there needs to be a greater analysis of what the problem is. I've tried, but I'm not sure of what the answer is - thus this post.

As far as I can see, the PHP is generating a correct page. When you do a correct login and you get the erroneous login window popup again, if you view the source you do see the javascript which is generated:
<BODY onLoad='opener.location.reload(); parent.close()'>

So how come this doesn't get executed by the browser - the only reason I can see for this is that 'opener' is undefined thus the code blows up and doesn't run.

So - why is 'opener' undefined?

If there was a session or cookies problem, you wouldn't get as far as this.

So - is there anyone out there who's willing to help me debug this? It may turn out to be an anomoly in my hosting set up, but I don't think that is the conclusion I'm currently coming to.[/b]

 
re-built

Joined: 2003-08-06
Posts: 2
Posted: Wed, 2003-08-06 18:11

Hai,

I have also the same problem. The differend is that I running on a Windows 2000 machine.

I checked C.8 and C.9.
With the session test, the ID changed, but the views stays by 1 and does not increase.

I checked my PHP.INI settings, but it looks to be fine.

Gallery version: 1.3.4
Apache version: 1.3.27
PHP version: 4.2.3
Graphics Toolkit: netpbm
Operating system: Windows 2000
Web browser/version (if applicable): IE6

 
joan
joan's picture

Joined: 2002-10-21
Posts: 3473
Posted: Thu, 2003-08-07 10:05

username/password so we can see this ourselves?

 
ajh

Joined: 2003-07-17
Posts: 3
Posted: Thu, 2003-08-07 14:23

username = user
password = password

Thanks

 
joan
joan's picture

Joined: 2002-10-21
Posts: 3473
Posted: Thu, 2003-08-07 14:40

FAQ c.8

Use the same url you specified in the configuration. eg
http://pixolet.co.uk/gallery/albums.php

 
Boyd

Joined: 2003-08-09
Posts: 1
Posted: Sat, 2003-08-09 20:25

I have the same problem, but I noticed it is only if I'm using Netscape's browser (4.7XX?). When I use IE it works fine.

DB

 
jui

Joined: 2003-08-10
Posts: 12
Posted: Sun, 2003-08-10 21:05

here's the same problem, session-check doesn't count ab although php.ini really seems to be fine. gallery running in a virtual host environment.
i don't know what to check now ... using 1.3.4pl1 on php 4.2.2/apache 1.3.26.
what the heck is the problem, I have access to all files on this machine, so I will be able to check any of your ideas.

we should find out what the problem is.
you may also send me a mail:

jui.gallery_at_familie-betz.de (replace "_at_" by "@" when sending mail)

--
jui

Gallery: 1.3.4pl1 w/ ImageMagick
Apache: 1.3.26
PHP: 4.2.2
OS: SuSE Linux 8.1

 
kirkram

Joined: 2003-08-11
Posts: 1
Posted: Mon, 2003-08-11 04:18

I get the same problem, and I've had a heck of a time getting it running this time around with the latest version.

I've installed it several times before with other servers and older versions no problems.

This time around I've gone through the FAQ and past post and nobody answered except to repeat the read the FAQ etc.

I'm not complaining, just offering feedback that it may be more widespread than people think. I'm not going to post my server information unless someone really wants to dig into it then I can post it or include login/pwd's.

 
chigo58

Joined: 2003-08-11
Posts: 4
Posted: Mon, 2003-08-11 10:31
 
joan
joan's picture

Joined: 2002-10-21
Posts: 3473
Posted: Mon, 2003-08-11 11:05

Not the same problem

 
joan
joan's picture

Joined: 2002-10-21
Posts: 3473
Posted: Mon, 2003-08-11 11:06

If anyone wants this problem debugged, please give a URL and username/password, so we can see what the problem is.

 
jui

Joined: 2003-08-10
Posts: 12
Posted: Mon, 2003-08-11 11:59

what password/username do you need? the one to access gallery (if it works) or do you want access to the machine? this is impossible in my case because of many users with many vhosts are located on this machine. what I may give you is an account to access the /gallery directory on the machine as well as a copy of the php.ini file.

enough for debugging?

jui

 
joan
joan's picture

Joined: 2002-10-21
Posts: 3473
Posted: Mon, 2003-08-11 12:21

I don't need to debug, all I need is a GALLERY username and password to prove it is either FAQ c.8 or FAQ c.9

 
jui

Joined: 2003-08-10
Posts: 12
Posted: Tue, 2003-08-12 17:51

so give it a try.

admin:test
www.familie-betz.de/gallery

it's an empty installation with no albums at the moment. I plan to restore my old albums-folder when the basic-system is running without problems.

so have a look at it ...

 
c0nfus3d

Joined: 2003-08-13
Posts: 7
Posted: Wed, 2003-08-13 18:00

hi,

i am currently facing the same problem. Are there any solutions to this yet?

 
joan
joan's picture

Joined: 2002-10-21
Posts: 3473
Posted: Wed, 2003-08-13 18:07

jui, c0nfus3d,

what results did you get from the session test?

 
c0nfus3d

Joined: 2003-08-13
Posts: 7
Posted: Wed, 2003-08-13 18:14
joan wrote:
jui, c0nfus3d,

what results did you get from the session test?

For me, it's very weird, for IE 6, it doesn't work, but for Netscape 7.1 it will work just fine.

 
c0nfus3d

Joined: 2003-08-13
Posts: 7
Posted: Wed, 2003-08-13 18:19
c0nfus3d wrote:
joan wrote:
jui, c0nfus3d,

what results did you get from the session test?

For me, it's very weird, for IE 6, it doesn't work, but for Netscape 7.1 it will work just fine.

Correction...now it works for IE too... :-?

Does php uses any logging for or are there any debugging tools? Sorry I am not very skilled in PHP.

 
jui

Joined: 2003-08-10
Posts: 12
Posted: Wed, 2003-08-13 21:22

Session test doesn't count up!
No reason found why this happens.
Writing to php /tmp successfully.

Any idea what I should test/check?

I'll give 755 to ./setup so you can also have a look at that, ok?

jui

 
alindeman
alindeman's picture

Joined: 2002-10-06
Posts: 8194
Posted: Wed, 2003-08-13 21:36

Yes, if you could give us a URL of your Gallery in setup mode, I'll poke around (TM) ;)

 
liquidj

Joined: 2003-08-14
Posts: 1
Posted: Thu, 2003-08-14 12:56

I had this problem, after my initial install. No matter how many times I got out of secure more and changed the password, and then tried to login the login screen wouldn't disappear. Going back to the main browser window didn't fix anything either, I was still logged out.

I used Gallery Remote 1.1b14 (i think) to login (so I know my passwd works) and then added an album. After that the broswer interface worked, and I could login.

I don't know the source of the problem but I can recommend anyother user do what I did to see if it fixes their installation.

 
joan
joan's picture

Joined: 2002-10-21
Posts: 3473
Posted: Thu, 2003-08-14 13:11

jui,

I'm mystified. Hopefullyjoyoflinux can take up your cause and solve it for us.

 
alindeman
alindeman's picture

Joined: 2002-10-06
Posts: 8194
Posted: Thu, 2003-08-14 16:10

Weird... that's pretty crazy...

 
jui

Joined: 2003-08-10
Posts: 12
Posted: Thu, 2003-08-14 19:48

So you had no luck and everything seems ok whan you take a look at the setup-mode, right!
Waht I would also suggest is to ask all people having a similar problem about the distribution they or their provider is using.
I have it on a SuSE 8.1 and what I and the hosters support found is, that another customer has a similar problem not with gallery but with a login-script written in php. So we were testing around and found, that suSe once offered an PHP-Patch setting session handling very restrictive. When this Patch had been applied to a system many scipts had problems with sessions. I seems that the php-code needs to be modified to match to these restrictive setting (i am not a php-programmer so i only tell what information i got).
But many people wanted SuSE to fix this patch to get their scripts working again, because they were not able to modify scripts by themselves. so SuSE applied a new Patch with less restrictions and most of the login-scripts for most people worked again.
On our system we found that the old restrictive script was still active. So my hoster added the newer one from SuSE and now the script of the other user who had problems with anohter (not gallery) login-script were gone. But it didn't change anything for my gallery :-((( So maybe it's up to the programmers to change the code (session handling) to get it to work. But what would be interesting is, if some of the other people having that problem are running a suSe 8.1 or similar. That could be a good starting point as well as a suse-mailinglist or the suse homepage for the programmers - if it seems to be a suse-specific problem (maybe only 8.1).

Thanks for your support, I hope to get gallery running one day.

Jui

 
c0nfus3d

Joined: 2003-08-13
Posts: 7
Posted: Thu, 2003-08-14 20:47

I am running on the latest version of redhat, 9.0.

I will try out the Gallery Remote thing and feedback!

Cheers~

 
alindeman
alindeman's picture

Joined: 2002-10-06
Posts: 8194
Posted: Thu, 2003-08-14 21:06

Your Redhat 9 thing might be related to this: FAQ c.21

 
joan
joan's picture

Joined: 2002-10-21
Posts: 3473
Posted: Thu, 2003-08-14 21:42
 
jui

Joined: 2003-08-10
Posts: 12
Posted: Fri, 2003-08-15 09:34

hi joan!

thanks for the link. no, i didn't find this thread and didn't know about it before, but it seems to be the main problem. suse released another patch which should not be so restrictive, but as gallery still doesn't work there must be some more incompatibility.
what i wonder is if the gallery developers are able to work around this problem by patching gallery so it works with that restrictive suse patches.

jui

 
jui

Joined: 2003-08-10
Posts: 12
Posted: Fri, 2003-08-15 09:54

PROBLEM RESOLVED!!!!

Ok, thanks for your help and with your comments you directed me to the right direction.
It were two faults, one by me and one caused by a SuSe Patch.

1) A very restrictive suSE Patch fpr PHP caused problems with session management. Everythin in Gallery-Config was ok, but no login possible. So I decided to use an older Gallery-Version where I knew it was working on another system. But the same Problem with that.

2) Now we found that there were problems reported with that SuSe Security-Patch and we installed a newer Patch from suSe which was known to bo not so restrictive. From that Point on other Login-Scripts and Session counter worked, but still no Gallery-Login possible.

3) Now I checked again all the configuration and found, that when I changed the gallery-version I forgot to set the URL correct. I just forgot this time to set "www." in front of the rest of the URL.
When I corrected this gallery worked.

So I came from one errorless configuration but problem with the server to an incorrect configuration on a patched server ... :-)
Hope that this may help others on solving their problems.

 
c0nfus3d

Joined: 2003-08-13
Posts: 7
Posted: Fri, 2003-08-15 20:49

I am now trying to upgrade PHP. I have tried many ways, including compiling every single thing all over again but to no avail.

I am back with my old config because my other applications still require the old php n apache.

Does anyone has experience in upgrading php via rpm?

I have downloaded the php rpm file but as usual..there are a lot of dependencies issues, so I am trying to find a howto for RH9.0 php upgrade.

 
alindeman
alindeman's picture

Joined: 2002-10-06
Posts: 8194
Posted: Fri, 2003-08-15 21:00
 
c0nfus3d

Joined: 2003-08-13
Posts: 7
Posted: Sat, 2003-08-16 03:30

Have done this, but the same problem is still there, which is why I revert back to my old settings

 
c0nfus3d

Joined: 2003-08-13
Posts: 7
Posted: Sat, 2003-08-16 19:07

ok..am running apache2.0 and php4.3.2 now. (compiled)

Same problem still around, what should I check next?

 
silverfox

Joined: 2004-10-08
Posts: 21
Posted: Fri, 2004-10-08 05:30

I'm having a similar problem. I'm using PHP 4.3.8-12 (cli) (built: Sep 6 2004 05:46:13)

This problem appears to be caused by the subroutine called from Line 61 of login.php:

dismissAndReload();

I'm not too good at php, so I'm not sure where is this routine lives, and I don't see any include files listed in login.php, so I'm not sure where it comes from. Is it a native php command?

 
beckett
beckett's picture

Joined: 2002-08-16
Posts: 3474
Posted: Fri, 2004-10-08 06:04

dismissAndReload() is implemented in util.php. What's the exact problem you're having? (This is a long thread and I don't feel like reading it all right now...)

-Beckett (

)