version 1.1.1.1, 2007/11/02 20:55:00
|
version 1.1.1.1.2.1, 2007/11/13 07:36:19
|
Line 24
|
Line 24
|
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
# SUCH DAMAGE. |
# SUCH DAMAGE. |
# |
# |
|
# $Paefchen$ |
# $MCom: portstools/tinderbox/webui/module/moduleConfig.php,v 1.4 2007/10/13 02:28:47 ade Exp $ |
# $MCom: portstools/tinderbox/webui/module/moduleConfig.php,v 1.4 2007/10/13 02:28:47 ade Exp $ |
# |
# |
|
|
require_once 'module/module.php'; |
|
require_once 'module/moduleUsers.php'; |
|
|
|
class moduleConfig extends module { |
class moduleConfig extends module { |
|
private $moduleUsers = null; |
|
|
function moduleConfig() { | public function moduleConfig() { |
| parent::__construct(); |
$this->module(); |
$this->module(); |
$this->moduleUsers = new moduleUsers(); | $this->moduleUsers = new moduleUsers; |
} |
} |
|
|
function _array_sort_and_assign( $sort_me, $tpl_key ) { | private function _array_sort_and_assign( $sort_me, $tpl_key ) { |
if( is_array( $sort_me ) && count( $sort_me ) > 0 ) { |
if( is_array( $sort_me ) && count( $sort_me ) > 0 ) { |
foreach( $sort_me as $res ) |
foreach( $sort_me as $res ) |
$sort[] = $res[$tpl_key.'_name']; |
$sort[] = $res[$tpl_key.'_name']; |
Line 49 class moduleConfig extends module {
|
Line 49 class moduleConfig extends module {
|
} |
} |
} |
} |
|
|
function display_config() { | public function display_config() { |
if( !$this->moduleUsers->is_logged_in() ) { |
if( !$this->moduleUsers->is_logged_in() ) { |
return $this->template_parse( 'please_login.tpl' ); |
return $this->template_parse( 'please_login.tpl' ); |
} else if( ! $this->moduleUsers->checkWwwAdmin() ) { |
} else if( ! $this->moduleUsers->checkWwwAdmin() ) { |
Line 70 class moduleConfig extends module {
|
Line 70 class moduleConfig extends module {
|
'jail_update_cmd' => $jail->getUpdateCmd(), |
'jail_update_cmd' => $jail->getUpdateCmd(), |
'jail_description' => $jail->getDescription(), |
'jail_description' => $jail->getDescription(), |
'jail_src_mount' => $jail->getSrcMount() ); |
'jail_src_mount' => $jail->getSrcMount() ); |
}; | } |
|
|
foreach( $ports_trees as $ports_tree ) { |
foreach( $ports_trees as $ports_tree ) { |
$ports_tree_id = $ports_tree->getId(); |
$ports_tree_id = $ports_tree->getId(); |
Line 80 class moduleConfig extends module {
|
Line 80 class moduleConfig extends module {
|
'ports_tree_description' => $ports_tree->getDescription(), |
'ports_tree_description' => $ports_tree->getDescription(), |
'ports_tree_cvsweb_url' => $ports_tree->getCVSwebURL(), |
'ports_tree_cvsweb_url' => $ports_tree->getCVSwebURL(), |
'ports_tree_ports_mount' => $ports_tree->getPortsMount() ); |
'ports_tree_ports_mount' => $ports_tree->getPortsMount() ); |
}; | } |
|
|
foreach( $builds as $build ) { |
foreach( $builds as $build ) { |
$build_id = $build->getId(); |
$build_id = $build->getId(); |
Line 88 class moduleConfig extends module {
|
Line 88 class moduleConfig extends module {
|
'build_description' => $build->getDescription(), |
'build_description' => $build->getDescription(), |
'jail_name' => $all_jails[$build->getJailId()]['jail_name'], |
'jail_name' => $all_jails[$build->getJailId()]['jail_name'], |
'ports_tree_name' => $all_ports_trees[$build->getPortsTreeId()]['ports_tree_name'] ); |
'ports_tree_name' => $all_ports_trees[$build->getPortsTreeId()]['ports_tree_name'] ); |
}; | } |
|
|
foreach( $config_options as $config_option ) { |
foreach( $config_options as $config_option ) { |
$all_config_options[] = array( 'config_option_name' => $config_option->getName(), |
$all_config_options[] = array( 'config_option_name' => $config_option->getName(), |
'config_option_value' => $config_option->getValue() ); |
'config_option_value' => $config_option->getValue() ); |
}; | } |
|
|
$this->_array_sort_and_assign( $all_jails, 'jail' ); |
$this->_array_sort_and_assign( $all_jails, 'jail' ); |
$this->_array_sort_and_assign( $all_ports_trees, 'ports_tree' ); |
$this->_array_sort_and_assign( $all_ports_trees, 'ports_tree' ); |
Line 102 class moduleConfig extends module {
|
Line 102 class moduleConfig extends module {
|
|
|
return $this->template_parse( 'config.tpl' ); |
return $this->template_parse( 'config.tpl' ); |
} |
} |
|
|
} |
} |
|
|
?> |
?> |