Пример #1
0
function checkPublicForumPerm_old($role, $id_forum)
{
    if (checkPerm('mod', true)) {
        return true;
    }
    $res = false;
    $role_id = "";
    $user =& $GLOBALS['current_user'];
    $acl = new DoceboACL();
    $role_id = '/lms/course/public/public_forum/' . $id_forum . '/' . $role;
    if ($role_id !== "" && $acl->getRoleST($role_id) != false) {
        $res = $user->matchUserRole($role_id);
    }
    return $res;
}
Пример #2
0
 function checkWikiPerm($wiki_id, $perm, $return_res = FALSE)
 {
     $res = FALSE;
     $user =& $GLOBALS['current_user'];
     $acl = new DoceboACL();
     $role_id = "/framework/wiki/" . $wiki_id . "/" . $perm;
     if ($role_id != "" && $acl->getRoleST($role_id) != FALSE) {
         $res = $user->matchUserRole($role_id);
     }
     if ($return_res) {
         return $res;
     } else {
         if (!$res) {
             die("You can't access!");
         }
     }
 }