当前位置: 首页>>代码示例>>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;未经允许,请勿转载。