diff --git a/system/src/Grav/Common/User/User.php b/system/src/Grav/Common/User/User.php index 6528d9b0c..9c7e0d324 100644 --- a/system/src/Grav/Common/User/User.php +++ b/system/src/Grav/Common/User/User.php @@ -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. *