aboutsummaryrefslogtreecommitdiff
path: root/app/models
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2013-11-17 15:24:30 +0100
committerGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2013-11-17 15:24:30 +0100
commit9ec13c6c32ad0f8fb50f100e6ae127abe1535ccc (patch)
tree255cfb5995b67df7edd5fa541bebe3905be44715 /app/models
parent53505964412fc05d5bbd11b0707b4700634c8f9f (diff)
Début de multi-utilisateurs
Préparation de https://github.com/marienfressinaud/FreshRSS/issues/126 Suite de https://github.com/marienfressinaud/FreshRSS/issues/248 Nécessite un script de mise à jour https://github.com/marienfressinaud/FreshRSS/issues/255 Install.php n'est pas encore testé https://github.com/marienfressinaud/FreshRSS/issues/273
Diffstat (limited to 'app/models')
-rwxr-xr-xapp/models/Entry.php8
-rw-r--r--app/models/Feed.php4
-rwxr-xr-xapp/models/RSSConfiguration.php3
3 files changed, 8 insertions, 7 deletions
diff --git a/app/models/Entry.php b/app/models/Entry.php
index 8b817cc14..c4856af8b 100755
--- a/app/models/Entry.php
+++ b/app/models/Entry.php
@@ -311,11 +311,11 @@ class EntryDAO extends Model_pdo {
$affected = $stm->rowCount();
if ($affected > 0) {
- $sql = 'UPDATE freshrss_feed f '
+ $sql = 'UPDATE ' . $this->prefix . 'feed f '
. 'LEFT OUTER JOIN ('
. 'SELECT e.id_feed, '
. 'COUNT(*) AS nbUnreads '
- . 'FROM freshrss_entry e '
+ . 'FROM ' . $this->prefix . 'entry e '
. 'WHERE e.is_read = 0 '
. 'GROUP BY e.id_feed'
. ') x ON x.id_feed=f.id '
@@ -364,11 +364,11 @@ class EntryDAO extends Model_pdo {
$affected = $stm->rowCount();
if ($affected > 0) {
- $sql = 'UPDATE freshrss_feed f '
+ $sql = 'UPDATE ' . $this->prefix . 'feed f '
. 'LEFT OUTER JOIN ('
. 'SELECT e.id_feed, '
. 'COUNT(*) AS nbUnreads '
- . 'FROM freshrss_entry e '
+ . 'FROM ' . $this->prefix . 'entry e '
. 'WHERE e.is_read = 0 '
. 'GROUP BY e.id_feed'
. ') x ON x.id_feed=f.id '
diff --git a/app/models/Feed.php b/app/models/Feed.php
index adc8e1677..549603664 100644
--- a/app/models/Feed.php
+++ b/app/models/Feed.php
@@ -530,12 +530,12 @@ class FeedDAO extends Model_pdo {
return $res[0]['count'];
}
public function updateCachedValues () { //For one single feed, call updateLastUpdate($id)
- $sql = 'UPDATE freshrss_feed f '
+ $sql = 'UPDATE ' . $this->prefix . 'feed f '
. 'INNER JOIN ('
. 'SELECT e.id_feed, '
. 'COUNT(CASE WHEN e.is_read = 0 THEN 1 END) AS nbUnreads, '
. 'COUNT(e.id) AS nbEntries '
- . 'FROM freshrss_entry e '
+ . 'FROM ' . $this->prefix . 'entry e '
. 'GROUP BY e.id_feed'
. ') x ON x.id_feed=f.id '
. 'SET f.cache_nbEntries=x.nbEntries, f.cache_nbUnreads=x.nbUnreads';
diff --git a/app/models/RSSConfiguration.php b/app/models/RSSConfiguration.php
index f8379a625..9604bee1d 100755
--- a/app/models/RSSConfiguration.php
+++ b/app/models/RSSConfiguration.php
@@ -348,7 +348,7 @@ class RSSConfigurationDAO extends Model_array {
public $bottomline_link = 'yes';
public function __construct () {
- parent::__construct (DATA_PATH . '/Configuration.array.php');
+ parent::__construct (DATA_PATH . Configuration::currentUser () . '_user.php');
// TODO : simplifier ce code, une boucle for() devrait suffir !
if (isset ($this->array['language'])) {
@@ -441,5 +441,6 @@ class RSSConfigurationDAO extends Model_array {
}
$this->writeFile($this->array);
+ touch(DATA_PATH . '/touch.txt');
}
}