Function isAuthenticated() on a non-object

Fermé
Suprem Messages postés 20 Date d'inscription dimanche 6 janvier 2013 Statut Membre Dernière intervention 11 avril 2017 - 24 août 2013 à 12:14
Suprem Messages postés 20 Date d'inscription dimanche 6 janvier 2013 Statut Membre Dernière intervention 11 avril 2017 - 25 août 2013 à 19:35
Bonjour,
j'ai une erreur dans mon code php que je n'arrive pas à résoudre, pouvez-vous m'aider :
Call to a member function isAuthenticated() on a non-object


<?php
include_once("libraries/securimage/securimage.php");
require_once('application/libraries/PasswordHash.php');

class User extends CI_Controller
{

private $hashTool;
private $data = array();

public function __construct()
{
$this->hashTool = new PasswordHash(8, TRUE);
$this->usermanager =& get_instance();
}
public function check_password($pass, $hash){
return $this->hashTool->CheckPassword($pass, $hash);
}


public function index() {

if ($this->usermanager->isAuthenticated()) {
$this->profile();
} else {
$this->authenticate();
}
}

public function authenticate() {
if ($this->usermanager->isAuthenticated()) {
$this->profile();
return;
}

if ($this->input->post("nickname") || $this->input->post("password")) {
$name = $this->input->post("nickname");
$password = $this->input->post("password");
if ($this->usermanager->authenticate($name, $this->hashTool->CheckPassword($password, $stored_hash))) {
$this->data["goodError"] = "Bienvenue <strong>" . $name . "</strong> !";
$this->profile();
return;
} else {
$this->data["error"] = "Mauvais identifiant/mot de passe.";
}
}
$this->layout->view("user_authenticate", $this->data);
}
A voir également:

1 réponse

Suprem Messages postés 20 Date d'inscription dimanche 6 janvier 2013 Statut Membre Dernière intervention 11 avril 2017 1
25 août 2013 à 19:35
up
0