LoginFirstname => ( C4::Context->userenv ? C4::Context->userenv->{"firstname"} : "Bel" ),
LoginSurname => C4::Context->userenv ? C4::Context->userenv->{"surname"} : "Inconnu",
emailaddress => C4::Context->userenv ? C4::Context->userenv->{"emailaddress"} : undef,
- loggedinpersona => C4::Context->userenv ? C4::Context->userenv->{"persona"} : undef,
TagsEnabled => C4::Context->preference("TagsEnabled"),
hide_marc => C4::Context->preference("hide_marc"),
item_level_itypes => C4::Context->preference('item-level_itypes'),
using_https => $using_https,
noItemTypeImages => C4::Context->preference("noItemTypeImages"),
marcflavour => C4::Context->preference("marcflavour"),
- persona => C4::Context->preference("persona"),
OPACBaseURL => C4::Context->preference('OPACBaseURL'),
);
if ( $in->{'type'} eq "intranet" ) {
my $authnotrequired = shift;
my $flagsrequired = shift;
my $type = shift;
- my $persona = shift;
$type = 'opac' unless $type;
my $dbh = C4::Context->dbh;
);
$loggedin = 1;
}
- elsif ($persona) {
-
- # we don't want to set a session because we are being called by a persona callback
- }
elsif ( $sessionID = $query->cookie("CGISESSID") )
{ # assignment, not comparison
my $session = get_session($sessionID);
$session->param('surname'), $session->param('branch'),
$session->param('branchname'), $session->param('flags'),
$session->param('emailaddress'), $session->param('branchprinter'),
- $session->param('persona'), $session->param('shibboleth')
+ $session->param('shibboleth')
);
C4::Context::set_shelves_userenv( 'bar', $session->param('barshelves') );
C4::Context::set_shelves_userenv( 'pub', $session->param('pubshelves') );
if ( ( $cas && $query->param('ticket') )
|| $userid
|| ( $shib && $shib_login )
- || $pki_field ne 'None'
- || $persona )
+ || $pki_field ne 'None' )
{
my $password = $query->param('password');
my $shibSuccess = 0;
$info{'invalidCasLogin'} = 1 unless ($return);
}
- elsif ($persona) {
- my $value = $persona;
-
- # If we're looking up the email, there's a chance that the person
- # doesn't have a userid. So if there is none, we pass along the
- # borrower number, and the bits of code that need to know the user
- # ID will have to be smart enough to handle that.
- require C4::Members;
- my @users_info = C4::Members::GetBorrowersWithEmail($value);
- if (@users_info) {
-
- # First the userid, then the borrowernum
- $value = $users_info[0][1] || $users_info[0][0];
- }
- else {
- undef $value;
- }
- $return = $value ? 1 : 0;
- $userid = $value;
- }
-
elsif (
( $pki_field eq 'Common Name' && $ENV{'SSL_CLIENT_S_DN_CN'} )
|| ( $pki_field eq 'emailAddress'
$session->param( 'ip', $session->remote_addr() );
$session->param( 'lasttime', time() );
}
- if ($persona) {
- $session->param( 'persona', 1 );
- }
C4::Context->set_userenv(
$session->param('number'), $session->param('id'),
$session->param('cardnumber'), $session->param('firstname'),
$session->param('surname'), $session->param('branch'),
$session->param('branchname'), $session->param('flags'),
$session->param('emailaddress'), $session->param('branchprinter'),
- $session->param('persona'), $session->param('shibboleth')
+ $session->param('shibboleth')
);
}
wrongip => $info{'wrongip'},
PatronSelfRegistration => C4::Context->preference("PatronSelfRegistration"),
PatronSelfRegistrationDefaultCategory => C4::Context->preference("PatronSelfRegistrationDefaultCategory"),
- persona => C4::Context->preference("Persona"),
opac_css_override => $ENV{'OPAC_CSS_OVERRIDE'},
);
C4::Context->set_userenv($usernum, $userid, $usercnum,
$userfirstname, $usersurname,
$userbranch, $branchname, $userflags,
- $emailaddress, $branchprinter, $persona);
+ $emailaddress, $branchprinter);
Establish a hash of user environment variables.
#'
sub set_userenv {
shift @_;
- my ($usernum, $userid, $usercnum, $userfirstname, $usersurname, $userbranch, $branchname, $userflags, $emailaddress, $branchprinter, $persona, $shibboleth)=
+ my ($usernum, $userid, $usercnum, $userfirstname, $usersurname, $userbranch, $branchname, $userflags, $emailaddress, $branchprinter, $shibboleth)=
map { Encode::is_utf8( $_ ) ? $_ : Encode::decode('UTF-8', $_) } # CGI::Session doesn't handle utf-8, so we decode it here
@_;
my $var=$context->{"activeuser"} || '';
"flags" => $userflags,
"emailaddress" => $emailaddress,
"branchprinter" => $branchprinter,
- "persona" => $persona,
"shibboleth" => $shibboleth,
};
$context->{userenv}->{$var} = $cell;
--- /dev/null
+DELETE FROM systempreferences WHERE variable="Persona";
('PayPalSandboxMode', '1', NULL , 'If enabled, the system will use PayPal''s sandbox server for testing, rather than the production server.', 'YesNo'),
('PayPalSignature', '', NULL , 'Your PayPal API signature', 'Free'),
('PayPalUser', '', NULL , 'Your PayPal API username ( email address )', 'Free'),
-('Persona','0','','Use Mozilla Persona for login','YesNo'),
('PrefillItem','0','','When a new item is added, should it be prefilled with last created item values?','YesNo'),
('previousIssuesDefaultSortOrder','asc','asc|desc','Specify the sort order of Previous Issues on the circulation page','Choice'),
('printcirculationslips','1','','If ON, enable printing circulation receipts','YesNo'),
- "Google OpenID Connect Restrict to domain (or subdomain of this domain): "
- pref: GoogleOpenIDConnectDomain
- Leave blank for all google domains
- Mozilla Persona:
- -
- - "Allow Mozilla persona for login: "
- - pref: Persona
- default: 0
- choices:
- yes: "Yes"
- no: "No"
Share anonymous usage statistics:
-
- "Share anonymous Koha usage data with the Koha community: "
+++ /dev/null
-/* Link body */
-a.persona-button {
- color : #FFF;
-}
-
-.persona-button{
- color: #fff;
- display: inline-block;
- font-size: 14px;
- font-family: Helvetica, Arial, sans-serif;
- font-weight: bold;
- line-height: 1.1;
- overflow: hidden;
- position: relative;
- text-decoration: none;
- text-shadow: 0 1px rgba(0,0,0,0.5), 0 0 2px rgba(0,0,0,0.2);
-
- background: #297dc3;
- background: -moz-linear-gradient(top, #43a6e2, #287cc2);
- background: -ms-linear-gradient(top, #43a6e2, #287cc2);
- background: -o-linear-gradient(top, #43a6e2, #287cc2);
- background: -webkit-linear-gradient(top, #43a6e2, #287cc2);
- background: linear-gradient(to bottom, #43a6e2 0%,#287cc2 100%); /* W3C */
-
- -moz-border-radius: 3px;
- -ms-border-radius: 3px;
- -o-border-radius: 3px;
- -webkit-border-radius: 3px;
- border-radius: 3px;
-
- -moz-box-shadow: 0 1px 0 rgba(0,0,0,0.2);
- -ms-box-shadow: 0 1px 0 rgba(0,0,0,0.2);
- -o-box-shadow: 0 1px 0 rgba(0,0,0,0.2);
- -webkit-box-shadow: 0 1px 0 rgba(0,0,0,0.2);
- box-shadow: 0 1px 0 rgba(0,0,0,0.2);
-}
-
-.persona-button:hover{
- background: #21669f;
- background: -moz-linear-gradient(top, #3788b9, #21669f);
- background: -ms-linear-gradient(top, #3788b9, #21669f);
- background: -o-linear-gradient(top, #3788b9, #21669f);
- background: -webkit-linear-gradient(top, #3788b9, #21669f);
- background: linear-gradient(to bottom, #3788b9 0%,#21669f 100%); /* W3C */
-}
-
-.persona-button:active, .persona-button:focus{
- top: 1px;
- -moz-box-shadow: none;
- -ms-box-shadow: none;
- -o-box-shadow: none;
- -webkit-box-shadow: none;
- box-shadow: none;
-}
-
-.persona-button span{
- display: inline-block;
- padding: 5px 10px 5px 40px;
-}
-
-/* Icon */
-.persona-button span:after{
- background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA0AAAAPCAYAAAA/I0V3AAAA4klEQVR42o2RWaqEMBRE3YaCiDjPwQGcd9CrysLv4wTyoLFD90dxqbp1EgdPRB7Kskznea6Zn/aPoKoqUUrJOI5m4l2QBfSyLHKep1zXZSae3An1fS/7vst931bGkzuhaZrsLVbGkzuheZ7lOI6HyJ2QUkqv6yrbtv0LT+6E7G0UrfBfP3lZlpoXH4ZBmHgn5Pv+KwxDfqp0XQdgJp6c/RsUBIGOokiSJDE/s21bACbe5Ozp0TdAHMdSFIXUdS1N01C2wpObPT36HifwCJzI0iX29Oh7XP0E3CB9L01TzM+i/wePv4ZE5RtAngAAAABJRU5ErkJggg==) 10px center no-repeat;
- content: '';
- display: block;
- width: 31px;
-
- position: absolute;
- bottom: 0;
- left: -3px;
- top: 0;
- z-index: 10;
-}
-
-/* Icon background */
-.persona-button span:before{
- content: '';
- display: block;
- height: 100%;
- width: 20px;
-
- position: absolute;
- bottom: 0;
- left: 0;
- top: 0;
- z-index: 1;
-
- background: #42a9dd;
- background: -moz-linear-gradient(top, #50b8e8, #3095ce);
- background: -ms-linear-gradient(top, #50b8e8, #3095ce);
- background: -o-linear-gradient(top, #50b8e8, #3095ce);
- background: -webkit-linear-gradient(top, #50b8e8, #3095ce);
- background: linear-gradient(to bottom, #50b8e8 0%,#3095ce 100%); /* W3C */
-
- -moz-border-radius: 3px 0 0 3px;
- -ms-border-radius: 3px 0 0 3px;
- -o-border-radius: 3px 0 0 3px;
- -webkit-border-radius: 3px 0 0 3px;
- border-radius: 3px 0 0 3px;
-}
-
-/* Triangle */
-.persona-button:before{
- background: #42a9dd;
- content: '';
- display: block;
- height: 26px;
- width: 26px;
-
- position: absolute;
- left: 2px;
- top: 50%;
- margin-top: -13px;
- z-index: 0;
-
- background: -moz-linear-gradient(-45deg, #50b8e8, #3095ce);
- background: -ms-linear-gradient(-45deg, #50b8e8, #3095ce);
- background: -o-linear-gradient(-45deg, #50b8e8, #3095ce);
- background: -webkit-linear-gradient(-45deg, #50b8e8, #3095ce);
- background: linear-gradient(to bottom, #50b8e8 0%,#3095ce 100%); /* W3C */
-
- -moz-box-shadow: 1px -1px 1px rgba(0,0,0,0.1);
- -ms-box-shadow: 1px -1px 1px rgba(0,0,0,0.1);
- -o-box-shadow: 1px -1px 1px rgba(0,0,0,0.1);
- -webkit-box-shadow: 1px -1px 1px rgba(0,0,0,0.1);
- box-shadow: 1px -1px 1px rgba(0,0,0,0.1);
-
- -moz-transform: rotate(45deg);
- -ms-transform: rotate(45deg);
- -o-transform: rotate(45deg);
- -webkit-transform: rotate(45deg);
- transform: rotate(45deg);
-}
-
-/* Inset shadow (required here because the icon background clips it when on the `a` element) */
-.persona-button:after{
- content: '';
- display: block;
- height: 100%;
- width: 100%;
-
- position: absolute;
- left: 0;
- top: 0;
- bottom: 0;
- right: 0;
- z-index: 10;
-
- -moz-border-radius: 3px;
- -ms-border-radius: 3px;
- -o-border-radius: 3px;
- -webkit-border-radius: 3px;
- border-radius: 3px;
-
- -moz-box-shadow: inset 0 -1px 0 rgba(0,0,0,0.3);
- -ms-box-shadow: inset 0 -1px 0 rgba(0,0,0,0.3);
- -o-box-shadow: inset 0 -1px 0 rgba(0,0,0,0.3);
- -webkit-box-shadow: inset 0 -1px 0 rgba(0,0,0,0.3);
- box-shadow: inset 0 -1px 0 rgba(0,0,0,0.3);
-}
-
-/* ========================================================
- * Dark button
- * ===================================================== */
-.persona-button.dark{
- background: #3c3c3c;
- background: -moz-linear-gradient(top, #606060, #3c3c3c);
- background: -ms-linear-gradient(top, #606060, #3c3c3c);
- background: -o-linear-gradient(top, #606060, #3c3c3c);
- background: -webkit-linear-gradient(top, #606060, #3c3c3c);
- background: linear-gradient(top, #606060, #3c3c3c);
-}
-.persona-button.dark:hover{
- background: #2d2d2d;
- background: -moz-linear-gradient(top, #484848, #2d2d2d);
- background: -ms-linear-gradient(top, #484848, #2d2d2d);
- background: -o-linear-gradient(top, #484848, #2d2d2d);
- background: -webkit-linear-gradient(top, #484848, #2d2d2d);
- background: linear-gradient(top, #484848, #2d2d2d);
-}
-.persona-button.dark span:before{ /* Icon BG */
- background: #d34f2d;
- background: -moz-linear-gradient(top, #ebac45, #d34f2d);
- background: -ms-linear-gradient(top, #ebac45, #d34f2d);
- background: -o-linear-gradient(top, #ebac45, #d34f2d);
- background: -webkit-linear-gradient(top, #ebac45, #d34f2d);
- background: linear-gradient(top, #ebac45, #d34f2d);
-}
-.persona-button.dark:before{ /* Triangle */
- background: #d34f2d;
- background: -moz-linear-gradient(-45deg, #ebac45, #d34f2d);
- background: -ms-linear-gradient(-45deg, #ebac45, #d34f2d);
- background: -o-linear-gradient(-45deg, #ebac45, #d34f2d);
- background: -webkit-linear-gradient(-45deg, #ebac45, #d34f2d);
- background: linear-gradient(-45deg, #d34f2d, #ebac45); /* flipped for updated spec */
-}
-
-/* ========================================================
- * Orange button
- * ===================================================== */
-.persona-button.orange{
- background: #ee731a;
- background: -moz-linear-gradient(top, #ee731a, #d03116);
- background: -ms-linear-gradient(top, #ee731a, #d03116);
- background: -o-linear-gradient(top, #ee731a, #d03116);
- background: -webkit-linear-gradient(top, #ee731a, #d03116);
- background: linear-gradient(top, #ee731a, #d03116);
-}
-.persona-button.orange:hover{
- background: #cb6216;
- background: -moz-linear-gradient(top, #cb6216, #b12a13);
- background: -ms-linear-gradient(top, #cb6216, #b12a13);
- background: -o-linear-gradient(top, #cb6216, #b12a13);
- background: -webkit-linear-gradient(top, #cb6216, #b12a13);
- background: linear-gradient(top, #cb6216, #b12a13);
-}
-.persona-button.orange span:before{ /* Icon BG */
- background: #e84a21;
- background: -moz-linear-gradient(top, #f7ad27, #e84a21);
- background: -ms-linear-gradient(top, #f7ad27, #e84a21);
- background: -o-linear-gradient(top, #f7ad27, #e84a21);
- background: -webkit-linear-gradient(top, #f7ad27, #e84a21);
- background: linear-gradient(top, #f7ad27, #e84a21);
-}
-.persona-button.orange:before{ /* Triangle */
- background: #e84a21;
- background: -moz-linear-gradient(-45deg, #f7ad27, #e84a21);
- background: -ms-linear-gradient(-45deg, #f7ad27, #e84a21);
- background: -o-linear-gradient(-45deg, #f7ad27, #e84a21);
- background: -webkit-linear-gradient(-45deg, #f7ad27, #e84a21);
- background: linear-gradient(-45deg, #e84a21, #f7ad27); /* flipped for updated spec */
-}
<link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/[% opac_css_override %]" />
[% END %]
<link rel="stylesheet" type="text/css" media="print" href="[% interface %]/[% theme %]/css/print.css" />
-[% IF persona %]
- <link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/persona-buttons.css" />
-[% END %]
[% IF ( bidi ) %]
<link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/right-to-left.css" />
[% END %]
[% IF Koha.Preference( 'opacuserlogin' ) == 1 %]
[% IF ( loggedinusername ) %]
<li><p class="navbar-text">
- [% IF persona %]
- <a class="logout" id="logout" href="/cgi-bin/koha/opac-main.pl?logout.x=1">
- [% ELSE %]
- <a class="logout" id="logout" href="/cgi-bin/koha/opac-main.pl?logout.x=1">
- [% END %]
+ <a class="logout" id="logout" href="/cgi-bin/koha/opac-main.pl?logout.x=1">
Log out</a></p></li>
[% END %]
[% END %]
<script type="text/javascript" src="https://www.google.com/jsapi"></script>
<script type="text/javascript" src="[% interface %]/[% theme %]/js/googleindictransliteration.js"></script>
[% END %]
-[% IF persona %]
- <script src="https://login.persona.org/include.js"></script>
- <script type="text/javascript">
-
- navigator.id.watch({
- loggedInUser: [% IF emailaddress && loggedinpersona %]'[% emailaddress %]'[% ELSE %]null[% END %],
- onlogin: function (assertion) {
- $.post('/cgi-bin/koha/svc/login',
- { assertion: assertion },
- function (data) {
- window.location = '/cgi-bin/koha/opac-user.pl';
- }
- )
- .fail(function() { var errstr = _("Could not login, perhaps your Persona email does not match your Koha one");
- alert(errstr);
- });
- },
- onlogout: function () {
- window.location = '/cgi-bin/koha/opac-main.pl?logout.x=1';
- }
- });
-
- $(".logout").on("click",function(){
- navigator.id.logout();
- });
-
- var signinLink = document.getElementById('browserid');
-
- if (signinLink) {
- signinLink.onclick = function(evt) {
- // Requests a signed identity assertion from the user.
- navigator.id.request({
- siteName: "[% LibraryName | html %]",
- returnTo: '/cgi-bin/koha/opac-user.pl',
- oncancel: function() { alert('user refuses to share identity.'); }
- });
- };
- }
-
- </script>
-[% END # / IF persona %]
<script type="text/javascript" src="[% interface %]/[% theme %]/lib/jquery/plugins/jquery.cookie.min.js"></script>
<script type="text/javascript">
</ul>
[% END # / IF opacuserlogin %]
- [% IF persona %]
- <p><a href="#" class="persona-button" id="browserid" ><span>Sign in with your Email</span></a></p>
- [% END %]
-
</div> <!-- /.opac-auth -->
</div> <!-- /.span12 -->
</div> <!-- /.row-fluid -->
</form>
</div> <!-- /#login -->
[% END # /casAuthentication %]
- [% IF persona %]
- <a href="#" class="persona-button" id="browserid" ><span>Sign in with your email</span></a>
- [% END # /persona %]
[% END # / loggedinusername %]
[% END # /opacuserlogin %]
[% IF ( OpacNavRight ) %]
</form>
</div> <!-- /#login -->
[% END # /casAuthentication %]
- [% IF persona %]
- <a href="#" class="persona-button" id="browserid" ><span>Sign in with your email</span></a>
- [% END # /persona %]
[% END # / loggedinusername %]
[% END # /opacuserlogin %]
[% IF ( OpacNavRight ) %]
+++ /dev/null
-#!/usr/bin/perl
-
-# Copyright chris@bigballofwax.co.nz 2013
-#
-# This file is part of Koha.
-#
-# Koha is free software; you can redistribute it and/or modify it under the
-# terms of the GNU General Public License as published by the Free Software
-# Foundation; either version 3 of the License, or (at your option) any later
-# version.
-#
-# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
-# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
-# A PARTICULAR PURPOSE. See the GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License along
-# with Koha; if not, write to the Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-
-use CGI qw ( -utf8 );
-use strict;
-use warnings;
-use C4::Auth;
-use C4::Context;
-
-use LWP::UserAgent;
-use HTTP::Request::Common qw{ POST };
-use JSON qw( decode_json );
-
-my $url = 'https://verifier.login.persona.org/verify';
-
-my $query = CGI->new();
-
-my $host = C4::Context->preference('OPACBaseURL');
-
-my $assertion = $query->param('assertion');
-
-my $ua = LWP::UserAgent->new();
-my $response =
- $ua->post( $url, [ 'assertion' => $assertion, 'audience' => $host ] );
-
-if ( $response->is_success ) {
- my $content = $response->decoded_content();
- my $decoded_json = decode_json($content);
- my ( $userid, $cookie, $sessionID ) =
- checkauth( $query, 1, {}, 'opac', $decoded_json->{'email'} );
- if ($userid) { # a valid user has logged in
- print $query->header( -cookie => $cookie );
- print $decoded_json;
- }
- else {
-# logged in with an email that isn't associated with a borrower
- die "Email not associated with a borrower";
- }
-}
-else {
- warn $response->status_line, "\n";
-}