当前位置: 首页>>代码示例>>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;未经允许,请勿转载。