Esempio n. 1
0
            }
            $out_str .= "<body style='backgroud-color:#ffffff;'>\n";
            $out_str .= "<script language=javascript src=\"js/edit.js\"></script>\n";
            $out_str .= "<script language=javascript src=\"js/hash.js\"></script>\n";
            $line = @file($path);
            $content = "";
            $lines = "";
            $n = count($line);
            for ($i = 0; $i < $n; $i++) {
                $content .= htmlspecialchars($line[$i]);
            }
            $n += 1000;
            for ($i = 0; $i < $n; $i++) {
                $lines .= $i + 1 . "\n";
            }
            $main = deal_temp("js/editor.htm", array("path" => $path, "titleback" => $icon["titleback"], "width" => $sitewidth - 60, "filename" => basename1($path), "size" => dealsize(filesize($path)), "selected_gb2312" => $selected_gb2312, "selected_utf8" => $selected_utf8, "encode" => $encode));
            $main = deal_temp("temp/{$tempname}/main.htm", array("sitewidth" => $sitewidth, "title" => "编辑文件 " . basename1($path), "logout" => "<a href='login.php?action=logout' target=_top>退出</a>", "main" => $main, "currentpath" => " ", "username" => $user["name"], "footer" => ""));
            $encode2 = get_encode("temp/{$tempname}/main.htm");
            if ($encode != $encode2) {
                $s1 = @iconv($encode2, $encode, $out_str);
                $out_str = $s1 ? $s1 : $out_str;
                $s1 = @iconv($encode2, $encode, $main);
                $main = $s1 ? $s1 : $main;
            }
            echo $out_str;
            echo str_replace(array("{lines}", "{content}"), array($lines, $content), $main);
            echo "<script>RoundCorner('titlediv');RoundCorner('maindiv');</script>";
            exit;
        }
    }
}
Esempio n. 2
0
* Copyright (c) 2004-2006 phpcms.cn
* Author: Longbill ( http://www.longbill.cn )
* longbill.cn@gmail.com
*#########################################
*/
@error_reporting(1);
include_once "common.php";
$uc = check_login();
header("Content-type:TEXT/HTML;Charset=GB2312");
if ($uc) {
    uncookie('user_name');
    uncookie('user_pass');
    exitjs("您已经退出!", "index.php");
} else {
    if ($_POST["action"] != "login") {
        echo deal_temp("temp/{$tempname}/login.htm", array("title" => $title));
        die;
    }
    $user_orig = $_POST["user_name"];
    $pass_orig = $_POST["user_pass"];
    $user_name = my_encode($user_orig);
    $user_pass = my_encode($pass_orig);
    $users = file("class/users.php");
    for ($i = 1; $i < count($users); $i++) {
        if (!trim($users[$i])) {
            continue;
        }
        $arr = explode("|", $users[$i]);
        if ($user_name == my_encode($arr[0]) && $user_pass == $arr[1]) {
            mkcookie('user_name', $user_name);
            mkcookie('user_pass', $user_pass);