summaryrefslogtreecommitdiff
path: root/scire
diff options
context:
space:
mode:
authorPreston Cody <codeman@gentoo.org>2007-03-17 03:21:40 +0000
committerPreston Cody <codeman@gentoo.org>2007-03-17 03:21:40 +0000
commite444edb75351e6152366eea3928afe80df2e6b6a (patch)
tree2647a4477de599432253cf0f10bf0aa52396c5f9 /scire
parentadding path varible to allow for module use. (diff)
downloadscire-e444edb75351e6152366eea3928afe80df2e6b6a.tar.gz
scire-e444edb75351e6152366eea3928afe80df2e6b6a.tar.bz2
scire-e444edb75351e6152366eea3928afe80df2e6b6a.zip
smarty: adding Modules link to main bar.
common: add path check. someone else please verify if this is secure. functions: adding functions for default fields values. svn path=/; revision=185
Diffstat (limited to 'scire')
-rw-r--r--scire/.lib/common.php13
-rw-r--r--scire/.lib/functions.php12
-rw-r--r--scire/.lib/smarty.php1
3 files changed, 26 insertions, 0 deletions
diff --git a/scire/.lib/common.php b/scire/.lib/common.php
index 85e8d65..0c2f2ba 100644
--- a/scire/.lib/common.php
+++ b/scire/.lib/common.php
@@ -1,5 +1,18 @@
<?php
+# Validate the path if it exists.
+if (isset($path)) {
+ if ($path != "../") {
+ header('Content-type: text/html; charset=UTF-8');
+ $smarty->assign('title', 'Path Error');
+ $smarty->assign('message', 'invalid path. stop trying to hack me you mofo!');
+ $smarty->display('message.tpl');
+ exit(0);
+ }
+} else {
+ $path = "";
+}
+
# Configuration
require_once('config.php');
diff --git a/scire/.lib/functions.php b/scire/.lib/functions.php
index 5908f09..7f49f7f 100644
--- a/scire/.lib/functions.php
+++ b/scire/.lib/functions.php
@@ -40,6 +40,10 @@ function get_clients_fields() {
return $fields;
}
+function get_default_clients_fields() {
+ return 'hostname,ip,profile_name,osname,username,status,groups';
+}
+
function get_users_fields() {
$fields['username'] = array('name' => 'Username', 'sortable' => True);
$fields['real_name'] = array('name' => 'Real Name', 'sortable' => True);
@@ -49,6 +53,10 @@ function get_users_fields() {
return $fields;
}
+function get_default_users_fields() {
+ return 'username,real_name,comment,status,groups';
+}
+
function get_jobs_fields() {
$fields['hostname'] = array('name' => 'Hostname', 'sortable' => True);
$fields['priority'] = array('name' => 'Priority', 'sortable' => True);
@@ -62,6 +70,10 @@ function get_jobs_fields() {
return $fields;
}
+function get_default_jobs_fields() {
+ return 'hostname,scriptname,priority,created,permname,pending,failed';
+}
+
function get_priorities() {
return array('1','2','3','4','5','6','7','8','9');
}
diff --git a/scire/.lib/smarty.php b/scire/.lib/smarty.php
index bd4a7be..4d9d3c5 100644
--- a/scire/.lib/smarty.php
+++ b/scire/.lib/smarty.php
@@ -26,6 +26,7 @@ $topbar_right = array(
$topbar_left[] = array('name' => 'Users', 'link' => 'users.php');
#}
$topbar_left[] = array('name' => 'Script Library', 'link' => 'script_library.php');
+$topbar_left[] = array('name' => 'Modules', 'link' => 'modules.php');
$smarty->assign('topbar_left', $topbar_left);
$smarty->assign('topbar_right', $topbar_right);