Tags:
archive_me1Add my vote for this tag plugin_api1Add my vote for this tag create new tag
, view all tags
RenameTopicDoesMainMainUser reminded me to ask, can we please have username canonicalisatin published through the plugins API? I had to write my own for the action tracker, and it would be much better if this service were provided from the core.

-- CrawfordCurrie - 22 Jul 2004

Could you elaborate what kind of functions / functionality you need?

-- PeterThoeny - 23 Jul 2004

OK, I started writing just the little bit I need for the AT but what is really needed is a designed approach to user handling, so here we go. What I'd really like is a user object that can be derived starting from a wikiname (with or without web), a remote username, or an e-mail address. So I can do this:

my $id = $attrs->get( "who" );
my $user = new TWiki::Plugins::User( $id );
print "User $id not known" unless ( $user );
print "id $id identified as $user->{username} alias $user->{wikiname} alias $user->{email}\n" if ( $user );
Further I'd also like integrated prefs handling, and be able to forget that users come from a web:
my $ebw = $user->getPreference("EDITBOXWIDTH");
my ($meta, $text) = $user->readPersonalTopic();
but I'd settle for the first bit short term, if the user record contains the web the user comes from (so I can access the user's personal topic).

Note that in the interests of lazy-loading user information the access to fields should be via functions i.e. $user->email() not $user->{email}

-- CrawfordCurrie - 24 Jul 2004

not to be pedantic or a language rules lawyer or anything, but, you can use perl tie's to execute arbitrary code for read and/or write to a variable. so, with some perl magic, you can have $user->{email} provide lazy-loading of user information. (i'm not saying you want to do it this way---i'm not arguing either way atm, just saying it can be done both ways---but that's not the important part of this discussion).

-- WillNorris - 24 Jul 2004

Topic revision: r6 - 2004-09-09 - RafaelAlvarez
 
Twitter Delicious Facebook Digg Google Bookmarks E-mail LinkedIn Reddit StumbleUpon    
  • Download TWiki
TWiki logo Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2012 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.