Ejemplo n.º 1
0
function upload($form, $met_file_format)
{
    global $lang_js22, $lang_js23, $lang_fileOK, $lang_fileError1, $lang_fileError2, $lang_fileError3, $lang_fileError4;
    if (is_array($form)) {
        $filear = $form;
    } else {
        $filear = $_FILES[$form];
    }
    if (!is_writable('../upload/file/')) {
        okinfo('javascript:history.go(-1);', $lang_js22);
    }
    //Get extension
    $ext = explode(".", $filear["name"]);
    $extnum = count($ext) - 1;
    $ext = $ext[$extnum];
    //Save the settings file name
    $name = met_rand(32) . "." . $ext;
    if (strtolower($ext) == 'php' || strtolower($ext) == 'aspx' || strtolower($ext) == 'asp' || strtolower($ext) == 'jsp' || strtolower($ext) == 'js' || strtolower($ext) == 'asa') {
        okinfo('javascript:history.go(-1);', $lang_js23);
    }
    if ($met_file_format != "" && !in_array(strtolower($ext), explode("|", strtolower($met_file_format)))) {
        okinfo('javascript:history.go(-1);', $lang_js23);
    }
    if (!copy($filear["tmp_name"], "../upload/file/" . $name)) {
        $errors = array(0 => "{$lang_fileOK}", 1 => "{$lang_fileError1} ", 2 => "{$lang_fileError2} ", 3 => "{$lang_fileError3} ", 4 => "{$lang_fileError4} ");
    } else {
        @unlink($filear["tmp_name"]);
        //Delete temporary files
    }
    return "../upload/file/" . $name;
}
Ejemplo n.º 2
0
function login_met_cookie($userid)
{
    global $met_cookie, $metinfo_admin_name, $metinfo_admin_pass, $met_webkeys, $db, $met_admin_table;
    $met_cookie = array();
    $met_cookie['time'] = time();
    $json = json_encode($met_cookie);
    $userid = daddslashes($userid, 0, 1);
    $db->query("update {$met_admin_table} set cookie='{$json}' WHERE admin_id='{$userid}'");
    $query = "select * from {$met_admin_table} WHERE admin_id='{$userid}'";
    $user = $db->get_one($query);
    $met_key = met_rand(7);
    $user[admin_pass] = md5($user[admin_pass]);
    $auth = authcode("{$user['admin_id']}\t{$user['admin_pass']}", 'ENCODE', $met_webkeys . $met_key, 86400);
    met_setcookie("met_auth", $auth, 0);
    met_setcookie("met_key", $met_key, 0);
}
Ejemplo n.º 3
0
Archivo: wap.php Proyecto: nanfs/lt
    if ($met_wap_tpb) {
        if ($met_langok[$lang][link]) {
            $met_weburl_mobile = $met_langok[$lang][link];
        }
        if ($met_wap_url) {
            $met_weburl_mobile = $met_wap_url;
        }
    }
    $post = array('text' => $met_weburl_mobile, 'w' => $wap_dimensional_size, 'logo' => $met_dimensional_logo_file);
    $re = curl_post($post, 30);
    if (!file_exists('../../../upload/files/')) {
        mkdir('../../../upload/files/');
    }
    file_put_contents('../../../upload/files/dimensional.png', $re);
    require_once $depth . '../include/config.php';
    echo '../../../upload/files/dimensional.png?' . met_rand(4);
    die;
}
if ($action == 'modify') {
    if ($met_wapshowtype == 0) {
        $met_wap_ok = 0;
    } else {
        $query = "update {$met_column} SET wap_ok = '0' where lang='{$lang}'";
        $db->query($query);
        if ($f_columnlist != ',') {
            $allidlist = explode(',', $f_columnlist);
            foreach ($allidlist as $key => $val) {
                if ($val) {
                    $query = "update {$met_column} SET wap_ok = '1' where id = '{$val}' and lang='{$lang}'";
                    $db->query($query);
                }
Ejemplo n.º 4
0
         sql_execute($sql);
     }
     dl_error("{$file_error[2]}{$lang_updaterr14}", $type, $olid, $ver, $addr, $action);
 }
 $str = file_get_contents("../update/{$addr}/update.php");
 if ($str != 'No Date') {
     include "../update/{$addr}/update.php";
 }
 if ($type == 1) {
     $db->query("update {$met_config} set value='{$ver}' where name='metcms_v'");
     $authinfo = $db->get_one("SELECT * FROM {$met_otherinfo} where id=1");
     $met_file = '/dl/record_dl.php';
     $post_data = array('cmd' => 'sys', 'url' => $met_weburl, 'code' => $authinfo['authcode'], 'key' => $authinfo['authpass'], 'ver' => $ver);
     curl_post($post_data, 10);
     $num = 1;
     $random = met_rand(6);
     $date = date('Ymd', time());
     require_once '../system/database/global.func.php';
     do {
         $sqldump = '';
         $startrow = '';
         $statistics1 = $tablepre . 'visit_day';
         $statistics2 = $tablepre . 'visit_detail';
         $statistics3 = $tablepre . 'visit_summary';
         $tables = tableprearray($tablepre);
         $sizelimit = 2048;
         $tableid = isset($tableid) ? $tableid - 1 : 0;
         $startfrom = isset($startfrom) ? intval($startfrom) : 0;
         $tablenumber = count($tables);
         for ($i = $tableid; $i < $tablenumber && strlen($sqldump) < $sizelimit * 1000; $i++) {
             if ($tables[$i] == $statistics1 || $tables[$i] == $statistics2 || $tables[$i] == $statistics3) {