/* Checkt of voor 10u is (tussen 6 en 10u) */
    header("Location: buitentijd.php");
    exit(0);
}
if (!isset($_SESSION["aangemeld"]) || $_SESSION["aangemeld"] == false) {
    /* Checkt of je aangemeld bent */
    header("Location: aanmelden.php");
    exit(0);
} else {
    if (isset($_GET["wijzig"])) {
        if ($_GET["wijzig"]) {
            $klant = CustomerService::haalKlantOp($_SESSION["klant"]);
            if (!empty($_POST["huidig"]) && !empty($_POST["nieuw1"]) && !empty($_POST["nieuw2"])) {
                if ($klant->getWachtwoord() == $_POST["huidig"]) {
                    if ($_POST["nieuw1"] == $_POST["nieuw2"] && $_POST["nieuw1"] != null) {
                        CustomerService::wijzigWachtwoord($_SESSION["klant"], $_POST["nieuw1"]);
                        $gelijk = true;
                        header("Location: bestellen.php");
                        exit(0);
                    }
                    $gelijk = false;
                    $leeg = false;
                    $wachtwoord = true;
                } else {
                    $wachtwoord = false;
                }
            } else {
                $leeg = true;
            }
        }
    }
Exemple #2
0
$classLoader = new ClassLoader("BroodjesProject", "src");
$classLoader->register();
session_start();
if (TijdService::checkTijd()) {
    header("Location: buitentijd.php");
    exit(0);
}
if ($_SESSION["aangemeld"]) {
    header("Location: bestellen.php");
    exit(0);
}
if (isset($_GET["action"])) {
    if ($_GET["action"] == "registreren") {
        if ($_POST["wachtwoord"] == $_POST["wachtwoordCheck"] && $_POST["voornaam"] != null && $_POST["achternaam"] != null && $_POST["email"] != null && $_POST["wachtwoord"] != null && $_POST["wachtwoordCheck"] != null) {
            /* Geen controle of klant bestaat! */
            CustomerService::VoegNieuweKlantToe($_POST["voornaam"], $_POST["achternaam"], $_POST["email"], $_POST["wachtwoord"]);
            header("Location: aanmelden.php");
            exit(0);
        } else {
            if ($_POST["voornaam"] == null || $_POST["achternaam"] == null || $_POST["email"] == null || $_POST["wachtwoord"] == null || $_POST["wachtwoordCheck"] == null) {
                header("Location: registreren.php?error=veldleeg");
                exit(0);
            }
            if ($_POST["wachtwoord"] != $_POST["wachtwoordCheck"]) {
                header("Location: registreren.php?error=wachtwoord");
                exit(0);
            }
        }
    }
}
if (isset($_GET["error"])) {
Exemple #3
0
<?php

use BroodjesProject\Business\CustomerService;
use BroodjesProject\Business\TijdService;
use Doctrine\Common\ClassLoader;
require_once "Doctrine/Common/ClassLoader.php";
require_once "libraries/Twig/Autoloader.php";
Twig_Autoloader::register();
$loader = new Twig_Loader_Filesystem("src/BroodjesProject/presentation");
$twig = new Twig_Environment($loader);
$classLoader = new ClassLoader("BroodjesProject", "src");
$classLoader->register();
session_start();
$customerSvc = new CustomerService();
if (TijdService::checkTijd()) {
    header("Location: buitentijd.php");
    exit(0);
}
if (isset($_GET["uitloggen"])) {
    if ($_GET["uitloggen"]) {
        $_SESSION["aangemeld"] = false;
    }
}
if (isset($_SESSION["aangemeld"])) {
    if ($_SESSION["aangemeld"]) {
        header("Location: bestellen.php");
        exit(0);
    }
}
if (isset($_GET["action"])) {
    if ($_GET["action"] == "login") {