[interchange-cvs] interchange - jon modified lib/Vend/UserDB.pm

interchange-cvs at icdevgroup.org interchange-cvs at icdevgroup.org
Mon Nov 7 16:58:43 EST 2005


User:      jon
Date:      2005-11-07 21:58:43 GMT
Modified:  lib/Vend UserDB.pm
Log:
Addition of "postlogin_action" profile behavior/argument for UserDB by
Ethan Rowe <ethan at endpoint.com>.

Can provide a whitespace-separated list of sub names to execute
following a successful login; this "postlogin_action" list
directive/argument can be specified at the profile level or as an
argument to the [userdb] tag at login time. The subs will be executed in
the order they are listed within the "postlogin_action" value. They are
not passed any arguments, and their return values are not used in any
meaningful way; any behaviors desired from the login must therefore be
entirely encapsulated within the sub(s) specified in the list.

Revision  Changes    Path
2.40      +12 -3     interchange/lib/Vend/UserDB.pm


rev 2.40, prev_rev 2.39
Index: UserDB.pm
===================================================================
RCS file: /var/cvs/interchange/lib/Vend/UserDB.pm,v
retrieving revision 2.39
retrieving revision 2.40
diff -u -u -r2.39 -r2.40
--- UserDB.pm	19 Oct 2005 14:26:32 -0000	2.39
+++ UserDB.pm	7 Nov 2005 21:58:43 -0000	2.40
@@ -1,6 +1,6 @@
 # Vend::UserDB - Interchange user database functions
 #
-# $Id: UserDB.pm,v 2.39 2005/10/19 14:26:32 mheins Exp $
+# $Id: UserDB.pm,v 2.40 2005/11/07 21:58:43 jon Exp $
 #
 # Copyright (C) 2002-2003 Interchange Development Group
 # Copyright (C) 1996-2002 Red Hat, Inc.
@@ -17,7 +17,7 @@
 
 package Vend::UserDB;
 
-$VERSION = substr(q$Revision: 2.39 $, 10);
+$VERSION = substr(q$Revision: 2.40 $, 10);
 
 use vars qw!
 	$VERSION
@@ -1266,7 +1266,16 @@
 	$Vend::login_table = $Vend::Session->{login_table} = $self->{DB_ID};
 	$Vend::username = $Vend::Session->{username} = $self->{USERNAME};
 	$Vend::Session->{logged_in} = 1;
-	
+
+	if (my $macros = $self->{OPTIONS}{postlogin_action}) {
+		eval {
+			Vend::Dispatch::run_macro $macros;
+		};
+		if ($@) {
+			logError("UserDB postlogin_action execution error: %s\n", $@);
+		}
+	}
+
 	1;
 }
 








More information about the interchange-cvs mailing list