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


PHP QApplication::objUserAccount方法代碼示例

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


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

示例1: array

<?php

require_once '../includes/prepend.inc.php';
// Check that the user is properly authenticated
if (!isset($_SESSION['intUserAccountId'])) {
    // authenticate error
    QApplication::Redirect('./index.php');
} else {
    QApplication::$objUserAccount = UserAccount::Load($_SESSION['intUserAccountId']);
}
$strWarning = "";
$arrCheckedAssetCode = "";
$strJavaScriptCode = "";
if ($_POST && $_POST['method'] == 'complete_transaction') {
    /*
    Run error checking on the array of asset codes and the destination location
    If there are no errors, then you will add the transaction to the database.
    	That will include an entry in the Transaction and Asset Transaction table.
    	You will also have to change the asset.location_id to the destination location
    */
    $arrAssetCode = array_unique(explode('#', $_POST['result']));
    $blnError = false;
    $arrCheckedAssetCode = array();
    foreach ($arrAssetCode as $strAssetCode) {
        if ($strAssetCode) {
            // Begin error checking
            $objNewAsset = Asset::LoadByAssetCode($strAssetCode);
            if (!$objNewAsset instanceof Asset) {
                $blnError = true;
                $strWarning .= $strAssetCode . " - That asset code does not exist.<br />";
            } elseif ($objNewAsset->LocationId == 2) {
開發者ID:heshuai64,項目名稱:einv2,代碼行數:31,代碼來源:asset_checkout.php

示例2: Authenticate

 public static function Authenticate($intModuleId = null)
 {
     // If logins have been disabled for this site, log the user out
     if (QApplication::$TracmorSettings->DisableLogins) {
         QApplication::Logout();
     }
     if (array_key_exists('intUserAccountId', $_SESSION)) {
         $objUserAccount = UserAccount::Load($_SESSION['intUserAccountId']);
         if ($objUserAccount) {
             // Assign the UserAccount object to the globally available QApplication
             QApplication::$objUserAccount = $objUserAccount;
             // If they are not in the admin panel
             if ($intModuleId) {
                 $objRoleModule = RoleModule::LoadByRoleIdModuleId($objUserAccount->RoleId, $intModuleId);
                 // If they do not have access to this module
                 if (!$objRoleModule->AccessFlag) {
                     QApplication::Redirect('../common/trespass.php');
                 } else {
                     QApplication::$objRoleModule = $objRoleModule;
                 }
             } elseif (!$objUserAccount->AdminFlag) {
                 QApplication::Redirect('../common/trespass.php');
             }
         } else {
             QApplication::Redirect('../common/trespass.php');
         }
     } else {
         QApplication::Redirect('../login.php?strReferer=' . urlencode(QApplication::$RequestUri));
     }
 }
開發者ID:jdellinger,項目名稱:tracmor,代碼行數:30,代碼來源:QApplication.class.php

示例3: Authenticate

 public static function Authenticate($intModuleId = null)
 {
     if (array_key_exists('intUserAccountId', $_SESSION)) {
         $objUserAccount = UserAccount::Load($_SESSION['intUserAccountId']);
         if ($objUserAccount) {
             // Assign the UserAccount object to the globally available QApplication
             QApplication::$objUserAccount = $objUserAccount;
             // If they are not in the admin panel
             if ($intModuleId) {
                 $objRoleModule = RoleModule::LoadByRoleIdModuleId($objUserAccount->RoleId, $intModuleId);
                 // If they do not have access to this module
                 if (!$objRoleModule->AccessFlag) {
                     QApplication::Redirect('../common/trespass.php');
                 } else {
                     QApplication::$objRoleModule = $objRoleModule;
                 }
             } elseif (!$objUserAccount->AdminFlag) {
                 QApplication::Redirect('../common/trespass.php');
             }
         } else {
             QApplication::Redirect('../common/trespass.php');
         }
     } else {
         QApplication::Redirect('../login.php');
     }
 }
開發者ID:heshuai64,項目名稱:einv2,代碼行數:26,代碼來源:prepend.inc.php


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