This repository has been archived on 2024-04-08. You can view files and clone it, but cannot push or open issues or pull requests.
phptsmadmin/application/classes/auth/orm.php
2011-05-01 13:53:27 +10:00

32 lines
882 B
PHP

<?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();
}
}
?>