Esempio n. 1
0
require_once "lib/manage_class.php";
require_once "lib/config_class.php";
$db = new database();
$manage = new manage($db);
$config = new config();
if ($_POST["AuthUser"]) {
    $_SESSION["login"] = $_POST["login"];
    $r = $manage->checkUser();
} elseif ($_POST["reg"]) {
    $r = $manage->regUser();
} elseif ($_POST["reg_step2"]) {
    $r = $manage->regUserStep2($_POST);
} elseif ($_POST["auth"]) {
    $r = $manage->AuthUser();
} elseif ($_POST["vote"]) {
    $r = $manage->Vote();
} elseif ($_POST["edit"]) {
    unset($_SESSION["login"]);
    $r = $config->address;
} elseif ($_POST["image_editor"]) {
    $_SESSION["image_id"] = $_POST["image_id"];
    $r = $config->address . "?view=image_editor";
} elseif ($_POST["delete_image"]) {
    $_SESSION["image_id"] = $_POST["image_id"];
    $r = $config->address . "?view=image_delete";
} elseif ($_POST["delete_the_image"]) {
    $r = $manage->deleteOnId($_SESSION["image_id"]);
} elseif ($_POST["purchase"]) {
    if (!$_SESSION["login"]) {
        $_SESSION["message"] = "ERROR_NOTAUTH";
        $r = $config->address . "?view=message";