Added login_log and overdue_reminders

This commit is contained in:
Deon George
2011-09-27 21:22:13 +10:00
parent f38acfe403
commit b6802e4b5d
12 changed files with 302 additions and 21 deletions

View File

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

View 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')),
),
);
}
?>

View File

@@ -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