Fixes for KH 3.3 - to do with case file names
This commit is contained in:
4
application/classes/Controller/Default.php
Normal file
4
application/classes/Controller/Default.php
Normal file
@@ -0,0 +1,4 @@
|
||||
<?php defined('SYSPATH') or die('No direct access allowed.');
|
||||
|
||||
class Controller_Default extends lnApp_Controller_Default {}
|
||||
?>
|
70
application/classes/Controller/Domain.php
Normal file
70
application/classes/Controller/Domain.php
Normal file
@@ -0,0 +1,70 @@
|
||||
<?php defined('SYSPATH') or die('No direct access allowed.');
|
||||
|
||||
/**
|
||||
* This class provides information on TSM Nodes.
|
||||
*
|
||||
* @package PTA
|
||||
* @subpackage Domains
|
||||
* @category Controllers
|
||||
* @author Deon George
|
||||
* @copyright (c) 2010 phpTSMadmin Development Team
|
||||
* @license http://phptsmadmin.sf.net/license.html
|
||||
*/
|
||||
class Controller_Domain extends Controller_TemplateDefault {
|
||||
/**
|
||||
* Default Index for Controller
|
||||
*/
|
||||
public function action_index() {
|
||||
$do = ORM::factory('DOMAIN');
|
||||
$output = '';
|
||||
|
||||
$output .= sprintf(_('This server has <b>%s</b> domains.'),$do->count_all());
|
||||
$output .= '<br/>';
|
||||
$output .= '<br/>';
|
||||
|
||||
$select = array();
|
||||
$select[NULL] = '';
|
||||
|
||||
foreach ($do->find_all() as $domain)
|
||||
$select[$domain->DOMAIN_NAME] = $domain->DOMAIN_NAME;
|
||||
|
||||
$output .= Form::open('/domain/detail',array('id'=>'domain_detail'));
|
||||
$output .= sprintf('%s: %s',_('Choose a domain to view'),Form::select('domain_name',$select,NULL,array('id'=>'domain_name')));
|
||||
$output .= Form::submit('form_submit',_('Go'));
|
||||
$output .= Form::close();
|
||||
|
||||
Block::add(array(
|
||||
'title'=>_('TSM Domains'),
|
||||
'body'=>$output,
|
||||
));
|
||||
}
|
||||
|
||||
public function action_detail($domain_name=NULL) {
|
||||
if (is_null($domain_name) AND (empty($_POST['domain_name']) OR ! $domain_name = $_POST['domain_name'])) {
|
||||
SystemMessage::add(array(
|
||||
'title'=>_('DOMAIN_NAME is required'),
|
||||
'type'=>'error',
|
||||
'body'=>_('The domain name is required.'),
|
||||
));
|
||||
|
||||
HTTP::redirect('domain');
|
||||
}
|
||||
|
||||
$do = ORM::factory('DOMAIN',$domain_name);
|
||||
if (! $do->loaded()) {
|
||||
SystemMessage::add(array(
|
||||
'title'=>_('Unknown DOMAIN_NAME'),
|
||||
'type'=>'error',
|
||||
'body'=>sprintf(_('The domain [%s] does not exist?.'),$domain_name),
|
||||
));
|
||||
|
||||
HTTP::redirect('domain');
|
||||
}
|
||||
|
||||
Block::add(array(
|
||||
'title'=>sprintf(_('Node Information for Domain %s'),$do->DOMAIN_NAME),
|
||||
'body'=>View::factory('domain/detail')->set('do',$do)
|
||||
));
|
||||
}
|
||||
}
|
||||
?>
|
72
application/classes/Controller/Library.php
Normal file
72
application/classes/Controller/Library.php
Normal file
@@ -0,0 +1,72 @@
|
||||
<?php defined('SYSPATH') or die('No direct access allowed.');
|
||||
|
||||
/**
|
||||
* This class provides information on TSM attached Libraries.
|
||||
*
|
||||
* @package PTA
|
||||
* @subpackage Libraries
|
||||
* @category Controllers
|
||||
* @author Deon George
|
||||
* @copyright (c) 2010 phpTSMadmin Development Team
|
||||
* @license http://phptsmadmin.sf.net/license.html
|
||||
*/
|
||||
class Controller_Library extends Controller_TemplateDefault {
|
||||
/**
|
||||
* Default Index for Controller
|
||||
*/
|
||||
public function action_index() {
|
||||
$lo = ORM::factory('LIBRARY');
|
||||
$output = '';
|
||||
|
||||
$output .= sprintf(_('This server has <b>%s</b> libraries.'),$lo->count_all());
|
||||
$output .= '<br/>';
|
||||
$output .= '<br/>';
|
||||
|
||||
$select = array();
|
||||
$select[NULL] = '';
|
||||
|
||||
foreach ($lo->find_all() as $library)
|
||||
$select[$library->LIBRARY_NAME] = $library->LIBRARY_NAME;
|
||||
|
||||
$output .= Form::open('/library/detail',array('id'=>'library_detail'));
|
||||
$output .= sprintf('%s: %s',_('Choose a storage pool to view'),Form::select('library_name',$select,NULL,array('id'=>'library_name')));
|
||||
$output .= Form::submit('form_submit',_('Go'));
|
||||
$output .= Form::close();
|
||||
|
||||
Block::add(array(
|
||||
'title'=>_('TSM Libraries'),
|
||||
'body'=>$output,
|
||||
));
|
||||
}
|
||||
|
||||
public function action_detail($library=NULL) {
|
||||
if (is_null($library) AND (empty($_POST['library_name']) OR ! $library = $_POST['library_name'])) {
|
||||
SystemMessage::add(array(
|
||||
'title'=>_('LIBRARY_NAME is required'),
|
||||
'type'=>'error',
|
||||
'body'=>_('The library pool name is required.'),
|
||||
));
|
||||
|
||||
HTTP::redirect('library');
|
||||
}
|
||||
|
||||
$lo = ORM::factory('LIBRARY',$library);
|
||||
if (! $lo->loaded()) {
|
||||
SystemMessage::add(array(
|
||||
'title'=>_('Unknown LIBRARY_NAME'),
|
||||
'type'=>'error',
|
||||
'body'=>sprintf(_('The library pool [%s] does not exist?.'),$library),
|
||||
));
|
||||
|
||||
HTTP::redirect('library');
|
||||
}
|
||||
|
||||
Block::add(array(
|
||||
'title'=>sprintf(_('Library Information for %s'),$lo->LIBRARY_NAME),
|
||||
'body'=>View::factory('library/detail')
|
||||
->set('lo',$lo)
|
||||
->set('slots',$lo->slots())
|
||||
));
|
||||
}
|
||||
}
|
||||
?>
|
4
application/classes/Controller/Login.php
Normal file
4
application/classes/Controller/Login.php
Normal file
@@ -0,0 +1,4 @@
|
||||
<?php defined('SYSPATH') or die('No direct access allowed.');
|
||||
|
||||
class Controller_Login extends lnApp_Controller_Login {}
|
||||
?>
|
4
application/classes/Controller/Logout.php
Normal file
4
application/classes/Controller/Logout.php
Normal file
@@ -0,0 +1,4 @@
|
||||
<?php defined('SYSPATH') or die('No direct access allowed.');
|
||||
|
||||
class Controller_Logout extends lnApp_Controller_Logout {}
|
||||
?>
|
4
application/classes/Controller/Media.php
Normal file
4
application/classes/Controller/Media.php
Normal file
@@ -0,0 +1,4 @@
|
||||
<?php defined('SYSPATH') or die('No direct access allowed.');
|
||||
|
||||
class Controller_Media extends lnApp_Controller_Media {}
|
||||
?>
|
85
application/classes/Controller/Node.php
Normal file
85
application/classes/Controller/Node.php
Normal file
@@ -0,0 +1,85 @@
|
||||
<?php defined('SYSPATH') or die('No direct access allowed.');
|
||||
|
||||
/**
|
||||
* This class provides information on TSM Nodes.
|
||||
*
|
||||
* @package PTA
|
||||
* @subpackage Nodes
|
||||
* @category Controllers
|
||||
* @author Deon George
|
||||
* @copyright (c) 2010 phpTSMadmin Development Team
|
||||
* @license http://phptsmadmin.sf.net/license.html
|
||||
*/
|
||||
class Controller_Node extends Controller_TemplateDefault {
|
||||
/**
|
||||
* Default Index for Controller
|
||||
*/
|
||||
public function action_index() {
|
||||
$no = ORM::factory('NODE');
|
||||
$output = '';
|
||||
|
||||
$output .= sprintf(_('This server has <b>%s</b> defined nodes.'),$no->count_all());
|
||||
$output .= '<br/>';
|
||||
$output .= '<br/>';
|
||||
|
||||
$select = array();
|
||||
$select[NULL] = '';
|
||||
|
||||
foreach ($no->find_all() as $node)
|
||||
$select[$node->NODE_NAME] = $node->NODE_NAME;
|
||||
|
||||
$output .= Form::open('/node/detail',array('id'=>'node_detail'));
|
||||
$output .= sprintf('%s: %s',_('Choose a node to view'),Form::select('node_name',$select,NULL,array('id'=>'node_name')));
|
||||
$output .= Form::submit('form_submit',_('Go'));
|
||||
$output .= Form::close();
|
||||
|
||||
Block::add(array(
|
||||
'title'=>_('TSM Nodes'),
|
||||
'body'=>$output,
|
||||
));
|
||||
}
|
||||
|
||||
public function action_detail($node_name=NULL) {
|
||||
if (is_null($node_name) AND (empty($_POST['node_name']) OR ! $node_name = $_POST['node_name'])) {
|
||||
SystemMessage::add(array(
|
||||
'title'=>_('NODE_NAME is required'),
|
||||
'type'=>'error',
|
||||
'body'=>_('The node name is required.'),
|
||||
));
|
||||
|
||||
HTTP::redirect('node');
|
||||
}
|
||||
|
||||
$no = ORM::factory('NODE',$node_name);
|
||||
if (! $no->loaded()) {
|
||||
SystemMessage::add(array(
|
||||
'title'=>_('Unknown NODE_NAME'),
|
||||
'type'=>'error',
|
||||
'body'=>sprintf(_('The node [%s] does not exist?.'),$node_name),
|
||||
));
|
||||
|
||||
HTTP::redirect('node');
|
||||
}
|
||||
|
||||
Block::add(array(
|
||||
'title'=>sprintf('%s %s',_('Detailed Node Information for'),$no->NODE_NAME),
|
||||
'body'=>View::factory('node/detail')->set('node',$no),
|
||||
));
|
||||
|
||||
Block::add(array(
|
||||
'title'=>_('Protected File System Information'),
|
||||
'body'=>View::factory('node/detail_filesystem')->set('node',$no),
|
||||
));
|
||||
|
||||
Block::add(array(
|
||||
'title'=>_('Sequential Volume Usage Information'),
|
||||
'body'=>View::factory('node/detail_volumes')->set('node',$no),
|
||||
));
|
||||
|
||||
Block::add(array(
|
||||
'title'=>_('Schedule Information'),
|
||||
'body'=>View::factory('node/detail_schedule')->set('node',$no),
|
||||
));
|
||||
}
|
||||
}
|
||||
?>
|
188
application/classes/Controller/Server.php
Normal file
188
application/classes/Controller/Server.php
Normal file
@@ -0,0 +1,188 @@
|
||||
<?php defined('SYSPATH') or die('No direct access allowed.');
|
||||
|
||||
/**
|
||||
* This class provides information on TSM Server.
|
||||
*
|
||||
* @package PTA
|
||||
* @subpackage Server
|
||||
* @category Controllers
|
||||
* @author Deon George
|
||||
* @copyright (c) 2010 phpTSMadmin Development Team
|
||||
* @license http://phptsmadmin.sf.net/license.html
|
||||
*/
|
||||
class Controller_Server extends Controller_TemplateDefault {
|
||||
/**
|
||||
* Default Index for Controller
|
||||
*/
|
||||
public function action_index() {
|
||||
}
|
||||
|
||||
public function action_gantt() {
|
||||
$end = strftime('%Y-%m-%d 23:59',time());
|
||||
$start = strftime('%Y-%m-%d 00:00',time()-86400);
|
||||
|
||||
$ao = ORM::factory('SUMMARY')
|
||||
->where_open()
|
||||
->where('START_TIME','>=',$start)
|
||||
->and_where('END_TIME','>=',$end)
|
||||
->where_close()
|
||||
->or_where_open()
|
||||
->where('END_TIME','<=',$end)
|
||||
->and_where('END_TIME','>=',$start)
|
||||
->or_where_close();
|
||||
|
||||
$graph = new JPGraph_Gantt;
|
||||
|
||||
foreach ($ao->find_all() as $a) {
|
||||
$sort = 10;
|
||||
$csim = '';
|
||||
$caption = '';
|
||||
$wait = 0; // @todo
|
||||
|
||||
switch ($a->ACTIVITY) {
|
||||
case('TAPE MOUNT'):
|
||||
$summary = sprintf('%s (%s)',$a->ACTIVITY,$a->DRIVE_NAME);
|
||||
$csim = sprintf('%s (%s)',$a->VOLUME_NAME,$a->LAST_USE);
|
||||
$sort = 1;
|
||||
break;
|
||||
|
||||
case('STGPOOL BACKUP'):
|
||||
$summary = sprintf('%s (%s)',$a->ACTIVITY,$a->ENTITY);
|
||||
$csim = sprintf('%3d MB. %ss Media wait',$a->BYTES/1024/1024,$a->MEDIAW);
|
||||
$sort = 4;
|
||||
break;
|
||||
|
||||
case('ARCHIVE'):
|
||||
$summary = sprintf('%s (%s)',$a->ACTIVITY,$a->ENTITY);
|
||||
$csim = sprintf('%3d MB',$a->BYTES/1024/1024);
|
||||
$sort = 3;
|
||||
break;
|
||||
|
||||
case('BACKUP'):
|
||||
$summary = sprintf('%s (%s)',$a->ACTIVITY,$a->ENTITY);
|
||||
$csim = sprintf('%3d MB',$a->BYTES/1024/1024);
|
||||
$sort = 2;
|
||||
break;
|
||||
|
||||
case('RESTORE'):
|
||||
$summary = sprintf('%s (%s)',$a->ACTIVITY,$a->ENTITY);
|
||||
$csim = sprintf('%3d MB. %ss Media wait',$a->BYTES/1024/1024,$a->MEDIAW);
|
||||
$sort = 2;
|
||||
break;
|
||||
|
||||
case('RETRIEVE'):
|
||||
$summary = sprintf('%s (%s)',$a->ACTIVITY,$a->ENTITY);
|
||||
$csim = sprintf('%3d MB. %ss Media wait',$a->BYTES/1024/1024,$a->MEDIAW);
|
||||
$sort = 2;
|
||||
break;
|
||||
|
||||
case('FULL_DBBACKUP'):
|
||||
$summary = $a->ACTIVITY;
|
||||
$csim = sprintf('%3d MB. %ss Media wait',$a->BYTES/1024/1024,$a->MEDIAW);
|
||||
break;
|
||||
|
||||
case('RECLAMATION'):
|
||||
$summary = $a->ACTIVITY.' ('.preg_replace('/^(.*)\s+\(.*\)$/','$1',$a->ENTITY).')';
|
||||
$csim = sprintf('%3d MB. %ss Media wait',$a->BYTES/1024/1024,$a->MEDIAW);
|
||||
$sort = 4;
|
||||
break;
|
||||
|
||||
case('MIGRATION'):
|
||||
$summary = $a->ACTIVITY.' ('.$a->ENTITY.')';
|
||||
$csim = sprintf('%3d MB. %ss Media wait',$a->BYTES/1024/1024,$a->MEDIAW);
|
||||
$sort = 4;
|
||||
break;
|
||||
|
||||
case('MOVE NODEDATA'):
|
||||
$summary = $a->ACTIVITY.' ('.$a->ENTITY.')';
|
||||
$csim = sprintf('%3d MB. %ss Media wait',$a->BYTES/1024/1024,$a->MEDIAW);
|
||||
$sort = 4;
|
||||
break;
|
||||
|
||||
case('EXPIRATION'):
|
||||
$summary = 'EXPIRATION PROCESSING';
|
||||
$caption = sprintf('%ss',$a->AFFECTED);
|
||||
|
||||
default:
|
||||
$summary = $a->ACTIVITY;
|
||||
}
|
||||
|
||||
$graph->add($summary,$a->START_TIME,$a->END_TIME)
|
||||
->sort($sort)
|
||||
->progress($wait)
|
||||
->caption($caption)
|
||||
->csim($csim);
|
||||
}
|
||||
|
||||
$graph->jpgraph->SetMargin(1,1,1,1);
|
||||
$graph->jpgraph->SetMarginColor('#FFFFFF');
|
||||
$graph->jpgraph->SetFrame(FALSE,'#FFFFFF',3);
|
||||
$graph->jpgraph->SetColor('#F6F6F8');
|
||||
|
||||
// We want to display day, hour and minute scales
|
||||
$graph->jpgraph->ShowHeaders(GANTT_HDAY | GANTT_HHOUR | GANTT_HMIN);
|
||||
|
||||
$graph->jpgraph->hgrid->Show();
|
||||
$graph->jpgraph->hgrid->SetRowFillColor('#AAAACC@0.85');
|
||||
|
||||
// Setup hour format
|
||||
$graph->jpgraph->scale->day->SetFontColor('white');
|
||||
$graph->jpgraph->scale->day->SetBackgroundColor('blue');
|
||||
$graph->jpgraph->scale->hour->SetFontColor('white');
|
||||
$graph->jpgraph->scale->hour->SetBackgroundColor('blue');
|
||||
$graph->jpgraph->scale->hour->SetIntervall(1);
|
||||
$graph->jpgraph->scale->hour->SetStyle(HOURSTYLE_H24);
|
||||
$graph->jpgraph->scale->minute->SetFontColor('white');
|
||||
$graph->jpgraph->scale->minute->SetBackgroundColor('blue');
|
||||
$graph->jpgraph->scale->minute->SetIntervall(30);
|
||||
|
||||
$url = $graph->draw('gantt');
|
||||
|
||||
Block::add(array(
|
||||
'title'=>_('Server Gantt Activity'),
|
||||
'body'=>HTML::Image('media/'.$url,array('alt'=>_('Service Gantt Activity'))),
|
||||
));
|
||||
}
|
||||
|
||||
// @todo Other work in progress
|
||||
public function xaction_gantt() {
|
||||
$end = date('Y-m-d H:i');
|
||||
$start = date('Y-m-d H:i',time()-86400);
|
||||
|
||||
$startActivites = array();
|
||||
$startActivities['811'] = array('start'=>'Expire Inventory');
|
||||
$startActivities['812'] = array('success'=>'Expire Inventory');
|
||||
$startActivities['2562'] = array('start'=>'Event Records Delete');
|
||||
$startActivities['2564'] = array('success'=>'Event Records Delete');
|
||||
$startActivities['2102'] = array('start'=>'Activity Log Delete');
|
||||
$startActivities['2102'] = array('success'=>'Activity Log Delete');
|
||||
$startActivities['2280'] = array('start'=>'DB Backup');
|
||||
$startActivities['4550'] = array('success'=>'DB Backup');
|
||||
$startActivities['406'] = array('start'=>'Session');
|
||||
$startActivities['403'] = array('success'=>'Session');
|
||||
|
||||
$ao = ORM::factory('ACTLOG')
|
||||
->where('DATE_TIME','>=',$start)
|
||||
->and_where('DATE_TIME','<=',$end)
|
||||
->and_where('ORIGINATOR','=','SERVER')
|
||||
->and_where('MSGNO','in',array_keys($startActivities));
|
||||
|
||||
$activity = array();
|
||||
foreach ($ao->find_all() as $a) {
|
||||
# New Event.
|
||||
if (isset($startActivities[$a->MSGNO]['start'])) {
|
||||
$activity[$startActivities[$a->MSGNO]['start']][]['start'] = $a->DATE_TIME;
|
||||
|
||||
} elseif (isset($startActivities[$a->MSGNO]['success'])) {
|
||||
$item = (isset($activity[$startActivities[$a->MSGNO]['success']]) ? count($activity[$startActivities[$a->MSGNO]['success']])-1 : 0);
|
||||
|
||||
# Is there a start event.
|
||||
if (! isset($activity[$startActivities[$a->MSGNO]['success']][$item]['start']))
|
||||
$activity[$startActivities[$a->MSGNO]['success']][$item]['start'] = $a->DATE_TIME;
|
||||
|
||||
$activity[$startActivities[$a->MSGNO]['success']][$item]['end'] = $a->DATE_TIME;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
70
application/classes/Controller/Stgpool.php
Normal file
70
application/classes/Controller/Stgpool.php
Normal file
@@ -0,0 +1,70 @@
|
||||
<?php defined('SYSPATH') or die('No direct access allowed.');
|
||||
|
||||
/**
|
||||
* This class provides information on TSM Storage Pools.
|
||||
*
|
||||
* @package PTA
|
||||
* @subpackage Storage Pools
|
||||
* @category Controllers
|
||||
* @author Deon George
|
||||
* @copyright (c) 2010 phpTSMadmin Development Team
|
||||
* @license http://phptsmadmin.sf.net/license.html
|
||||
*/
|
||||
class Controller_Stgpool extends Controller_TemplateDefault {
|
||||
/**
|
||||
* Default Index for Controller
|
||||
*/
|
||||
public function action_index() {
|
||||
$so = ORM::factory('STGPOOL');
|
||||
$output = '';
|
||||
|
||||
$output .= sprintf(_('This server has <b>%s</b> stgpool pools.'),$so->count_all());
|
||||
$output .= '<br/>';
|
||||
$output .= '<br/>';
|
||||
|
||||
$select = array();
|
||||
$select[NULL] = '';
|
||||
|
||||
foreach ($so->find_all() as $stgpool)
|
||||
$select[$stgpool->STGPOOL_NAME] = $stgpool->STGPOOL_NAME;
|
||||
|
||||
$output .= Form::open('/stgpool/detail',array('id'=>'stgpool_detail'));
|
||||
$output .= sprintf('%s: %s',_('Choose a storage pool to view'),Form::select('stgpool_name',$select,NULL,array('id'=>'stgpool_name')));
|
||||
$output .= Form::submit('form_submit',_('Go'));
|
||||
$output .= Form::close();
|
||||
|
||||
Block::add(array(
|
||||
'title'=>_('TSM Storage Pools'),
|
||||
'body'=>$output,
|
||||
));
|
||||
}
|
||||
|
||||
public function action_detail($stgpool=NULL) {
|
||||
if (is_null($stgpool) AND (empty($_POST['stgpool_name']) OR ! $stgpool = $_POST['stgpool_name'])) {
|
||||
SystemMessage::add(array(
|
||||
'title'=>_('STGPOOL_NAME is required'),
|
||||
'type'=>'error',
|
||||
'body'=>_('The stgpool pool name is required.'),
|
||||
));
|
||||
|
||||
HTTP::redirect('stgpool');
|
||||
}
|
||||
|
||||
$so = ORM::factory('STGPOOL',$stgpool);
|
||||
if (! $so->loaded()) {
|
||||
SystemMessage::add(array(
|
||||
'title'=>_('Unknown STGPOOL_NAME'),
|
||||
'type'=>'error',
|
||||
'body'=>sprintf(_('The stgpool pool [%s] does not exist?.'),$stgpool),
|
||||
));
|
||||
|
||||
HTTP::redirect('stgpool');
|
||||
}
|
||||
|
||||
Block::add(array(
|
||||
'title'=>sprintf(_('Storage Pool Information for %s'),$so->STGPOOL_NAME),
|
||||
'body'=>View::factory('stgpool/detail')->set('so',$so)
|
||||
));
|
||||
}
|
||||
}
|
||||
?>
|
16
application/classes/Controller/TemplateDefault.php
Normal file
16
application/classes/Controller/TemplateDefault.php
Normal file
@@ -0,0 +1,16 @@
|
||||
<?php defined('SYSPATH') or die('No direct access allowed.');
|
||||
|
||||
/**
|
||||
* This class provides the default template controller for rendering pages.
|
||||
*
|
||||
* @package PTA
|
||||
* @subpackage Page/Template
|
||||
* @category Controllers
|
||||
* @author Deon George
|
||||
* @copyright (c) 2010 phpTSMadmin Development Team
|
||||
* @license http://phptsmadmin.sf.net/license.html
|
||||
*/
|
||||
class Controller_TemplateDefault extends lnApp_Controller_TemplateDefault {
|
||||
protected $auth_required = TRUE;
|
||||
}
|
||||
?>
|
69
application/classes/Controller/Tree.php
Normal file
69
application/classes/Controller/Tree.php
Normal file
@@ -0,0 +1,69 @@
|
||||
<?php defined('SYSPATH') or die('No direct access allowed.');
|
||||
|
||||
/**
|
||||
* This class extends renders OSB menu tree.
|
||||
*
|
||||
* @package lnApp
|
||||
* @subpackage Tree
|
||||
* @category Controllers
|
||||
* @author Deon George
|
||||
* @copyright (c) 2010 Open Source Billing
|
||||
* @license http://dev.osbill.net/license.html
|
||||
*/
|
||||
class Controller_Tree extends lnApp_Controller_Tree {
|
||||
protected $auth_required = TRUE;
|
||||
|
||||
/**
|
||||
* Draw the Tree Menu
|
||||
*
|
||||
* The incoming ID is either a Branch B_x or a Node N_x
|
||||
* Where X is actually the module.
|
||||
*
|
||||
* @param id
|
||||
*/
|
||||
public function action_json(array $data=array()) {
|
||||
// @todo Our menu options
|
||||
array_push($data,array(
|
||||
'id'=>'domain',
|
||||
'name'=>'Domain Info',
|
||||
'state'=>'none',
|
||||
'attr_id'=>'1',
|
||||
'attr_href'=>URL::Site('domain'),
|
||||
));
|
||||
|
||||
array_push($data,array(
|
||||
'id'=>'library',
|
||||
'name'=>'Library Info',
|
||||
'state'=>'none',
|
||||
'attr_id'=>'1',
|
||||
'attr_href'=>URL::Site('library'),
|
||||
));
|
||||
|
||||
array_push($data,array(
|
||||
'id'=>'node',
|
||||
'name'=>'Node Info',
|
||||
'state'=>'none',
|
||||
'attr_id'=>'1',
|
||||
'attr_href'=>URL::Site('node'),
|
||||
));
|
||||
|
||||
array_push($data,array(
|
||||
'id'=>'activity',
|
||||
'name'=>'Server Activity Gantt',
|
||||
'state'=>'none',
|
||||
'attr_id'=>'1',
|
||||
'attr_href'=>URL::Site('server/gantt'),
|
||||
));
|
||||
|
||||
array_push($data,array(
|
||||
'id'=>'stgpool',
|
||||
'name'=>'Storage Pool Info',
|
||||
'state'=>'none',
|
||||
'attr_id'=>'1',
|
||||
'attr_href'=>URL::Site('stgpool'),
|
||||
));
|
||||
|
||||
return parent::action_json($data);
|
||||
}
|
||||
}
|
||||
?>
|
29
application/classes/Controller/Welcome.php
Normal file
29
application/classes/Controller/Welcome.php
Normal file
@@ -0,0 +1,29 @@
|
||||
<?php defined('SYSPATH') or die('No direct access allowed.');
|
||||
|
||||
/**
|
||||
* phpTSMadmin Main home page
|
||||
*
|
||||
* @package PTA
|
||||
* @subpackage Page/Home
|
||||
* @category Controllers
|
||||
* @author Deon George
|
||||
* @copyright (c) 2010 phpTSMadmin Development Team
|
||||
* @license http://phptsmadmin.sf.net/license.html
|
||||
*/
|
||||
class Controller_Welcome extends Controller_TemplateDefault {
|
||||
protected $auth_required = FALSE;
|
||||
|
||||
public function action_index() {
|
||||
if (! Kohana::$config->load('config')->client)
|
||||
HTTP::redirect('guide/app');
|
||||
|
||||
if (! Auth::instance()->logged_in())
|
||||
HTTP::redirect('login');
|
||||
|
||||
Block::add(array(
|
||||
'title'=>sprintf('%s: %s (%s)',_('Server'),TSM::name(),TSM::version()),
|
||||
'body'=>'hello, world!',
|
||||
));
|
||||
}
|
||||
}
|
||||
?>
|
Reference in New Issue
Block a user