diff options
| author | 2019-09-16 21:18:42 +0200 | |
|---|---|---|
| committer | 2019-09-16 21:18:42 +0200 | |
| commit | 80590daeb3627e5712be15fdc4bd98f0e2c40ea5 (patch) | |
| tree | d0e0b908ce31e0ab7d993e8326d257289b2a3133 /app/Controllers/userController.php | |
| parent | c76a318193cda63064625b2d92c719b7150d7d64 (diff) | |
Configure user defaults (#2490)
* new users inherit defaults from config-user.php
* installer creates ./data/config-user.php
* fixed typo
* .gitignore fix
* fixed style issues
* Fixed comments
* Update according to feedback
- rename file into `data/config-user.custom.php`
- make it optional (and so, don't copy it during installation)
* fixup! Update according to feedback
Diffstat (limited to 'app/Controllers/userController.php')
| -rw-r--r-- | app/Controllers/userController.php | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/app/Controllers/userController.php b/app/Controllers/userController.php index 96e4fec8c..69c1820e5 100644 --- a/app/Controllers/userController.php +++ b/app/Controllers/userController.php @@ -211,9 +211,20 @@ class FreshRSS_user_Controller extends Minz_ActionController { } } - public static function createUser($new_user_name, $email, $passwordPlain, $apiPasswordPlain, $userConfig = array(), $insertDefaultFeeds = true) { - if (!is_array($userConfig)) { - $userConfig = array(); + public static function createUser($new_user_name, $email, $passwordPlain, $apiPasswordPlain, $userConfigOverride = array(), $insertDefaultFeeds = true) { + $userConfig = array(); + + $customUserConfigPath = join_path(DATA_PATH, 'config-user.custom.php'); + if (file_exists($customUserConfigPath)) { + $customUserConfig = include($customUserConfigPath); + } + + if (is_array($customUserConfig)) { + $userConfig = $customUserConfig; + } + + if (is_array($userConfigOverride)) { + $userConfig = array_merge($userConfig, $userConfigOverride); } $ok = self::checkUsername($new_user_name); |
