[interchange-cvs] interchange - heins modified 2 files

interchange-core@interchange.redhat.com interchange-core@interchange.redhat.com
Thu Jul 4 13:20:01 2002


User:      heins
Date:      2002-07-04 17:19:49 GMT
Modified:  lib/Vend Interpolate.pm UserDB.pm
Log:
* Use Vend::Interpolate::tag_counter instead of direct counter object,
  allows "UserDB  default sql_counter table:sequence" to permit SQL
  sequence assignment of indirect usernames (or assigned usernames)

* Add data lookup primitive for tag_attr_list.

Revision  Changes    Path
2.79      +3 -2      interchange/lib/Vend/Interpolate.pm


rev 2.79, prev_rev 2.78
Index: Interpolate.pm
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /anon_cvs/repository/interchange/lib/Vend/Interpolate.pm,v
retrieving revision 2.78
retrieving revision 2.79
diff -u -r2.78 -r2.79
--- Interpolate.pm	4 Jul 2002 06:11:47 -0000	2.78
+++ Interpolate.pm	4 Jul 2002 17:19:48 -0000	2.79
@@ -1,6 +1,6 @@
 # Vend::Interpolate - Interpret Interchange tags
 #=20
-# $Id: Interpolate.pm,v 2.78 2002/07/04 06:11:47 mheins Exp $
+# $Id: Interpolate.pm,v 2.79 2002/07/04 17:19:48 mheins Exp $
 #
 # Copyright (C) 1996-2002 Red Hat, Inc. <interchange@redhat.com>
 #
@@ -27,7 +27,7 @@
 require Exporter;
 @ISA =3D qw(Exporter);
=20
-$VERSION =3D substr(q$Revision: 2.78 $, 10);
+$VERSION =3D substr(q$Revision: 2.79 $, 10);
=20
 @EXPORT =3D qw (
=20
@@ -4037,6 +4037,7 @@
 	$body =3D~ s!\{($Codere)\s+($Some)\}! $hash->{$1} ? $2 : ''!eg;
 	$body =3D~ s!\{($Codere)\?\}($Some){/\1\?\}! $hash->{$1} ? $2 : ''!eg;
 	$body =3D~ s!\{($Codere)\:\}($Some){/\1\:\}! $hash->{$1} ? '' : $2!eg;
+	$body =3D~ s!\{(\w+)\:+(\w+)\:+(.*?)\}! tag_data($1, $2, $3) !eg;
 	return $body;
 }
=20



2.7       +10 -6     interchange/lib/Vend/UserDB.pm


rev 2.7, prev_rev 2.6
Index: UserDB.pm
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /anon_cvs/repository/interchange/lib/Vend/UserDB.pm,v
retrieving revision 2.6
retrieving revision 2.7
diff -u -r2.6 -r2.7
--- UserDB.pm	23 Jun 2002 15:04:04 -0000	2.6
+++ UserDB.pm	4 Jul 2002 17:19:48 -0000	2.7
@@ -1,6 +1,6 @@
 # Vend::UserDB - Interchange user database functions
 #
-# $Id: UserDB.pm,v 2.6 2002/06/23 15:04:04 mheins Exp $
+# $Id: UserDB.pm,v 2.7 2002/07/04 17:19:48 mheins Exp $
 #
 # Copyright (C) 1996-2002 Red Hat, Inc. <interchange@redhat.com>
 #
@@ -16,7 +16,7 @@
=20
 package Vend::UserDB;
=20
-$VERSION =3D substr(q$Revision: 2.6 $, 10);
+$VERSION =3D substr(q$Revision: 2.7 $, 10);
=20
 use vars qw!
 	$VERSION
@@ -1094,6 +1094,7 @@
 			my $ufield =3D $self->{LOCATION}{USERNAME};
 			$uname =3D $udb->quote($uname);
 			my $q =3D "select $ufield from $self->{DB_ID} where $foreign =3D $uname=
";
+#::logDebug("indirect login query: $q");
 			my $ary =3D $udb->query($q)
 				or do {
 					my $msg =3D ::errmsg( "Database access error for query: %s", $q);
@@ -1102,7 +1103,8 @@
 			@$ary =3D=3D 1
 				or do {
 					logError(
-						"Denied attempted login with nonexistent (indirect) user name %s",
+						"Denied attempted login with nonexistent (indirect from %s) user nam=
e %s",
+						$foreign,
 						$uname,
 						$self->{USERNAME},
 					);
@@ -1305,12 +1307,14 @@
=20
 sub assign_username {
 	my $self =3D shift;
-	my $file =3D shift || $self->{OPTIONS}{'counter'};
+	my $file =3D shift || $self->{OPTIONS}{counter};
 	my $start =3D $self->{OPTIONS}{username} || 'U00000';
 	$file =3D './etc/username.counter' if ! $file;
-	my $ctr =3D Vend::CounterFile->new($file, $start);
=20
-	my $custno =3D $ctr->inc();
+	my $custno =3D Vend::Interpolate::tag_counter(
+						$file,
+						{ sql =3D> $self->{OPTIONS}{sql_counter} },
+					);
=20
 	if(my $l =3D $Vend::Cfg->{Accounting}) {
=20