} } foreach ($_POST["acl"] as $key => $value) { $acl[$key] = $value; } foreach ($_POST["acltab"] as $key => $value) { $acltab[$key] = $value; } foreach ($_POST["aclattr"] as $key => $value) { $aclattr[$key] = $value; } setAcl($_GET["user"], createAclString($acl, $acltab, $aclattr)); if (!isXMLRPCError()) { new NotifyWidgetSuccess(_("User ACLs successfully modified.")); } $aclString = getAcl($_GET["user"]); list($acl, $acltab, $aclattr) = createAclArray($aclString); } elseif (isset($_POST["bgetacl"])) { ob_end_clean(); header("Pragma: "); header("Cache-Control: "); header("Content-type: text/txt"); header('Content-Disposition: attachment; filename="' . $_GET["user"] . '-acl.txt"'); print $aclString; exit; } function createAclAttrTemplate($module_name, $aclattr, $form) { global $aclArray; $rowNum = 1; if (!empty($aclArray[$module_name])) {
<?php $_SESSION["login"] = $login; $_SESSION["pass"] = $pass; /* Set session expiration time */ $_SESSION["expire"] = time() + 90 * 60; if (isset($_POST["lang"])) { $lang = $_POST["lang"]; } if (isset($_GET["lang"])) { $lang = $_GET["lang"]; } $_SESSION['lang'] = $lang; setcookie('lang', $lang, time() + 3600 * 24 * 30); list($_SESSION["acl"], $_SESSION["acltab"], $_SESSION["aclattr"]) = createAclArray(getAcl($login)); /* Register agent module list */ $_SESSION["supportModList"] = array(); $list = xmlCall("base.getModList", null); if (is_array($list)) { sort($list); $_SESSION["supportModList"] = $list; } /* Register module version */ $_SESSION["modListVersion"]['rev'] = xmlCall("getRevision", null); $_SESSION["modListVersion"]['ver'] = xmlCall("getVersion", null); /* Make the comnpany logo effect */ $_SESSION["doeffect"] = True;
// Is the community viewable that topics //------------------------------------------------------------ $t->diag('Is the community viewable that topics'); // * public_flag: auth_commu_member // * topic_authority: admin_only $t->diag('public_flag: auth_commu_member, topic_authority: admin_only'); $acl = getAcl($communities[0]); $t->cmp_ok($acl->isAllowed(1, null, 'view'), '===', true, 'returns true for the community admin'); $t->cmp_ok($acl->isAllowed(3, null, 'view'), '===', true, 'returns true for a community member'); $t->cmp_ok($acl->isAllowed(4, null, 'view'), '===', false, 'returns false for a non-community member'); // * public_flag: public // * topic_authority: admin_only $t->diag('public_flag: public, topic_authority: admin_only'); $acl = getAcl($communities[1]); $t->cmp_ok($acl->isAllowed(1, null, 'view'), '===', true, 'returns true for the community admin'); $t->cmp_ok($acl->isAllowed(3, null, 'view'), '===', true, 'returns true for a community member'); $t->cmp_ok($acl->isAllowed(4, null, 'view'), '===', true, 'returns true for a non-community member'); // * public_flag: auth_commu_member // * topic_authority: public $t->diag('public_flag: auth_commu_member, topic_authority: public'); $acl = getAcl($communities[2]); $t->cmp_ok($acl->isAllowed(1, null, 'view'), '===', true, 'returns true for the community admin'); $t->cmp_ok($acl->isAllowed(3, null, 'view'), '===', true, 'returns true for a community member'); $t->cmp_ok($acl->isAllowed(4, null, 'view'), '===', false, 'returns false for a non-community member'); // * public_flag: public // * topic_authority: public $t->diag('public_flag: public, topic_authority: public'); $acl = getAcl($communities[3]); $t->cmp_ok($acl->isAllowed(1, null, 'view'), '===', true, 'returns true for the community admin'); $t->cmp_ok($acl->isAllowed(3, null, 'view'), '===', true, 'returns true for a community member'); $t->cmp_ok($acl->isAllowed(4, null, 'view'), '===', true, 'returns true for a non-community member');