Modalise login
This commit is contained in:
@@ -10,6 +10,19 @@
|
||||
* @license http://dev.osbill.net/license.html
|
||||
*/
|
||||
class Auth_OSB extends Auth_ORM {
|
||||
/**
|
||||
* We need to override Kohana's __construct(), for tasks, which attempt to open a session
|
||||
* and probably dont have access to PHP sessions path.
|
||||
* Tasks dont need sessions anyway?
|
||||
*/
|
||||
public function __construct($config = array()) {
|
||||
// Save the config in the object
|
||||
$this->_config = $config;
|
||||
|
||||
if (PHP_SAPI !== 'cli')
|
||||
parent::__construct($config);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the user that a token applies to
|
||||
*
|
||||
@@ -181,6 +194,10 @@ class Auth_OSB extends Auth_ORM {
|
||||
public function logged_in($role=NULL,$debug=NULL) {
|
||||
$status = FALSE;
|
||||
|
||||
// If we are a CLI, we are not logged in
|
||||
if (PHP_SAPI === 'cli')
|
||||
return $status;
|
||||
|
||||
// Get the user from the session
|
||||
$uo = $this->get_user();
|
||||
|
||||
|
@@ -72,21 +72,20 @@ class Controller_Login extends lnApp_Controller_Login {
|
||||
|
||||
// Show our token screen even if the email was invalid.
|
||||
if (isset($_POST['username']))
|
||||
Block::factory()
|
||||
->body(View::factory('pages/login_reset_sent'));
|
||||
$output = View::factory('pages/login_reset_sent');
|
||||
|
||||
else
|
||||
HTTP::redirect('login');
|
||||
|
||||
} else {
|
||||
Block::factory()
|
||||
->body(View::factory('pages/login_reset'));
|
||||
$output = View::factory('pages/login_reset');
|
||||
}
|
||||
|
||||
Style::factory()
|
||||
->type('file')
|
||||
->data('media/theme/baseadmin/css/pages/login.css');
|
||||
|
||||
$this->template->content = $output;
|
||||
$this->template->shownavbar = FALSE;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user