Example #1
0
$dwoo_data->assign('styles', explode(':', KU_MENUSTYLES));
$tpl_links = '';
if (!$manage_class->ValidateSession(true)) {
    $tpl_links .= '<li><a href="' . KU_WEBFOLDER . '" target="_top">' . _gettext('Home') . '</a></li>' . "\n";
    $tpl_links .= '<li><a href="manage_page.php">' . ucfirst(_gettext('log in')) . '</a></li>';
} else {
    $manage_postpassword = md5_encrypt($_SESSION['manageusername'], KU_RANDOMSEED);
    $tpl_links .= _gettext('Welcome') . ', <strong>' . $_SESSION['manageusername'] . '</strong>';
    if ($_SESSION['manageusername'] == 'admin') {
        $salt = $tc_db->GetOne("SELECT `salt` FROM " . KU_DBPREFIX . "staff WHERE `username` = " . $tc_db->qstr($_SESSION['manageusername']));
        if ($_SESSION['managepassword'] == md5('admin' . $salt)) {
            $tpl_links .= '<br /><strong><font color="red">' . _gettext('NOTICE: You are using the default administrator account. Anyone can log in to this account, so a second administrator account needs to be created. Create another, log in to it, and delete this one.') . '</font></strong>';
        }
    }
    $tpl_links .= '<br />' . _gettext('Staff rights') . ': <strong>';
    if ($manage_class->CurrentUserIsAdministrator()) {
        $tpl_links .= _gettext('Administrator');
    } elseif ($manage_class->CurrentUserIsModerator()) {
        $tpl_links .= _gettext('Moderator');
    } else {
        $tpl_links .= _gettext('Janitor');
    }
    $tpl_links .= "</strong>";
    $tpl_links .= '<li><a href="' . KU_WEBFOLDER . '" target="_top">' . _gettext('Home') . '</a></li>' . "\n";
    $tpl_links .= '<li><a href="manage_page.php?action=logout">' . _gettext('Log out') . '</a></li>
	<li><span id="postingpassword"><a id="showpwd" href="#" onclick="javascript:document.getElementById(\'postingpassword\').innerHTML = \'<input type=text id=postingpasswordbox value=' . $manage_postpassword . '>\'; document.getElementById(\'postingpasswordbox\').select(); return false;">' . _gettext('Show Posting Password') . '</a></span></li></ul>';
    // Home
    $tpl_links .= section_html(_gettext('Home'), 'home') . '<ul>
	<li><a href="manage_page.php?">' . _gettext('View Announcements') . '</a></li>
	<li><a href="manage_page.php?action=posting_rates">' . _gettext('Posting rates (past hour)') . '</a></li>
	<li><a href="manage_page.php?action=statistics">' . _gettext('Statistics') . '</a></li>';