diff options
Diffstat (limited to 'app/Models/UserDAO.php')
| -rw-r--r-- | app/Models/UserDAO.php | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/app/Models/UserDAO.php b/app/Models/UserDAO.php index e9d3a7329..0cf163bae 100644 --- a/app/Models/UserDAO.php +++ b/app/Models/UserDAO.php @@ -30,19 +30,17 @@ class FreshRSS_UserDAO extends Minz_ModelPdo { } } if ($ok && $insertDefaultFeeds) { - if (defined('SQL_INSERT_FEEDS')) { //E.g. MySQL - $sql = sprintf(SQL_INSERT_FEEDS, $bd_prefix_user); + $default_feeds = FreshRSS_Context::$system_conf->default_feeds; + foreach ($default_feeds as $feed) { + $sql = sprintf(SQL_INSERT_FEED, $bd_prefix_user); $stm = $userPDO->bd->prepare($sql); - $ok &= $stm && $stm->execute(); - } else { //E.g. SQLite - global $SQL_INSERT_FEEDS; - if (is_array($SQL_INSERT_FEEDS)) { - foreach ($SQL_INSERT_FEEDS as $instruction) { - $sql = sprintf($instruction, $bd_prefix_user); - $stm = $userPDO->bd->prepare($sql); - $ok &= ($stm && $stm->execute()); - } - } + $parameters = array( + ':url' => $feed['url'], + ':name' => $feed['name'], + ':website' => $feed['website'], + ':description' => $feed['description'], + ); + $ok &= ($stm && $stm->execute($parameters)); } } } catch (Exception $e) { |
