@@ -, +, @@ --- C4/Context.pm | 16 +++++++++++++++- 1 files changed, 15 insertions(+), 1 deletions(-) --- a/C4/Context.pm +++ a/C4/Context.pm @@ -25,7 +25,7 @@ BEGIN { require CGI::Carp; # FIXME for future reference, CGI::Carp doc says # "Note that fatalsToBrowser does not work with mod_perl version 2.0 and higher." - import CGI::Carp qw(fatalsToBrowser); + import CGI::Carp qw(fatalsToBrowser carp); sub handle_errors { my $msg = shift; my $debug_level; @@ -1228,6 +1228,20 @@ sub tz { } +=head2 IsSuperLibrarian + + C4::Context->IsSuperlibrarian(); + +=cut + +sub IsSuperLibrarian { + if ( C4::Context->userenv ) { + return C4::Context->userenv->{flags} % 2 == 1; + } + else { + carp("C4::Context->userenv not defined!"); + } +} 1; __END__ --