Clean up Session::Privilege code.
Add $! to errorHandler message in Session::Icon when toolbar dir cannot be opened. Change i18n for default toolbar "Default" to be more self explanatory.
This commit is contained in:
parent
052d0ddb15
commit
37aad09679
3 changed files with 5 additions and 9 deletions
|
|
@ -258,7 +258,7 @@ sub getToolbarOptions {
|
|||
my $self = shift;
|
||||
$options{useLanguageDefault} = WebGUI::International->new($self->session,'WebGUI')->get(1084);
|
||||
my $dir = $self->session->config->get("extrasPath")."/toolbar";
|
||||
opendir (DIR,$dir) or $self->session->errorHandler->warn("Can't open toolbar directory!");
|
||||
opendir (DIR,$dir) or $self->session->errorHandler->warn("Can't open toolbar directory!: $!");
|
||||
my @files = readdir(DIR);
|
||||
foreach my $file (@files) {
|
||||
if (substr($file,0,1) ne ".") {
|
||||
|
|
|
|||
|
|
@ -58,8 +58,7 @@ sub adminOnly {
|
|||
my $self = shift;
|
||||
my $i18n = WebGUI::International->new($self->session);
|
||||
$self->session->http->setStatus("401", "Admin Only");
|
||||
my ($output, $sth, @data);
|
||||
$output = '<h1>'.$i18n->get(35).'</h1>';
|
||||
my $output = '<h1>'.$i18n->get(35).'</h1>';
|
||||
$output .= $i18n->get(36);
|
||||
return $self->session->style->userStyle($output);
|
||||
}
|
||||
|
|
@ -91,10 +90,8 @@ sub insufficient {
|
|||
my $self = shift;
|
||||
my $i18n = WebGUI::International->new($self->session);
|
||||
$self->session->http->setStatus("401", "Insufficient Privileges");
|
||||
my ($output);
|
||||
$output = '<h1>'.$i18n->get(37).'</h1>';
|
||||
my $output = '<h1>'.$i18n->get(37).'</h1>';
|
||||
$output .= $i18n->get(38);
|
||||
$output .= '<p>';
|
||||
return $self->session->style->userStyle($output);
|
||||
}
|
||||
|
||||
|
|
@ -155,7 +152,6 @@ sub notMember {
|
|||
my ($output);
|
||||
$output = '<h1>'.$i18n->get(345).'</h1>';
|
||||
$output .= $i18n->get(346);
|
||||
$output .= '<p>';
|
||||
return $self->session->style->userStyle($output);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -603,8 +603,8 @@ Database Links enable a WebGUI administrator to add commonly used databases for
|
|||
},
|
||||
|
||||
'1084' => {
|
||||
message => q|Default|,
|
||||
lastUpdated => 1077472740
|
||||
message => q|Use the default toolbar for my language|,
|
||||
lastUpdated => 1161300438,
|
||||
},
|
||||
|
||||
'370' => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue