當前位置: 首頁>>代碼示例>>PHP>>正文


PHP OA_Permission::hasAccess方法代碼示例

本文整理匯總了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'>&nbsp;</td>\n";
     echo "\t\t\t\t\t<td height='25'>&nbsp;</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>&nbsp;&nbsp;";
     } else {
         echo "&nbsp;";
     }
     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}'>&nbsp;<a href='agency-delete.php?token=" . urlencode(phpAds_SessionGetToken()) . "&agencyid=" . $agency['agencyid'] . "&returnurl=agency-index.php'" . phpAds_DelConfirm($strConfirmDeleteAgency) . ">{$strDelete}</a>&nbsp;&nbsp;&nbsp;&nbsp;";
     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++;
開發者ID:Spark-Eleven,項目名稱:revive-adserver,代碼行數:31,代碼來源:agency-index.php

示例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;
 }
開發者ID:villos,項目名稱:tree_admin,代碼行數:22,代碼來源:Permission.php


注:本文中的OA_Permission::hasAccess方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。