koha-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Koha-cvs] koha/opac opac-passwd.pl [rel_2_2]


From: Waylon Robertson
Subject: [Koha-cvs] koha/opac opac-passwd.pl [rel_2_2]
Date: Sun, 28 Jan 2007 05:30:49 +0000

CVSROOT:        /sources/koha
Module name:    koha
Branch:         rel_2_2
Changes by:     Waylon Robertson <genji>        07/01/28 05:30:49

Modified files:
        opac           : opac-passwd.pl 

Log message:
        fix for Bug 1150, password now has to be at least systempreference - 
MinPasswordLength or 5, if the preference doesn't exist.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/koha/opac/opac-passwd.pl?cvsroot=koha&only_with_tag=rel_2_2&r1=1.1.2.4&r2=1.1.2.5

Patches:
Index: opac-passwd.pl
===================================================================
RCS file: /sources/koha/koha/opac/opac-passwd.pl,v
retrieving revision 1.1.2.4
retrieving revision 1.1.2.5
diff -u -b -r1.1.2.4 -r1.1.2.5
--- opac-passwd.pl      8 Mar 2006 13:46:55 -0000       1.1.2.4
+++ opac-passwd.pl      28 Jan 2007 05:30:49 -0000      1.1.2.5
@@ -40,7 +40,9 @@
                             flagsrequired => {borrow => 1},
                             debug => 1,
                             });
-
+my $MinPasswordLength = (C4::Context->preference("MinPasswordLength") ? 
+                                                           
C4::Context->preference("MinPasswordLength") :5
+                                                           );
 # get borrower information ....
 my ($borr, $flags) = getpatroninformation(undef, $borrowernumber);
 my $sth = $dbh->prepare("UPDATE borrowers SET password = ? WHERE 
borrowernumber=?");
@@ -48,7 +50,7 @@
 if ( $query->param('Oldkey') && $query->param('Newkey') && 
$query->param('Confirm') ){
        if ( goodkey($dbh,$borrowernumber, $query->param('Oldkey')) ){
                if ( $query->param('Newkey') eq $query->param('Confirm') &&
-                       length($query->param('Confirm')) > 5 ){ # Record 
password
+                       length($query->param('Confirm')) >= $MinPasswordLength 
){ # Record password
                        my $clave = md5_base64($query->param('Newkey'));
                        $sth->execute($clave,$borrowernumber);
                        $template->param('password_updated' => '1');
@@ -57,10 +59,11 @@
                        $template->param('Ask_data' => '1');
                        $template->param('Error_messages' => '1');
                        $template->param('PassMismatch' => '1');
-               }elsif (length($query->param('Confirm')) <= 5 ){
+               }elsif (length($query->param('Confirm')) < $MinPasswordLength ){
                        $template->param('Ask_data' => '1');
                        $template->param('Error_messages' => '1');
                        $template->param('ShortPass' => '1');
+                       $template->param('MinPasswordLength' => 
$MinPasswordLength );
                }else{
                        $template->param('Error_messages' => '1');
                } 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]