summaryrefslogtreecommitdiff
path: root/app/Controllers/userController.php
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2019-11-06 21:54:13 +0100
committerGravatar GitHub <noreply@github.com> 2019-11-06 21:54:13 +0100
commit91cb165829badde07c42a002215cf52779d891b6 (patch)
treeb8ee6e04e32dcf6c6fc25b7b0b9fe2952d2991ba /app/Controllers/userController.php
parent3aa66f317b496ccd9a2df914bbc747c52081a7ad (diff)
parent6d596e9e54308297d423b23bf65338d62eebc415 (diff)
Merge pull request #2633 from FreshRSS/dev1.15.1
FreshRSS 1.15.1
Diffstat (limited to 'app/Controllers/userController.php')
-rw-r--r--app/Controllers/userController.php16
1 files changed, 15 insertions, 1 deletions
diff --git a/app/Controllers/userController.php b/app/Controllers/userController.php
index 6afc91b4e..7ce6b298a 100644
--- a/app/Controllers/userController.php
+++ b/app/Controllers/userController.php
@@ -248,7 +248,21 @@ class FreshRSS_user_Controller extends Minz_ActionController {
}
if ($ok) {
$newUserDAO = FreshRSS_Factory::createUserDao($new_user_name);
- $ok &= $newUserDAO->createUser($insertDefaultFeeds);
+ $ok &= $newUserDAO->createUser();
+
+ if ($ok && $insertDefaultFeeds) {
+ $opmlPath = DATA_PATH . '/opml.xml';
+ if (!file_exists($opmlPath)) {
+ $opmlPath = FRESHRSS_PATH . '/opml.default.xml';
+ }
+ $importController = new FreshRSS_importExport_Controller();
+ try {
+ $importController->importFile($opmlPath, $opmlPath, $new_user_name);
+ } catch (Exception $e) {
+ Minz_Log::error('Error while importing default OPML for user ' . $new_user_name . ': ' . $e->getMessage());
+ }
+ }
+
$ok &= self::updateUser($new_user_name, $email, $passwordPlain, $apiPasswordPlain);
}
return $ok;