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

(-)a/C4/Context.pm (-20 / +16 lines)
Lines 747-790 sub set_userenv { Link Here
747
    return $cell;
747
    return $cell;
748
}
748
}
749
749
750
=head2 _new_userenv
750
=head2 new_userenv
751
751
752
  C4::Context->_new_userenv($session);  # FIXME: This calling style is wrong for what looks like an _internal function
752
  C4::Context->new_userenv($session);
753
753
754
Builds a hash for user environment variables.
754
Builds a hash for user environment variables.
755
755
756
This hash shall be cached for future use: if you call
756
This hash shall be cached for future use: if you call
757
C<C4::Context-E<gt>userenv> twice, you will get the same hash without real DB access
757
C<C4::Context-E<gt>userenv> twice, you will get the same hash without real DB access
758
758
759
_new_userenv is called in Auth.pm
759
new_userenv is called in Auth.pm
760
760
761
=cut
761
=cut
762
762
763
#'
763
sub new_userenv {
764
sub _new_userenv
764
    my ( $class, $sessionID ) = @_;
765
{
765
    $context->{activeuser} = $sessionID;
766
    shift;  # Useless except it compensates for bad calling style
767
    my ($sessionID)= @_;
768
     $context->{"activeuser"}=$sessionID;
769
}
766
}
770
767
771
=head2 _unset_userenv
768
=head2 unset_userenv
772
769
773
  C4::Context->_unset_userenv;
770
  C4::Context->unset_userenv( $sessionID );
774
771
775
Destroys the hash for activeuser user environment variables.
772
Destroys the hash for activeuser user environment variables if sessionID matches.
776
773
777
=cut
774
=cut
778
775
779
#'
776
sub unset_userenv {
780
777
    my ( $class, $sessionID )= @_;
781
sub _unset_userenv
778
    if( defined($sessionID) && defined($context->{activeuser}) &&
782
{
779
        $context->{activeuser} eq $sessionID )
783
    my ($sessionID)= @_;
780
    {
784
    undef $context->{"activeuser"} if ($context->{"activeuser"} eq $sessionID);
781
        undef $context->{activeuser};
782
    }
785
}
783
}
786
784
787
788
=head2 get_versions
785
=head2 get_versions
789
786
790
  C4::Context->get_versions
787
  C4::Context->get_versions
791
- 

Return to bug 29954