예제 #1
0
파일: file.php 프로젝트: JeRoNZ/concrete5-1
    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;
 }