<?php // include needed files; update the include path to find the libraries $paths = array(get_include_path(), '/usr/lib/abet1', '/usr/local/lib/abet1'); set_include_path(implode(PATH_SEPARATOR, $paths)); require_once 'abet1-login.php'; // check authentication; if none found then redirect to the login page if (!abet_is_authenticated()) { header('Location: /login.php'); // returns 302 to client exit; } ?> <!DOCTYPE html> <html> <head> <title>ABET</title> <script src="scripts/jquery.min.js" type="text/javascript"></script> <script src="scripts/jquery-ui.min.js" type="text/javascript"></script> <script src="scripts/abet.js" type="text/javascript"></script> <script src="scripts/home.js" type="text/javascript"></script> <script src="scripts/profile.js" type="text/javascript"></script> <script src="scripts/navigation.js" type="text/javascript"></script> <script src="scripts/content.js" type="text/javascript"></script> <script src="scripts/rubric.js" type="text/javascript"></script> <script src="scripts/worksheet.js" type="text/javascript"></script> <script src="scripts/search.js" type="text/javascript"></script> <script src="scripts/tree.js" type="text/javascript"></script> <script src="scripts/confirm.js" type="text/javascript"></script> <?php if (abet_is_admin_authenticated()) {
function abet_update_username() { if (abet_is_authenticated()) { // query username for user id $userName = (new Query(new QueryBuilder(SELECT_QUERY, array('tables' => array('userprofile' => 'username'), 'where' => "userprofile.id = {$_SESSION['id']}"))))->get_row_ordered()[0]; $_SESSION['username'] = $userName; } }