This repository has been archived on 2024-04-08. You can view files and clone it, but cannot push or open issues or pull requests.
tsmac/application/classes/Controller/User/Welcome.php
2014-10-09 23:23:02 +11:00

96 lines
2.6 KiB
PHP

<?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;
protected $secure_actions = array(
'index'=>0,
);
public function action_index() {
Block::factory()
->title('Quick Shortcuts')
->title_icon('icon-bookmark')
->span(3)
->body(View::factory('welcome/user/shortcuts'));
$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 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()))
->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 TSM : %s',$this->ao->name()))
->title_icon('icon-info-sign')
->span(9)
->body($output);
}
}
?>