summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2017-04-10 19:46:22 +0200
committerGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2017-04-10 19:46:22 +0200
commit510045b3c554261a0a6434bfe73adac32b12cc81 (patch)
treecc0907d84ec5ad72baed8e0fb6fe7d81176bbb3c /app
parent8854f230866f458382f6dc207f706220e9c32351 (diff)
parente849de7296efbece490447cdceeed9726f10b33c (diff)
Merge branch 'FreshRSS/dev' into multiuser-token
Diffstat (limited to 'app')
-rw-r--r--app/Controllers/userController.php1
-rw-r--r--app/Models/Feed.php15
-rw-r--r--app/SQL/install.sql.mysql.php2
-rw-r--r--app/SQL/install.sql.pgsql.php2
-rw-r--r--app/SQL/install.sql.sqlite.php2
-rw-r--r--app/i18n/en/gen.php2
-rw-r--r--app/install.php2
7 files changed, 14 insertions, 12 deletions
diff --git a/app/Controllers/userController.php b/app/Controllers/userController.php
index ee575fa09..ed30eb69f 100644
--- a/app/Controllers/userController.php
+++ b/app/Controllers/userController.php
@@ -217,6 +217,7 @@ class FreshRSS_user_Controller extends Minz_ActionController {
$userDAO = new FreshRSS_UserDAO();
$ok &= $userDAO->deleteUser($username);
$ok &= recursive_unlink($user_data);
+ array_map('unlink', glob(PSHB_PATH . '/feeds/*/' . $username . '.txt'));
}
return $ok;
}
diff --git a/app/Models/Feed.php b/app/Models/Feed.php
index 7a9cf8612..1bc6e48e8 100644
--- a/app/Models/Feed.php
+++ b/app/Models/Feed.php
@@ -429,7 +429,7 @@ class FreshRSS_Feed extends Minz_Model {
}
} else {
@mkdir($path, 0777, true);
- $key = sha1($path . FreshRSS_Context::$system_conf->salt . uniqid(mt_rand(), true));
+ $key = sha1($path . FreshRSS_Context::$system_conf->salt);
$hubJson = array(
'hub' => $this->hubUrl,
'key' => $key,
@@ -451,15 +451,16 @@ class FreshRSS_Feed extends Minz_Model {
//Parameter true to subscribe, false to unsubscribe.
function pubSubHubbubSubscribe($state) {
- if (FreshRSS_Context::$system_conf->base_url && $this->hubUrl && $this->selfUrl) {
- $hubFilename = PSHB_PATH . '/feeds/' . base64url_encode($this->selfUrl) . '/!hub.json';
+ $url = $this->selfUrl ? $this->selfUrl : $this->url;
+ if (FreshRSS_Context::$system_conf->base_url && $url) {
+ $hubFilename = PSHB_PATH . '/feeds/' . base64url_encode($url) . '/!hub.json';
$hubFile = @file_get_contents($hubFilename);
if ($hubFile === false) {
Minz_Log::warning('JSON not found for PubSubHubbub: ' . $this->url);
return false;
}
$hubJson = json_decode($hubFile, true);
- if (!$hubJson || empty($hubJson['key']) || !ctype_xdigit($hubJson['key'])) {
+ if (!$hubJson || empty($hubJson['key']) || !ctype_xdigit($hubJson['key']) || empty($hubJson['hub'])) {
Minz_Log::warning('Invalid JSON for PubSubHubbub: ' . $this->url);
return false;
}
@@ -474,13 +475,13 @@ class FreshRSS_Feed extends Minz_Model {
}
$ch = curl_init();
curl_setopt_array($ch, array(
- CURLOPT_URL => $this->hubUrl,
+ CURLOPT_URL => $hubJson['hub'],
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_USERAGENT => 'FreshRSS/' . FRESHRSS_VERSION . ' (' . PHP_OS . '; ' . FRESHRSS_WEBSITE . ')',
CURLOPT_POSTFIELDS => 'hub.verify=sync'
. '&hub.mode=' . ($state ? 'subscribe' : 'unsubscribe')
- . '&hub.topic=' . urlencode($this->selfUrl)
+ . '&hub.topic=' . urlencode($url)
. '&hub.callback=' . urlencode($callbackUrl)
)
);
@@ -488,7 +489,7 @@ class FreshRSS_Feed extends Minz_Model {
$info = curl_getinfo($ch);
file_put_contents(USERS_PATH . '/_/log_pshb.txt', date('c') . "\t" .
- 'PubSubHubbub ' . ($state ? 'subscribe' : 'unsubscribe') . ' to ' . $this->selfUrl .
+ 'PubSubHubbub ' . ($state ? 'subscribe' : 'unsubscribe') . ' to ' . $url .
' with callback ' . $callbackUrl . ': ' . $info['http_code'] . ' ' . $response . "\n", FILE_APPEND);
if (substr($info['http_code'], 0, 1) == '2') {
diff --git a/app/SQL/install.sql.mysql.php b/app/SQL/install.sql.mysql.php
index 6b07f5965..09defd452 100644
--- a/app/SQL/install.sql.mysql.php
+++ b/app/SQL/install.sql.mysql.php
@@ -92,7 +92,7 @@ INSERT IGNORE INTO `%1$sfeed` (url, category, name, website, description, ttl) V
INSERT IGNORE INTO `%1$sfeed` (url, category, name, website, description, ttl) VALUES("https://github.com/FreshRSS/FreshRSS/releases.atom", 1, "FreshRSS @ GitHub", "https://github.com/FreshRSS/FreshRSS/", "FreshRSS releases @ GitHub", 86400);
');
-define('SQL_DROP_TABLES', 'DROP TABLE IF EXISTS `%1$sentry`, `%1$sfeed`, `%1$scategory`');
+define('SQL_DROP_TABLES', 'DROP TABLE IF EXISTS `%1$sentrytmp`, `%1$sentry`, `%1$sfeed`, `%1$scategory`');
define('SQL_UPDATE_UTF8MB4', '
ALTER DATABASE `%2$s` CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
diff --git a/app/SQL/install.sql.pgsql.php b/app/SQL/install.sql.pgsql.php
index 74c6d1b79..4cfeb2517 100644
--- a/app/SQL/install.sql.pgsql.php
+++ b/app/SQL/install.sql.pgsql.php
@@ -84,4 +84,4 @@ $SQL_INSERT_FEEDS = array(
'INSERT INTO "%1$sfeed" (url, category, name, website, description, ttl) SELECT \'https://github.com/FreshRSS/FreshRSS/releases.atom\', 1, \'FreshRSS @ GitHub\', \'https://github.com/FreshRSS/FreshRSS/\', \'FreshRSS releases @ GitHub\', 86400 WHERE NOT EXISTS (SELECT id FROM "%1$sfeed" WHERE url = \'https://github.com/FreshRSS/FreshRSS/releases.atom\');',
);
-define('SQL_DROP_TABLES', 'DROP TABLE IF EXISTS "%1$sentry", "%1$sfeed", "%1$scategory"');
+define('SQL_DROP_TABLES', 'DROP TABLE IF EXISTS "%1$sentrytmp", "%1$sentry", "%1$sfeed", "%1$scategory"');
diff --git a/app/SQL/install.sql.sqlite.php b/app/SQL/install.sql.sqlite.php
index bce9f5a95..c4e4af006 100644
--- a/app/SQL/install.sql.sqlite.php
+++ b/app/SQL/install.sql.sqlite.php
@@ -86,4 +86,4 @@ $SQL_INSERT_FEEDS = array(
'INSERT OR IGNORE INTO `feed` (url, category, name, website, description, ttl) VALUES("https://github.com/FreshRSS/FreshRSS/releases.atom", 1, "FreshRSS releases", "https://github.com/FreshRSS/FreshRSS/", "FreshRSS releases @ GitHub", 86400);',
);
-define('SQL_DROP_TABLES', 'DROP TABLE IF EXISTS entry, feed, category');
+define('SQL_DROP_TABLES', 'DROP TABLE IF EXISTS `entrytmp`, `entry`, `feed`, `category`');
diff --git a/app/i18n/en/gen.php b/app/i18n/en/gen.php
index d6ae266b7..a502e829a 100644
--- a/app/i18n/en/gen.php
+++ b/app/i18n/en/gen.php
@@ -2,7 +2,7 @@
return array(
'action' => array(
- 'actualize' => 'Updating',
+ 'actualize' => 'Actualize',
'back_to_rss_feeds' => '← Go back to your RSS feeds',
'cancel' => 'Cancel',
'create' => 'Create',
diff --git a/app/install.php b/app/install.php
index f598f6528..ebfffa47d 100644
--- a/app/install.php
+++ b/app/install.php
@@ -465,7 +465,7 @@ function printStep1() {
<?php if ($res['fileinfo'] == 'ok') { ?>
<p class="alert alert-success"><span class="alert-head"><?php echo _t('gen.short.ok'); ?></span> <?php echo _t('install.check.fileinfo.ok'); ?></p>
<?php } else { ?>
- <p class="alert alert-error"><span class="alert-head"><?php echo _t('gen.short.damn'); ?></span> <?php echo _t('install.check.fileinfo.nok'); ?></p>
+ <p class="alert alert-warn"><span class="alert-head"><?php echo _t('gen.short.damn'); ?></span> <?php echo _t('install.check.fileinfo.nok'); ?></p>
<?php } ?>
<?php if ($res['data'] == 'ok') { ?>