Beispiel #1
0
<?php

// +----------------------------------------------------------
// | Auto-Press
// +----------------------------------------------------------
// | toegang.php
// |
// +----------------------------------------------------------
// | Jan Bevers
// +----------------------------------------------------------
include_once getcwd() . "/classes/BLUser.php";
$blUser = new BLUser();
$user = $blUser->getUserByPassword($_POST["account"], $_POST["password"]);
if ($user != null) {
    $_SESSION["online"] = true;
    $_SESSION["userid"] = $user->getId();
    $_SESSION["userrole"] = $user->getRole();
    $_SESSION["username"] = $user->getAccount();
    $_SESSION["dbbackupfinished"] = false;
    header("Location: " . SUBFOLDER . "/page/siteadministration");
} else {
    $_SESSION["online"] = false;
    $_SESSION["username"] = $_POST["account"];
    //echo (md5($_POST["wachtwoord"]));
    header("Location: " . SUBFOLDER . "/page/home");
}
Beispiel #2
0
<?php

include_once getcwd() . "/classes/BLUser.php";
$blUser = new BLUser();
$user = $blUser->getUser($_SESSION["userid"]);
$withpass = false;
if (isset($_POST["account"])) {
    if ($_POST["password"] != $_POST["password2"]) {
        $error["password"] = "******";
    } else {
        $user->setAccount($_POST["account"]);
        $user->setEmail($_POST["email"]);
        $user->setName($_POST["name"]);
        if ($_POST["password"] != "") {
            $user->setPassword($_POST["password"]);
            $withpass = true;
        }
        $error = $blUser->updateUser($user, $withpass);
        $success = "";
        if (is_numeric($error)) {
            $success = "Profile saved!";
            $error = null;
            $_SESSION["username"] = $user->getAccount();
        }
    }
}
?>


<h2 id="gebruikersgegevens">My profile</h2>