Ejemplo n.º 1
0
$FTPUSER = "******";
$FTPPASS = "";
$FTPPATH = "/pub/idb/nighty-ver/";
// HTTP Download Info
$HTTPURL = "http://download.berlios.de/idb/";
// File Name Info for both FTP and HTTP
$TARGZFILE = "iDB.tar.gz";
$TARFILE = "iDB.tar";
require_once "./untar.php";
$mydir = addslashes(str_replace("\\", "/", dirname(__FILE__) . "/"));
$conn_id = ftp_connect($FTPURL, 21, 90);
$login_result = ftp_login($conn_id, $FTPUSER, $FTPPASS);
if (!$conn_id || !$login_result) {
    $tarhandle = fopen("./" . $TARGZFILE, "a+");
    fwrite($tarhandle, file_get_contents($HTTPURL . $TARGZFILE));
    fclose($tarhandle);
    chmod("./" . $TARGZFILE, 0777);
} else {
    ftp_pasv($conn_id, true);
    ftp_chdir($conn_id, $FTPPATH);
    ftp_get($conn_id, "./" . $TARGZFILE, "./" . $TARGZFILE, FTP_BINARY);
    ftp_close($conn_id);
}
gunzip("./" . $TARGZFILE, "./" . $TARFILE);
unlink("./" . $TARGZFILE);
unlink("./LICENSE");
untar("./" . $TARFILE, "./");
unlink("./" . $TARFILE);
unlink("./untar.php");
unlink("./webinstall.php");
header("Location: ./install.php");
Ejemplo n.º 2
0
     $_POST['act'] = "";
 }
 if ($_GET['act'] == "gettheme" && $_POST['act'] == "gettheme" && $_POST['GetTheme'] == "None") {
     $_GET['act'] = "themelist";
     $_POST['act'] = "";
 }
 $conn_id = ftp_connect("ftp.berlios.de", 21, 90);
 ftp_login($conn_id, "anonymous", "anonymous");
 ftp_pasv($conn_id, true);
 if ($_GET['act'] == "themelist") {
     ftp_chdir($conn_id, "/pub/idb/themes/");
 }
 if ($_GET['act'] == "gettheme" && $_POST['act'] == "gettheme") {
     ftp_chdir($conn_id, "/pub/idb/themes/" . $_POST['GetTheme'] . "/");
     ftp_get($conn_id, $SettDir['archive'] . $_POST['GetTheme'] . ".tar", "./" . $_POST['GetTheme'] . ".tar", FTP_BINARY);
     untar($SettDir['archive'] . $_POST['GetTheme'] . ".tar", $SettDir['themes'] . $_POST['GetTheme'] . "/");
     unlink($SettDir['archive'] . $_POST['GetTheme'] . ".tar");
     if ($Settings['SQLThemes'] == "off") {
         $_POST['update'] = "now";
     }
     if ($Settings['SQLThemes'] == "on") {
         $_POST['update'] = "now";
         $_GET['act'] = "resyncthemes";
     }
 }
 if ($_GET['act'] == "themelist") {
     $themelist = ftp_nlist($conn_id, ".");
     $it = 0;
     $numt = count($themelist);
     $themeact = url_maker($exfile['admin'], $Settings['file_ext'], "act=gettheme", $Settings['qstr'], $Settings['qsep'], $prexqstr['admin'], $exqstr['admin']);
     $admincptitle = " " . $ThemeSet['TitleDivider'] . " Theme Setup";
Ejemplo n.º 3
0
function iuntar($tarfile, $outdir = "./", $chmod = null, $extract = true, $lsonly = false, $findfile = null)
{
    return untar($tarfile, $outdir, $chmod, $extract, $lsonly, $findfile);
}
Ejemplo n.º 4
0
        echo gzencode(file_get_contents($sourcedir . $_GET['tar']));
    }
    if ($_GET['output'] == "bzip2") {
        $FileType = "application/x-bzip2";
        header("Content-Disposition: attachment; filename=\"" . basename($_GET['tar']) . ".bz2\"");
        header("Content-type: " . $FileType);
        echo bzcompress(file_get_contents($sourcedir . $_GET['tar']));
    }
    die;
    exit;
}
if (isset($_GET['tar']) && $_GET['act'] != "view" && $_GET['act'] != "html") {
    $File = array_sort(untar($sourcedir . $_GET['tar'], "/", null, false, true), "FileType", 'SORT_DESC');
}
if (isset($_GET['tar']) && $_GET['act'] == "view" || isset($_GET['tar']) && $_GET['act'] == "html" || isset($_GET['tar']) && $_GET['act'] == "download") {
    $File = array_sort(untar($sourcedir . $_GET['tar'], "/", null, false, false, $_GET['file']), "FileType", 'SORT_DESC');
}
if ($_GET['act'] == "view" || $_GET['act'] == "html" || $_GET['act'] == "download") {
    $i = 0;
    $num = count($File);
    $fileview = false;
    while ($i < $num) {
        if ($_GET['file'] == $File[$i]['FileName']) {
            if (count(explode(".", $File[$i]['FileName'])) > 1) {
                $FileExp = strtolower(end(explode(".", $File[$i]['FileName'])));
            }
            if (count(explode(".", $File[$i]['FileName'])) <= 1) {
                $FileExp = "null";
            }
            if (isset($FileExp)) {
                $FileExt = $FileExp;