Ejemplo n.º 1
0
    die("Sorry.");
}
if (!file_exists("./config.php")) {
    header("Location: ./install.php");
    die;
}
include "config.php";
include "inc/mitsuba.php";
include "inc/strings/imgboard.strings.php";
if (!empty($_POST['mode'])) {
    $return_url = "./";
    if (!empty($_POST['board'])) {
        $return_url = "./" . $_POST['board'] . "/";
    }
    $conn = new mysqli($db_host, $db_username, $db_password, $db_database);
    $mitsuba = new Mitsuba($conn);
    $e = array("requestdata" => &$_POST);
    $mitsuba->emitEvent("imgboard.begin", $e);
    $mod = 0;
    if (!empty($_GET['mod']) && $_GET['mod'] >= 1) {
        if (!empty($_POST['board']) && $mitsuba->common->isBoard($_POST['board'])) {
            $mitsuba->admin->canBoard($_POST['board']);
            $mod = 1;
            if ($_GET['mod'] == 1) {
                $return_url = "mod.php?/board&b=" . $_POST['board'];
            } else {
                $mod = 2;
            }
        } else {
            $mod = 1;
            if ($_GET['mod'] == 1) {
Ejemplo n.º 2
0
} else {
    $pkey = array_keys($_GET);
    if (substr($pkey[0], 0, 1) == "/") {
        $path = $pkey[0];
    } else {
        $path = "/";
    }
}
if ($path != "/") {
    $path = rtrim($path, "/ ");
}
if ((!isset($_SESSION['logged']) || $_SESSION['logged'] == 0) && !($path == "/" || $path == "/login")) {
    die($lang['mod/not_logged_in']);
}
$conn = new mysqli($db_host, $db_username, $db_password, $db_database);
$mitsuba = new Mitsuba($conn);
function deleteEntry($conn, $type, $id)
{
    global $mitsuba;
    if (!is_numeric($id)) {
        return -1;
    }
    $table = "";
    if ($type == 0) {
        $table = "announcements";
    }
    if ($type == 1) {
        $table = "news";
    }
    if ($mitsuba->admin->checkPermission($table . ".delete", $_SESSION['group'])) {
        $conn->query("DELETE FROM " . $table . " WHERE id=" . $id);