Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision f07df483

Von Moritz Bunkus vor fast 14 Jahren hinzugefügt

  • ID f07df483ee9e755f29fe599424a1ba2ed8bcc6b8
  • Vorgänger 03c526b3
  • Nachfolger 4099d0e8

Überprüfung der Passwortrichtlinie, wenn die Benutzerin ihr Passwort ändert

Unterschiede anzeigen:

bin/mozilla/am.pl
34 34
use utf8;
35 35

  
36 36
use SL::Auth;
37
use SL::Auth::PasswordPolicy;
37 38
use SL::AM;
38 39
use SL::CA;
39 40
use SL::Form;
......
2549 2550

  
2550 2551
  TODO->save_user_config('login' => $form->{login}, %{ $form->{todo_cfg} || { } });
2551 2552

  
2552
  $form->redirect($locale->text('Preferences saved!')) if (AM->save_preferences(\%myconfig, \%$form, 0));
2553
  if (AM->save_preferences(\%myconfig, $form)) {
2554
    if ($::auth->can_change_password()
2555
        && defined $form->{new_password}
2556
        && ($form->{new_password} ne '********')) {
2557
      my $verifier = SL::Auth::PasswordPolicy->new;
2558
      my $result   = $verifier->verify($form->{new_password});
2559

  
2560
      if ($result != SL::Auth::PasswordPolicy->OK()) {
2561
        $form->error($::locale->text('The settings were saved, but the password was not changed.') . ' ' . join(' ', $verifier->errors($result)));
2562
      }
2563

  
2564
      $::auth->change_password($form->{login}, $form->{new_password});
2565

  
2566
      $form->{password} = $form->{new_password};
2567
      $::auth->set_session_value('password', $form->{password});
2568
      $::auth->create_or_refresh_session();
2569
    }
2570

  
2571
    $form->redirect($locale->text('Preferences saved!'));
2572
  }
2573

  
2553 2574
  $form->error($locale->text('Cannot save preferences!'));
2554 2575

  
2555 2576
  $main::lxdebug->leave_sub();

Auch abrufbar als: Unified diff