Go to the documentation of this file.00001 <?php
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 include_once('Auth/Auth.php');
00025
00034 class ilAuthDB extends Auth
00035 {
00041 public function __construct()
00042 {
00043 global $ilClientIniFile;
00044
00045 $auth_params = array(
00046 'dsn' => IL_DSN,
00047 'table' => $ilClientIniFile->readVariable("auth", "table"),
00048 'usernamecol' => $ilClientIniFile->readVariable("auth", "usercol"),
00049 'passwordcol' => $ilClientIniFile->readVariable("auth", "passcol")
00050 );
00051 parent::Auth("DB", $auth_params,"",false);
00052
00053
00054 $this->setCallbacks();
00055 }
00056
00062 protected function loginObserver($a_username)
00063 {
00064 if(!strlen($_POST['password']))
00065 {
00066 $this->status = AUTH_WRONG_LOGIN;
00067 $this->logout();
00068 return false;
00069 }
00070 return true;
00071 }
00072
00080 protected function failedLoginObserver()
00081 {
00082 return false;
00083 }
00084
00089 private function setCallbacks()
00090 {
00091 $this->setLoginCallback(array($this,'loginObserver'));
00092 $this->setFailedLoginCallback(array($this,'failedLoginObserver'));
00093 }
00094
00095 }
00096 ?>