本文整理匯總了PHP中OA_Permission::hasAccess方法的典型用法代碼示例。如果您正苦於以下問題:PHP OA_Permission::hasAccess方法的具體用法?PHP OA_Permission::hasAccess怎麽用?PHP OA_Permission::hasAccess使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類OA_Permission
的用法示例。
在下文中一共展示了OA_Permission::hasAccess方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: foreach
foreach (array_keys($aManagers) as $key) {
$agency = $aManagers[$key];
echo "\t\t\t\t<tr height='25' " . ($i % 2 == 0 ? "bgcolor='#F6F6F6'" : "") . ">\n";
// Icon & name
echo "\t\t\t\t\t<td height='25'>\n";
echo "\t\t\t\t\t\t<img src='" . OX::assetPath() . "/images/spacer.gif' height='16' width='16' align='absmiddle'>\n";
echo "\t\t\t\t\t\t<img src='" . OX::assetPath() . "/images/icon-advertiser.gif' align='absmiddle'>\n";
echo "\t\t\t\t\t\t<a href='agency-edit.php?agencyid=" . $agency['agencyid'] . "'>" . htmlspecialchars($agency['name']) . "</a>\n";
echo "\t\t\t\t\t</td>\n";
// ID
echo "\t\t\t\t\t<td height='25'>" . $agency['agencyid'] . "</td>\n";
echo "\t\t\t\t\t<td height='25'> </td>\n";
echo "\t\t\t\t\t<td height='25'> </td>\n";
// Button - Channels
echo "<td height='25'>";
if (OA_Permission::hasAccess($agency['account_id'])) {
echo "<a href='account-switch.php?account_id={$agency['account_id']}'>";
echo $strSwitchAccount . "</a> ";
} else {
echo " ";
}
echo "</td>";
// Delete
echo "\t\t\t\t\t<td height='25'>";
echo "<img src='" . OX::assetPath() . "/images/icon-recycle.gif' border='0' align='absmiddle' alt='{$strDelete}'> <a href='agency-delete.php?token=" . urlencode(phpAds_SessionGetToken()) . "&agencyid=" . $agency['agencyid'] . "&returnurl=agency-index.php'" . phpAds_DelConfirm($strConfirmDeleteAgency) . ">{$strDelete}</a> ";
echo "</td>\n";
echo "\t\t\t\t</tr>\n";
echo "\t\t\t\t<tr height='1'>\n";
echo "\t\t\t\t\t<td colspan='6' bgcolor='#888888'><img src='" . OX::assetPath() . "/images/break.gif' height='1' width='100%'></td>\n";
echo "\t\t\t\t</tr>\n";
$i++;
示例2: attemptToSwitchForAccess
function attemptToSwitchForAccess($entityTable, $entityId)
{
if (!($userId = OA_Permission::getUserId())) {
return false;
}
$doEntity = OA_Dal::staticGetDO($entityTable, $entityId);
if ($doEntity) {
$aAccountIds = $doEntity->getOwningAccountIds();
foreach ($aAccountIds as $accountId) {
if (OA_Permission::hasAccess($accountId)) {
OA_Permission::switchAccount($accountId, $hasAccess = true);
return true;
}
}
if (OA_Permission::isUserLinkedToAdmin()) {
$accountId = $doEntity->getRootAccountId();
OA_Permission::switchAccount($accountId, $hasAccess = true);
return true;
}
}
return false;
}