r1391 - in packages/libuser-simple-perl/branches/upstream/current:
. lib/User lib/User/Simple
Gunnar Wolf
gwolf at costa.debian.org
Sun Oct 2 17:02:44 UTC 2005
Author: gwolf
Date: 2005-10-02 17:02:44 +0000 (Sun, 02 Oct 2005)
New Revision: 1391
Modified:
packages/libuser-simple-perl/branches/upstream/current/Changes
packages/libuser-simple-perl/branches/upstream/current/META.yml
packages/libuser-simple-perl/branches/upstream/current/lib/User/Simple.pm
packages/libuser-simple-perl/branches/upstream/current/lib/User/Simple/Admin.pm
Log:
Load /tmp/tmp.kHpf7G/libuser-simple-perl-1.23 into
packages/libuser-simple-perl/branches/upstream/current.
Modified: packages/libuser-simple-perl/branches/upstream/current/Changes
===================================================================
--- packages/libuser-simple-perl/branches/upstream/current/Changes 2005-10-02 17:01:37 UTC (rev 1390)
+++ packages/libuser-simple-perl/branches/upstream/current/Changes 2005-10-02 17:02:44 UTC (rev 1391)
@@ -1,5 +1,10 @@
Revision history for Perl extension User::Simple.
+1.23 Sun Oct 2 11:45:35 CDT 2005
+ - Bugfix: Some DBDs return uppercase fields, some
+ lowercase... Try to handle them all correctly (or at least,
+ not as incorrectly :) )
+
1.22 Mon Sep 26 19:47:12 2005
- Bugfix: Last remanent of old name/level structure
removed. Thanks, Alex Juarez!
Modified: packages/libuser-simple-perl/branches/upstream/current/META.yml
===================================================================
--- packages/libuser-simple-perl/branches/upstream/current/META.yml 2005-10-02 17:01:37 UTC (rev 1390)
+++ packages/libuser-simple-perl/branches/upstream/current/META.yml 2005-10-02 17:02:44 UTC (rev 1391)
@@ -1,7 +1,7 @@
# http://module-build.sourceforge.net/META-spec.html
#XXXXXXX This is a prototype!!! It will change in the future!!! XXXXX#
name: User-Simple
-version: 1.22
+version: 1.23
version_from: lib/User/Simple.pm
installdirs: site
requires:
Modified: packages/libuser-simple-perl/branches/upstream/current/lib/User/Simple/Admin.pm
===================================================================
--- packages/libuser-simple-perl/branches/upstream/current/lib/User/Simple/Admin.pm 2005-10-02 17:01:37 UTC (rev 1390)
+++ packages/libuser-simple-perl/branches/upstream/current/lib/User/Simple/Admin.pm 2005-10-02 17:02:44 UTC (rev 1391)
@@ -310,10 +310,7 @@
# Retrieving information
sub dump_users {
- # Some DBDs are case-insensitive towards Perl (we can query/modify the
- # columns case-insensitively), but internally are case sensitive. Gah, we
- # work around that to provide the much more common lowercase fields...
- my ($self, $order, $sth, $results, %users);
+ my ($self, $order, $sth, %users);
$self = shift;
unless ($sth = $self->{db}->prepare("SELECT * FROM $self->{tbl}")
@@ -323,15 +320,27 @@
}
$sth->execute;
- $results = $sth->fetchall_hashref('ID');
# Keep to myself the internal fields, translate the fieldnames to lowercase
- for my $user (keys %$results) {
- for my $in_field (keys %{$results->{$user}}) {
+ while (my $row = $sth->fetchrow_hashref) {
+ for my $in_field (keys %$row) {
+ my ($id);
+ # Some DBDs are case-insensitive towards Perl (we can query/modify
+ # the columns case-insensitively), but internally are case
+ # sensitive. Gah, we work around that to provide the much more
+ # common lowercase fields... This might still have some problems
+ # attached, please tell me if it breaks for you.
+ for my $case qw(id ID Id iD) {
+ if (exists $row->{$case}) {
+ $id = $row->{$case};
+ last;
+ }
+ }
+ carp "Did not find an ID field - Cannot continue" unless $id;
my $out_field = lc($in_field);
next if $out_field =~ /^(?:id|session|session_exp)$/;
- $users{$user}{$out_field} = $results->{$user}{$in_field};
+ $users{$id}{$out_field} = $row->{$in_field};
}
}
return %users;
Modified: packages/libuser-simple-perl/branches/upstream/current/lib/User/Simple.pm
===================================================================
--- packages/libuser-simple-perl/branches/upstream/current/lib/User/Simple.pm 2005-10-02 17:01:37 UTC (rev 1390)
+++ packages/libuser-simple-perl/branches/upstream/current/lib/User/Simple.pm 2005-10-02 17:02:44 UTC (rev 1391)
@@ -156,7 +156,7 @@
use UNIVERSAL qw(isa);
our $AUTOLOAD;
-our $VERSION = '1.22';
+our $VERSION = '1.23';
######################################################################
# Constructor/destructor
More information about the Pkg-perl-cvs-commits
mailing list