Gossamer Forum
Home : Products : DBMan : Customization :

Something wrong with logging off?

Quote Reply
Something wrong with logging off?
Hi,

I have noticed a bug in the script. When user log's off from the database, the who's online MOD sometimes doesn't remove the user from the list. The default.log shows that the user has logged ON two times, when actually he has first logged in, then after a minute, out. I've also asked the user did he press the log off link, and he says yes, he did. After the $auth_time (2 hours) is run out, the user disappears normally from the who's online list.

So, I need help to solve this. This is very important for me to get it work right, because before updating the database, I allways wait till database has no users.

maco
Quote Reply
Re: [maco] Something wrong with logging off? In reply to
Quote:
because before updating the database, I allways wait till database has no users.

To determine if I have users logged in, I check the Auth folder using FTP. Then if I have no users, I disable the dbman so no users can login.

Do you edit the database outside of Dbman, such as with excel?
Quote Reply
Re: [joematt] Something wrong with logging off? In reply to
In Reply To:
Quote:

To determine if I have users logged in, I check the Auth folder using FTP. Then if I have no users, I disable the dbman so no users can login.

Do you edit the database outside of Dbman, such as with excel?
How do you disable it? I'm not sure that I understud right, but with updating I mean modifications to the code in the database scripts. I use a program called EditPlus to modify and those are uploaded via ftp.
Quote Reply
Re: [maco] Something wrong with logging off? In reply to
Yes, of course you mean edits to the code, silly me, I forgot you were still editting the code.

To disable goes something like this;

I have a html file that I give out as a link to the database, it just says welcome and click here to proceed, or click here to view without log-in.

When I disable the database I replace that html file with one that says, Sorry, try back later, send me an email etc...

Then to really disable the database, I just replace the .pass file with a file that does not have passwords for any users, but has passwords for me to test the database.

Does that make sense? You can disable (break) the database in many many ways, Smile, I do it by renaming the .pass file.

Sometimes I edit the database in excel, and in that case I want to be sure no one is logged-on, as edits they make would be lost when I upload the new database.
Quote Reply
Re: [maco] Something wrong with logging off? In reply to
How much time are you setting in your .cfg file to determine when their session ids will expire?

In *.cfg, set

$auth_time = 600; # (10 minutes)
$auth_time = 1200; # (20 minutes)

Unoffical DBMan FAQ
http://redundantcartridge.com/dbman/
Quote Reply
Re: [LoisC] Something wrong with logging off? In reply to
In Reply To:
How much time are you setting in your .cfg file to determine when their session ids will expire?


Two hours:

$auth_time = 7200;
Quote Reply
Re: [joematt] Something wrong with logging off? In reply to
In Reply To:
I have a html file that I give out as a link to the database, it just says welcome and click here to proceed, or click here to view without log-in.

When I disable the database I replace that html file with one that says, Sorry, try back later, send me an email etc...

Then to really disable the database, I just replace the .pass file with a file that does not have passwords for any users, but has passwords for me to test the database.

Does that make sense? You can disable (break) the database in many many ways, Smile, I do it by renaming the .pass file.

Sometimes I edit the database in excel, and in that case I want to be sure no one is logged-on, as edits they make would be lost when I upload the new database.


Good ideas, but my updates are very short in time, few seconds only, so those are a bit too fancy ;) tricks for me to use. But checking the auth dir (I didn't know that) seems the next best solution, IF I can't make the log file (or who's online mod) to work right.
Quote Reply
Re: [maco] Something wrong with logging off? In reply to
I would suggest setting the timeout to 10 or 20 minutes as the instructions for the mod suggests.

Having it set at 2 hours means their information will remain for 2 hours after they logoff.

Unoffical DBMan FAQ
http://redundantcartridge.com/dbman/
Quote Reply
Re: [LoisC] Something wrong with logging off? In reply to
In Reply To:
I would suggest setting the timeout to 10 or 20 minutes as the instructions for the mod suggests.

Having it set at 2 hours means their information will remain for 2 hours after they logoff.


OK. But: I have so many input fields, that filling takes a long time. So, if I change the auth_time to twenty minutes, the programs belives very soon that the user has leave the database, when actually he is still filling the input fields.

# Included is a "true logoff," which removes the session file for the
# user when he logs off the database. Also, since many users do not
# log off when they leave the database, their session ids will be
# after 10 or 20 minutes of inactivity.


Why the default.log shows accosionally 2 log ONs, when actually the user has first logged on, and then off? I think solving THIS problem is the solution. There must be something wrong with this "true logoff"...
Quote Reply
Re: [maco] Something wrong with logging off? In reply to
I might found something...

This is part of the who's online mod instructions:

--------------------------

# In db.cgi, sub main, change

elsif ($in{'logoff'}) { &auth_logging('logged off') if ($auth_logging);
$auth_logoff ? (print "Location: $auth_logoff\n\n") : (print "Location: $db_script_url\n\n"); }

# to


elsif ($in{'logoff'}) { &auth_logging('logged off') if ($auth_logging);
unlink "$auth_dir/$db_uid";
$auth_logoff ? (print "Location: $auth_logoff\n\n") : (print "Location: $db_script_url\n\n"); }

---------------------------------------



This is the same part of the original (and mine) db.cgi :

----------------------------------------

elsif ($in{'logoff'}) { &auth_logging('logged off') if ($auth_logging);
(-e "$auth_dir/$db_uid") and ($db_uid =~ /^[\A-Za-z0-9]+\.\d+$/) and unlink ("$auth_dir/$db_uid");
$auth_logoff ? (print "Location: $auth_logoff\n\n") : (print "Location: $db_script_url\n\n");


---------------------------------------------

So you can see, that in the mod is asked to change something, which actually doesn't exist.

How should code be?
Quote Reply
Re: [maco] Something wrong with logging off? In reply to
If you compare dates you will notice that the mod was written a month before the latest DBMan 2.05.

So the coding within the version you have should work fine.

Unoffical DBMan FAQ
http://redundantcartridge.com/dbman/