Bugzilla – Attachment 10841 Details for
Bug 8446
Shibboleth authentication
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Shibboleth patch for Auth.pm on Koha 3.8
Auth-shibboleth.patch (text/plain), 3.43 KB, created by
Tom Francart
on 2012-07-14 10:28:59 UTC
(
hide
)
Description:
Shibboleth patch for Auth.pm on Koha 3.8
Filename:
MIME Type:
Creator:
Tom Francart
Created:
2012-07-14 10:28:59 UTC
Size:
3.43 KB
patch
obsolete
>18a19,20 >> # >> # Shibboleth support added by Tom Francart (2012) - only tested at KU Leuven >31a34,37 >> use C4::Members qw(AddMember); # [Tom] Shibboleth: add user >> use C4::Members::Attributes; >> use C4::Members::AttributeTypes; >> >636,645c642,652 >< if ( $userid = $ENV{'REMOTE_USER'} ) { >< # Using Basic Authentication, no cookies required >< $cookie = $query->cookie( >< -name => 'CGISESSID', >< -value => '', >< -expires => '' >< ); >< $loggedin = 1; >< } >< elsif ( $sessionID = $query->cookie("CGISESSID")) { # assignment, not comparison >--- >> # [Tom] Removed: incompatible with Shib >> # if ( $userid = $ENV{'REMOTE_USER'} ) { >> # # Using Basic Authentication, no cookies required >> # $cookie = $query->cookie( >> # -name => 'CGISESSID', >> # -value => '', >> # -expires => '' >> # ); >> # $loggedin = 1; >> # } >> if ( $sessionID = $query->cookie("CGISESSID")) { # assignment, not comparison >729a737,741 >> >> unless ($userid) { >> $userid = $ENV{'HTTP_SHIB_PERSON_UID'}; >> } >> >1440a1453,1454 >> >> >1490a1505,1571 >> >> >> # [Tom] Try shibboleth >> >> # check if shib login ok: >> if ($ENV{'HTTP_SHIB_PERSON_UID'} =~ /^\w\d+$/ ) { >> >> # print "\n\nkonijn2\n"; >> >> >> my %borrower; >> $borrower{cardnumber} = $ENV{'HTTP_SHIB_PERSON_UID'}; >> $borrower{userid} = $ENV{'HTTP_SHIB_PERSON_UID'}; >> $borrower{firstname} = $ENV{'HTTP_SHIB_PERSON_GIVENNAME'}; # MANDATORY FIELD >> $borrower{surname} = $ENV{'HTTP_SHIB_PERSON_SURNAME'}; # MANDATORY FIELD >> $borrower{initials} = substr($borrower{firstname},0,1).substr($borrower{surname},0,1)." "; # MANDATORY FIELD >> $borrower{streetaddress} = ''; # MANDATORY FIELD >> $borrower{city} = " "; # MANDATORY FIELD >> $borrower{phone} = " "; # MANDATORY FIELD >> $borrower{branchcode} = 'AUD'; # MANDATORY FIELD >> $borrower{email} = $ENV{'HTTP_SHIB_PERSON_MAIL'}; >> $borrower{dateexpiry} = '2050-01-01'; >> >> >> my $catnr=$ENV{'HTTP_SHIB_KUL_OUNUMBER'}; >> if ($catnr =~ /50000672/) { # EXP ORL AUD >> $borrower{categorycode} = 'EXPORL'; >> $borrower{flags} = 2; >> } else { >> $borrower{categorycode} = 'STUDENT'; >> } >> >> $userid=$borrower{userid}; >> >> # check if borrower exists >> my $sth=$dbh->prepare("select password from borrowers where cardnumber=?"); >> $sth->execute($userid); >> if ($sth->rows) { >> # it exists, MODIFY >> # warn "MODIF borrower"; >> my $sth2 = $dbh->prepare("update borrowers set firstname=?,surname=?,initials=?,categorycode=?,branchcode=?,email=? where cardnumber=?"); >> $sth2->execute($borrower{firstname},$borrower{surname},$borrower{initials}, >> $borrower{categorycode},$borrower{branchcode},$borrower{email}, >> ,$userid); >> } else { >> # it does not exists, ADD borrower >> print "ADD borrower"; >> my $borrowerid = AddMember(%borrower); >> >> # C4::Members::Attributes::SetBorrowerAttributes($borrowernumber, $extended_patron_attributes); >> } >> # >> # CREATE or MODIFY PASSWORD/LOGIN >> # >> # search borrowerid >> # $sth = $dbh->prepare("select borrowernumber from borrowers where cardnumber=?"); >> # $sth->execute($userid); >> # my ($borrowerid)=$sth->fetchrow; >> # warn "change password for $borrowerid setting $password"; >> # my $digest=md5_base64($password); >> # changepassword($userid,$borrowerid,$digest); >> return 1, $userid, $userid; >> >> } >> ####### End Shibboleth ######### >> >>
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 8446
:
10841
|
22098
|
22107
|
22860
|
23224
|
23225
|
23226
|
25765
|
25766
|
26176
|
26177
|
26178
|
26187
|
26749
|
26750
|
26751
|
26752
|
26760
|
26761
|
26762
|
28892
|
28893
|
28894
|
28895
|
28896
|
28897
|
28898
|
28899
|
28900
|
28901
|
28902
|
28903
|
30017
|
30018
|
30019
|
30020
|
30021
|
30022
|
30023
|
30030
|
30031
|
30033
|
30283
|
30284
|
30285
|
30286
|
30335
|
30353
|
30354
|
30355
|
30356
|
30384
|
30594
|
30604
|
30605
|
30616
|
30617
|
30618
|
30619
|
30620
|
30621
|
30684
|
31407
|
31408
|
31836
|
31905
|
31906
|
31907
|
32125
|
32158
|
32162
|
32163
|
32164
|
32165
|
32166
|
32167
|
32168
|
32169
|
32170
|
32365
|
32366
|
32367
|
32368
|
32369
|
32370
|
32371
|
32372
|
32373
|
32374
|
32426
|
32427