//show user panel showUserPanel($datarootpath, $user, $ecad_php_version); } else { //normal path handling ---------------------------------------------------------------------------------------------------------------------------------------------------------- //get the path and full path if ($canAccessSystemFolder) { $path = getSafePath($datarootpath, ""); $fullpath = getSafeFullPath($datarootpath, "", $path); } else { $path = getSafePath($datarootpath, "/users/" . $userpath . "/data"); $fullpath = getSafeFullPath($datarootpath, "/users/" . $userpath . "/data", $path); } if (is_file($fullpath)) { //download file if path is a file ecad_php_log($datarootpath, "INFO", "file download " . '[' . $path . ']'); makeDownload($fullpath, $path); } else { //normal user ----------------------------------------- $show_user_interface = true; //user inputs --------------------------------------------------------------------------------------------- //create new folder if (isset($_POST['create_Folder']) && $can_delete) { $show_user_interface = true; create_Folder($fullpath); } //show rename folder / file form if (isset($_POST['rename_FolderOrFile']) && $can_delete) { $show_user_interface = false; rename_FolderOrFile($nichtgelisteteDatein, $fullpath); } //rename folder or file if user has comfirmed
/** * Makes library requests for the makefile */ function makeLibs($libs = array(), $opts = array()) { $output = $loop = ''; // loop through libraries if ($libs) { foreach ($libs as $k => $v) { $loop = ''; if (strpos($k, '|') !== FALSE) { $loop .= makeDownload('libraries', $k, $v, $opts); $output .= $loop; } else { $loop .= 'libraries[' . $k . '][download][type] = "file"' . "\r\n" . 'libraries[' . $k . '][download][url] = "' . $v . '"' . "\r\n"; $output .= $loop; } } } if (!$loop) { $output = '; No libraries were included'; //$output .= "; Adding a module such as jquery_update will never add the related library automatically.\r\n; https://github.com/rupl/drush_make_generator/issues/closed#issue/1 \r\n"; } return $output; }
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. ---------------------------------------------------------------------- */ function makeDownload($file, $dir, $type) { header("Content-Type: application/pdf"); header("Content-Disposition: attachment; filename={$file}"); readfile($dir . $file); } $user = $_POST['user']; $dir = "../data/user/" . $user . "/"; $type = $_POST['type']; $display = $_POST['display']; if (!empty($_POST['file']) && !preg_match('=/=', $_POST['file'])) { if (file_exists($dir . $_POST['file'])) { makeDownload($_POST['file'], $dir, $type); } } else { echo "error"; } ?> <html> <body onLoad="window.print()"> </body> </html>