Enabled login

This commit is contained in:
Deon George
2011-03-04 10:06:18 +11:00
parent d03f675646
commit 2c15a4b40e
13 changed files with 779 additions and 4 deletions

View File

@@ -0,0 +1,31 @@
<?php defined('SYSPATH') or die('No direct access allowed.');
/**
* This class overrides Kohana's Auth so that we can login to TSM
*
* @package PTA
* @subpackage Auth
* @category Overrides
* @author Deon George
* @copyright (c) 2010 phpTSMadmin Development Team
* @license http://phptsmadmin.sf.net/license.html
*/
class Auth_ORM extends Kohana_Auth_ORM {
/**
* Attempt to log in a user by using an ORM object and plain-text password.
*
* @param string username to log in
* @param string password to check against
* @param boolean enable autologin
* @return boolean
*/
public function login($username, $password, $remember = FALSE) {
// With TSM, if we get this far, we are logged in
return $username->loaded();
}
public function logged_in($role = NULL, $all_required = TRUE) {
return FALSE !== $this->get_user();
}
}
?>