X-Git-Url: http://koha-dev.rot13.org:8081/gitweb/?a=blobdiff_plain;f=C4%2FAuth.pm;h=38bbd5ef1576083215bb80f291a91cd46d778007;hb=b32c38f9f10e0e2ad6eff5c044a520a14f9f1eaf;hp=e4bd11964816050239ad92ba880c1a90a001e09d;hpb=d508f0244bd288066d62dcaa40244702b2581514;p=koha_gimpoz diff --git a/C4/Auth.pm b/C4/Auth.pm old mode 100755 new mode 100644 index e4bd119648..38bbd5ef15 --- a/C4/Auth.pm +++ b/C4/Auth.pm @@ -27,15 +27,13 @@ use CGI::Session; require Exporter; use C4::Context; use C4::Templates; # to get the template -use C4::Members; -use C4::Koha; use C4::Branch; # GetBranches use C4::VirtualShelves; use POSIX qw/strftime/; use List::MoreUtils qw/ any /; # use utf8; -use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS $debug $ldap $cas $caslogout $servers $memcached); +use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS $debug $ldap $cas $caslogout); BEGIN { sub psgi_env { any { /^psgi\./ } keys %ENV } @@ -61,16 +59,7 @@ BEGIN { if ($cas) { import C4::Auth_with_cas qw(check_api_auth_cas checkpw_cas login_cas logout_cas login_cas_url); } - $servers = C4::Context->config('memcached_servers'); - if ($servers) { - require Cache::Memcached; - $memcached = Cache::Memcached->new({ - servers => [ $servers ], - debug => 0, - compress_threshold => 10_000, - namespace => C4::Context->config('memcached_namespace') || 'koha', - }); - } + } =head1 NAME @@ -158,17 +147,6 @@ sub get_template_and_user { my $insecure = C4::Context->preference('insecure'); if ($user or $insecure) { - # load the template variables for stylesheets and JavaScript - $template->param( css_libs => $in->{'css_libs'} ); - $template->param( css_module => $in->{'css_module'} ); - $template->param( css_page => $in->{'css_page'} ); - $template->param( css_widgets => $in->{'css_widgets'} ); - - $template->param( js_libs => $in->{'js_libs'} ); - $template->param( js_module => $in->{'js_module'} ); - $template->param( js_page => $in->{'js_page'} ); - $template->param( js_widgets => $in->{'js_widgets'} ); - # user info $template->param( loggedinusername => $user ); $template->param( sessionID => $sessionID ); @@ -188,8 +166,8 @@ sub get_template_and_user { } $borrowernumber = getborrowernumber($user) if defined($user); - - my ( $borr ) = GetMemberDetails( $borrowernumber ); + require C4::Members; + my ( $borr ) = C4::Members::GetMemberDetails( $borrowernumber ); my @bordat; $bordat[0] = $borr; $template->param( "USER_INFO" => \@bordat ); @@ -292,17 +270,6 @@ sub get_template_and_user { } else { # if this is an anonymous session, setup to display public lists... - # load the template variables for stylesheets and JavaScript - $template->param( css_libs => $in->{'css_libs'} ); - $template->param( css_module => $in->{'css_module'} ); - $template->param( css_page => $in->{'css_page'} ); - $template->param( css_widgets => $in->{'css_widgets'} ); - - $template->param( js_libs => $in->{'js_libs'} ); - $template->param( js_module => $in->{'js_module'} ); - $template->param( js_page => $in->{'js_page'} ); - $template->param( js_widgets => $in->{'js_widgets'} ); - $template->param( sessionID => $sessionID ); my ($total, $pubshelves) = C4::Context->get_shelves_userenv(); # an anonymous user has no 'barshelves'... @@ -1426,8 +1393,8 @@ sub get_session { elsif ($storage_method eq 'Pg') { $session = new CGI::Session("driver:PostgreSQL;serializer:yaml;id:md5", $sessionID, {Handle=>$dbh}); } - elsif ($storage_method eq 'memcached' && $servers){ - $session = new CGI::Session("driver:memcached;serializer:yaml;id:md5", $sessionID, { Memcached => $memcached } ); + elsif ($storage_method eq 'memcached' && C4::Context->ismemcached){ + $session = new CGI::Session("driver:memcached;serializer:yaml;id:md5", $sessionID, { Memcached => C4::Context->memcached } ); } else { # catch all defaults to tmp should work on all systems