Added login_log and overdue_reminders
This commit is contained in:
40
application/classes/controller/admin/account.php
Normal file
40
application/classes/controller/admin/account.php
Normal file
@@ -0,0 +1,40 @@
|
||||
<?php defined('SYSPATH') or die('No direct access allowed.');
|
||||
|
||||
/**
|
||||
* This class provides Admin Account management
|
||||
*
|
||||
* @package lnApp
|
||||
* @subpackage Page/Account
|
||||
* @category Controllers
|
||||
* @author Deon George
|
||||
* @copyright (c) 2010 Deon George
|
||||
* @license http://dev.leenooks.net/license.html
|
||||
*/
|
||||
class Controller_Admin_Account extends Controller_TemplateDefault_Admin {
|
||||
protected $secure_actions = array(
|
||||
'listlog'=>TRUE,
|
||||
);
|
||||
|
||||
/**
|
||||
* Show a list of account logins
|
||||
*/
|
||||
public function action_listlog() {
|
||||
Block::add(array(
|
||||
'title'=>_('Account Login Log'),
|
||||
'body'=>Table::display(
|
||||
ORM::factory('account_log')->order_by('id','DESC')->find_all(),
|
||||
25,
|
||||
array(
|
||||
'id'=>array('label'=>'ID','url'=>'admin/account/view/'),
|
||||
'date_orig'=>array('label'=>'Date'),
|
||||
'account->name()'=>array('label'=>'Account'),
|
||||
'ip'=>array('label'=>'IP Address'),
|
||||
'details'=>array('label'=>'Details'),
|
||||
),
|
||||
array(
|
||||
'page'=>TRUE,
|
||||
)),
|
||||
));
|
||||
}
|
||||
}
|
||||
?>
|
@@ -24,9 +24,9 @@ class Controller_Admin_Welcome extends Controller_TemplateDefault {
|
||||
$o = ORM::factory('invoice');
|
||||
|
||||
Block_Sub::add(array(
|
||||
'title'=>'Invoices Overdue',
|
||||
'title'=>'Invoices Overdue - No Auto Billing',
|
||||
'body'=>Table::display(
|
||||
$o->list_overdue($t),
|
||||
$o->list_overdue_billing($t),
|
||||
25,
|
||||
array(
|
||||
'due_date'=>array('label'=>'Due Date'),
|
||||
@@ -40,6 +40,23 @@ class Controller_Admin_Welcome extends Controller_TemplateDefault {
|
||||
'order'=>1,
|
||||
));
|
||||
|
||||
Block_Sub::add(array(
|
||||
'title'=>'Invoices Overdue - Auto Billing',
|
||||
'body'=>Table::display(
|
||||
$o->list_overdue_billing($t,TRUE),
|
||||
25,
|
||||
array(
|
||||
'due_date'=>array('label'=>'Due Date'),
|
||||
'account->name()'=>array('label'=>'Account'),
|
||||
'account->display("status")'=>array('label'=>'Active'),
|
||||
'id()'=>array('label'=>'ID'),
|
||||
'due(TRUE)'=>array('label'=>'Amount Due','class'=>'right'),
|
||||
),
|
||||
array('page'=>TRUE)),
|
||||
'position'=>2,
|
||||
'order'=>1,
|
||||
));
|
||||
|
||||
Block_Sub::add(array(
|
||||
'title'=>'Invoices Due',
|
||||
'body'=>Table::display(
|
||||
@@ -53,7 +70,7 @@ class Controller_Admin_Welcome extends Controller_TemplateDefault {
|
||||
'due(TRUE)'=>array('label'=>'Amount Due','class'=>'right'),
|
||||
),
|
||||
array('show_other'=>'due()')),
|
||||
'position'=>2,
|
||||
'position'=>3,
|
||||
'order'=>1,
|
||||
));
|
||||
|
||||
@@ -73,8 +90,8 @@ class Controller_Admin_Welcome extends Controller_TemplateDefault {
|
||||
'balance(TRUE)'=>array('label'=>'Balance','class'=>'right'),
|
||||
),
|
||||
array('show_other'=>'balance()')),
|
||||
'position'=>3,
|
||||
'order'=>1,
|
||||
'position'=>1,
|
||||
'order'=>2,
|
||||
));
|
||||
|
||||
Block::add(array(
|
||||
|
@@ -168,6 +168,9 @@ class Controller_lnApp_Login extends Controller_TemplateDefault {
|
||||
'USER_NAME'=>sprintf('%s %s',$mt->account->first_name,$mt->account->last_name),
|
||||
);
|
||||
$et->send();
|
||||
|
||||
// Log the password reset
|
||||
$ao->log('Password reset token sent');
|
||||
}
|
||||
|
||||
// Redirect to our password reset, the Auth will validate the token.
|
||||
|
@@ -15,7 +15,9 @@ class Controller_lnApp_Logout extends Controller {
|
||||
public function action_index() {
|
||||
# If user already signed-in
|
||||
if (Auth::instance()->logged_in()!= 0) {
|
||||
$ao = Auth::instance()->get_user();
|
||||
Auth::instance()->logout();
|
||||
$ao->log('Logged Out');
|
||||
|
||||
Request::current()->redirect('login');
|
||||
}
|
||||
|
Reference in New Issue
Block a user