Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 8c7e4493

Von Moritz Bunkus vor mehr als 16 Jahren hinzugefügt

  • ID 8c7e44938a661e035f62840e1e177353240ace5d
  • Vorgänger 3ced230b
  • Nachfolger ce45d060

Umstellung der Benutzerverwaltung von Dateien im Verzeichnis "users" auf die Verwendung einer Authentifizierungsdatenbank.
Es ist erforderlich, die Dateien doc/UPGRADE und doc/INSTALL/index.html zu lesen und die angesprochenen Punkte auszuführen, um nach einem Upgrade weiter arbeiten zu können.

Unterschiede anzeigen:

bin/mozilla/bp.pl
40 40

  
41 41
# end of main
42 42

  
43
sub assert_bp_access {
44
  my %access_map = (
45
    'invoice'           => 'invoice_edit',
46
    'sales_order'       => 'sales_order_edit',
47
    'sales_quotation'   => 'sales_quotation_edit',
48
    'purchase_order'    => 'purchase_order_edit',
49
    'request_quotation' => 'request_quotation_edit',
50
    'check'             => 'cash',
51
    'receipt'           => 'cash',
52
  );
53

  
54
  if ($form->{type} && $access_map{$form->{type}}) {
55
    $auth->assert($access_map{$form->{type}});
56

  
57
  } elsif ($form->{type} eq 'packing_list') {
58
    $lxdebug->message(0, "1");
59
    if (!$auth->assert('sales_order_edit', 1)) {
60
    $lxdebug->message(0, "2");
61
      $auth->assert('invoice_edit') ;
62
    }
63
    $lxdebug->message(0, "3");
64

  
65
  } else {
66
    $auth->assert('DOES_NOT_EXIST');
67
  }
68
}
69

  
43 70
sub search {
44 71
  $lxdebug->enter_sub();
45 72

  
73
  assert_bp_access();
74

  
46 75
  # $locale->text('Sales Invoices')
47 76
  # $locale->text('Packing Lists')
48 77
  # $locale->text('Sales Orders')
......
190 219
  print qq|
191 220
<body onLoad="$onload">
192 221

  
193
<form method=post action=$form->{script}>
222
<form method=post action=bp.pl>
194 223

  
195 224
<input type=hidden name=vc value=$form->{vc}>
196 225
<input type=hidden name=type value=$form->{type}>
......
229 258

  
230 259
<input type=hidden name=nextsub value=list_spool>
231 260

  
232
<input type=hidden name=login value=$form->{login}>
233
<input type=hidden name=password value=$form->{password}>
234

  
235 261
<br>
236 262
<input class=submit type=submit name=action value="|
237 263
    . $locale->text('Continue') . qq|">
......
251 277
sub remove {
252 278
  $lxdebug->enter_sub();
253 279

  
280
  assert_bp_access();
281

  
254 282
  $selected = 0;
255 283

  
256 284
  for $i (1 .. $form->{rowcount}) {
......
269 297
  print qq|
270 298
<body>
271 299

  
272
<form method=post action=$form->{script}>
300
<form method=post action=bp.pl>
273 301
|;
274 302

  
275 303
  map { delete $form->{$_} } qw(action header);
276 304

  
277 305
  foreach $key (keys %$form) {
306
    next if (($key eq 'login') || ($key eq 'password') || ('' ne ref $form->{$key}));
278 307
    print qq|<input type=hidden name=$key value="$form->{$key}">\n|;
279 308
  }
280 309

  
......
300 329
sub yes {
301 330
  $lxdebug->enter_sub();
302 331

  
332
  assert_bp_access();
333

  
303 334
  $form->info($locale->text('Removing marked entries from queue ...'));
304 335
  $form->{callback} .= "&header=1" if $form->{callback};
305 336

  
......
313 344
sub print {
314 345
  $lxdebug->enter_sub();
315 346

  
347
  assert_bp_access();
348

  
316 349
  $form->get_lists(printers => 'ALL_PRINTERS');
317 350
  # use the command stored in the databse or fall back to $myconfig{printer}
318 351
  my $selected_printer = (grep { $_->{id} eq $form->{printer} } @{ $form->{ALL_PRINTERS} })[0]->{'printer_command'} || $myconfig{printer};
......
343 376
sub list_spool {
344 377
  $lxdebug->enter_sub();
345 378

  
379
  assert_bp_access();
380

  
346 381
  $form->{ $form->{vc} } = $form->unescape($form->{ $form->{vc} });
347 382
  ($form->{ $form->{vc} }, $form->{"$form->{vc}_id"}) =
348 383
    split(/--/, $form->{ $form->{vc} });
......
350 385
  BP->get_spoolfiles(\%myconfig, \%$form);
351 386

  
352 387
  $title = $form->escape($form->{title});
353
  $href  =
354
    "$form->{script}?action=list_spool&login=$form->{login}&password=$form->{password}&vc=$form->{vc}&type=$form->{type}&title=$title";
388
  $href  = "bp.pl?action=list_spool&vc=$form->{vc}&type=$form->{type}&title=$title";
355 389

  
356 390
  $title = $form->escape($form->{title}, 1);
357 391
  $callback =
358
    "$form->{script}?action=list_spool&login=$form->{login}&password=$form->{password}&vc=$form->{vc}&type=$form->{type}&title=$title";
392
    "bp.pl?action=list_spool&vc=$form->{vc}&type=$form->{type}&title=$title";
359 393

  
360 394
  if ($form->{ $form->{vc} }) {
361 395
    $callback .= "&$form->{vc}=" . $form->escape($form->{ $form->{vc} }, 1);
......
454 488
  print qq|
455 489
<body>
456 490

  
457
<form method=post action=$form->{script}>
491
<form method=post action=bp.pl>
458 492

  
459 493
<table width=100%>
460 494
  <tr>
......
505 539
    }
506 540

  
507 541
    $column_data{invnumber} =
508
      "<td><a href=$module?action=edit&id=$ref->{id}&login=$form->{login}&password=$form->{password}&type=$form->{type}&callback=$callback>$ref->{invnumber}</a></td>";
542
      "<td><a href=$module?action=edit&id=$ref->{id}&type=$form->{type}&callback=$callback>$ref->{invnumber}</a></td>";
509 543
    $column_data{ordnumber} =
510
      "<td><a href=$module?action=edit&id=$ref->{id}&login=$form->{login}&password=$form->{password}&type=$form->{type}&callback=$callback>$ref->{ordnumber}</a></td>";
544
      "<td><a href=$module?action=edit&id=$ref->{id}&type=$form->{type}&callback=$callback>$ref->{ordnumber}</a></td>";
511 545
    $column_data{quonumber} =
512
      "<td><a href=$module?action=edit&id=$ref->{id}&login=$form->{login}&password=$form->{password}&type=$form->{type}&callback=$callback>$ref->{quonumber}</a></td>";
546
      "<td><a href=$module?action=edit&id=$ref->{id}&type=$form->{type}&callback=$callback>$ref->{quonumber}</a></td>";
513 547
    $column_data{name}      = "<td>$ref->{name}</td>";
514 548
    $column_data{spoolfile} =
515 549
      qq|<td><a href=$spool/$ref->{spoolfile}>$ref->{spoolfile}</a></td>
......
553 587
<input type=hidden name=sort value="$form->{sort}">
554 588

  
555 589
<input type=hidden name=account value="$form->{account}">
556

  
557
<input type=hidden name=login value=$form->{login}>
558
<input type=hidden name=password value=$form->{password}>
559 590
|;
560 591

  
561 592
#  if ($myconfig{printer}) {
......
595 626
sub select_all {
596 627
  $lxdebug->enter_sub();
597 628

  
629
  assert_bp_access();
630

  
598 631
  map { $form->{"checked_$_"} = 1 } (1 .. $form->{rowcount});
599 632
  &list_spool;
600 633

  

Auch abrufbar als: Unified diff