aboutsummaryrefslogtreecommitdiffhomepage
path: root/inc
diff options
context:
space:
mode:
Diffstat (limited to 'inc')
-rw-r--r--inc/3rdparty/Session.class.php13
-rw-r--r--inc/3rdparty/libraries/feedwriter/FeedItem.php1
-rwxr-xr-xinc/poche/Poche.class.php19
3 files changed, 25 insertions, 8 deletions
diff --git a/inc/3rdparty/Session.class.php b/inc/3rdparty/Session.class.php
index b30a31f3..599b68cd 100644
--- a/inc/3rdparty/Session.class.php
+++ b/inc/3rdparty/Session.class.php
@@ -33,7 +33,7 @@ class Session
33 // his/her session is considered expired (3600 sec. = 1 hour) 33 // his/her session is considered expired (3600 sec. = 1 hour)
34 public static $inactivityTimeout = 86400; 34 public static $inactivityTimeout = 86400;
35 // Extra timeout for long sessions (if enabled) (82800 sec. = 23 hours) 35 // Extra timeout for long sessions (if enabled) (82800 sec. = 23 hours)
36 public static $longSessionTimeout = 31536000; 36 public static $longSessionTimeout = 604800; // 604800 = a week
37 // If you get disconnected often or if your IP address changes often. 37 // If you get disconnected often or if your IP address changes often.
38 // Let you disable session cookie hijacking protection 38 // Let you disable session cookie hijacking protection
39 public static $disableSessionProtection = false; 39 public static $disableSessionProtection = false;
@@ -61,7 +61,7 @@ class Session
61 if (isset($_SERVER["HTTPS"]) && $_SERVER["HTTPS"] == "on") { 61 if (isset($_SERVER["HTTPS"]) && $_SERVER["HTTPS"] == "on") {
62 $ssl = true; 62 $ssl = true;
63 } 63 }
64 session_set_cookie_params($cookie['lifetime'], $cookiedir, $_SERVER['HTTP_HOST'], $ssl); 64 session_set_cookie_params(self::$longSessionTimeout, $cookiedir, $_SERVER['HTTP_HOST'], $ssl);
65 // Use cookies to store session. 65 // Use cookies to store session.
66 ini_set('session.use_cookies', 1); 66 ini_set('session.use_cookies', 1);
67 // Force cookies for session (phpsessionID forbidden in URL) 67 // Force cookies for session (phpsessionID forbidden in URL)
@@ -143,7 +143,14 @@ class Session
143 */ 143 */
144 public static function logout() 144 public static function logout()
145 { 145 {
146 unset($_SESSION['uid'],$_SESSION['ip'],$_SESSION['expires_on'],$_SESSION['tokens'], $_SESSION['login'], $_SESSION['pass'], $_SESSION['longlastingsession'], $_SESSION['poche_user']); 146 // unset($_SESSION['uid'],$_SESSION['ip'],$_SESSION['expires_on'],$_SESSION['tokens'], $_SESSION['login'], $_SESSION['pass'], $_SESSION['longlastingsession'], $_SESSION['poche_user']);
147
148 // Destruction du cookie (le code peut paraître complexe mais c'est pour être certain de reprendre les mêmes paramètres)
149 $args = array_merge(array(session_name(), ''), array_values(session_get_cookie_params()));
150 $args[2] = time() - 3600;
151 call_user_func_array('setcookie', $args);
152 // Suppression physique de la session
153 session_destroy();
147 } 154 }
148 155
149 /** 156 /**
diff --git a/inc/3rdparty/libraries/feedwriter/FeedItem.php b/inc/3rdparty/libraries/feedwriter/FeedItem.php
index 9373deeb..0eae5e08 100644
--- a/inc/3rdparty/libraries/feedwriter/FeedItem.php
+++ b/inc/3rdparty/libraries/feedwriter/FeedItem.php
@@ -156,6 +156,7 @@
156 if($this->version == RSS2 || $this->version == RSS1) 156 if($this->version == RSS2 || $this->version == RSS1)
157 { 157 {
158 $this->setElement('link', $link); 158 $this->setElement('link', $link);
159 $this->setElement('guid', $link);
159 } 160 }
160 else 161 else
161 { 162 {
diff --git a/inc/poche/Poche.class.php b/inc/poche/Poche.class.php
index 5a89a8d2..fb4e1a7f 100755
--- a/inc/poche/Poche.class.php
+++ b/inc/poche/Poche.class.php
@@ -534,8 +534,12 @@ class Poche
534 switch ($view) 534 switch ($view)
535 { 535 {
536 case 'config': 536 case 'config':
537 $dev = trim($this->getPocheVersion('dev')); 537 $dev_infos = $this->getPocheVersion('dev');
538 $prod = trim($this->getPocheVersion('prod')); 538 $dev = trim($dev_infos[0]);
539 $check_time_dev = date('d-M-Y H:i', $dev_infos[1]);
540 $prod_infos = $this->getPocheVersion('prod');
541 $prod = trim($prod_infos[0]);
542 $check_time_prod = date('d-M-Y H:i', $prod_infos[1]);
539 $compare_dev = version_compare(POCHE, $dev); 543 $compare_dev = version_compare(POCHE, $dev);
540 $compare_prod = version_compare(POCHE, $prod); 544 $compare_prod = version_compare(POCHE, $prod);
541 $themes = $this->getInstalledThemes(); 545 $themes = $this->getInstalledThemes();
@@ -547,6 +551,8 @@ class Poche
547 'languages' => $languages, 551 'languages' => $languages,
548 'dev' => $dev, 552 'dev' => $dev,
549 'prod' => $prod, 553 'prod' => $prod,
554 'check_time_dev' => $check_time_dev,
555 'check_time_prod' => $check_time_prod,
550 'compare_dev' => $compare_dev, 556 'compare_dev' => $compare_dev,
551 'compare_prod' => $compare_prod, 557 'compare_prod' => $compare_prod,
552 'token' => $token, 558 'token' => $token,
@@ -1067,15 +1073,17 @@ class Poche
1067 private function getPocheVersion($which = 'prod') 1073 private function getPocheVersion($which = 'prod')
1068 { 1074 {
1069 $cache_file = CACHE . '/' . $which; 1075 $cache_file = CACHE . '/' . $which;
1076 $check_time = time();
1070 1077
1071 # checks if the cached version file exists 1078 # checks if the cached version file exists
1072 if (file_exists($cache_file) && (filemtime($cache_file) > (time() - 86400 ))) { 1079 if (file_exists($cache_file) && (filemtime($cache_file) > (time() - 86400 ))) {
1073 $version = file_get_contents($cache_file); 1080 $version = file_get_contents($cache_file);
1081 $check_time = filemtime($cache_file);
1074 } else { 1082 } else {
1075 $version = file_get_contents('http://static.wallabag.org/versions/' . $which); 1083 $version = file_get_contents('http://static.wallabag.org/versions/' . $which);
1076 file_put_contents($cache_file, $version, LOCK_EX); 1084 file_put_contents($cache_file, $version, LOCK_EX);
1077 } 1085 }
1078 return $version; 1086 return array($version, $check_time);
1079 } 1087 }
1080 1088
1081 public function generateToken() 1089 public function generateToken()
@@ -1109,8 +1117,9 @@ class Poche
1109 $feed = new FeedWriter(RSS2); 1117 $feed = new FeedWriter(RSS2);
1110 $feed->setTitle('wallabag — ' . $type . ' feed'); 1118 $feed->setTitle('wallabag — ' . $type . ' feed');
1111 $feed->setLink(Tools::getPocheUrl()); 1119 $feed->setLink(Tools::getPocheUrl());
1112 $feed->setChannelElement('updated', date(DATE_RSS , time())); 1120 $feed->setChannelElement('pubDate', date(DATE_RSS , time()));
1113 $feed->setChannelElement('author', 'wallabag'); 1121 $feed->setChannelElement('generator', 'wallabag');
1122 $feed->setDescription('wallabag ' . $type . ' elements');
1114 1123
1115 if ($type == 'tag') { 1124 if ($type == 'tag') {
1116 $entries = $this->store->retrieveEntriesByTag($tag_id, $user_id); 1125 $entries = $this->store->retrieveEntriesByTag($tag_id, $user_id);