Initial commit
This commit is contained in:
71
application/classes/Controller/User/Welcome.php
Normal file
71
application/classes/Controller/User/Welcome.php
Normal file
@@ -0,0 +1,71 @@
|
||||
<?php defined('SYSPATH') or die('No direct access allowed.');
|
||||
|
||||
/**
|
||||
* Main home page
|
||||
*
|
||||
* @package TSM Access Management
|
||||
* @category Controllers/User
|
||||
* @author Deon George
|
||||
* @copyright (c) 2014 Deon George
|
||||
* @license http://dev.leenooks.net/license.html
|
||||
*/
|
||||
class Controller_User_Welcome extends Controller_Welcome {
|
||||
protected $auth_required = TRUE;
|
||||
|
||||
public function action_index() {
|
||||
$n = ORM::factory('ADMIN')->where('EMAIL_ADDRESS','=',$this->ao->email)->find_all();
|
||||
if (! $n->count())
|
||||
$output = 'You have no currently registered ADMINs, would you like to '.HTML::anchor(URL::link('user','admin/add'),'Register').' one?';
|
||||
else
|
||||
$output = Table::factory()
|
||||
->data($n)
|
||||
->columns(array(
|
||||
'ADMIN_NAME'=>'Admin',
|
||||
'REG_TIME'=>'Registered',
|
||||
'PWSET_TIME'=>'PW Reset',
|
||||
'LASTACC_TIME'=>'Last Access',
|
||||
'LOCKED'=>'Locked',
|
||||
))
|
||||
->prepend(array(
|
||||
'id'=>array('url'=>URL::link('user','admin/edit/')),
|
||||
));
|
||||
|
||||
Block::factory()
|
||||
->title(sprintf('Your ADMINs in TSMs : %s',$this->ao->name()))
|
||||
->title_icon('icon-info-sign')
|
||||
->span(9)
|
||||
->body($output);
|
||||
|
||||
$n = ORM::factory('NODE')->where('EMAIL_ADDRESS','=',$this->ao->email)->find_all();
|
||||
if (! $n->count())
|
||||
$output = 'You have no currently registered NODES, would you like to '.HTML::anchor(URL::link('user','node/add'),'Register').' one?';
|
||||
else
|
||||
$output = Table::factory()
|
||||
->data($n)
|
||||
->columns(array(
|
||||
'NODE_NAME'=>'Node',
|
||||
'REG_TIME'=>'Registered',
|
||||
'version()'=>'Version',
|
||||
'PWSET_TIME'=>'PW Reset',
|
||||
'LASTACC_TIME'=>'Last Access',
|
||||
))
|
||||
->prepend(array(
|
||||
'id'=>array('url'=>URL::link('user','node/edit/')),
|
||||
));
|
||||
|
||||
Block::factory()
|
||||
->title(sprintf('Your NODES in TSMs : %s',$this->ao->name()))
|
||||
->title_icon('icon-info-sign')
|
||||
->span(9)
|
||||
->body($output);
|
||||
|
||||
/*
|
||||
Block::factory()
|
||||
->title('Quick Shortcuts')
|
||||
->title_icon('icon-bookmark')
|
||||
->span(3)
|
||||
->body(View::factory('welcome/user/shortcuts'));
|
||||
*/
|
||||
}
|
||||
}
|
||||
?>
|
Reference in New Issue
Block a user