本文整理匯總了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');
}
}