Added login_log and overdue_reminders
This commit is contained in:
@@ -34,6 +34,10 @@ class Controller_User_Account extends Controller_TemplateDefault_User {
|
||||
));
|
||||
|
||||
$this->ao->save();
|
||||
|
||||
// Log the password reset
|
||||
$this->ao->log('Password reset');
|
||||
|
||||
Request::current()->redirect('login');
|
||||
|
||||
} else {
|
||||
@@ -50,6 +54,12 @@ class Controller_User_Account extends Controller_TemplateDefault_User {
|
||||
'body'=>_('Your updates didnt pass validation.').'<br/>'.$output,
|
||||
));
|
||||
}
|
||||
else
|
||||
SystemMessage::add(array(
|
||||
'title'=>_('Record NOT updated'),
|
||||
'type'=>'info',
|
||||
'body'=>_('Your account has NOT been updated.')
|
||||
));
|
||||
|
||||
Block::add(array(
|
||||
'title'=>_('Password Reset'),
|
||||
|
@@ -112,5 +112,16 @@ class Model_Account extends Model_Auth_UserDefault {
|
||||
|
||||
return $format ? Currency::display($result) : $result;
|
||||
}
|
||||
|
||||
public function log($message) {
|
||||
// Log the logout
|
||||
$alo = ORM::factory('account_log');
|
||||
$alo->account_id = $this->id;
|
||||
$alo->ip = $_SERVER['REMOTE_ADDR'];
|
||||
$alo->details = $message;
|
||||
$alo->save();
|
||||
|
||||
return $alo->saved();
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
24
modules/account/classes/model/account/log.php
Normal file
24
modules/account/classes/model/account/log.php
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php defined('SYSPATH') or die('No direct access allowed.');
|
||||
|
||||
/**
|
||||
* This class supports Account Login Logging
|
||||
*
|
||||
* @package OSB
|
||||
* @subpackage Account
|
||||
* @category Models
|
||||
* @author Deon George
|
||||
* @copyright (c) 2010 Open Source Billing
|
||||
* @license http://dev.osbill.net/license.html
|
||||
*/
|
||||
class Model_Account_Log extends ORMOSB {
|
||||
protected $_belongs_to = array(
|
||||
'account'=>array(),
|
||||
);
|
||||
|
||||
protected $_display_filters = array(
|
||||
'date_orig'=>array(
|
||||
array('Config::datetime',array(':value')),
|
||||
),
|
||||
);
|
||||
}
|
||||
?>
|
@@ -55,7 +55,9 @@ class Model_Auth_UserDefault extends Model_Auth_User {
|
||||
* We can also do some other post-login actions here.
|
||||
* @todo Maybe we can do our session update here.
|
||||
*/
|
||||
public function complete_login() {}
|
||||
public function complete_login() {
|
||||
return $this->log('Logged In');
|
||||
}
|
||||
|
||||
/**
|
||||
* Test to see if a record has been changed
|
||||
|
Reference in New Issue
Block a user