mirror of
https://github.com/getgrav/grav.git
synced 2026-07-04 14:28:57 +02:00
Override save to not store the username field
This commit is contained in:
@@ -91,6 +91,20 @@ class User extends Data
|
||||
return (bool) $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Save user without the username
|
||||
*/
|
||||
public function save()
|
||||
{
|
||||
$file = $this->file();
|
||||
if ($file) {
|
||||
$username = $this->get('username');
|
||||
unset($this->username);
|
||||
$file->save($this->items);
|
||||
$this->set('username', $username);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks user authorization to the action.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user