[interchange-cvs] interchange - heins modified 2 files
interchange-core@icdevgroup.org
interchange-core@icdevgroup.org
Thu Apr 3 23:44:01 2003
User: heins
Date: 2003-04-04 04:43:20 GMT
Modified: lib/Vend Session.pm UserDB.pm
Log:
* Allow reliable setting of login_table (like Vend::(admin|superuser|username)).
* Make permission for acl checks defaults to read -- previously was a no-op
if paramaeter not passed.
Revision Changes Path
2.11 +6 -4 interchange/lib/Vend/Session.pm
rev 2.11, prev_rev 2.10
Index: Session.pm
===================================================================
RCS file: /var/cvs/interchange/lib/Vend/Session.pm,v
retrieving revision 2.10
retrieving revision 2.11
diff -u -r2.10 -r2.11
--- Session.pm 18 Nov 2002 16:55:15 -0000 2.10
+++ Session.pm 4 Apr 2003 04:43:20 -0000 2.11
@@ -1,6 +1,6 @@
# Vend::Session - Interchange session routines
#
-# $Id: Session.pm,v 2.10 2002/11/18 16:55:15 mheins Exp $
+# $Id: Session.pm,v 2.11 2003/04/04 04:43:20 mheins Exp $
#
# Copyright (C) 1996-2002 Red Hat, Inc. <interchange@redhat.com>
#
@@ -26,7 +26,7 @@
require Exporter;
use vars qw($VERSION);
-$VERSION = substr(q$Revision: 2.10 $, 10);
+$VERSION = substr(q$Revision: 2.11 $, 10);
@ISA = qw(Exporter);
@@ -301,6 +301,7 @@
$Vend::Session->{username} = $Vend::username;
$Vend::Session->{admin} = $Vend::admin;
$Vend::Session->{superuser} = $Vend::superuser;
+ $Vend::Session->{login_table} = $Vend::login_table;
$s = ! $File_sessions ? uneval_fast($Vend::Session) : $Vend::Session;
$Vend::SessionDBM{$Vend::SessionName} = $s or
die "Data was not stored in SessionDBM\n";
@@ -394,9 +395,10 @@
$Vend::Session->{host} = $CGI::host;
- $Vend::username = $Vend::Session->{username};
- $Vend::admin = $Vend::Session->{admin};
+ $Vend::username = $Vend::Session->{username};
+ $Vend::admin = $Vend::Session->{admin};
$Vend::superuser = $Vend::Session->{superuser};
+ $Vend::login_table = $Vend::Session->{login_table};
$Vend::Session->{arg} = $Vend::Argument;
2.12 +4 -5 interchange/lib/Vend/UserDB.pm
rev 2.12, prev_rev 2.11
Index: UserDB.pm
===================================================================
RCS file: /var/cvs/interchange/lib/Vend/UserDB.pm,v
retrieving revision 2.11
retrieving revision 2.12
diff -u -r2.11 -r2.12
--- UserDB.pm 5 Nov 2002 17:00:04 -0000 2.11
+++ UserDB.pm 4 Apr 2003 04:43:20 -0000 2.12
@@ -1,6 +1,6 @@
# Vend::UserDB - Interchange user database functions
#
-# $Id: UserDB.pm,v 2.11 2002/11/05 17:00:04 kwalsh Exp $
+# $Id: UserDB.pm,v 2.12 2003/04/04 04:43:20 mheins Exp $
#
# Copyright (C) 1996-2002 Red Hat, Inc. <interchange@redhat.com>
#
@@ -16,7 +16,7 @@
package Vend::UserDB;
-$VERSION = substr(q$Revision: 2.11 $, 10);
+$VERSION = substr(q$Revision: 2.12 $, 10);
use vars qw!
$VERSION
@@ -472,6 +472,7 @@
sub _check_acl {
my ($self, $loc, %options) = @_;
return undef unless $options{location};
+ $options{mode} = 'r' if ! defined $options{mode};
my $acl = $self->{DB}->field( $self->{USERNAME}, $loc);
my $f = $ready->reval($acl);
return 0 unless exists $f->{$options{location}};
@@ -1211,7 +1212,7 @@
);
}
- $Vend::Session->{login_table} = $self->{DB_ID};
+ $Vend::login_table = $Vend::Session->{login_table} = $self->{DB_ID};
$Vend::username = $Vend::Session->{username} = $self->{USERNAME};
$Vend::Session->{logged_in} = 1;
@@ -1605,8 +1606,6 @@
my $opt = shift;
my %options;
-
-#::logDebug("Called userdb function=$function opt=$opt " . Data::Dumper::Dumper($opt));
if(ref $opt) {
%options = %$opt;