Bugzilla – Attachment 21292 Details for
Bug 10900
Incorrect calling conventions accessing C4::Context
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Fix other set_userenv calls with bad parameters
0003-Bug-10900-Incorrect-calling-conventions-accessing-C4.patch (text/plain), 3.58 KB, created by
Mark Tompsett
on 2013-09-21 04:33:31 UTC
(
hide
)
Description:
Fix other set_userenv calls with bad parameters
Filename:
MIME Type:
Creator:
Mark Tompsett
Created:
2013-09-21 04:33:31 UTC
Size:
3.58 KB
patch
obsolete
>From 7c11f1f3ef8f06d4c695c9e26986109d1d30b5bb Mon Sep 17 00:00:00 2001 >From: Mark Tompsett <mtompset@hotmail.com> >Date: Sat, 21 Sep 2013 00:15:59 -0400 >Subject: [PATCH 3/3] Bug 10900 - Incorrect calling conventions accessing > C4::Context > >First there was the :: vs -> calling problem. The first patch >solves that. Then, a set of wrong parameters was discovered. The >second patch solves that. This third patch intentionally went >looking for other bad parameters to fix for the set_userenv >routine in C4::Context. The biggest problems were missing >surnames or branch names. >--- > C4/Auth.pm | 14 +++++++------- > installer/InstallAuth.pm | 2 +- > 2 files changed, 8 insertions(+), 8 deletions(-) > >diff --git a/C4/Auth.pm b/C4/Auth.pm >index e9f459b..3263613 100644 >--- a/C4/Auth.pm >+++ b/C4/Auth.pm >@@ -1485,33 +1485,33 @@ sub checkpw { > # INTERNAL AUTH > my $sth = > $dbh->prepare( >-"select password,cardnumber,borrowernumber,userid,firstname,surname,branchcode,flags from borrowers where userid=?" >+"select password,cardnumber,borrowernumber,userid,firstname,surname,borrowers.branchcode,branches.branchname,flags from borrowers join branches on borrowers.branchcode=branches.branchcode where userid=?" > ); > $sth->execute($userid); > if ( $sth->rows ) { > my ( $md5password, $cardnumber, $borrowernumber, $userid, $firstname, >- $surname, $branchcode, $flags ) >+ $surname, $branchcode, $branchname, $flags ) > = $sth->fetchrow; > if ( md5_base64($password) eq $md5password and $md5password ne "!") { > > C4::Context->set_userenv( "$borrowernumber", $userid, $cardnumber, >- $firstname, $surname, $branchcode, $flags ); >+ $firstname, $surname, $branchcode, $branchname, $flags ); > return 1, $cardnumber, $userid; > } > } > $sth = > $dbh->prepare( >-"select password,cardnumber,borrowernumber,userid, firstname,surname,branchcode,flags from borrowers where cardnumber=?" >+"select password,cardnumber,borrowernumber,userid,firstname,surname,borrowers.branchcode,branches.branchname,flags from borrowers join branches on borrowers.branchcode=branches.branchcode where cardnumber=?" > ); > $sth->execute($userid); > if ( $sth->rows ) { > my ( $md5password, $cardnumber, $borrowernumber, $userid, $firstname, >- $surname, $branchcode, $flags ) >+ $surname, $branchcode, $branchname, $flags ) > = $sth->fetchrow; > if ( md5_base64($password) eq $md5password ) { > > C4::Context->set_userenv( $borrowernumber, $userid, $cardnumber, >- $firstname, $surname, $branchcode, $flags ); >+ $firstname, $surname, $branchcode, $branchname, $flags ); > return 1, $cardnumber, $userid; > } > } >@@ -1520,7 +1520,7 @@ sub checkpw { > { > > # Koha superuser account >-# C4::Context->set_userenv(0,0,C4::Context->config('user'),C4::Context->config('user'),C4::Context->config('user'),"",1); >+# C4::Context->set_userenv(0,0,C4::Context->config('user'),C4::Context->config('user'),C4::Context->config('user'),"","",1); > return 2; > } > if ( $userid && $userid eq 'demo' >diff --git a/installer/InstallAuth.pm b/installer/InstallAuth.pm >index 1aafe70..fb68e0d 100644 >--- a/installer/InstallAuth.pm >+++ b/installer/InstallAuth.pm >@@ -417,7 +417,7 @@ sub checkpw { > C4::Context->config('user'), > C4::Context->config('user'), > C4::Context->config('user'), >- "", 1 >+ "", "NO_LIBRARY_SET", 1 > ); > return 2; > } >-- >1.7.9.5 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 10900
:
21152
|
21263
|
21290
|
21291
|
21292
|
22037
|
22038
|
22585
|
22937
|
27729
|
28183
|
30243
|
30244
|
31297
|
31298
|
31719
|
31720
|
31721
|
34355
|
34356
|
34357
|
35542
|
35543
|
35544