Beispiel #1
0
 /**
  * The main function, checks if the user wants to perform any supported operations
  *
  * @param string $location current location
  *
  * @return checks if any action is required
  */
 public function run($location)
 {
     $postuserdir = filter_input(INPUT_POST, "userdir", FILTER_SANITIZE_STRING);
     $postnewname = filter_input(INPUT_POST, "newname", FILTER_SANITIZE_STRING);
     if ($postuserdir) {
         // add new folder
         Actions::newFolder($location, $postuserdir);
     } elseif (isset($_FILES['userfile']['name'])) {
         // upload files
         $this->uploadMulti($_FILES['userfile']);
     } elseif ($postnewname) {
         // rename files or folders
         $postoldname = filter_input(INPUT_POST, "oldname", FILTER_SANITIZE_STRING);
         $postnewname = Utils::normalizeStr($postnewname);
         $this->setRename($postoldname, $postnewname);
     } else {
         // no post action
         $getdel = filter_input(INPUT_GET, "del", FILTER_SANITIZE_STRING);
         // delete files or folders
         if ($getdel && GateKeeper::isUserLoggedIn() && GateKeeper::isAllowed('delete_enable')) {
             $getdel = str_replace(' ', '+', $getdel);
             $getdel = urldecode(base64_decode($getdel));
             $getdel = EncodeExplorer::extraChars($getdel);
             $this->setDel($getdel);
         }
     }
 }