本文整理汇总了PHP中AuthManager::getAllAuths方法的典型用法代码示例。如果您正苦于以下问题:PHP AuthManager::getAllAuths方法的具体用法?PHP AuthManager::getAllAuths怎么用?PHP AuthManager::getAllAuths使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AuthManager
的用法示例。
在下文中一共展示了AuthManager::getAllAuths方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: indexAction
public function indexAction()
{
$authManager = new AuthManager();
$auths = $authManager->getAllAuths();
$this->view->messages = $this->getZendFlashMessenger()->getMessages();
$this->view->auths = $auths;
}
示例2: getRelatedFromPolicy
public static function getRelatedFromPolicy(Policy $policy)
{
$ret = array();
$authm = new AuthManager();
$apim = new ApiManager();
$allAuths = $authm->getAllAuths(true);
$relatedAuthIds = array();
$relatedAuths = array();
$authPropsArr = array();
$allApis = $apim->getAllApis(true);
$relatedApiIds = array();
$relatedApis = array();
$apiPropsArr = array();
foreach ($allAuths as $auth) {
/**
* @var $auth Auth
*/
foreach ($policy->getAuthIds() as $authBucket) {
if ($authBucket->getAuthIds() && in_array($auth->getId(), $authBucket->getAuthIds())) {
$relatedAuths[] = $auth;
}
}
}
foreach ($relatedAuths as $auth) {
$props = $auth->getProperties();
if (!empty($props)) {
$authPropsArr[$auth->getId()] = array_keys($props);
}
}
$relatedApiIds = $policy->getApiIds();
foreach ($allApis as $api) {
/**
* @var $api Api
*/
if (in_array($api->getId(), $relatedApiIds)) {
$relatedApis[] = $api;
}
}
foreach ($relatedApis as $api) {
$props = $api->getProperties();
if (!empty($props)) {
if ($api->getDisplayName()) {
$apiPropsArr[$api->getDisplayName()] = array_keys($props);
} else {
$apiPropsArr[$api->getId()] = array_keys($props);
}
}
}
if (!empty($authPropsArr)) {
$ret["auth"] = $authPropsArr;
}
if (!empty($apiPropsArr)) {
$ret["api"] = $apiPropsArr;
}
return json_encode($ret);
}
示例3: getAllAuths
/**
* Gets all Auths or returns false on error
*
* @return array(Auth)|bool
*/
public function getAllAuths()
{
$manager = new AuthManager();
try {
return $manager->getAllAuths();
} catch (Exception $e) {
$this->error($e);
}
return false;
}