create new tag
, view all tags

UserInfoPluginDev Discussion: Page for developer collaboration, enhancement requests, patches and improved versions on UserInfoPlugin contributed by the TWikiCommunity.
• Please let us know what you think of this extension.
• For support, check the existing questions, or ask a new support question in the Support web!
• Please report bugs below

Feedback on the UserInfoPlugin

MichaelDaum - 07 Apr 2005
I will have a look at the TodaysVisitorsPlugin code to merge usefull stuff in here.

TravisBarker - 07 Apr 2005
UserCookiePlugin may also be of interest?

PeterThoeny - 08 Apr 2005
Hmm, editing now the topic instead of adding a comment, it eats my comments and adds just a signature. Interesting idea of using divs, but I see a drawback that it is very hard to hand-edit text on the page since text is burried in HTML tags.

MichaelDaum - 08 Apr 2005
Peter, I altered the mufat comment style to ease that.

Thanks Michael for externalizing this Plugin and for making it available to the TWikiCommunity!

MichaelDaum - 12 Apr 2005
Released an initial version today. Can anybody verify wether this plugin works on TWiki/Cairo?

MichaelDaum - 12 Apr 2005
fixed some issues

MartinCleaver - 12 Apr 2005
I'd prefer if this:
  1. first changed the display of existing bulletted lists
  2. facilitated interjection into those lists

And then we add formatters such as mufat that display normal lists nicely.

MichaelDaum - 13 Apr 2005
Are you advotating for a generic FormattedListsPlugin that takes a comma separated input and does arbitrary formatting?

JosMaccabiani - 10 Jun 2005
Interesting Plugin. Unfortunately, on my Cairo installation, the plugin topic is not displayed:

Software error: %BR%
Can't use an undefined value as an ARRAY reference at /wikiroot/twiki/lib/TWiki/Plugins/UserInfoPlugin.pm line 173.

Those lines read:

172   my ($visitors) = &getCurrentVisitors(undef, $twikiGuest); %BR%
173   return "" if !@$visitors;

Unfortunately I'm a Perl dummy. Anyone has any suggestions? Thanks!

SueLocke - 29 Jun 2005
Having same problem and same error message. The syntax that seems to be throwing the plugin on my installation (sept2 2004) seems to be the NRGUESTS and NRVISITORS. I can use the other variables without any problem. The plugin page won't load on my installation (error message as above) due to the presence of these variables on the plugin home page. Seems strange.

MichaelDaum - 30 Jun 2005
Have you got the SessionPlugin up and running? Where are your sessions stored? Are they in /tmp or in lib/twiki/data/.session? Lookup the lib/twiki/Plugins/SessionPlugin.pm somewhere at lines 904+905 and toggle the comments of the both lines to get sessions stored in lib/twiki/data/.session. Unfortunately this is hardcoded into the UserInfoPlugin.

MichaelDaum - 30 Jun 2005
The next release will bail out with a warning if the session store can not be found.

WillNorris - 19 Jul 2005
checked .zip into CVS

TravisBarker - 23 Aug 2005
mine worked great until last week when i did a system wide upgrade, now I am having some issues. I will document them when I put a finger closer to the issue causing the bug (just a heads up)

RobertPudlik - 19 Oct 2005
For some reason I am getting the following error on the Admin page:

UserInfoPlugin: (disabled)

It appears as enabled in the Configuration page.

I'm getting the following error on my InstalledPlugins page:

TWiki::Plugins::UserInfoPlugin could not be loaded. Errors were: Can't locate TWiki/Plugins/SessionPlugin.pm in @INC (@INC contains: /var/www/twiki/lib . /etc/perl /usr/lib/perl5/site_perl/5.8.6/i686-linux /usr/lib/perl5/site_perl/5.8.6 /usr/lib/perl5/site_perl/5.8.5 /usr/lib/perl5/site_perl/5.8.5/i686-linux /usr/lib/perl5/site_perl /usr/lib/perl5/vendor_perl/5.8.6/i686-linux /usr/lib/perl5/vendor_perl/5.8.6 /usr/lib/perl5/vendor_perl/5.8.5 /usr/lib/perl5/vendor_perl/5.8.5/i686-linux /usr/lib/perl5/vendor_perl /usr/lib/perl5/5.8.6/i686-linux /usr/lib/perl5/5.8.6 /usr/local/lib/site_perl) at /var/www/twiki/lib/TWiki/Plugins/UserInfoPlugin.pm line 78. BEGIN failed--compilation aborted at /var/www/twiki/lib/TWiki/Plugins/UserInfoPlugin.pm line 78. Compilation failed in require at (eval 45) line 1. BEGIN failed--compilation aborted at (eval 45) line 1.

I thought the Session plugin was integrated into Dakar. Does anyone have an idea why this is happening? Thanks for any help!

I'm using a Beta build of Dakar: Thu, 22 Sep 2005 build 6515

MichaelDaum - 20 Oct 2005
Robert, I uploaded a new version 1.3 that is in sync with its svn counterpart and dakar beta and fixes the issue that you've reported.

RobertPudlik - 20 Oct 2005
Thanks for the quick response. I appreciate it.

DavidBright - 24 May 2006
If you use %NRVISITORS% and %NRLASTVISITORS% on the same page, at least if %NRVISITORS% comes first, it won't work. The reason is that the code to calculate/display %NRLASTVISITORS% will use a cached value of %NRVISITORS%. I've fixed that in my version. I'll try to post a patch soon, but I've got several other things I'm doing with this code, so I have to untangle my mods. Is there any chance that this plugin will get put into SVN?

By the way, thanks for developing and releasing this plugin!

MichaelDaum - 25 May 2006
Hi David. I amvery interested in your fix. Thanks in advance. Btw, this plugin is in svn already. Home comes you didn't find it there?

DavidBright - 26 May 2006
Re: SVN. My mistake; when I saw the modification policy of ContactAuthorFirst on the UserInfoPlugin topic, I just assumed it wouldn't be in SVN. Obviously, a bad assumption, especially since the line right next to that says DevelopedInSVN: Yes

DavidBright - 26 May 2006
Patch for %NRLASTVISITORS% attached.

MichaelDaum - 26 May 2006
David, thank you very much for you patch!!! I will look at at it asap.

MichaelDaum - 27 May 2006
Ok, released v1.51 that includes your fix, albeit in a little improved version fixing some other issues too.

DavidBright - 06 Jun 2006
The getVisitors() routine will duplicate user entries when the number of days spans months (i.e., log files). For instance, today (6 Jun) when executing %LASTVISITORS{days="7"}% on my TWiki, I found myself listed twice, once today and once on 31 May. Naturally, the count returned by %NRLASTVISITORS{days="7"}% is also off, having counted me twice. The problem is that the %seen hash, which is used to prevent such a problem, is being initialized inside the loop over the log files. If the initialization is moved outside of that loop, the problem disappears. I'm attaching a patch for that (http://twiki.org/p/pub/Plugins/UserInfoPluginDev/GetVisitors-patch.txt).

MichaelDaum - 06 Jun 2006
Thanks, David. I found that error too. Will make a new release asap.

PeterThoeny - 05 Aug 2006
The [[%ATTACHURL%/%TOPIC%.zip][Download]] link fails if this Plugin is installed; it works only here on TWiki.org. Better to write the full URL [[http://twiki.org/p/pub/Plugins/%TOPIC%/%TOPIC%.zip][Download]]. Actually I think it is better to keep the original text "Download the ZIP file from the Plugin web (see below)" (and fix the viewfile issue on TWiki.org.)

MarkusBajones - 16 Aug 2006

I have a little problem with this Plugin. It shows me every Info except the VISITORS. It just shows blank where the users should be listed.

My TWiki installation is: TWiki version Tue, 04 Jul 2006 build 10807, Plugin API version 1.1.

Is this a wanted behavior depending on some settings or a bug?? How can I change this?

Markus Bajones

MichaelDaum - 16 Aug 2006
The VISITORS information is extracted from the session files, that is those little cgisess_*** files you have in /tmp or in .../data/.session. Maybe the plugin can't find your session files. It does the following to find them:
  1. Take directory specified in the TWiki::cfg{Sessions}{Dir} configuration variable (in lib/LocalSite.cfg)
  2. Check if the directory <data>/.session exists
  3. Fallback to /tmp
Please, have a look at your configuration and check the respective directory for cgisess_*** files.

The other reason you don't see any VISITORS is that there are none, that is there is no registered user currently logged in.

MarkusBajones - 16 Aug 2006
The files and the directory are readable and the TWiki::cfg{Sessions}{Dir} configuration variable is properly set to twikidir/data/.session

The only way I get a list of logged in users is to comment out next if $includeNames && $wikiName !~ /$includeNames/; (line 445) in Core.pm. But if I do so ad hit Reload in my browser its like a random behavior. Users are shown, they are not, they are shown, and so on...(Oops. This seems to be my fault, didn't restart my Apache).

One question though. Why are users who are logged out for some time now still shown as logged in ??

MichaelDaum - 17 Aug 2006
That's a misunderstanding of what VISITORS shows. It does not show who is currently online, but who has logged in in the given timespan at all. Tracking the logouts is possible reliably as most users simply tend to drive away.

Btw. try to enable debugging in the file lib/TWiki/Plugins/UserInfoPlugin/Core.pm in line 27 and watch out for the lines ignoreHosts and ignoreUsers in your debug.txt logfile. This will give you a hint what gets hidden.

MarkusBajones - 18 Aug 2006
Oh, Ok. From the Description "list of users currently logged in " i thought it should show me the users who are online.

My debug.txt looks like:

| 18 Aug 2006 - 06:19 | - UserInfoPlugin - ignoreHosts=
| 18 Aug 2006 - 06:19 | - UserInfoPlugin - ignoreUsers=TestUser|TWikiGuest|UnknownUser|TWikiRegistrationAgent|TWikiContributor
| 18 Aug 2006 - 06:19 | - UserInfoPlugin - called handleCurrentVisitors
| 18 Aug 2006 - 06:19 | - UserInfoPlugin - getVisitorsFromSessionStore()
| 18 Aug 2006 - 06:19 | - UserInfoPlugin - excludeNames=TestUser|TWikiGuest|UnknownUser|TWikiRegistrationAgent|TWikiContributor
| 18 Aug 2006 - 06:19 | - UserInfoPlugin - found bajo
| 18 Aug 2006 - 06:19 | - UserInfoPlugin - getVisitors()
| 18 Aug 2006 - 06:19 | - UserInfoPlugin - theDays=1
| 18 Aug 2006 - 06:19 | - UserInfoPlugin - includeNames=bajo
| 18 Aug 2006 - 06:19 | - UserInfoPlugin - excludeNames=TestUser|TWikiGuest|UnknownUser|TWikiRegistrationAgent|TWikiContributor

As I dont know perl I just have to guess, but could this be a problem with the WikiName and LoginName. I think that in sub getVisitorsFromSessionStore the Wikinames like MarkusBajones or MichaelDaum should be retrieved. Instead the Loginnames like bajo is read from the cgisess_* files. With this the line 445 in Core.pm makes sense too me next if $includeNames && $wikiName !~ /$includeNames/; . If the wikiName and the includeNames are not in includeNames go to the beginning of the loop and start it.

So if there are no real Wikinames it just jumps over them and never prints out anything. Could this be true or am I just totally wrong?

Btw. is the given timespan the duration of the cgi Sessions ?

MichaelDaum - 21 Aug 2006
I see what you mean wrt wikinames. Could possibly a bug.

The timespan is the number of days found in the log***txt files.

MarkusBajones - 28 Aug 2006
So how could the script look for the loginname and save it in a variable, for example: loginName. ? If we have the loginName it should be no problem to say: if $includeNames && $loginName !~ /$includeNames/; to do the same as for the wikiName and show the found users to the output.

MarkusBajones - 08 Sep 2006
I'I had time to do this now: In Core.pm, sub getVisitorsFromSessionStore after:
my $wikiName = $this->{twikiGuest};
if ($dump =~ /['"]?AUTHUSER['"]? => ["'](.*?)["']/) {
$wikiName = $1;


my $realwiki = TWiki::Func::userToWikiName($wikiName, 1);
$wikiName = $realwiki;

AlokNarula - 13 Feb 2007
Is this plugin compatible with TWiki 4.1? It was working with TWiki 4.05, but when I upgraded to 4.1, the following variables do not give the intended result:

AlokNarula - 19 Feb 2007
I see a change in the configuration files of TWiki 4.1.1. The session files are now saved in /tmp/twiki by default. If I set $TWiki::cfg{TempfileDir} = /var/www/twiki/data/.session, the cgiss files are created but the plugin is not able to resolve the data in the files to show the visitors.

SteffenPoulsen - 17 Apr 2007
Missing info in output is now reported as Bugs:Item3916.

CarloSchulz - 27 Apr 2007
Is it possilble to pass the $topic (last visited topic) variable to WebTopicCreator so that the topic you came from is automatically pre selected as the parent topic?

JoieySeeley - 30 Apr 2007
Is this plugin still being maintained? Looks like it's been awhile since it had an update...

MartinKaufmann - 20 Jun 2007
As AlokNarula mentioned, the session files are now stored in TempfileDir. I therefore patched Core.pm to look for the session files in the right directory (the patch also contains the changes suggested by MarkusBajones). %NRVISITORS% now works for me on TWiki 4.1.2.

RobertNelander - 12 Feb 2008
TWiki 4.2 no longer stores session files where the plugin can find them. Either the Core.pm needs patching to looking in the 'working/tmp' dir, or the configuration script must again store the information the module needs: $TWiki::cfg{Sessions}{Dir} = '/rootTWikiDir/working/tmp';

KoenMartens - 20 Mar 2008
This plugin does have issues with login names vs WikiNames (i noticed in 4.2), the above fix ( AlokNarula - 13 Feb 2007 ) didn't cut it for me, as the log files do contain the login name rather than the WikName.

The problem seems to be with the check in getVisitors:

# check back
next unless TWiki::Func::topicExists($mainWeb, $wikiName);

If $wikiName contains a login name (eg gmc) it will of course not find the topic, it should be checking for KoenMartens instead.. My quick fix is to change the check to:

# check back
next unless TWiki::Func::topicExists($mainWeb, TWiki::Func::getWikiName($wikiName));

Although i could imagine the best solution is to convert all usernames/wikinames/whatever internally to canonical form with getCanonicalUserID(), although that's only in 4.2 of course.

JimCrum - 07 Apr 2008
I reported a support issue on topic CantLocateObjectMethodfindUser on 4.2

The message is "can't locate object method "findUser" via package TWiki::Users at pluginname_installer.pl line 562." The code at that line is $twiki->{users}->findUser($TWiki::cfg{AdminUserWikiName}, $TWiki::cfg{AdminUserWikiName});

Peter referred me here with this comment....
It looks like those plugins use functions other than the documented TWikiFuncDotPm. Post this in plugin's Dev topic or file a bug report for each plugin. -- PeterThoeny - 06 Apr 2008

Is this a simple thing or will it take some time to implement?

MichaelSchmidt - 06 May 2008
After upgrading TWiki to version 4.2.0 I realized that UserInfoPlugin depends on the (classic) format of date $day $month $year.

I used the recommended setting of the configure script ($year/$mo/$day). The Variable %NEWUSERS% only showed the users registered with the classic format. After manually changing the date format to the classic format for the users registered after the upgrade, all new users are listed again.

Additionally I changed the configuration to use the classic format again.

JohannKappacher - 30 Jul 2008
Strange, this Plugin implements the WikiMatrix feature RecentVisitors and the red mark (no solution) is sticking for years. I guess this plugin could be also enhanced to show RecentVisits or RecentViews without much effort. Thanks to MIchael Daum for this pretty nice feature!

PeterThoeny - 2012-12-03
I changed the ModificationPolicy of this extension from ContactAuthorFirst to PleaseFeelFreeToModify due to inactivity. Anyone please feel free to work on this extension.

Topic attachments
I Attachment History Action Size Date Who Comment
Unknown file formatpatch Core-Change-SessionDir.patch r1 manage 1.0 K 2007-06-20 - 11:45 MartinKaufmann Patch to look for session files in the right place.
Texttxt GetVisitors-patch.txt r1 manage 0.6 K 2006-06-06 - 15:47 DavidBright Patch for problem with the getVisitors() routine that causes it to produce duplicate user entries when spanning months (log files).
Texttxt NrLastVisitors-patch.txt r1 manage 1.3 K 2006-05-26 - 18:26 DavidBright Patch for problem with %NRLASTVISITORS%
Edit | Attach | Watch | Print version | History: r50 < r49 < r48 < r47 < r46 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r50 - 2012-12-03 - PeterThoeny
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2017 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.