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


PHP Authentication::setIdle方法代碼示例

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


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

示例1: header

    header('Cache-Control: max-age=0');
    header('Pragma: public');
}
//Do not overwrite a previously sent content-type header, this breaks WAP.
if (!isset($enable_wap)) {
    header('Content-Type: text/html; charset=UTF-8');
}
$permission = new Permission();
$authentication = new Authentication();
if (isset($authenticate) and $authenticate === FALSE) {
    Debug::text('Bypassing Authentication', __FILE__, __LINE__, __METHOD__, 10);
    TTi18n::chooseBestLocale();
} else {
    //Increase timeout on WAP devices, so they don't have to login as often.
    if (isset($enable_wap) and $enable_wap == TRUE) {
        $authentication->setIdle(32400);
        //9hrs
    } elseif (isset($config_vars['other']['web_session_timeout']) and $config_vars['other']['web_session_timeout'] != '') {
        $authentication->setIdle((int) $config_vars['other']['web_session_timeout']);
    }
    if ($authentication->Check() === TRUE) {
        /*
         * Get default interface data here. Things like User info, Company info etc...
         */
        $current_user = $authentication->getObject();
        Debug::text('User Authenticated: ' . $current_user->getUserName() . ' Created Date: ' . $authentication->getCreatedDate(), __FILE__, __LINE__, __METHOD__, 10);
        $clf = new CompanyListFactory();
        $current_company = $clf->getByID($current_user->getCompany())->getCurrent();
        unset($clf);
        //Check to make sure the logged in user's information is all up to date.
        //Make sure they also have permissions to edit information, otherwise don't redirect them.
開發者ID:J-P-Hanafin,項目名稱:TimeTrex-1,代碼行數:31,代碼來源:Interface.inc.php

示例2: isLoggedIn

 function isLoggedIn($touch_updated_date = TRUE)
 {
     global $authentication, $config_vars;
     $session_id = getSessionID();
     if ($session_id != '') {
         $authentication = new Authentication();
         Debug::text('AMF Session ID: ' . $session_id . ' Source IP: ' . $_SERVER['REMOTE_ADDR'], __FILE__, __LINE__, __METHOD__, 10);
         if (isset($config_vars['other']['web_session_timeout']) and $config_vars['other']['web_session_timeout'] != '') {
             $authentication->setIdle((int) $config_vars['other']['web_session_timeout']);
         }
         if ($authentication->Check($session_id, $touch_updated_date) === TRUE) {
             return TRUE;
         }
     }
     return FALSE;
 }
開發者ID:alachaum,項目名稱:timetrex,代碼行數:16,代碼來源:APIAuthentication.class.php


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