本文整理汇总了PHP中Acl::getAclGroupList方法的典型用法代码示例。如果您正苦于以下问题:PHP Acl::getAclGroupList方法的具体用法?PHP Acl::getAclGroupList怎么用?PHP Acl::getAclGroupList使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Acl
的用法示例。
在下文中一共展示了Acl::getAclGroupList方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getGroupList
private function getGroupList($tree_id)
{
if ($this->groupList) {
return $this->groupList;
}
$acl = new Acl();
$aclList = $acl->getAclGroupList($tree_id);
$this->groupList = array();
foreach ($aclList as $grp_id => $rights) {
if (!in_array(Acl::VIEW, $rights)) {
continue;
}
$this->groupList[] = $grp_id;
}
return $this->groupList;
}
示例2: notify
/**
* notifies users able to edit node id and with notify option enabled
* only users that are not frontend type are notified
*
* @param integer $tree_id node id that requests notification. Users with rights for this node will be notified
* @param string $subject subject of email message
* @param string $message content of notification email
*/
public function notify($tree_id = NULL, $subject, $message)
{
$searchcriteria = array('notify' => true);
$acl = new Acl();
$grouplist = $acl->getAclGroupList($tree_id);
$group = array();
foreach ($grouplist as $grp_id => $item) {
if (in_array(Acl::EDIT, $item) || in_array(Acl::CREATE, $item) || in_array(Acl::MODIFY, $item) || in_array(Acl::DELETE, $item)) {
$group[] = $grp_id;
}
}
if ($group) {
$searchcriteria['tree_access'] = $group;
} else {
$searchcriteria['role'] = self::ROLE_ADMIN;
}
$userlist = $this->getList($searchcriteria);
$mailto = array();
foreach ($userlist['data'] as $item) {
$mailto[] = $item['email'];
}
if (!$mailto) {
return;
}
$this->sendMail($mailto, $this->director->getConfig()->email_address, $subject, $message);
}
示例3: handleAdminEditRootAclGet
/**
* handle edit
*/
private function handleAdminEditRootAclGet($retrieveFields = true)
{
$template = new TemplateEngine($this->getPath() . "templates/" . $this->templateFile);
$request = Request::getInstance();
if (!$request->exists('id')) {
throw new Exception(__FUNCTION__ . ' Node ontbreekt.');
}
$id = intval($request->getValue('id'));
$template->setVariable('id', $id, false);
$key = array('id' => $id);
// check if node exists
if ($id != $this->tree->getRootId()) {
throw new HttpException('403');
}
$this->tree->setCurrentId($id);
$this->renderBreadcrumb();
// check if user has execute rights
$auth = Authentication::getInstance();
// edit root node only for acl. only admins can edit acl
if (!$auth->isRole(SystemUser::ROLE_ADMIN)) {
throw new HttpException('403');
}
$groupSelect = array();
if ($retrieveFields) {
$acl = new Acl();
$groupSelect = $acl->getAclGroupList($id);
} else {
$groupSelect = $request->getValue('acl');
}
if (!is_array($groupSelect)) {
$groupSelect = array();
}
$template->setVariable('groupSelect', $groupSelect, false);
$this->handleEdit($template, array());
$this->template[$this->director->theme->getConfig()->main_tag] = $template;
}
示例4: getUserCombo
private function getUserCombo($tree_id, $usr_id)
{
$acl = new Acl();
$aclList = $acl->getAclGroupList($tree_id);
$groupList = array();
foreach ($aclList as $grp_id => $rights) {
if (!in_array(Acl::VIEW, $rights)) {
continue;
}
$groupList[] = $grp_id;
}
$userList = $this->director->systemUser->getList(array('grp_id' => $groupList));
return Utils::getHtmlCombo($userList['data'], $usr_id, NULL, 'id', 'formatName');
}