Exemple #1
0
     die;
 }
 switch ($op) {
     case 1:
         if (is_dir('../../../' . $val[1])) {
             deldir('../../../' . $val[1]);
             echo $lang_physicaldelok;
         } else {
             unlink('../../../' . $val[1]);
             echo $lang_physicaldelok;
         }
         break;
     case 2:
         $adminfile = $url_array[count($url_array) - 2];
         $strsvalto = readmin($val[1], $adminfile, 1);
         filetest('../../../' . $val[1]);
         deldir('../../../' . $val[1]);
         $dlappfile = parse_ini_file('dlappfile.php', true);
         if ($dlappfile[$strsvalto]['dlfile']) {
             $return = varcodeb('app');
             $checksum = $return['md5'];
             $met_file = '/dl/app_curl.php';
             $stringfile = dlfile($dlappfile[$strsvalto]['dlfile'], "../../../{$val['1']}");
         } else {
             $met_file = '/dl/olupdate_curl.php';
             $stringfile = dlfile("v{$metcms_v}/{$strsvalto}", "../../../{$val['1']}");
         }
         if ($stringfile == 1) {
             echo $lang_physicalupdatesuc;
         } else {
             echo dlerror($stringfile);
Exemple #2
0
         $startfrom = $startrow;
         $tableid = $i;
         if (trim($sqldump)) {
             $sqlfile[] = $bakfile = "../update/{$addr}/{$con_db_name}_{$date}_{$random}_{$num}.sql";
             $version = 'version:' . $metcms_v;
             $sqldump = "#MetInfo.cn Created {$version} \n#{$met_weburl}\n#{$tablepre}\n#{$met_webkeys}\n# --------------------------------------------------------\n\n\n" . $sqldump;
             if (!file_put_contents($bakfile, $sqldump)) {
                 dl_error($lang_updaterr2 . "({$adminfile}/update/{$addr}/{$con_db_name}_{$date}_{$random}_{$num}.sql)", $type, $olid, $ver, $addr, $action);
             }
         }
         $num++;
     } while (trim($sqldump));
     if (is_array($sqlfile)) {
         $string = "<?php\n \$sqlfile = " . var_export($sqlfile, true) . "; ?>";
     }
     filetest("../update/{$addr}/sqlist.php");
     if (!file_put_contents("../update/{$addr}/sqlist.php", $string)) {
         dl_error($lang_updaterr2 . "({$adminfile}/update/{$addr}/sqlist.php)", $type, $olid, $ver, $addr, $action);
     }
 }
 require_once '../system/database/global.func.php';
 $return = sql_execute($sql, 1);
 if ($return) {
     echo $lang_updaterr11 . "<script type=\"text/javascript\">setTimeout(function (){olupdate('{$olid}','{$ver}','update');},500);</script>";
 } else {
     foreach ($sqlfile as $sqlkey => $sqlval) {
         $sql = file_get_contents($sqlval);
         sql_execute($sql);
     }
     dl_error($lang_updaterr12 . mysql_error(), $type, $olid, $ver, $addr, $action);
 }
Exemple #3
0
function syn_lang($post, $filename, $langmark, $site, $type)
{
    global $met_host, $met_file, $met_language, $db;
    $met_file = '/dl/lang/lang.php';
    $restr = curl_post($post, 30);
    $link = link_error($restr);
    if ($link != 1) {
        return $link;
    }
    filetest($filename);
    file_put_contents($filename, $restr);
    $array = 0;
    $no_order = 0;
    $array_l = 0;
    $no_order_l = 0;
    $array_s = 0;
    $no_order_s = 0;
    if (file_exists($filename)) {
        if ($type != 1) {
            $query = "delete from {$met_language} where site='{$site}' and app='0' and lang='{$langmark}'";
            $db->query($query);
        }
        $fp = @fopen($filename, "r");
        while ($conf_line = @fgets($fp, 1024)) {
            if (substr($conf_line, 0, 1) == "#") {
                $no_order_l++;
                $array_l = 0;
                $no_order_s = 0;
                $array = $array_l;
                $no_order = $no_order_l;
                $line = ereg_replace("^#", "", $conf_line);
                $flag = 1;
            } else {
                $no_order_s++;
                $array_s = $no_order_l;
                $line = $conf_line;
                $array = $array_s;
                $no_order = $no_order_s;
                $flag = 0;
            }
            if (trim($line) == "") {
                continue;
            }
            $linearray = explode('=', $line);
            $linenum = count($linearray);
            if ($linenum == 2) {
                list($name, $value) = explode('=', $line);
            } else {
                for ($i = 0; $i < $linenum; $i++) {
                    $linetra = $i ? $linetra . "=" . $linearray[$i] : $linearray[$i] . 'metinfo_';
                }
                list($name, $value) = explode('metinfo_=', $linetra);
            }
            $value = str_replace("\"", "&quot;", $value);
            list($value, $valueinfo) = explode('/*', $value);
            $name = str_replace('\\', '', daddslashes(trim($name), 1, 'metinfo'));
            $value = str_replace("'", "''", $value);
            $value = str_replace("\\", "\\\\", $value);
            $value = trim($value, "\n");
            $value = trim($value, "\r");
            $value = trim($value, "\n");
            $value = trim($value, "\r");
            $value = str_replace('\\n', ',', $value);
            $query = "insert into {$met_language} set name='{$name}',value='{$value}',site='{$site}',no_order='{$no_order}',array='{$array}',lang='{$langmark}'";
            $db->query($query);
        }
        fclose($fp);
    }
    unlink($filename);
    return 1;
}
Exemple #4
0
require_once '../common.inc.php';
require_once ROOTPATH . 'include/export.func.php';
if ($action == 'patch') {
    $met_file = '/dl/patch.php';
    $post_data = array('ver' => $metcms_v, 'patch' => $met_patch);
    $difilelist = curl_post($post_data, 10);
    if ($difilelist != 'nohost') {
        $difilelists = explode('*', $difilelist);
        $met_file = '/dl/olupdate_curl.php';
        foreach ($difilelists as $key => $val) {
            $difilelistss = explode('|', $val);
            $met_patch = $difilelistss[0];
            unset($difilelistss[0]);
            foreach ($difilelistss as $key1 => $val1) {
                $val2 = readmin($val1, $met_adminfile, 2);
                filetest("../../{$val2}");
                $re = dlfile("v{$metcms_v}/{$val1}", "../../{$val2}");
                if ($re != 1) {
                    echo $re;
                    die;
                }
            }
            if (file_exists("../../{$met_adminfile}/update/v{$metcms_v}_{$met_patch}.php")) {
                require_once "../../{$met_adminfile}/update/v{$metcms_v}_{$met_patch}.php";
            }
            @unlink("../../{$met_adminfile}/update/v{$metcms_v}_{$met_patch}.php");
            $query = "update {$met_config} set value='{$met_patch}' where name='met_patch'";
            $db->query($query);
        }
        echo 1;
    } else {