本文整理汇总了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) {
示例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));
}
}
示例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');
}
}