Skip to content
Snippets Groups Projects
Select Git revision
  • 244a6ac9e03eab7a139afb5b72b74d4b1b4e3b6d
  • main default protected
  • studip-rector
  • ci-opt
  • course-members-export-as-word
  • data-vue-app
  • pipeline-improvements
  • webpack-optimizations
  • rector
  • icon-renewal
  • http-client-and-factories
  • jsonapi-atomic-operations
  • vueify-messages
  • tic-2341
  • 135-translatable-study-areas
  • extensible-sorm-action-parameters
  • sorm-configuration-trait
  • jsonapi-mvv-routes
  • docblocks-for-magic-methods
19 results

document.php

Blame
  • Forked from Stud.IP / Stud.IP
    3515 commits behind, 172 commits ahead of the upstream repository.
    user avatar
    Jan-Hendrik Willms authored
    a3da1483
    History
    Code owners
    Assign users and groups as approvers for specific file changes. Learn more.
    document.php 912 B
    <?php
    /**
    * document.php - compatibility for old download links
    *
    * This controller contains actions related to single files.
    *
    * This program is free software; you can redistribute it and/or
    * modify it under the terms of the GNU General Public License as
    * published by the Free Software Foundation; either version 2 of
    * the License, or (at your option) any later version.
    *
    * @author      André Noack <noack@data-quest.de>
    * @license     http://www.gnu.org/licenses/gpl-2.0.html GPL version 2
    * @category    Stud.IP
    */
    class DocumentController extends StudipController
    {
        function download_action($file_ref_id, $disposition = 'attachment')
        {
            $file_ref = FileRef::find($file_ref_id);
            if ($file_ref) {
                $this->redirect($file_ref->getDownloadURL($disposition === 'inline' ? 'normal' : 'force'));
            } else {
                throw new Trails_Exception(404);
            }
        }
    }