View | Details | Raw Unified | Return to bug 28317
Collapse All | Expand All

(-)a/C4/Auth.pm (-4 / +4 lines)
Lines 1850-1870 sub _get_session_params { Link Here
1850
    my $storage_method = C4::Context->preference('SessionStorage');
1850
    my $storage_method = C4::Context->preference('SessionStorage');
1851
    if ( $storage_method eq 'mysql' ) {
1851
    if ( $storage_method eq 'mysql' ) {
1852
        my $dbh = C4::Context->dbh;
1852
        my $dbh = C4::Context->dbh;
1853
        return { dsn => "driver:MySQL;serializer:yaml;id:md5", dsn_args => { Handle => $dbh } };
1853
        return { dsn => "driver:MySQL;id:md5", dsn_args => { Handle => $dbh } };
1854
    }
1854
    }
1855
    elsif ( $storage_method eq 'Pg' ) {
1855
    elsif ( $storage_method eq 'Pg' ) {
1856
        my $dbh = C4::Context->dbh;
1856
        my $dbh = C4::Context->dbh;
1857
        return { dsn => "driver:PostgreSQL;serializer:yaml;id:md5", dsn_args => { Handle => $dbh } };
1857
        return { dsn => "driver:PostgreSQL;id:md5", dsn_args => { Handle => $dbh } };
1858
    }
1858
    }
1859
    elsif ( $storage_method eq 'memcached' && Koha::Caches->get_instance->memcached_cache ) {
1859
    elsif ( $storage_method eq 'memcached' && Koha::Caches->get_instance->memcached_cache ) {
1860
        my $memcached = Koha::Caches->get_instance()->memcached_cache;
1860
        my $memcached = Koha::Caches->get_instance()->memcached_cache;
1861
        return { dsn => "driver:memcached;serializer:yaml;id:md5", dsn_args => { Memcached => $memcached } };
1861
        return { dsn => "driver:memcached;id:md5", dsn_args => { Memcached => $memcached } };
1862
    }
1862
    }
1863
    else {
1863
    else {
1864
        # catch all defaults to tmp should work on all systems
1864
        # catch all defaults to tmp should work on all systems
1865
        my $dir = C4::Context::temporary_directory;
1865
        my $dir = C4::Context::temporary_directory;
1866
        my $instance = C4::Context->config( 'database' ); #actually for packages not exactly the instance name, but generally safer to leave it as it is
1866
        my $instance = C4::Context->config( 'database' ); #actually for packages not exactly the instance name, but generally safer to leave it as it is
1867
        return { dsn => "driver:File;serializer:yaml;id:md5", dsn_args => { Directory => "$dir/cgisess_$instance" } };
1867
        return { dsn => "driver:File;id:md5", dsn_args => { Directory => "$dir/cgisess_$instance" } };
1868
    }
1868
    }
1869
}
1869
}
1870
1870
(-)a/C4/Context.pm (-4 / +7 lines)
Lines 745-753 set_userenv is called in Auth.pm Link Here
745
#'
745
#'
746
sub set_userenv {
746
sub set_userenv {
747
    shift @_;
747
    shift @_;
748
    my ($usernum, $userid, $usercnum, $userfirstname, $usersurname, $userbranch, $branchname, $userflags, $emailaddress, $shibboleth, $desk_id, $desk_name, $register_id, $register_name)=
748
    my (
749
    map { Encode::is_utf8( $_ ) ? $_ : Encode::decode('UTF-8', $_) } # CGI::Session doesn't handle utf-8, so we decode it here
749
        $usernum,      $userid,     $usercnum,   $userfirstname,
750
    @_;
750
        $usersurname,  $userbranch, $branchname, $userflags,
751
        $emailaddress, $shibboleth, $desk_id,    $desk_name,
752
        $register_id,  $register_name
753
    ) = @_;
754
751
    my $var=$context->{"activeuser"} || '';
755
    my $var=$context->{"activeuser"} || '';
752
    my $cell = {
756
    my $cell = {
753
        "number"     => $usernum,
757
        "number"     => $usernum,
754
- 

Return to bug 28317