2014-10-06 10:57:54 +00:00
|
|
|
<?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;
|
|
|
|
|
2014-10-08 12:17:00 +00:00
|
|
|
protected $secure_actions = array(
|
|
|
|
'index'=>0,
|
|
|
|
);
|
|
|
|
|
2014-10-06 10:57:54 +00:00
|
|
|
public function action_index() {
|
2014-10-09 12:23:02 +00:00
|
|
|
Block::factory()
|
|
|
|
->title('Quick Shortcuts')
|
|
|
|
->title_icon('icon-bookmark')
|
|
|
|
->span(3)
|
|
|
|
->body(View::factory('welcome/user/shortcuts'));
|
|
|
|
|
2014-10-06 10:57:54 +00:00
|
|
|
$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()
|
2014-10-08 12:17:00 +00:00
|
|
|
->title(sprintf('Your ADMINs in TSM : %s',$this->ao->name()))
|
|
|
|
->title_icon('icon-info-sign')
|
|
|
|
->span(9)
|
|
|
|
->body($output);
|
|
|
|
|
|
|
|
$n = $this->ao->ssl->find_all();
|
|
|
|
if (! $n->count())
|
|
|
|
$output = 'You have no currently SSL Certificates, would you like to '.HTML::anchor(URL::link('user','ssl/add'),'add').' one?';
|
|
|
|
else
|
|
|
|
$output = Table::factory()
|
|
|
|
->data($n)
|
|
|
|
->columns(array(
|
|
|
|
'id'=>'ID',
|
|
|
|
'dn()'=>'Cert',
|
|
|
|
'valid_to(TRUE)'=>'Expires',
|
|
|
|
'issuer_cn()'=>'Issuer',
|
|
|
|
))
|
|
|
|
->prepend(array(
|
|
|
|
'id'=>array('url'=>URL::link('user','ssl/view/')),
|
|
|
|
));
|
|
|
|
|
|
|
|
Block::factory()
|
|
|
|
->title(sprintf('Your SSL Certificates for TSM : %s',$this->ao->name()))
|
2014-10-06 10:57:54 +00:00
|
|
|
->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()
|
2014-10-08 12:17:00 +00:00
|
|
|
->title(sprintf('Your NODES in TSM : %s',$this->ao->name()))
|
2014-10-06 10:57:54 +00:00
|
|
|
->title_icon('icon-info-sign')
|
|
|
|
->span(9)
|
|
|
|
->body($output);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
?>
|