Пример #1
0
    protected function getRequestFiles($permission = 'canViewFileInFileManager') {
        $files = array();
        if (is_array($_REQUEST['fID'])) {
            $fileIDs = $_REQUEST['fID'];
        } else {
            $fileIDs[] = $_REQUEST['fID'];
        }
        foreach($fileIDs as $fID) {
            $f = ConcreteFile::getByID($fID);
            $fp = new ConcretePermissions($f);
            if ($fp->$permission()) {
                $files[] = $f;
            }
        }

        if (count($files) == 0) {
            throw new Exception(t("Access Denied."));
        }

        return $files;
    }
Пример #2
0
 protected function getRequestFiles($permission = 'canViewFileInFileManager')
 {
     $files = array();
     if (is_array($_REQUEST['fID'])) {
         $fileIDs = $_REQUEST['fID'];
     } else {
         $fileIDs[] = $_REQUEST['fID'];
     }
     foreach ($fileIDs as $fID) {
         $f = ConcreteFile::getByID($fID);
         $fp = new ConcretePermissions($f);
         if ($fp->{$permission}()) {
             $files[] = $f;
         }
     }
     if (count($files) == 0) {
         Core::make('helper/ajax')->sendError(t('File not found.'));
     }
     return $files;
 }