Logout button for mod interface

This commit is contained in:
Savetheinternet 2011-03-27 14:48:22 +11:00
parent d5e42bf5bf
commit b08751f562

11
mod.php
View File

@ -78,7 +78,8 @@
// Dashboard // Dashboard
$fieldset = Array( $fieldset = Array(
'Boards' => '', 'Boards' => '',
'Administration' => '' 'Administration' => '',
'Logout' => ''
); );
// Boards // Boards
@ -103,6 +104,8 @@
$fieldset['Administration'] .= '<li><a href="?/config">Show configuration</a></li>'; $fieldset['Administration'] .= '<li><a href="?/config">Show configuration</a></li>';
} }
$fieldset['Logout'] .= '<li><a href="?/logout">Logout</a></li>';
// TODO: Statistics, etc, in the dashboard. // TODO: Statistics, etc, in the dashboard.
$body = ''; $body = '';
@ -118,6 +121,10 @@
//,'mod'=>true /* All 'mod' does, at this point, is put the "Return to dashboard" link in. */ //,'mod'=>true /* All 'mod' does, at this point, is put the "Return to dashboard" link in. */
) )
); );
} elseif(preg_match('/^\/logout$/', $query)) {
destroyCookies();
header('Location: ?/', true, $config['redirect_http']);
} elseif(preg_match('/^\/log$/', $query)) { } elseif(preg_match('/^\/log$/', $query)) {
if($mod['type'] < $config['mod']['modlog']) error($config['error']['noaccess']); if($mod['type'] < $config['mod']['modlog']) error($config['error']['noaccess']);
@ -698,7 +705,7 @@
'">'. $ban['ip'] . '</a></td>' . '">'. $ban['ip'] . '</a></td>' .
// Reason // Reason
'<td>' . ($ban['reason'] ? $ban['reason'] : '<em>none given</em>') . '</td>' . '<td>' . ($ban['reason'] ? $ban['reason'] : '<em>-</em>') . '</td>' .
// Set // Set
'<td style="white-space: nowrap">' . date($config['post_date'], $ban['set']) . '</td>' . '<td style="white-space: nowrap">' . date($config['post_date'], $ban['set']) . '</td>' .