version 1.125.4.6, 2009/10/08 21:15:19
|
version 1.125.4.7, 2009/10/09 01:44:26
|
Line 42 use Apache::loncommon();
|
Line 42 use Apache::loncommon();
|
use Apache::lonhtmlcommon(); |
use Apache::lonhtmlcommon(); |
use Apache::lonlocal; |
use Apache::lonlocal; |
use Apache::lonnet; |
use Apache::lonnet; |
|
use LONCAPA::lonauthcgi(); |
use LONCAPA(); |
use LONCAPA(); |
|
|
# |
# |
Line 2072 sub handler {
|
Line 2073 sub handler {
|
|| ($printmenu eq 'not_on_error' && !$error) ) |
|| ($printmenu eq 'not_on_error' && !$error) ) |
&& (!$env{'form.returnurl'})) { |
&& (!$env{'form.returnurl'})) { |
my $optionlist = '<table cellpadding="5">'; |
my $optionlist = '<table cellpadding="5">'; |
if ($env{'user.name'} =~ |
if (&can_toggle_debug()) { |
/^(albertel|kortemey|fox|foxr|korte|hallmat3|turtle|raeburn)$/ |
|
) { |
|
push (@Options,({ action => 'debugtoggle', |
push (@Options,({ action => 'debugtoggle', |
linktext => 'Toggle Debug Messages', |
linktext => 'Toggle Debug Messages', |
text => 'Current Debug status is -'. |
text => 'Current Debug status is -'. |
$env{'user.debug'}.'-.', |
($env{'user.debug'} ? 'on' : 'off'), |
href => '/adm/preferences', |
href => '/adm/preferences', |
printmenu => 'yes', |
printmenu => 'yes', |
subroutine => \&toggle_debug, |
subroutine => \&toggle_debug, |
Line 2120 sub handler {
|
Line 2119 sub handler {
|
} |
} |
|
|
sub toggle_debug { |
sub toggle_debug { |
if ($env{'user.debug'}) { |
if (&can_toggle_debug()) { |
&Apache::lonnet::delenv('user.debug'); |
if ($env{'user.debug'}) { |
} else { |
&Apache::lonnet::delenv('user.debug'); |
&Apache::lonnet::appenv({'user.debug' => 1}); |
} else { |
|
&Apache::lonnet::appenv({'user.debug' => 1}); |
|
} |
} |
} |
} |
} |
|
|
|
sub can_toggle_debug { |
|
my $can_toggle = 0; |
|
my $page = 'toggledebug'; |
|
if (&LONCAPA::lonauthcgi::can_view($page)) { |
|
$can_toggle = 1; |
|
} elsif (&LONCAPA::lonauthcgi::check_ipbased_access($page)) { |
|
$can_toggle = 1; |
|
} |
|
return $can_toggle; |
|
} |
|
|
|
|
1; |
1; |
__END__ |
__END__ |