summaryrefslogtreecommitdiff
path: root/mod.php
diff options
context:
space:
mode:
authorSavetheinternet <savetheinternet@tinyboard.org>2011-12-02 15:11:13 +1100
committerSavetheinternet <savetheinternet@tinyboard.org>2011-12-02 15:11:13 +1100
commitc1be29ce359d054fa273fd56661d9900f88fa491 (patch)
tree583cbc673ceaeb847f64b70bb92ab8d5cd885637 /mod.php
parent313012f034c13826fd2af2e4ae9d1ac36d9d0590 (diff)
ammended mod authentication system (no more $_SESSION)
Diffstat (limited to 'mod.php')
-rw-r--r--mod.php16
1 files changed, 10 insertions, 6 deletions
diff --git a/mod.php b/mod.php
index e44ecde2..34a540f7 100644
--- a/mod.php
+++ b/mod.php
@@ -171,8 +171,8 @@
if($mod['type'] >= ADMIN && $config['check_updates']) {
if(!$config['version'])
error('Could not find current version! (Check .installed)');
- if(isset($_SESSION['update']) && time() - $_SESSION['update']['time'] < $config['check_updates_time']) {
- $latest = unserialize($_SESSION['update']['latest']);
+ if(isset($_COOKIE['update'])) {
+ $latest = unserialize($_COOKIE['update']);
} else {
$ctx = stream_context_create(array(
'http' => array(
@@ -208,7 +208,9 @@
// TODO: Display some sort of warning message
$latest = false;
}
- $_SESSION['update'] = Array('time' => time(), 'latest' => serialize($latest));
+
+
+ setcookie('update', serialize($latest), time() + $config['check_updates_time'], $config['cookies']['jail'] ? $config['cookies']['path'] : '/', null, false, true);
}
if($latest) {
@@ -236,8 +238,7 @@
'title'=>_('Dashboard'),
'body'=>$body,
'__mod'=>true
- )
- );
+ ));
} elseif(preg_match('/^\/logout$/', $query)) {
destroyCookies();
@@ -1221,6 +1222,9 @@
if($_mod['id'] == $mod['id']) {
// Changed own password. Update cookies
+
+ login($mod['username'], $_POST['password']);
+
setCookies();
}
}
@@ -2248,7 +2252,7 @@
openBoard($targetBoard);
foreach($replies as &$post) {
- var_dump(post($post, false));
+ post($post, false);
if($post['has_file']) {
$clone($post['file_src'], sprintf($config['board_path'], $board['uri']) . $config['dir']['img'] . $post['file']);
$clone($post['file_thumb'], sprintf($config['board_path'], $board['uri']) . $config['dir']['thumb'] . $post['thumb']);