Remove support for config.user, it was broken and bad practise

This commit is contained in:
Matias Griese
2017-11-10 22:07:29 +02:00
parent 37891a1032
commit 31e3c1c295
2 changed files with 2 additions and 5 deletions

View File

@@ -13,6 +13,7 @@
* Removed an extra `/` in `CompileFile.php` [#1693](https://github.com/getgrav/grav/pull/1693)
* Uri: Encode user and password to prevent issues in browsers
* Fixed "Invalid AJAX response" When using Built-in PHP Webserver in Windows [#1258](https://github.com/getgrav/grav-plugin-admin/issues/1258)
* Remove support for `config.user`, it was broken and bad practise
# v1.3.8
## 10/26/2017

View File

@@ -29,7 +29,6 @@ class User extends Data
{
$grav = Grav::instance();
$locator = $grav['locator'];
$config = $grav['config'];
// force lowercase of username
$username = strtolower($username);
@@ -38,7 +37,7 @@ class User extends Data
$blueprint = $blueprints->get('user/account');
$file_path = $locator->findResource('account://' . $username . YAML_EXT);
$file = CompiledYamlFile::instance($file_path);
$content = $file->content();
$content = (array)$file->content();
if (!isset($content['username'])) {
$content['username'] = $username;
}
@@ -48,9 +47,6 @@ class User extends Data
$user = new User($content, $blueprint);
$user->file($file);
// add user to config
$config->set("user", $user);
return $user;
}