From: Peter T. <pet...@us...> - 2002-12-29 10:13:22
|
Update of /cvsroot/twiki/twiki/lib/TWiki In directory sc8-pr-cvs1:/tmp/cvs-serv21669/TWiki Modified Files: Plugins.pm Log Message: Codev.MorePluginHooks with initializeUserHandler and registrationHandler Index: Plugins.pm =================================================================== RCS file: /cvsroot/twiki/twiki/lib/TWiki/Plugins.pm,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -r1.18 -r1.19 *** Plugins.pm 29 Dec 2002 09:01:59 -0000 1.18 --- Plugins.pm 29 Dec 2002 10:13:18 -0000 1.19 *************** *** 34,37 **** --- 34,39 ---- @registrableHandlers = ( # VERSION: 'initPlugin', # ( $topic, $web, $user, $installWeb ) 1.000 + 'initializeUserHandler', # ( $loginName, $url, $pathInfo ) 1.010 + 'registrationHandler', # ( $web, $wikiName, $loginName ) 1.010 'commonTagsHandler', # ( $text, $topic, $web ) 1.000 'startRenderingHandler', # ( $text, $web ) 1.000 *************** *** 48,52 **** ); ! %onlyOnceHandlers = ( 'writeHeaderHandler' => 1, 'redirectCgiQueryHandler' => 1, 'getSessionValueHandler' => 1, --- 50,56 ---- ); ! %onlyOnceHandlers = ( 'initializeUserHandler' => 1, ! 'registrationHandler' => 1, ! 'writeHeaderHandler' => 1, 'redirectCgiQueryHandler' => 1, 'getSessionValueHandler' => 1, *************** *** 240,263 **** # ========================= ! # This could be better integrated with the other auto discovery for plugins ! sub initializeUser { ! # my( $theRemoteUser, $theUrl, $thePathInfo ) = @_; ! my $user; ! my $p = "TWiki::Plugins::SessionPlugin"; ! my $sub = $p.'::initializeUserHandler'; - my $libDir = &TWiki::getTWikiLibDir(); - if( -e "$libDir/TWiki/Plugins/SessionPlugin.pm" ) { - eval "use $p;"; - if( defined( &$sub ) ) { - $user = &$sub( @_ ); - } - } if( ! defined( $user ) ) { $user = &TWiki::initializeRemoteUser( $_[0] ); } ! return $user; } --- 244,269 ---- # ========================= ! sub initializeUserHandler { ! # Called by TWiki::initialize ! # my( $theLoginName, $theUrl, $thePathInfo ) = @_; ! ! unshift @_, ( 'initializeUserHandler' ); ! my $user = &applyHandlers; if( ! defined( $user ) ) { $user = &TWiki::initializeRemoteUser( $_[0] ); } ! return $user; + } + + # ========================= + sub registrationHandler + { + # Called by the register script + # my( $web, $wikiName, $loginName ) = @_; + unshift @_, ( 'registrationHandler' ); + &applyHandlers; } |