A free, self-hostable news aggregator…
Configure user defaults (#2490)
Joris Kinable80590daeb362
diff --git a/app/Controllers/userController.php b/app/Controllers/userController.phpindex 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);diff --git a/config-user.default.php b/config-user.default.phpindex d7149778d..950bef045 100644--- a/config-user.default.php+++ b/config-user.default.php@@ -1,5 +1,8 @@<?php+# Do not modify this file, which defines default values, but create a+# `./data/config-user.custom.php` file instead, containing the keys you want to+# override.return array ('language' => 'en','old_entries' => 3,diff --git a/data/.gitignore b/data/.gitignoreindex 0410f3797..1d2d8db89 100644--- a/data/.gitignore+++ b/data/.gitignore@@ -1,6 +1,7 @@.htpasswdconfig.phpconfig.php.bak.php+config-user.custom.phpforce-https.txtlast_update.txtno-cache.txt