Пример #1
0
        $query = "SELECT seminar_id FROM archiv WHERE archiv_protected_file_id = ?";
        $statement = DBManager::get()->prepare($query);
        $statement->execute(array($file_id));
        $archiv_seminar_id = $statement->fetchColumn();
        if ($archiv_seminar_id) {
            $no_access = !in_array(archiv_check_perm($archiv_seminar_id), words('tutor dozent admin'));
        }
    }
}
//download bibliography
if ($type == 5) {
    $range_id = Request::option('range_id');
    $list_id = Request::option('list_id');
    if ($range_id == $user->id || $perm->have_studip_perm('tutor', $range_id)) {
        $no_access = false;
        $the_data = StudipLitList::GetTabbedList($range_id, $list_id);
    }
}
//download ad hoc created files, always allowed
if (in_array($type, array(2, 3, 4))) {
    $no_access = false;
}
//if download not allowed throw exception to terminate script
if ($no_access) {
    // redirect to login page if user is not logged in
    $auth->login_if($auth->auth['uid'] == 'nobody');
    throw new AccessDeniedException(_("Sie haben keine Zugriffsberechtigung für diesen Download!"));
}
switch ($type) {
    //We want to download from the archive (this mode performs perm checks)
    case 1: