Пример #1
0
<?php

require_once "../App.class.php";
App::loadMod("User");
App::loadMod("Eassy");
App::loadMod("Setting");
$app = new App();
$user = new User();
$eassy = new Eassy();
$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");
Пример #2
0
<?php

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());
?>
Пример #3
0
<?php

require_once "../App.class.php";
App::loadMod("User");
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'] : "";