當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Ticket_User::get_username_from_id方法代碼示例

本文整理匯總了PHP中Ticket_User::get_username_from_id方法的典型用法代碼示例。如果您正苦於以下問題:PHP Ticket_User::get_username_from_id方法的具體用法?PHP Ticket_User::get_username_from_id怎麽用?PHP Ticket_User::get_username_from_id使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Ticket_User的用法示例。


在下文中一共展示了Ticket_User::get_username_from_id方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: dashboard

/**
* This function is beign used to load info that's needed for the dashboard page.
* check if the person who wants to view this page is a mod/admin, if this is not the case, he will be redirected to an error page.
* next it will fetch a lot of information regarding to the status of the ticket system (eg return the total amount of tickets) and return this information so
* it can be used by the template.
* @author Daan Janssens, mentored by Matthew Lagoe
*/
function dashboard()
{
    //if logged in
    if (WebUsers::isLoggedIn()) {
        //is Mod
        if (ticket_user::isMod(unserialize($_SESSION['ticket_user']))) {
            //return useful information about the status of the ticket system.
            $result['user_id'] = unserialize($_SESSION['ticket_user'])->getTUserId();
            $result['nrToDo'] = Ticket_Queue_Handler::getNrOfTicketsToDo(unserialize($_SESSION['ticket_user'])->getTUserId());
            $result['nrAssignedWaiting'] = Ticket_Queue_Handler::getNrOfTicketsAssignedWaiting(unserialize($_SESSION['ticket_user'])->getTUserId());
            $result['nrTotalTickets'] = Ticket_Queue_Handler::getNrOfTickets();
            $ticket = Ticket_Queue_Handler::getNewestTicket();
            $result['newestTicketId'] = $ticket->getTId();
            $result['newestTicketTitle'] = $ticket->getTitle();
            $result['newestTicketAuthor'] = Ticket_User::get_username_from_id($ticket->getAuthor());
            global $INGAME_WEBPATH;
            $result['ingame_webpath'] = $INGAME_WEBPATH;
            return $result;
        } else {
            //ERROR: No access!
            $_SESSION['error_code'] = "403";
            header("Cache-Control: max-age=1");
            header("Location: index.php?page=error");
            throw new SystemExit();
        }
    } else {
        //ERROR: not logged in!
        header("Cache-Control: max-age=1");
        header("Location: index.php");
        throw new SystemExit();
    }
}
開發者ID:cls1991,項目名稱:ryzomcore,代碼行數:39,代碼來源:dashboard.php


注:本文中的Ticket_User::get_username_from_id方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。