This repository has been archived on 2025-05-24. You can view files and clone it, but cannot push or open issues or pull requests.
Files
qemudb/include/sidebar_login.php
2006-07-06 17:27:54 +00:00

49 lines
1.5 KiB
PHP

<?php
/*****************/
/* Login SideBar */
/*****************/
require_once(BASE."include/maintainer.php");
require_once(BASE."include/application.php");
require_once(BASE."include/user.php");
function global_sidebar_login() {
$g = new htmlmenu("User Menu");
if($_SESSION['current']->isLoggedIn())
{
$g->add("Logout", BASE."account.php?sCmd=logout");
$g->add("Preferences", BASE."preferences.php");
/* if this user maintains any applications list them */
/* in their sidebar */
$apps_user_maintains = getAppsFromUserId($_SESSION['current']->iUserId);
if($apps_user_maintains)
{
$g->addmisc("");
$g->addmisc("You maintain:\n");
while(list($index, list($appId, $versionId, $superMaintainer)) = each($apps_user_maintains))
{
if($superMaintainer)
$g->addmisc("<a href='".BASE."appview.php?iAppId=$appId'>".Application::lookup_name($appId)."*</a>", "center");
else
$g->addmisc("<a href='".BASE."appview.php?iVersionId=$versionId'>".Application::lookup_name($appId)." ".Version::lookup_name($versionId)."</a>", "center");
}
}
$appsRejected = $_SESSION['current']->getAllRejectedApps();
if($appsRejected)
$g->addmisc("<a href='".BASE."appsubmit.php?'>Review Rejected Apps</a>", "center");
}
else
{
$g->add("Login", BASE."account.php?sCmd=login");
}
$g->done();
}
?>