Gossamer Forum
Home : Products : DBMan : Customization :

Who's Online Duplicates

Quote Reply
Who's Online Duplicates
I read the post and fix to Donm from JPD to stop duplicate entries in the Who's Online listing. It does not work for me so I wonder:

Could we check the auth directory at login and if an auth file exists for the user, delete it when the same user logs on? My key is set to the Userid. Thanks!



Quote Reply
Re: Who's Online Duplicates In reply to
What do you mean it didn't work? Did it still show duplicates? I don't know how it could.

However, you can add a bunch of code that will do what you want.

In auth.pl, after

$db_uid = "$userid." . time() . (int(rand(100000)) + 1);# Build User Id

add

Code:

opendir (AUTHDIR, "$auth_dir") || &cgierr("unable to open directory: $auth_dir. Reason: $!");
@files = readdir(AUTHDIR); # Read in list of files in directory..
closedir (AUTHDIR);
FILE: foreach $file (@files) {
if ($file =~ /^$userid./) {
unlink "$auth_dir/$file";
last;
}
}
JPD
http://www.jpdeni.com/dbman/
Quote Reply
Re: Who's Online Duplicates In reply to
Thank you JPD, excellent fix Smile and better than just masking the display of the user IMHO. This forum is great thanks to you and the other "problem solvers" who hang out here.

When I said the fix you gave Donm didn't work for me, it gave me an internal error and no debug information. I guessed it was because of one or another of the mods I have installed since it still happened even when I ripped out that whole section of Who's Online and used only your code.

Thanks again for your watchful eye. BTW, for back problems, my therapist says (so do I) that a foam swimming pool "noodle" cut to an appropriate length is great for supporting the offended area.

Tom

Quote Reply
Re: Who's Online Duplicates In reply to
I'm glad I was able to come up with code for you that worked.

Thanks for the advice about my back. It seems that there was something just a little bit out of place which was causing all the pain. Once the muscles relaxed enough (after taking lots of pills!), it clicked back into place and I was fine.

I probably do need to get a better chair, though, or something for support as I sit here for hours on end. Wink


JPD
http://www.jpdeni.com/dbman/