0.9.8.10
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
MyAuthAdapter.php
Go to the documentation of this file.
1 <?
24 require_once("Zend/Auth/Result.php");
25 require_once("ProfileTable.php");
26 require_once("Profile.php");
27 
28 class MyAuthAdapter implements Zend_Auth_Adapter_Interface
29 {
30  public function __construct($username, $password) {
31  $this->_username=$username;
32  $this->_password=$password;
33  }
34 
35  public function authenticate() {
36  $profile=ProfileTable::load($this->_username);
37  if (!$profile)
38  return new Zend_Auth_Result(-1, null, array());
39  if (!$profile->checkPassword($this->_password))
40  return new Zend_Auth_Result(-3, null, array());
41  return new Zend_Auth_Result(1, $profile, array());
42  }
43 }
44 
45 ?>
Copyright (C) 2007-2015 Hypertable, Inc.
__construct($username, $password)