Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision c621a918

Von Sven Schöling vor etwa 15 Jahren hinzugefügt

  • ID c621a9187eb258019fa540490de21b248c709516
  • Vorgänger 80f6efd0
  • Nachfolger ed944ca3

strictness für Menu und Ca

Unterschiede anzeigen:

SL/Menu.pm
37 37
use SL::Auth;
38 38
use SL::Inifile;
39 39

  
40
use strict;
41

  
40 42
sub new {
41 43
  $main::lxdebug->enter_sub();
42 44

  
......
91 93
  # add other params
92 94
  foreach my $key (keys %{ $self->{$item} }) {
93 95
    $str .= "&" . $form->escape($key, 1) . "=";
94
    ($value, $conf) = split(/=/, $self->{$item}{$key}, 2);
96
    my ($value, $conf) = split(/=/, $self->{$item}{$key}, 2);
95 97
    $value = $myconfig->{$value} . "/$conf" if ($conf);
96 98
    $str .= $form->escape($value, 1);
97 99
  }
......
135 137
  # add other params
136 138
  foreach my $key (keys %{ $self->{$item} }) {
137 139
    $str .= "&" . $form->escape($key, 1) . "=";
138
    ($value, $conf) = split(/=/, $self->{$item}{$key}, 2);
140
    my ($value, $conf) = split(/=/, $self->{$item}{$key}, 2);
139 141
    $value = $myconfig->{$value} . "/$conf" if ($conf);
140 142
    $str .= $form->escape($value, 1);
141 143
  }
......
149 151

  
150 152
  my ($self, $name, $item) = @_;
151 153

  
152
  my $form        = $main::form;
154
  my $form        =  $main::form;
155
  my $myconfig    = \%main::myconfig;
153 156

  
154 157
  my $module      = $self->{$name}->{module} || $form->{script};
155 158
  my $action      = $self->{$name}->{action};
......
207 210
  # add other params
208 211
  foreach my $key (keys %{ $self->{$item} }) {
209 212
    $str .= "&" . $form->escape($key, 1) . "=";
210
    ($value, $conf) = split(/=/, $self->{$item}{$key}, 2);
213
    my ($value, $conf) = split(/=/, $self->{$item}{$key}, 2);
211 214
    $value = $myconfig->{$value} . "/$conf" if ($conf);
212 215
    $str .= $form->escape($value, 1);
213 216
  }
......
267 270
  # add other params
268 271
  foreach my $key (keys %{ $self->{$item} }) {
269 272
    $str .= "&" . $form->escape($key, 1) . "=";
270
    ($value, $conf) = split(/=/, $self->{$item}{$key}, 2);
273
    my ($value, $conf) = split(/=/, $self->{$item}{$key}, 2);
271 274
    $value = $myconfig->{$value} . "/$conf" if ($conf);
272 275
    $str .= $form->escape($value, 1);
273 276
  }
......
311 314
  my $key    = shift;
312 315
  my $access = shift;
313 316

  
317
  my $form        =  $main::form;
318
  my $auth        =  $main::auth;
319
  my $myconfig    = \%main::myconfig;
320

  
314 321
  my @stack;
315 322
  my $cur_ary = [];
316 323

  
......
331 338
    } elsif ($token eq ")") {
332 339
      pop @stack;
333 340
      if (!@stack) {
334
        $main::form->error("Error in menu.ini for entry ${key}: missing '('");
341
        $form->error("Error in menu.ini for entry ${key}: missing '('");
335 342
      }
336 343
      $cur_ary = $stack[-1];
337 344

  
......
339 346
      push @{$cur_ary}, $token;
340 347

  
341 348
    } else {
342
      push @{$cur_ary}, $main::auth->check_right($main::form->{login}, $token, 1);
349
      push @{$cur_ary}, $auth->check_right($form->{login}, $token, 1);
343 350
    }
344 351
  }
345 352

  
346 353
  if ($access) {
347
    $main::form->error("Error in menu.ini for entry ${name}: unrecognized token at the start of '$access'\n");
354
    $form->error("Error in menu.ini for entry ${key}: unrecognized token at the start of '$access'\n");
348 355
  }
349 356

  
350 357
  if (1 < scalar @stack) {
351
    $main::form->error("Error in menu.ini for entry ${name}: Missing ')'\n");
358
    $main::form->error("Error in menu.ini for entry ${key}: Missing ')'\n");
352 359
  }
353 360

  
354 361
  return SL::Auth::evaluate_rights_ary($stack[0]);

Auch abrufbar als: Unified diff