[Koha-bugs] [Bug 10988] Allow login via Google OAuth2

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Thu Jun 11 14:14:02 CEST 2015


http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10988

--- Comment #31 from M. Tompsett <mtompset at hotmail.com> ---
Comment on attachment 40087
  --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=40087
Bug 10988 - Allow login via Google OAuth

Review of attachment 40087:
 --> (http://bugs.koha-community.org/bugzilla3/page.cgi?id=splinter.html&bug=10988&attachment=40087)
-----------------------------------------------------------------

::: C4/Auth.pm
@@ +37,4 @@
>  use Encode qw( encode is_utf8);
>  
>  # use utf8;
> +use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS $debug $googleoauth2 $ldap $cas $caslogout $shib $shib_login);

No need to add this.

@@ +55,4 @@
>        &get_all_subpermissions &get_user_subpermissions
>      );
>      %EXPORT_TAGS = ( EditPermissions => [qw(get_all_subpermissions get_user_subpermissions)] );
> +    $googleoauth2 = C4::Context->preference('GoogleOAuth2');

Or this.

@@ +471,4 @@
>              BranchesLoop                          => GetBranchesLoop($opac_name),
>              BranchCategoriesLoop                  => GetBranchCategories( 'searchdomain', 1, $opac_name ),
>              CalendarFirstDayOfWeek                => ( C4::Context->preference("CalendarFirstDayOfWeek") eq "Sunday" ) ? 0 : 1,
> +            GoogleOAuth2                          => (C4::Context->preference("GoogleOAuth2")),

Or even this.

@@ +1247,4 @@
>          );
>      }
>  
> +    if ($googleoauth2) {

Though you will have to grab the preference directly here.

::: koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc
@@ +58,4 @@
>                                                  <li role="presentation"><a href="#" tabindex="-1" class="menu-inactive" role="menuitem">No private lists</a></li>
>                                                  <li role="presentation"><a href="/cgi-bin/koha/opac-shelves.pl?display=privateshelves" tabindex="-1" role="menuitem" class="listmenulink">New list</a></li>
>                                              [% END %]
> +                                        [% ELSIF ( KOHA.Preference('GoogleOAuth2') == 1 ) %]

Haven't tested yet, but is Template Toolkit case sensitive? Why KOHA? The top
has [% Use Koha %] right?

@@ +78,4 @@
>                                          [% IF Koha.Preference('casAuthentication') %]
>                                              [%# CAS authentication is too complicated for modal window %]
>                                              <li><a href="/cgi-bin/koha/opac-user.pl">Log in to your account</a></li>
> +                                        [% ELSIF ( GoogleOAuth2 ) %]

Wasn't just the one location. I was talking about all of them. That way you
could minimize touching Auth.pm in the first place.

::: opac/svc/googleoauth2
@@ +114,5 @@
> +            my ( $userid, $cookie, $sessionID ) =
> +              checkauth( $query, 1, { borrow => 1 }, 'opac', $email );
> +            if ($userid) {    # A valid user has logged in
> +		if (   ($restricttodomain ne '' )
> +                    && (index($email, $restricttodomain) == -1) ) 

Pink spots at the end (at least that's the colour on my screen), usually
indicate spaces at the end of a line. That fails koha qa test tools.

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list