ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
ilFileSystemGUI Class Reference

File System Explorer GUI class. More...

+ Inheritance diagram for ilFileSystemGUI:
+ Collaboration diagram for ilFileSystemGUI:

Public Member Functions

 __construct ($a_main_directory)
 
 setAllowedSuffixes ($a_suffixes)
 Set allowed Suffixes. More...
 
 getAllowedSuffixes ()
 Get allowed Suffixes. More...
 
 setForbiddenSuffixes ($a_suffixes)
 Set forbidden Suffixes. More...
 
 getForbiddenSuffixes ()
 Get Accepted Suffixes. More...
 
 isValidSuffix ($a_suffix)
 Is suffix valid? More...
 
 setAllowDirectories ($a_val)
 Set allow directories. More...
 
 getAllowDirectories ()
 Get allow directories. More...
 
 setPostDirPath ($a_val)
 Set post dir path. More...
 
 getPostDirPath ()
 Get post dir path. More...
 
 setTableId ($a_val)
 Set table id. More...
 
 getTableId ()
 Get table id. More...
 
 setTitle ($a_val)
 Set title. More...
 
 getTitle ()
 Get title. More...
 
 setUseUploadDirectory ($a_val)
 Set use upload directory. More...
 
 getUseUploadDirectory ()
 Get use upload directory. More...
 
 getLastPerformedCommand ()
 Get performed command. More...
 
 executeCommand ()
 execute command More...
 
 addCommand (&$a_obj, $a_func, $a_name, $a_single=true, $a_allow_dir=false)
 Add command. More...
 
 clearCommands ()
 Clear commands. More...
 
 labelFile ($a_file, $a_label)
 label a file More...
 
 activateLabels ($a_act, $a_label_header)
 activate file labels More...
 
 extCommand ($a_nr)
 call external command More...
 
 setAllowDirectoryCreation ($a_val)
 Set allowed directory creation. More...
 
 getAllowDirectoryCreation ()
 Get allowed directory creation. More...
 
 setAllowFileCreation ($a_val)
 Set allowed file creation. More...
 
 getAllowFileCreation ()
 Get allowed file creation. More...
 
 listFiles ($a_table_gui=null)
 List files. More...
 
 getTable ($a_dir, $a_subdir)
 Get table. More...
 
 renameFileForm ($a_file)
 list files More...
 
 renameFile ()
 rename a file More...
 
 cancelRename ()
 cancel renaming a file More...
 
 createDirectory ()
 create directory More...
 
 uploadFile ()
 Upload file. More...
 
 confirmDeleteFile (array $a_files)
 Confirm file deletion. More...
 
 deleteFile ()
 delete object file More...
 
 unzipFile ($a_file=null)
 delete object file More...
 
 downloadFile ($a_file)
 delete object file More...
 
 getTabs (&$tabs_gui)
 get tabs More...
 
 getActionCommands ()
 
 defineCommands ()
 Define commands available. More...
 

Data Fields

 $ctrl
 
const CDIR = "cdir"
 

Protected Member Functions

 setPerformedCommand ($command, $pars="")
 Set performed command. More...
 
 parseCurrentDirectory ()
 
 getFileList ($a_dir, $a_subdir=null)
 
 getIncomingFiles ()
 

Protected Attributes

 $use_upload_directory = false
 
 $allowed_suffixes = array()
 
 $forbidden_suffixes = array()
 

Private Member Functions

 sanitizeCurrentDirectory ()
 

Detailed Description

File System Explorer GUI class.

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
Version
$Id$

Definition at line 12 of file class.ilFileSystemGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilFileSystemGUI::__construct (   $a_main_directory)

Definition at line 28 of file class.ilFileSystemGUI.php.

References $DIC, $ilCtrl, $lng, $tpl, defineCommands(), setAllowDirectories(), setAllowDirectoryCreation(), and setAllowFileCreation().

29  {
30  global $DIC;
31  $lng = $DIC['lng'];
32  $ilCtrl = $DIC['ilCtrl'];
33  $tpl = $DIC['tpl'];
34  $ilias = $DIC['ilias'];
35 
36  $this->ctrl = $ilCtrl;
37  $this->lng = $lng;
38  $this->ilias = $ilias;
39  $this->tpl = $tpl;
40  $this->main_dir = $a_main_directory;
41  $this->post_dir_path = false;
42 
43  $this->defineCommands();
44 
45  $this->file_labels = array();
46  $this->label_enable = false;
47  $this->ctrl->saveParameter($this, self::CDIR);
48  $lng->loadLanguageModule("content");
49  $this->setAllowDirectories(true);
50  $this->setAllowDirectoryCreation(true);
51  $this->setAllowFileCreation(true);
52  //echo "<br>main_dir:".$this->main_dir.":";
53  }
if(isset($_FILES['img_file']['size']) && $_FILES['img_file']['size'] > 0) $tpl
setAllowDirectories($a_val)
Set allow directories.
global $ilCtrl
Definition: ilias.php:18
$lng
redirection script todo: (a better solution should control the processing via a xml file) ...
setAllowDirectoryCreation($a_val)
Set allowed directory creation.
defineCommands()
Define commands available.
setAllowFileCreation($a_val)
Set allowed file creation.
$DIC
Definition: xapitoken.php:46
+ Here is the call graph for this function:

Member Function Documentation

◆ activateLabels()

ilFileSystemGUI::activateLabels (   $a_act,
  $a_label_header 
)

activate file labels

Definition at line 308 of file class.ilFileSystemGUI.php.

Referenced by ilObjFileBasedLMGUI\executeCommand().

309  {
310  $this->label_enable = $a_act;
311  $this->label_header = $a_label_header;
312  }
+ Here is the caller graph for this function:

◆ addCommand()

ilFileSystemGUI::addCommand ( $a_obj,
  $a_func,
  $a_name,
  $a_single = true,
  $a_allow_dir = false 
)

Add command.

Definition at line 271 of file class.ilFileSystemGUI.php.

References $i.

277  {
278  $i = count($this->commands);
279 
280  $this->commands[$i]["object"] = $a_obj;
281  $this->commands[$i]["method"] = $a_func;
282  $this->commands[$i]["name"] = $a_name;
283  $this->commands[$i]["single"] = $a_single;
284  $this->commands[$i]["allow_dir"] = $a_allow_dir;
285 
286  //$this->commands[] = $arr;
287  }
$i
Definition: metadata.php:24

◆ cancelRename()

ilFileSystemGUI::cancelRename ( )

cancel renaming a file

Definition at line 667 of file class.ilFileSystemGUI.php.

668  {
669  $this->ctrl->redirect($this, "listFiles");
670  }

◆ clearCommands()

ilFileSystemGUI::clearCommands ( )

Clear commands.

Definition at line 292 of file class.ilFileSystemGUI.php.

293  {
294  $this->commands = array();
295  }

◆ confirmDeleteFile()

ilFileSystemGUI::confirmDeleteFile ( array  $a_files)

Confirm file deletion.

Definition at line 785 of file class.ilFileSystemGUI.php.

References $DIC, $i, $ilCtrl, $lng, and $tpl.

786  {
787  global $DIC;
788  $ilCtrl = $DIC['ilCtrl'];
789  $tpl = $DIC['tpl'];
790  $lng = $DIC['lng'];
791 
792  include_once("./Services/Utilities/classes/class.ilConfirmationGUI.php");
793  $cgui = new ilConfirmationGUI();
794  $cgui->setFormAction($ilCtrl->getFormAction($this));
795  $cgui->setHeaderText($lng->txt("info_delete_sure"));
796  $cgui->setCancel($lng->txt("cancel"), "listFiles");
797  $cgui->setConfirm($lng->txt("delete"), "deleteFile");
798 
799  foreach ($a_files as $i) {
800  $cgui->addItem("file[]", $i, $i);
801  }
802 
803  $tpl->setContent($cgui->getHTML());
804  }
if(isset($_FILES['img_file']['size']) && $_FILES['img_file']['size'] > 0) $tpl
global $ilCtrl
Definition: ilias.php:18
$lng
$DIC
Definition: xapitoken.php:46
$i
Definition: metadata.php:24
Confirmation screen class.

◆ createDirectory()

ilFileSystemGUI::createDirectory ( )

create directory

Definition at line 675 of file class.ilFileSystemGUI.php.

References $_POST, $DIC, $lng, ilUtil\makeDir(), sanitizeCurrentDirectory(), ilUtil\sendFailure(), setPerformedCommand(), and ilUtil\stripSlashes().

676  {
677  global $DIC;
678  $lng = $DIC['lng'];
679 
680  // determine directory
681  $cur_subdir = $this->sanitizeCurrentDirectory();
682  $cur_dir = (!empty($cur_subdir))
683  ? $this->main_dir . "/" . $cur_subdir
684  : $this->main_dir;
685 
686  $new_dir = str_replace(".", "", ilUtil::stripSlashes($_POST["new_dir"]));
687  $new_dir = str_replace("/", "", $new_dir);
688 
689  if (!empty($new_dir)) {
690  ilUtil::makeDir($cur_dir . "/" . $new_dir);
691  if (is_dir($cur_dir . "/" . $new_dir)) {
692  ilUtil::sendSuccess($lng->txt("cont_dir_created"), true);
693  $this->setPerformedCommand("create_dir", array("name" => $new_dir));
694  }
695  } else {
696  ilUtil::sendFailure($lng->txt("cont_enter_a_dir_name"), true);
697  }
698  $this->ctrl->saveParameter($this, self::CDIR);
699  $this->ctrl->redirect($this, 'listFiles');
700  }
$lng
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
static makeDir($a_dir)
creates a new directory and inherits all filesystem permissions of the parent directory You may pass ...
$DIC
Definition: xapitoken.php:46
setPerformedCommand($command, $pars="")
Set performed command.
$_POST["username"]
+ Here is the call graph for this function:

◆ defineCommands()

ilFileSystemGUI::defineCommands ( )

Define commands available.

Definition at line 983 of file class.ilFileSystemGUI.php.

Referenced by __construct().

984  {
985  $this->commands = array(
986  0 => array(
987  "object" => $this,
988  "method" => "downloadFile",
989  "name" => $this->lng->txt("download"),
990  "int" => true,
991  "single" => true
992  ),
993  1 => array(
994  "object" => $this,
995  "method" => "confirmDeleteFile",
996  "name" => $this->lng->txt("delete"),
997  "allow_dir" => true,
998  "int" => true
999  ),
1000  2 => array(
1001  "object" => $this,
1002  "method" => "unzipFile",
1003  "name" => $this->lng->txt("unzip"),
1004  "int" => true,
1005  "single" => true
1006  ),
1007  3 => array(
1008  "object" => $this,
1009  "method" => "renameFileForm",
1010  "name" => $this->lng->txt("rename"),
1011  "allow_dir" => true,
1012  "int" => true,
1013  "single" => true
1014  ),
1015  );
1016  }
+ Here is the caller graph for this function:

◆ deleteFile()

ilFileSystemGUI::deleteFile ( )

delete object file

Definition at line 809 of file class.ilFileSystemGUI.php.

References $_POST, $DIC, $lng, ilUtil\delDir(), sanitizeCurrentDirectory(), setPerformedCommand(), and ilUtil\stripSlashes().

810  {
811  global $DIC;
812  $lng = $DIC['lng'];
813 
814  if (!isset($_POST["file"])) {
815  $this->ilias->raiseError($this->lng->txt("no_checkbox"), $this->ilias->error_obj->MESSAGE);
816  }
817 
818  foreach ($_POST["file"] as $post_file) {
819  if (ilUtil::stripSlashes($post_file) == "..") {
820  $this->ilias->raiseError($this->lng->txt("no_checkbox"), $this->ilias->error_obj->MESSAGE);
821  break;
822  }
823 
824  $cur_subdir = $this->sanitizeCurrentDirectory();
825  $cur_dir = (!empty($cur_subdir))
826  ? $this->main_dir . "/" . $cur_subdir
827  : $this->main_dir;
828  $pi = pathinfo($post_file);
829  $file = $cur_dir . "/" . ilUtil::stripSlashes($pi["basename"]);
830 
831  if (@is_file($file)) {
832  unlink($file);
833  }
834 
835  if (@is_dir($file)) {
836  $is_dir = true;
837  ilUtil::delDir($file);
838  }
839  }
840 
841  $this->ctrl->saveParameter($this, self::CDIR);
842  if ($is_dir) {
843  ilUtil::sendSuccess($lng->txt("cont_dir_deleted"), true);
844  $this->setPerformedCommand(
845  "delete_dir",
846  array("name" => ilUtil::stripSlashes($post_file))
847  );
848  } else {
849  ilUtil::sendSuccess($lng->txt("cont_file_deleted"), true);
850  $this->setPerformedCommand(
851  "delete_file",
852  array("name" => ilUtil::stripSlashes($post_file))
853  );
854  }
855  $this->ctrl->redirect($this, 'listFiles');
856  }
$lng
redirection script todo: (a better solution should control the processing via a xml file) ...
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
$DIC
Definition: xapitoken.php:46
setPerformedCommand($command, $pars="")
Set performed command.
static delDir($a_dir, $a_clean_only=false)
removes a dir and all its content (subdirs and files) recursively
$_POST["username"]
+ Here is the call graph for this function:

◆ downloadFile()

ilFileSystemGUI::downloadFile (   $a_file)

delete object file

Definition at line 941 of file class.ilFileSystemGUI.php.

References ilUtil\deliverFile(), and exit.

942  {
943  $file = $this->main_dir . "/" . $a_file;
944 
945  if (@is_file($file) && !(@is_dir($file))) {
946  ilUtil::deliverFile($file, basename($a_file));
947  exit;
948  } else {
949  $this->ctrl->saveParameter($this, self::CDIR);
950  $this->ctrl->redirect($this, "listFiles");
951  }
952  }
exit
Definition: login.php:29
static deliverFile( $a_file, $a_filename, $a_mime='', $isInline=false, $removeAfterDelivery=false, $a_exit_after=true)
deliver file for download via browser.
+ Here is the call graph for this function:

◆ executeCommand()

ilFileSystemGUI::executeCommand ( )

execute command

Definition at line 248 of file class.ilFileSystemGUI.php.

References $ret, and extCommand().

249  {
250  $next_class = $this->ctrl->getNextClass($this);
251  $cmd = $this->ctrl->getCmd("listFiles");
252 
253  switch ($next_class) {
254 
255  default:
256  if (substr($cmd, 0, 11) == "extCommand_") {
257  $ret = $this->extCommand(substr($cmd, 11, strlen($cmd) - 11));
258  } else {
259  $ret = $this->$cmd();
260  }
261  break;
262  }
263 
264  return $ret;
265  }
extCommand($a_nr)
call external command
$ret
Definition: parser.php:6
+ Here is the call graph for this function:

◆ extCommand()

ilFileSystemGUI::extCommand (   $a_nr)

call external command

Definition at line 406 of file class.ilFileSystemGUI.php.

References getIncomingFiles(), sanitizeCurrentDirectory(), ilUtil\sendFailure(), and ilUtil\stripSlashes().

Referenced by executeCommand().

407  {
408  $selected = $this->getIncomingFiles();
409 
410  if (!count($selected)) {
411  ilUtil::sendFailure($this->lng->txt("no_checkbox"), true);
412  $this->ctrl->redirect($this, "listFiles");
413  }
414 
415  // check if only one item is select, if command does not allow multiple selection
416  if (count($selected) > 1 && $this->commands[$a_nr]["single"]) {
417  ilUtil::sendFailure($this->lng->txt("cont_select_max_one_item"), true);
418  $this->ctrl->redirect($this, "listFiles");
419  }
420 
421  $cur_subdir = $this->sanitizeCurrentDirectory();
422 
423  // collect files and
424  $files = array();
425  foreach ($selected as $file) {
426  $file = ilUtil::stripSlashes($file);
427  $file = (!empty($cur_subdir))
428  ? $cur_subdir . "/" . $file
429  : $file;
430 
431  // check wether selected item is a directory
432  if (@is_dir($this->main_dir . "/" . $file) &&
433  !$this->commands[$a_nr]["allow_dir"]) {
434  ilUtil::sendFailure($this->lng->txt("select_a_file"), true);
435  $this->ctrl->redirect($this, "listFiles");
436  }
437 
438  $files[] = $file;
439  }
440 
441  if ($this->commands[$a_nr]["single"]) {
442  $files = array_shift($files);
443  }
444 
445  $obj = $this->commands[$a_nr]["object"];
446  $method = $this->commands[$a_nr]["method"];
447 
448  return $obj->$method($files);
449  }
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getActionCommands()

ilFileSystemGUI::getActionCommands ( )
Returns
array of commands

Definition at line 975 of file class.ilFileSystemGUI.php.

976  {
977  return $this->commands;
978  }

◆ getAllowDirectories()

ilFileSystemGUI::getAllowDirectories ( )

Get allow directories.

Returns
boolean allow directories

Definition at line 131 of file class.ilFileSystemGUI.php.

Referenced by listFiles(), and unzipFile().

132  {
133  return $this->allow_directories;
134  }
+ Here is the caller graph for this function:

◆ getAllowDirectoryCreation()

ilFileSystemGUI::getAllowDirectoryCreation ( )

Get allowed directory creation.

Definition at line 462 of file class.ilFileSystemGUI.php.

Referenced by listFiles().

463  {
464  return $this->directory_creation;
465  }
+ Here is the caller graph for this function:

◆ getAllowedSuffixes()

ilFileSystemGUI::getAllowedSuffixes ( )

Get allowed Suffixes.

Returns
array allowed Suffixes

Definition at line 70 of file class.ilFileSystemGUI.php.

References $allowed_suffixes.

Referenced by isValidSuffix().

71  {
73  }
+ Here is the caller graph for this function:

◆ getAllowFileCreation()

ilFileSystemGUI::getAllowFileCreation ( )

Get allowed file creation.

Definition at line 478 of file class.ilFileSystemGUI.php.

Referenced by listFiles().

479  {
480  return $this->file_creation;
481  }
+ Here is the caller graph for this function:

◆ getFileList()

ilFileSystemGUI::getFileList (   $a_dir,
  $a_subdir = null 
)
protected

Definition at line 345 of file class.ilFileSystemGUI.php.

References Vendor\Package\$e, and ilUtil\getDir().

Referenced by getIncomingFiles().

346  {
347  $items = array();
348 
349  $entries = (is_dir($a_dir))
350  ? ilUtil::getDir($a_dir)
351  : array(array("type" => "dir", "entry" => ".."));
352 
353  $items = array();
354  foreach ($entries as $e) {
355  if (($e["entry"] == ".") ||
356  ($e["entry"] == ".." && empty($a_subdir))) {
357  continue;
358  }
359 
360  $cfile = (!empty($a_subdir))
361  ? $a_subdir . "/" . $e["entry"]
362  : $e["entry"];
363 
364  $items[] = array(
365  "file" => $cfile,
366  "entry" => $e["entry"],
367  "type" => $e["type"],
368  "size" => $e["size"],
369  "hash" => md5($e["entry"])
370  );
371  }
372 
373  return $items;
374  }
static getDir($a_dir, $a_rec=false, $a_sub_dir="")
get directory
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getForbiddenSuffixes()

ilFileSystemGUI::getForbiddenSuffixes ( )

Get Accepted Suffixes.

Returns
array forbidden Suffixes

Definition at line 90 of file class.ilFileSystemGUI.php.

References $forbidden_suffixes.

Referenced by isValidSuffix().

91  {
93  }
+ Here is the caller graph for this function:

◆ getIncomingFiles()

ilFileSystemGUI::getIncomingFiles ( )
protected

Definition at line 376 of file class.ilFileSystemGUI.php.

References $_GET, $_POST, getFileList(), getPostDirPath(), and parseCurrentDirectory().

Referenced by extCommand().

377  {
378  $sel_files = $hashes = array();
379  if (isset($_POST["file"])) {
380  $hashes = $_POST["file"];
381  } elseif (isset($_GET["fhsh"])) {
382  $hashes = array($_GET["fhsh"]);
383  }
384 
385  if (sizeof($hashes)) {
386  $dir = $this->parseCurrentDirectory();
387  $all_files = $this->getFileList($dir["dir"], $dir["subdir"]);
388  foreach ($hashes as $hash) {
389  foreach ($all_files as $file) {
390  if ($file["hash"] == $hash) {
391  $sel_files[] = $this->getPostDirPath()
392  ? $file["file"]
393  : $file["entry"];
394  break;
395  }
396  }
397  }
398  }
399 
400  return $sel_files;
401  }
$_GET["client_id"]
getPostDirPath()
Get post dir path.
getFileList($a_dir, $a_subdir=null)
$_POST["username"]
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getLastPerformedCommand()

ilFileSystemGUI::getLastPerformedCommand ( )

Get performed command.

Returns
array command array

Definition at line 238 of file class.ilFileSystemGUI.php.

References $_SESSION, and $ret.

239  {
240  $ret = $_SESSION["fsys"]["lastcomm"];
241  $_SESSION["fsys"]["lastcomm"] = "none";
242  return $ret;
243  }
$_SESSION["AccountId"]
$ret
Definition: parser.php:6

◆ getPostDirPath()

ilFileSystemGUI::getPostDirPath ( )

Get post dir path.

Returns
boolean post dir path

Definition at line 151 of file class.ilFileSystemGUI.php.

Referenced by getIncomingFiles(), ilExAssignmentFileSystemGUI\getTable(), and getTable().

152  {
153  return $this->post_dir_path;
154  }
+ Here is the caller graph for this function:

◆ getTable()

ilFileSystemGUI::getTable (   $a_dir,
  $a_subdir 
)

Get table.

Parameters

Definition at line 555 of file class.ilFileSystemGUI.php.

References getPostDirPath(), and getTableId().

Referenced by listFiles().

556  {
557  include_once("./Services/FileSystem/classes/class.ilFileSystemTableGUI.php");
558  return new ilFileSystemTableGUI(
559  $this,
560  "listFiles",
561  $a_dir,
562  $a_subdir,
563  $this->label_enable,
564  $this->file_labels,
565  $this->label_header,
566  $this->commands,
567  $this->getPostDirPath(),
568  $this->getTableId()
569  );
570  }
getTableId()
Get table id.
getPostDirPath()
Get post dir path.
TableGUI class for file system.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getTableId()

ilFileSystemGUI::getTableId ( )

Get table id.

Returns
string table id

Definition at line 171 of file class.ilFileSystemGUI.php.

Referenced by ilExAssignmentFileSystemGUI\getTable(), and getTable().

172  {
173  return $this->table_id;
174  }
+ Here is the caller graph for this function:

◆ getTabs()

ilFileSystemGUI::getTabs ( $tabs_gui)

get tabs

Definition at line 957 of file class.ilFileSystemGUI.php.

References $DIC, and $ilCtrl.

958  {
959  global $DIC;
960  $ilCtrl = $DIC['ilCtrl'];
961 
962  $ilCtrl->setParameter($this, "resetoffset", 1);
963  $tabs_gui->addTarget(
964  "cont_list_files",
965  $this->ctrl->getLinkTarget($this, "listFiles"),
966  "listFiles",
967  get_class($this)
968  );
969  $ilCtrl->setParameter($this, "resetoffset", "");
970  }
global $ilCtrl
Definition: ilias.php:18
$DIC
Definition: xapitoken.php:46

◆ getTitle()

ilFileSystemGUI::getTitle ( )

Get title.

Returns
string title

Definition at line 191 of file class.ilFileSystemGUI.php.

Referenced by listFiles().

192  {
193  return $this->title;
194  }
+ Here is the caller graph for this function:

◆ getUseUploadDirectory()

ilFileSystemGUI::getUseUploadDirectory ( )

Get use upload directory.

Returns
bool use upload directory

Definition at line 211 of file class.ilFileSystemGUI.php.

References $use_upload_directory.

Referenced by listFiles().

212  {
214  }
+ Here is the caller graph for this function:

◆ isValidSuffix()

ilFileSystemGUI::isValidSuffix (   $a_suffix)

Is suffix valid?

Parameters
string$a_suffix
Returns
bool

Definition at line 101 of file class.ilFileSystemGUI.php.

References getAllowedSuffixes(), and getForbiddenSuffixes().

Referenced by renameFile(), unzipFile(), and uploadFile().

102  {
103  if (is_array($this->getForbiddenSuffixes()) && in_array($a_suffix, $this->getForbiddenSuffixes())) {
104  return false;
105  }
106  if (is_array($this->getAllowedSuffixes()) && in_array($a_suffix, $this->getAllowedSuffixes())) {
107  return true;
108  }
109  if (!is_array($this->getAllowedSuffixes()) || count($this->getAllowedSuffixes()) == 0) {
110  return true;
111  }
112  return false;
113  }
getForbiddenSuffixes()
Get Accepted Suffixes.
getAllowedSuffixes()
Get allowed Suffixes.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ labelFile()

ilFileSystemGUI::labelFile (   $a_file,
  $a_label 
)

label a file

Definition at line 300 of file class.ilFileSystemGUI.php.

301  {
302  $this->file_labels[$a_file][] = $a_label;
303  }

◆ listFiles()

ilFileSystemGUI::listFiles (   $a_table_gui = null)

List files.

Parameters
array$a_class_table_guiif we are here from a child class

Definition at line 489 of file class.ilFileSystemGUI.php.

References $_GET, $DIC, $ilCtrl, $lng, $si, ilUploadFiles\_getUploadDirectory(), ilUploadFiles\_getUploadFiles(), getAllowDirectories(), getAllowDirectoryCreation(), getAllowFileCreation(), getTable(), getTitle(), getUseUploadDirectory(), parseCurrentDirectory(), and ilFileInputGUI\setSize().

490  {
491  global $DIC;
492  $ilToolbar = $DIC['ilToolbar'];
493  $lng = $DIC['lng'];
494  $ilCtrl = $DIC['ilCtrl'];
495 
496  $dir = $this->parseCurrentDirectory();
497 
498  $this->ctrl->setParameter($this, self::CDIR, $dir["subdir"]);
499 
500  // toolbar for adding files/directories
501  $ilToolbar->setFormAction($ilCtrl->getFormAction($this), true);
502  include_once("./Services/Form/classes/class.ilTextInputGUI.php");
503 
504  if ($this->getAllowDirectories() && $this->getAllowDirectoryCreation()) {
505  $ti = new ilTextInputGUI($this->lng->txt("cont_new_dir"), "new_dir");
506  $ti->setMaxLength(80);
507  $ti->setSize(10);
508  $ilToolbar->addInputItem($ti, true);
509  $ilToolbar->addFormButton($lng->txt("create"), "createDirectory");
510 
511  $ilToolbar->addSeparator();
512  }
513 
514  include_once("./Services/Form/classes/class.ilFileInputGUI.php");
515  if ($this->getAllowFileCreation()) {
516  $fi = new ilFileInputGUI($this->lng->txt("cont_new_file"), "new_file");
517  $fi->setSize(10);
518  $ilToolbar->addInputItem($fi, true);
519  $ilToolbar->addFormButton($lng->txt("upload"), "uploadFile");
520  }
521 
522  include_once 'Services/FileSystem/classes/class.ilUploadFiles.php';
524  $ilToolbar->addSeparator();
526  $options[""] = $lng->txt("cont_select_from_upload_dir");
527  foreach ($files as $file) {
528  $file = htmlspecialchars($file, ENT_QUOTES, "utf-8");
529  $options[$file] = $file;
530  }
531  include_once("./Services/Form/classes/class.ilSelectInputGUI.php");
532  $si = new ilSelectInputGUI($this->lng->txt("cont_uploaded_file"), "uploaded_file");
533  $si->setOptions($options);
534  $ilToolbar->addInputItem($si, true);
535  $ilToolbar->addFormButton($lng->txt("copy"), "uploadFile");
536  }
537 
538  $fs_table = $this->getTable($dir["dir"], $dir["subdir"]);
539 
540  if ($this->getTitle() != "") {
541  $fs_table->setTitle($this->getTitle());
542  }
543  if ($_GET["resetoffset"] == 1) {
544  $fs_table->resetOffset();
545  }
546  $this->tpl->setContent($fs_table->getHTML());
547  }
$_GET["client_id"]
This class represents a file property in a property form.
getAllowDirectoryCreation()
Get allowed directory creation.
static _getUploadDirectory()
Get the directory with uploaded files.
static _getUploadFiles()
Get a list of readable files in the upload directory.
setSize($a_size)
Set Size.
getTable($a_dir, $a_subdir)
Get table.
global $ilCtrl
Definition: ilias.php:18
$lng
getUseUploadDirectory()
Get use upload directory.
getAllowDirectories()
Get allow directories.
getAllowFileCreation()
Get allowed file creation.
$DIC
Definition: xapitoken.php:46
+ Here is the call graph for this function:

◆ parseCurrentDirectory()

ilFileSystemGUI::parseCurrentDirectory ( )
protected

Definition at line 316 of file class.ilFileSystemGUI.php.

References $_GET, and ilUtil\stripSlashes().

Referenced by getIncomingFiles(), and listFiles().

317  {
318  // determine directory
319  // FIXME: I have to call stripSlashes here twice, because I could not
320  // determine where the second layer of slashes is added to the
321  // URL Parameter
322  $cur_subdir = ilUtil::stripSlashes(ilUtil::stripSlashes($_GET[self::CDIR]));
323  $new_subdir = ilUtil::stripSlashes(ilUtil::stripSlashes($_GET["newdir"]));
324 
325  if ($new_subdir == "..") {
326  $cur_subdir = substr($cur_subdir, 0, strrpos($cur_subdir, "/"));
327  } else {
328  if (!empty($new_subdir)) {
329  if (!empty($cur_subdir)) {
330  $cur_subdir = $cur_subdir . "/" . $new_subdir;
331  } else {
332  $cur_subdir = $new_subdir;
333  }
334  }
335  }
336 
337  $cur_subdir = str_replace("..", "", $cur_subdir);
338  $cur_dir = (!empty($cur_subdir))
339  ? $this->main_dir . "/" . $cur_subdir
340  : $this->main_dir;
341 
342  return array("dir" => $cur_dir, "subdir" => $cur_subdir);
343  }
$_GET["client_id"]
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ renameFile()

ilFileSystemGUI::renameFile ( )

rename a file

Definition at line 614 of file class.ilFileSystemGUI.php.

References $_GET, $_POST, $DIC, Vendor\Package\$e, $lng, isValidSuffix(), ilFileUtils\rename(), ilUtil\renameExecutables(), sanitizeCurrentDirectory(), ilUtil\sendFailure(), setPerformedCommand(), and ilUtil\stripSlashes().

615  {
616  global $DIC;
617  $lng = $DIC['lng'];
618 
619  $new_name = str_replace("..", "", ilUtil::stripSlashes($_POST["new_name"]));
620  $new_name = str_replace("/", "", $new_name);
621  if ($new_name == "") {
622  $this->ilias->raiseError($this->lng->txt("enter_new_name"), $this->ilias->error_obj->MESSAGE);
623  }
624 
625  $pi = pathinfo($new_name);
626  $suffix = $pi["extension"];
627  if ($suffix != "" && !$this->isValidSuffix($suffix)) {
628  ilUtil::sendFailure($this->lng->txt("file_no_valid_file_type") . " ($suffix)", true);
629  $this->ctrl->redirect($this, "listFiles");
630  }
631 
632  $cur_subdir = $this->sanitizeCurrentDirectory();
633  $dir = (!empty($cur_subdir))
634  ? $this->main_dir . "/" . $cur_subdir . "/"
635  : $this->main_dir . "/";
636 
637 
638  if (is_dir($dir . ilUtil::stripSlashes($_GET["old_name"]))) {
639  rename($dir . ilUtil::stripSlashes($_GET["old_name"]), $dir . $new_name);
640  } else {
641  include_once("./Services/Utilities/classes/class.ilFileUtils.php");
642 
643  try {
644  ilFileUtils::rename($dir . ilUtil::stripSlashes($_GET["old_name"]), $dir . $new_name);
645  } catch (ilException $e) {
646  ilUtil::sendFailure($e->getMessage(), true);
647  $this->ctrl->redirect($this, "listFiles");
648  }
649  }
650 
651  ilUtil::renameExecutables($this->main_dir);
652  if (@is_dir($dir . $new_name)) {
653  ilUtil::sendSuccess($lng->txt("cont_dir_renamed"), true);
654  $this->setPerformedCommand("rename_dir", array("old_name" => $_GET["old_name"],
655  "new_name" => $new_name));
656  } else {
657  ilUtil::sendSuccess($lng->txt("cont_file_renamed"), true);
658  $this->setPerformedCommand("rename_file", array("old_name" => $_GET["old_name"],
659  "new_name" => $new_name));
660  }
661  $this->ctrl->redirect($this, "listFiles");
662  }
$_GET["client_id"]
static rename($a_source, $a_target)
Rename a file.
$lng
redirection script todo: (a better solution should control the processing via a xml file) ...
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
isValidSuffix($a_suffix)
Is suffix valid?
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
static renameExecutables($a_dir)
Rename uploaded executables for security reasons.
$DIC
Definition: xapitoken.php:46
setPerformedCommand($command, $pars="")
Set performed command.
$_POST["username"]
+ Here is the call graph for this function:

◆ renameFileForm()

ilFileSystemGUI::renameFileForm (   $a_file)

list files

Definition at line 575 of file class.ilFileSystemGUI.php.

References $_GET, $DIC, $ilCtrl, $lng, sanitizeCurrentDirectory(), and ilUtil\stripSlashes().

576  {
577  global $DIC;
578  $lng = $DIC['lng'];
579  $ilCtrl = $DIC['ilCtrl'];
580 
581  $cur_subdir = $this->sanitizeCurrentDirectory();
582  $file = $this->main_dir . "/" . $a_file;
583 
584  $this->ctrl->setParameter($this, "old_name", basename($a_file));
585  $this->ctrl->setParameter($this, self::CDIR, ilUtil::stripSlashes($_GET[self::CDIR]));
586 
587  include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
588  $form = new ilPropertyFormGUI();
589 
590  // file/dir name
591  $ti = new ilTextInputGUI($this->lng->txt("name"), "new_name");
592  $ti->setMaxLength(200);
593  $ti->setSize(40);
594  $ti->setValue(basename($a_file));
595  $form->addItem($ti);
596 
597  // save and cancel commands
598  $form->addCommandButton("renameFile", $lng->txt("rename"));
599  $form->addCommandButton("cancelRename", $lng->txt("cancel"));
600  $form->setFormAction($ilCtrl->getFormAction($this, "renameFile"));
601 
602  if (@is_dir($file)) {
603  $form->setTitle($this->lng->txt("cont_rename_dir"));
604  } else {
605  $form->setTitle($this->lng->txt("rename_file"));
606  }
607 
608  $this->tpl->setContent($form->getHTML());
609  }
This class represents a property form user interface.
$_GET["client_id"]
global $ilCtrl
Definition: ilias.php:18
$lng
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
$DIC
Definition: xapitoken.php:46
+ Here is the call graph for this function:

◆ sanitizeCurrentDirectory()

ilFileSystemGUI::sanitizeCurrentDirectory ( )
private
Returns
string

Definition at line 1022 of file class.ilFileSystemGUI.php.

References $DIC, and ilUtil\stripSlashes().

Referenced by createDirectory(), deleteFile(), extCommand(), renameFile(), renameFileForm(), unzipFile(), and uploadFile().

1023  {
1024  global $DIC;
1025 
1026  return str_replace("..", "", ilUtil::stripSlashes($DIC->http()->request()->getQueryParams()[self::CDIR]));
1027  }
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
$DIC
Definition: xapitoken.php:46
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setAllowDirectories()

ilFileSystemGUI::setAllowDirectories (   $a_val)

Set allow directories.

Parameters
booleanallow directories

Definition at line 121 of file class.ilFileSystemGUI.php.

Referenced by __construct().

122  {
123  $this->allow_directories = $a_val;
124  }
+ Here is the caller graph for this function:

◆ setAllowDirectoryCreation()

ilFileSystemGUI::setAllowDirectoryCreation (   $a_val)

Set allowed directory creation.

Definition at line 454 of file class.ilFileSystemGUI.php.

Referenced by __construct().

455  {
456  $this->directory_creation = $a_val;
457  }
+ Here is the caller graph for this function:

◆ setAllowedSuffixes()

ilFileSystemGUI::setAllowedSuffixes (   $a_suffixes)

Set allowed Suffixes.

Parameters
array$a_suffixesallowed Suffixes

Definition at line 60 of file class.ilFileSystemGUI.php.

Referenced by ilObjMediaObjectGUI\executeCommand().

61  {
62  $this->allowed_suffixes = $a_suffixes;
63  }
+ Here is the caller graph for this function:

◆ setAllowFileCreation()

ilFileSystemGUI::setAllowFileCreation (   $a_val)

Set allowed file creation.

Definition at line 470 of file class.ilFileSystemGUI.php.

Referenced by __construct().

471  {
472  $this->file_creation = $a_val;
473  }
+ Here is the caller graph for this function:

◆ setForbiddenSuffixes()

ilFileSystemGUI::setForbiddenSuffixes (   $a_suffixes)

Set forbidden Suffixes.

Parameters
array$a_suffixesforbidden Suffixes

Definition at line 80 of file class.ilFileSystemGUI.php.

81  {
82  $this->forbidden_suffixes = $a_suffixes;
83  }

◆ setPerformedCommand()

ilFileSystemGUI::setPerformedCommand (   $command,
  $pars = "" 
)
protected

Set performed command.

Parameters
stringcommand
arrayparameter array

Definition at line 222 of file class.ilFileSystemGUI.php.

References $_SESSION.

Referenced by createDirectory(), deleteFile(), renameFile(), unzipFile(), and uploadFile().

223  {
224  if (!is_array($pars)) {
225  $pars = array();
226  }
227  $_SESSION["fsys"]["lastcomm"] = array_merge(
228  array("cmd" => $command),
229  $pars
230  );
231  }
$_SESSION["AccountId"]
+ Here is the caller graph for this function:

◆ setPostDirPath()

ilFileSystemGUI::setPostDirPath (   $a_val)

Set post dir path.

Parameters
booleanpost dir path

Definition at line 141 of file class.ilFileSystemGUI.php.

Referenced by ilObjMediaPoolGUI\executeCommand().

142  {
143  $this->post_dir_path = $a_val;
144  }
+ Here is the caller graph for this function:

◆ setTableId()

ilFileSystemGUI::setTableId (   $a_val)

Set table id.

Parameters
stringtable id

Definition at line 161 of file class.ilFileSystemGUI.php.

Referenced by ilExPeerReviewGUI\executeCommand(), and ilExerciseManagementGUI\executeCommand().

162  {
163  $this->table_id = $a_val;
164  }
+ Here is the caller graph for this function:

◆ setTitle()

ilFileSystemGUI::setTitle (   $a_val)

Set title.

Parameters
stringtitle

Definition at line 181 of file class.ilFileSystemGUI.php.

Referenced by ilExAssignmentEditorGUI\executeCommand().

182  {
183  $this->title = $a_val;
184  }
+ Here is the caller graph for this function:

◆ setUseUploadDirectory()

ilFileSystemGUI::setUseUploadDirectory (   $a_val)

Set use upload directory.

Parameters
bool$a_valuse upload directory

Definition at line 201 of file class.ilFileSystemGUI.php.

Referenced by ilObjSAHSLearningModuleGUI\executeCommand().

202  {
203  $this->use_upload_directory = $a_val;
204  }
+ Here is the caller graph for this function:

◆ unzipFile()

ilFileSystemGUI::unzipFile (   $a_file = null)

delete object file

Definition at line 861 of file class.ilFileSystemGUI.php.

References $_GET, $d, $DIC, Vendor\Package\$f, $lng, getAllowDirectories(), ilUtil\getDir(), isValidSuffix(), ilFileUtils\recursive_dirscan(), ilUtil\renameExecutables(), sanitizeCurrentDirectory(), ilUtil\sendFailure(), setPerformedCommand(), and ilUtil\unzip().

862  {
863  global $DIC;
864  $lng = $DIC['lng'];
865 
866  // #17470 - direct unzip call (after upload)
867  if (!$a_file &&
868  isset($_GET["upfile"])) {
869  $a_file = basename($_GET["upfile"]);
870  }
871 
872  $cur_subdir = $this->sanitizeCurrentDirectory();
873  $cur_dir = (!empty($cur_subdir))
874  ? $this->main_dir . "/" . $cur_subdir
875  : $this->main_dir;
876  $a_file = $this->main_dir . "/" . $a_file;
877 
878  if (@is_file($a_file)) {
879  include_once("./Services/Utilities/classes/class.ilFileUtils.php");
880  $cur_files = array_keys(ilUtil::getDir($cur_dir));
881  $cur_files_r = iterator_to_array(new RecursiveIteratorIterator(new RecursiveDirectoryIterator($cur_dir)));
882 
883  if ($this->getAllowDirectories()) {
884  ilUtil::unzip($a_file, true);
885  } else {
886  ilUtil::unzip($a_file, true, true);
887  }
888 
889  $new_files = array_keys(ilUtil::getDir($cur_dir));
890  $new_files_r = iterator_to_array(new RecursiveIteratorIterator(new RecursiveDirectoryIterator($cur_dir)));
891 
892  $diff = array_diff($new_files, $cur_files);
893  $diff_r = array_diff($new_files_r, $cur_files_r);
894 
895  // unlink forbidden file types
896  foreach ($diff_r as $f => $d) {
897  $pi = pathinfo($f);
898  if (!is_dir($f) && !$this->isValidSuffix(strtolower($pi["extension"]))) {
899  ilUtil::sendFailure($lng->txt("file_some_invalid_file_types_removed") . " (" . $pi["extension"] . ")", true);
900  unlink($f);
901  }
902  }
903 
904  if (sizeof($diff)) {
905  if ($this->getAllowDirectories()) {
906  include_once("./Services/Utilities/classes/class.ilFileUtils.php");
907  $new_files = array();
908 
909  foreach ($diff as $new_item) {
910  if (is_dir($cur_dir . "/" . $new_item)) {
911  ilFileUtils::recursive_dirscan($cur_dir . "/" . $new_item, $new_files);
912  }
913  }
914 
915  if (is_array($new_files["path"])) {
916  foreach ($new_files["path"] as $idx => $path) {
917  $path = substr($path, strlen($this->main_dir) + 1);
918  $diff[] = $path . $new_files["file"][$idx];
919  }
920  }
921  }
922 
923  $this->setPerformedCommand(
924  "unzip_file",
925  array("name" => substr($file, strlen($this->main_dir) + 1),
926  "added" => $diff)
927  );
928  }
929  }
930 
931  ilUtil::renameExecutables($this->main_dir);
932 
933  $this->ctrl->saveParameter($this, self::CDIR);
934  ilUtil::sendSuccess($lng->txt("cont_file_unzipped"), true);
935  $this->ctrl->redirect($this, "listFiles");
936  }
$_GET["client_id"]
static unzip($a_file, $overwrite=false, $a_flat=false)
unzip file
static getDir($a_dir, $a_rec=false, $a_sub_dir="")
get directory
$lng
getAllowDirectories()
Get allow directories.
isValidSuffix($a_suffix)
Is suffix valid?
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
static renameExecutables($a_dir)
Rename uploaded executables for security reasons.
$DIC
Definition: xapitoken.php:46
setPerformedCommand($command, $pars="")
Set performed command.
static recursive_dirscan($dir, &$arr)
Recursively scans a given directory and writes path and filename into referenced array.
for($i=6; $i< 13; $i++) for($i=1; $i< 13; $i++) $d
Definition: date.php:296
+ Here is the call graph for this function:

◆ uploadFile()

ilFileSystemGUI::uploadFile ( )

Upload file.

Definition at line 706 of file class.ilFileSystemGUI.php.

References $_POST, $DIC, Vendor\Package\$e, $lng, $name, $url, ilUploadFiles\_checkUploadFile(), ilUploadFiles\_copyUploadFile(), ilLinkButton\getInstance(), ilMimeTypeUtil\getMimeType(), isValidSuffix(), ilUtil\moveUploadedFile(), ilUtil\renameExecutables(), sanitizeCurrentDirectory(), ilUtil\sendFailure(), setPerformedCommand(), and ilUtil\stripSlashes().

707  {
708  global $DIC;
709  $lng = $DIC['lng'];
710 
711  // determine directory
712  $cur_subdir = $this->sanitizeCurrentDirectory();
713  $cur_dir = (!empty($cur_subdir))
714  ? $this->main_dir . "/" . $cur_subdir
715  : $this->main_dir;
716 
717  $tgt_file = null;
718 
719  $pi = pathinfo($_FILES["new_file"]["name"]);
720  $suffix = $pi["extension"];
721  if (!$this->isValidSuffix($suffix)) {
722  ilUtil::sendFailure($this->lng->txt("file_no_valid_file_type") . " ($suffix)", true);
723  $this->ctrl->redirect($this, "listFiles");
724  }
725 
726  if (is_file($_FILES["new_file"]["tmp_name"])) {
727  $name = ilUtil::stripSlashes($_FILES["new_file"]["name"]);
728  $tgt_file = $cur_dir . "/" . $name;
729  try {
730  ilUtil::moveUploadedFile($_FILES["new_file"]["tmp_name"], $name, $tgt_file);
731  } catch (ilException $e) {
732  ilUtil::sendFailure($e->getMessage(), true);
733  $this->ctrl->redirect($this, "listFiles");
734  }
735 
736  } elseif ($_POST["uploaded_file"]) {
737  include_once 'Services/FileSystem/classes/class.ilUploadFiles.php';
738 
739  // check if the file is in the ftp directory and readable
740  if (ilUploadFiles::_checkUploadFile($_POST["uploaded_file"])) {
741  $tgt_file = $cur_dir . "/" . ilUtil::stripSlashes($_POST["uploaded_file"]);
742 
743  // copy uploaded file to data directory
744  ilUploadFiles::_copyUploadFile($_POST["uploaded_file"], $tgt_file);
745  }
746  } elseif (trim($_FILES["new_file"]["name"]) == "") {
747  ilUtil::sendFailure($lng->txt("cont_enter_a_file"), true);
748  }
749 
750  if ($tgt_file && is_file($tgt_file)) {
751  $unzip = null;
752 
753  // extract zip?
754  include_once("./Services/Utilities/classes/class.ilMimeTypeUtil.php");
755  if (ilMimeTypeUtil::getMimeType($tgt_file) == "application/zip") {
756  $this->ctrl->setParameter($this, "upfile", basename($tgt_file));
757  $url = $this->ctrl->getLinkTarget($this, "unzipFile");
758  $this->ctrl->setParameter($this, "upfile", "");
759 
760  include_once "Services/UIComponent/Button/classes/class.ilLinkButton.php";
761  $unzip = ilLinkButton::getInstance();
762  $unzip->setCaption("unzip");
763  $unzip->setUrl($url);
764  $unzip = " " . $unzip->render();
765  }
766 
767  ilUtil::sendSuccess($lng->txt("cont_file_created") . $unzip, true);
768 
769  $this->setPerformedCommand(
770  "create_file",
771  array("name" => substr($tgt_file, strlen($this->main_dir) + 1))
772  );
773  }
774 
775  $this->ctrl->saveParameter($this, self::CDIR);
776 
777  ilUtil::renameExecutables($this->main_dir);
778 
779  $this->ctrl->redirect($this, 'listFiles');
780  }
static getMimeType($a_file='', $a_filename='', $a_mime='')
if($format !==null) $name
Definition: metadata.php:230
$lng
static moveUploadedFile($a_file, $a_name, $a_target, $a_raise_errors=true, $a_mode="move_uploaded")
move uploaded file
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
isValidSuffix($a_suffix)
Is suffix valid?
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
static renameExecutables($a_dir)
Rename uploaded executables for security reasons.
$DIC
Definition: xapitoken.php:46
setPerformedCommand($command, $pars="")
Set performed command.
$url
static _checkUploadFile($a_file)
Check if a file exists in the upload directory and is readable.
static _copyUploadFile($a_file, $a_target, $a_raise_errors=true)
copy an uploaded file to the target directory (including virus check)
$_POST["username"]
+ Here is the call graph for this function:

Field Documentation

◆ $allowed_suffixes

ilFileSystemGUI::$allowed_suffixes = array()
protected

Definition at line 21 of file class.ilFileSystemGUI.php.

Referenced by getAllowedSuffixes().

◆ $ctrl

ilFileSystemGUI::$ctrl

◆ $forbidden_suffixes

ilFileSystemGUI::$forbidden_suffixes = array()
protected

Definition at line 26 of file class.ilFileSystemGUI.php.

Referenced by getForbiddenSuffixes().

◆ $use_upload_directory

ilFileSystemGUI::$use_upload_directory = false
protected

Definition at line 16 of file class.ilFileSystemGUI.php.

Referenced by getUseUploadDirectory().

◆ CDIR

const ilFileSystemGUI::CDIR = "cdir"

Definition at line 17 of file class.ilFileSystemGUI.php.


The documentation for this class was generated from the following file: