string('Administration Locations') => array( $lang->string('Home') => 'index.php', $lang->string('Logout') => '../login.php?do=cplogout' ), $lang->string('Options') => array( $lang->string('Bugdar Settings') => 'setting.php', $lang->string('Manage Languages') => 'language.php', $lang->string('Edit User Help') => 'userhelp.php' ), $lang->string('Bug Fields') => array( $lang->string('Products / Versions / Components') => 'product.php', $lang->string('Priorities') => 'priority.php', $lang->string('Resolutions') => 'resolution.php', $lang->string('Severities') => 'severity.php', $lang->string('Statuses') => 'status.php', $lang->string('Custom Bug Fields') => 'field.php', $lang->string('Automatic Actions') => 'autoaction.php' ), $lang->string('User Management') => array( $lang->string('Users') => 'user.php', $lang->string('Usergroups') => 'usergroup.php', $lang->string('Usergroup Permissions') => 'permission.php' ) ); // ################################################################### // continue loading $bugsys->load('printer', 'admin', true); $admin->set('realm', $lang->string('Administration')); $admin->set('page_start_hook', 'nav_hook'); $admin->css_link('../framework/printer.css.php'); // ################################################################### function admin_login() { global $admin, $bugsys; $admin->page_start('Login', '', 15, '', 'document.cplogin.' . (($bugsys->userinfo['email']) ? 'password' : 'email') . '.focus();'); $admin->form_start('../login.php', 'cplogin', false, 'cplogin'); $admin->table_start(true, '425'); $admin->table_head($bugsys->lang->string('Login to Bugdar')); $admin->row_input($bugsys->lang->string('Email'), 'email', $bugsys->userinfo['email'], 2, 35, false, false, 'middle'); $admin->row_input($bugsys->lang->string('Password'), 'password', '', 2, 35, false, true, 'middle'); $admin->row_submit('', $bugsys->lang->string('Login')); $admin->table_end(); $admin->form_end(); $admin->page_end(); } // ################################################################### $bugsys->userinfo['adminsession'] = false; if ($_COOKIE[COOKIE_PREFIX . 'adminsession']) { if (can_perform('canadminpanel')) { if (md5(md5($bugsys->userinfo['authkey']) . md5(gmdate('F j, Y @ H'))) != $_COOKIE[COOKIE_PREFIX . 'adminsession']) { $funct->cookie(COOKIE_PREFIX . 'adminsession', ''); admin_login(); // do we need this message? $admin->error($lang->string('Invalid admin session has been terminated.')); } else { // renew the cookie $funct->cookie(COOKIE_PREFIX . 'adminsession', md5(md5($bugsys->userinfo['authkey']) . md5(gmdate('F j, Y @ H'))), false); $bugsys->userinfo['adminsession'] = true; } } else { $funct->cookie(COOKIE_PREFIX . 'adminsession', ''); admin_login(); } } if (!$_COOKIE[COOKIE_PREFIX . 'adminsession']) { admin_login(); } // ################################################################### // TEMPORARY NAVIGATION SYSTEM function nav_hook() { global $globalnav, $bugsys; $location = parse_url($_SERVER['SCRIPT_URL']); $location['path'] = preg_quote(end(explode('/', $location['path']))); $location['path'] = ((!$location['path']) ? 'index.php' : $location['path']); echo "