Exemple #1
0
 /**
  * Check customer informations saved into cookie and return customer validity
  *
  * @deprecated as of version 1.5 use Customer::isLogged() instead
  * @return boolean customer validity
  */
 public function isLogged($withGuest = false)
 {
     Tools::displayAsDeprecated();
     if (!$withGuest && $this->is_guest == 1) {
         return false;
     }
     /* Customer is valid only if it can be load and if cookie password is the same as database one */
     if ($this->logged == 1 && $this->id_customer && Validate::isUnsignedId($this->id_customer) && Customer::checkPassword((int) $this->id_customer, $this->passwd)) {
         return true;
     }
     return false;
 }
Exemple #2
0
 /**
  * Check customer informations and return customer validity
  *
  * @since 1.5.0
  * @param boolean $with_guest
  * @return boolean customer validity
  */
 public function isLogged($with_guest = false)
 {
     if (!$with_guest && $this->is_guest == 1) {
         return false;
     }
     /* Customer is valid only if it can be load and if object password is the same as database one */
     if ($this->logged == 1 && $this->id && Validate::isUnsignedId($this->id) && Customer::checkPassword($this->id, $this->passwd)) {
         return true;
     }
     return false;
 }
Exemple #3
0
 /**
  * Check customer informations saved into cookie and return customer validity
  *
  * @return boolean customer validity
  */
 function isLogged()
 {
     /* Customer is valid only if it can be load and if cookie password is the same as database one */
     if ($this->logged == 1 and $this->id_customer and Validate::isUnsignedId($this->id_customer) and Customer::checkPassword(intval($this->id_customer), $this->passwd)) {
         return true;
     }
     return false;
 }
Exemple #4
0
 /**
  * Check customer informations saved into cookie and return customer validity
  *
  * @return boolean customer validity
  */
 public function isLogged($withGuest = false)
 {
     if (!$withGuest and $this->is_guest == 1) {
         return false;
     }
     /* Customer is valid only if it can be load and if cookie password is the same as database one */
     if ($this->logged == 1 and $this->id_customer and Validate::isUnsignedId($this->id_customer) and Customer::checkPassword((int) $this->id_customer, $this->passwd)) {
         return true;
     }
     return false;
 }
<?php

require_once "util.php";
session_start();
if (isset($_SESSION["username"])) {
    header("location: index.php");
}
$message = "";
if (isset($_POST["username"]) && isset($_POST["password"])) {
    require_once "DataBase/Customer.php";
    $customer = new Customer();
    if ($customer->checkPassword(var_post("username", ""), var_post("password", ""))) {
        $_SESSION["username"] = var_post("username", "");
        header("location: index.php");
    } else {
        $message = "Anmeldung fehlgeschlagen";
    }
}
include "header.php";
?>

<br>
<br>

<form method="post" action="session_login.php" name="login_form">
<div width="100%" align="center">
<?php 
if ($message != "") {
    print "<div class=\"error\">" . $message . "</div><br>";
}
?>