diff options
| author | Savetheinternet <savetheinternet@tinyboard.org> | 2011-12-02 15:11:13 +1100 |
|---|---|---|
| committer | Savetheinternet <savetheinternet@tinyboard.org> | 2011-12-02 15:11:13 +1100 |
| commit | c1be29ce359d054fa273fd56661d9900f88fa491 (patch) | |
| tree | 583cbc673ceaeb847f64b70bb92ab8d5cd885637 /mod.php | |
| parent | 313012f034c13826fd2af2e4ae9d1ac36d9d0590 (diff) | |
ammended mod authentication system (no more $_SESSION)
Diffstat (limited to 'mod.php')
| -rw-r--r-- | mod.php | 16 |
1 files changed, 10 insertions, 6 deletions
@@ -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']); |
