> This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with this program. If not, see . */ include_once('config.php'); $menu=''; // Additional menu items depending on privileges/just being logged in $unreadmsgs=''; if(isset($_COOKIE['PHPSESSID'])) // TODO: See if there's a better way to check if there is a session to resume { session_start(); if(isset($_SESSION['id'])) { include_once('db.php'); $res=mysqli_query($db, 'select privileges, status from users where id='.(int)$_SESSION['id']); $res=mysqli_fetch_row($res); if($res[1]==ACCOUNT_BANNED) { print('Banned'); // TODO: Put this nicely? session_destroy(); exit(); } $privileges=$res[0]; if($privileges>0){$menu.='Administration';} // Check for unread messages $res=mysqli_query($db, 'select id from messages where user='.(int)$_SESSION['id'].' and !msgread limit 1'); if(mysqli_num_rows($res)>0){$unreadmsgs=' class="highlight"';} } } $loginlink=BASEURL.'/login?returnto='.urlencode($_SERVER['REQUEST_URI']); $logoutlink=BASEURL.'/logout?returnto='.urlencode($_SERVER['REQUEST_URI']); $search=htmlentities(isset($_GET['q'])?$_GET['q']:''); ?> <?=NODENAME?>