Question
Hi - I have an ActionTracker question.
Currently, to receive email notification, users must either enter their Wikiname or an alternate email address. Their Wikiname gets automagically expanded to Main.Wikiname.
Since I'm only using ActionTracker in my Main web, I'd like to eliminate users having deal with the "Main." appendage.
I found that commenting out line 151 of Action.pm answers part one of this question. Wikinames no longer get automatically expanded:
# line 151 # $n = _canonicalName( $n );
Next, looking at the "sub _getMailAddress" portion of the ActionNotify.pm script, does anyone know what needs to be edited to get the script to know it is always dealing with the Main web?
Thanks !
Environment
--
SamAbrams - 02 Jan 2004
Answer
Sam, I think this can be done pretty cleanly. In Action.pm there's a function
_canonicalName that has the lines:
if ( $who !~ /\./o ) {
$who = "$mainweb.$who";
}
This is what expands user ids to include the web name. You can try commenting them out, though without a careful inspection I couldn't tell what impact this might have elsewhere - though I'm pretty sure
_getMailAddress in ActionNotify.pm would also require changes:
} elsif ( $who =~ m/^$TWiki::wikiWordRegex$/o ) {
# A legal topic wikiname
$who = ActionTrackerPlugin::Action::_canonicalName( $who );
$addresses = _getMailAddress( $who, $mailAddress );
Changing this to:
} elsif ( $who =~ m/^$TWiki::wikiWordRegex$/o ) {
# A legal topic wikiname
$addresses = _getMailAddress( TWiki::Func::getMainWebName() . $who, $mailAddress );
ought to do it. Note that this would continue to work for everyone else as well. Let me know how you get on!
--
CrawfordCurrie - 03 Feb 2004
You rock ! Okay, I should have feedback for you over the next few days.
--
SamAbrams - 18 Feb 2004
Okay, I applied your mods to the latest bugfix release. This is the error message I get:
[dreamhost]$ ./actionnotify.cgi 'open'
Undefined subroutine &TWiki::Func::getMainWebName called at ../lib/TWiki/Plugins
/ActionTrackerPlugin/ActionNotify.pm line 261.
--
SamAbrams - 18 Feb 2004
Ah, bums.
getMainWebname not
getMainWebName
--
CrawfordCurrie - 22 Feb 2004
Okay, now I'm getting the following error:
[dreamhost]$ ./actionnotify.cgi 'open'
Deep recursion on subroutine "ActionTrackerPlugin::ActionNotify::_getMailAddress
" at ../lib/TWiki/Plugins/ActionTrackerPlugin/ActionNotify.pm line 261.
Killed
--
SamAbrams - 23 Feb 2004
Oh, doublebums. Not as simple as I thought. The recursion has to be blocked. I'll get back to you.
--
CrawfordCurrie - 25 Feb 2004
I think we have a pretty good solution to the problem. See
Plugins.ActionTrackerInput. This is my first attempt at sharing a complete solution to a problem. I am not sure I placed our results in the right place!
--
AlainMivilleDeChene - 12 Mar 2004