diff -ruN -x CVS portstools/tinderbox/webui/core/Hooks.php /tinderbox/scripts/webui/core/Hooks.php --- portstools/tinderbox/webui/core/Hooks.php 1969-12-31 19:00:00.000000000 -0500 +++ /tinderbox/scripts/webui/core/Hooks.php 2011-06-25 17:09:22.585399425 -0400 @@ -0,0 +1,56 @@ + +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# $MCom$ +# + +require_once 'TinderObject.php'; + +class Hooks extends TinderObject { + + function Hooks ( $argv = array() ) { + $object_hash = array( + 'hook_name' => '', + 'hook_cmd' => '', + 'hook_description' => '' + ); + + $this->TinderObject( $object_hash, $argv ); + } + + function getName() { + return $this->hook_name; + } + + function getCmd() { + return $this->hook_cmd; + } + + function getDescription() { + return $this->hook_description; + } +} +?> diff -ruN -x CVS portstools/tinderbox/webui/core/TinderboxDS.php /tinderbox/scripts/webui/core/TinderboxDS.php --- portstools/tinderbox/webui/core/TinderboxDS.php 2011-01-04 10:03:57.000000000 -0500 +++ /tinderbox/scripts/webui/core/TinderboxDS.php 2011-06-25 15:48:54.087479398 -0400 @@ -32,6 +32,7 @@ require_once 'BuildGroups.php'; require_once 'BuildPortsQueue.php'; require_once 'Config.php'; +require_once 'Hooks.php'; require_once 'Jail.php'; require_once 'LogfilePattern.php'; require_once 'Port.php'; @@ -54,6 +55,7 @@ 'PortFailPattern' => 'port_fail_patterns', 'PortFailReason' => 'port_fail_reasons', 'User' => 'users', + 'Hooks' => 'hooks', ); class TinderboxDS { @@ -753,6 +755,10 @@ return $this->getObjects( 'Config', $params ); } + function getHooks( $params = array() ) { + return $this->getObjects( 'Hooks', $params ); + } + function getBuildPortsQueue( $params = array() ) { return $this->getObjects( 'BuildPortsQueue', $params ); } @@ -799,6 +805,12 @@ return $config; } + function getAllHooks() { + $config = $this->getHooks(); + + return $config; + } + function getAllBuilds( $sortby = '' ) { $builds = $this->getBuilds( array(), $sortby ); diff -ruN -x CVS portstools/tinderbox/webui/module/moduleConfig.php /tinderbox/scripts/webui/module/moduleConfig.php --- portstools/tinderbox/webui/module/moduleConfig.php 2009-01-02 09:16:27.000000000 -0500 +++ /tinderbox/scripts/webui/module/moduleConfig.php 2011-06-25 16:16:42.734679770 -0400 @@ -60,6 +60,7 @@ $jails = $this->TinderboxDS->getAllJails(); $ports_trees = $this->TinderboxDS->getAllPortsTrees(); $config_options = $this->TinderboxDS->getAllConfig(); + $hooks = $this->TinderboxDS->getAllHooks(); foreach( $jails as $jail ) { $jail_id = $jail->getId(); @@ -72,6 +73,14 @@ 'jail_src_mount' => $jail->getSrcMount() ); }; + + $x = 0; + foreach( $hooks as $hook ) { + $all_hooks[$x++] = array( 'hook_name' => $hook->getName(), + 'hook_cmd' => $hook->getCmd(), + 'hook_description' => $hook->getDescription() ); + }; + foreach( $ports_trees as $ports_tree ) { $ports_tree_id = $ports_tree->getId(); $all_ports_trees[$ports_tree_id] = array( 'ports_tree_name' => $ports_tree->getName(), @@ -99,6 +108,7 @@ $this->_array_sort_and_assign( $all_ports_trees, 'ports_tree' ); $this->_array_sort_and_assign( $all_builds, 'build' ); $this->_array_sort_and_assign( $all_config_options, 'config_option' ); + $this->_array_sort_and_assign( $all_hooks, 'hook' ); return $this->template_parse( 'config.tpl' ); } diff -ruN -x CVS portstools/tinderbox/webui/templates/paefchen/config.tpl /tinderbox/scripts/webui/templates/paefchen/config.tpl --- portstools/tinderbox/webui/templates/paefchen/config.tpl 2008-09-14 12:22:15.000000000 -0400 +++ /tinderbox/scripts/webui/templates/paefchen/config.tpl 2011-06-25 17:00:34.869398411 -0400 @@ -95,6 +95,28 @@

There are no ports trees configured.

+

configured hooks:

+ + + + + + + + + + + + + + + + +
NameCommandDescription
+ +

There are no hooks configured.

+ +

further configurations: