예제 #1
0
$setting = new Setting();
if (!$user->isLogin()) {
    redirect("Location: status.php?action=login");
}
if (!isset($_GET['id'])) {
    redirect("Location: error.php");
}
if ($_GET['id'] == "new") {
    $t = false;
    $post['type'] = "草稿";
} else {
    $t = true;
    if (!$user->str_check($_GET['id'])) {
        header("Location: error.php");
    }
    $post = $eassy->getEassy($_GET['id']);
    if (!$post) {
        header("Location: error.php");
    }
    if ($user->getPower() != 0) {
        if ($user->getUser() != $post['author']) {
            redirect("Location: error.php");
        }
    }
}
$type = unserialize($setting->get("EassyType"));
if ($post['type'] != "草稿") {
    $flag = false;
    for ($i = 0; $i < count($type); ++$i) {
        if (!empty($type[$i])) {
            $flag = $flag || $type[$i] == $post['type'];
예제 #2
0
require_once "../App.class.php";
App::loadMod("User");
App::loadMod("Eassy");
App::loadMod("Setting");
$app = new App();
$user = new User();
$eassy = new Eassy();
if (!$user->isLogin()) {
    redirect("Location: status.php?action=login");
}
if (isset($_GET['action']) || isset($_GET['id'])) {
    if ($_GET['action'] == "delete") {
        if (!$user->str_check($_GET['id'])) {
            redirect("Location: error.php");
        }
        $e = $eassy->getEassy($_GET['id']);
        if ($user->getPower() != 0) {
            if ($user->getUser() != $e['author']) {
                redirect("Location: error.php");
            }
        }
        $eassy->deleteEassy($_GET['id']);
        echo "<script language=\"javascript\">alert('删除成功!');history.back(-1);</script>";
        die;
    }
}
$limit = isset($_GET['page']) ? (intval($_GET['page']) - 1) * 20 : "0";
$list = $eassy->getList(1, 20, $limit, $user->getPower() == 0 ? "" : $user->getUser());
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
예제 #3
0
App::loadMod("Talk");
App::loadMod("Eassy");
$app = new App();
$user = new User();
$talk = new Talk();
$eassy = new Eassy();
if (!$user->isLogin()) {
    redirect("Location: status.php?action=login");
}
if (isset($_GET['action']) || isset($_GET['id'])) {
    if ($_GET['action'] == "delete") {
        if (!$user->str_check($_GET['id'])) {
            redirect("Location: error.php");
        }
        $t = $talk->getTalk($_GET['id']);
        $e = $eassy->getEassy($t['tid']);
        if ($user->getPower() != 0) {
            if ($user->getUser() != $e['author']) {
                redirect("Location: error.php");
            }
        }
        $talk->delete($_GET['id']);
        echo "<script language=\"javascript\">alert('删除成功!');history.back(-1);</script>";
        die;
    }
}
$tid = isset($_GET['tid']) ? $_GET['tid'] : "";
$limit = isset($_GET['page']) ? (intval($_GET['page']) - 1) * 20 : "0";
if ($tid == "") {
    if ($user->getPower() == 0) {
        $u = "";