r1393 - in packages/libuser-simple-perl/trunk: . debian lib/User lib/User/Simple

Gunnar Wolf gwolf at costa.debian.org
Sun Oct 2 17:03:50 UTC 2005


Author: gwolf
Date: 2005-10-02 17:03:50 +0000 (Sun, 02 Oct 2005)
New Revision: 1393

Modified:
   packages/libuser-simple-perl/trunk/Changes
   packages/libuser-simple-perl/trunk/META.yml
   packages/libuser-simple-perl/trunk/debian/changelog
   packages/libuser-simple-perl/trunk/lib/User/Simple.pm
   packages/libuser-simple-perl/trunk/lib/User/Simple/Admin.pm
Log:
New upstream 


Modified: packages/libuser-simple-perl/trunk/Changes
===================================================================
--- packages/libuser-simple-perl/trunk/Changes	2005-10-02 17:02:53 UTC (rev 1392)
+++ packages/libuser-simple-perl/trunk/Changes	2005-10-02 17:03:50 UTC (rev 1393)
@@ -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/trunk/META.yml
===================================================================
--- packages/libuser-simple-perl/trunk/META.yml	2005-10-02 17:02:53 UTC (rev 1392)
+++ packages/libuser-simple-perl/trunk/META.yml	2005-10-02 17:03:50 UTC (rev 1393)
@@ -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/trunk/debian/changelog
===================================================================
--- packages/libuser-simple-perl/trunk/debian/changelog	2005-10-02 17:02:53 UTC (rev 1392)
+++ packages/libuser-simple-perl/trunk/debian/changelog	2005-10-02 17:03:50 UTC (rev 1393)
@@ -1,3 +1,9 @@
+libuser-simple-perl (1.23-1) unstable; urgency=low
+
+  * New upstream release - Small bugfix
+
+ -- Gunnar Wolf <gwolf at mosca.iiec.unam.mx>  Sun,  2 Oct 2005 11:59:44 -0500
+
 libuser-simple-perl (1.22-1) unstable; urgency=low
 
   * New upstream release

Modified: packages/libuser-simple-perl/trunk/lib/User/Simple/Admin.pm
===================================================================
--- packages/libuser-simple-perl/trunk/lib/User/Simple/Admin.pm	2005-10-02 17:02:53 UTC (rev 1392)
+++ packages/libuser-simple-perl/trunk/lib/User/Simple/Admin.pm	2005-10-02 17:03:50 UTC (rev 1393)
@@ -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/trunk/lib/User/Simple.pm
===================================================================
--- packages/libuser-simple-perl/trunk/lib/User/Simple.pm	2005-10-02 17:02:53 UTC (rev 1392)
+++ packages/libuser-simple-perl/trunk/lib/User/Simple.pm	2005-10-02 17:03:50 UTC (rev 1393)
@@ -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