++ cambio password obbligato: al primo accesso del sorvegliante dice "Password temporanea", non "Ripristino da backup"

users.password_temporanea distingue la password provvisoria data
dall'amministratore (creazione del gruppo, "Nuova password temporanea")
dal ripristino da backup. Migrazione 000040; si spegne a password
cambiata, il ripristino e l'import XML la spengono per tutti.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Francesco Picone
2026-10-20 13:52:35 +02:00
parent ec2e7bd7e9
commit d2d6b1bdce
12 changed files with 102 additions and 5 deletions

View File

@@ -109,7 +109,7 @@ class GruppoShow extends Component
}
$password = Str::password(12, symbols: false);
$utente->forceFill(['password' => $password, 'password_change_required' => true])->save();
$utente->forceFill(['password' => $password, 'password_change_required' => true, 'password_temporanea' => true])->save();
activity()->causedBy(auth()->user())->performedOn($utente)->log('password_reimpostata');
$this->passwordTemporanea = $password;

View File

@@ -80,6 +80,7 @@ class Profile extends Component
auth()->user()->update([
'password' => $this->password,
'password_change_required' => false,
'password_temporanea' => false,
]);
$this->reset(['current_password', 'password', 'password_confirmation']);

View File

@@ -582,6 +582,7 @@ class XmlExchange extends Component
if ($passwordHash !== '' && ! $eAttore) {
$meta['password'] = $passwordHash;
$meta['password_change_required'] = true;
$meta['password_temporanea'] = false;
}
if (! $eAttore) {
$meta['remember_token'] = null;