本文整理汇总了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;
}