diff options
237 files changed, 26247 insertions, 24 deletions
diff --git a/ChangeLog b/ChangeLog new file mode 100644 index 0000000..0720c0e --- /dev/null +++ b/ChangeLog @@ -0,0 +1,131 @@ +# ChangeLog for Scire +# Copyright 2006-2006 Gentoo Foundation; Distributed under the GPL v2 +# $Id$ + + 9 Dec 2006; Andrew Gaffney <agaffney@gentoo.org> + server/SecureXMLRPCServer.py: + switch to ForkingMixIn instead of ThreadingMixIn to prevent cert info from + bleeding between connection instances. + reverse order of inherited classes so MixIn works properly + + 15 Jul 2006; Preston Cody <codeman@gentoo.org> ChangeLog: + Updating the scire server and client programs with their current + development copy. All changes from previous version have been + made by Matt Disney as part of the Summer of Code. These are + somewhat large updates involving database connectivity using + python's ADOdb module and function calls between the server and + client. Many thanks to Matt for the contribution. + + 15 Jul 2006; Preston Cody <codeman@gentoo.org> ChangeLog: + Adding a Python-port of PHP-GACL's acl_check function, + written by Brian Coca. This is submitted with his permission. + this will take an ADOdb object (or config info), and then return + the result of acl_check() queries as in PHP. Many thanks to + Brian for the port. + + 14 Jun 2006; Preston Cody <codeman@gentoo.org> ChangeLog: + various updates around the board. mainly focusing on client and user + pages. some DB updates and asthetic changes. + preparing for user sessions + + 04 Jun 2006; Preston Cody <codeman@gentoo.org> ChangeLog: + adding some mockup HTML files made by blackace. + need templates for those files. + + 04 Jun 2006; Preston Cody <codeman@gentoo.org> ChangeLog: + updated some scire database interface files + fixed some queries + fixed the exporter pages (as useless as they are now). + + 04 Jun 2006; Preston Cody <codeman@gentoo.org> ChangeLog: + the database tables are most current on the wiki + they have been sync'd to svn. sample DB code too. + + 21 May 2006; Preston Cody <codeman@gentoo.org> ChangeLog: + updating Changelog. Lots of updates tonight. + Fixed up blackace's templates. + migrated index and login pages, admin to follow soon. + updates to moria.sql for session table. + + 07 May 2006; Preston Cody <codeman@gentoo.org> ChangeLog: + adding a lot of webgli screens, some of which are done + the details of the status of webgli is in /webgli/TODO + + 05 May 2006; Preston Cody <codeman@gentoo.org> ChangeLog: + adding a few documents to moria since that seems like a good + place to put them + + 23 Apr 2006; Preston Cody <codeman@gentoo.org> ChangeLog: + webgli: adding portage screen + + 23 Apr 2006; Preston Cody <codeman@gentoo.org> ChangeLog: + adding the rest of the converted admin pages. + conversion should be complete. + webgli: adding initial screens of makedotconf + + 22 Apr 2006; Preston Cody <codeman@gentoo.org> ChangeLog: + initial scire files and directory added. more will come soon + Lots more general updates. Getting things converted over and simplified. + + 22 Apr 2006; Preston Cody <codeman@gentoo.org> ChangeLog: + updated globaluse and Utility + adding initial localuse screens + + 17 Apr 2006; Andrew Gaffney <agaffney@gentoo.org> + webgli/XMLParser.php: + moved common code from webgliIP.php + webgli/webgliIP.php: + moved common code to XMLParser.php + webgli/webgliCF.php: + initial commit + + 17 Apr 2006; Preston Cody <codeman@gentoo.org> ChangeLog: + adding globaluse screen + will need to rearrange stuff so it works better + without sharing between pages. + minor touchups to other files + + 16 Apr 2006; Preston Cody <codeman@gentoo.org> ChangeLog: + adding etc_portage and extrapackages screens + edited daemons and config files + added functions to webgliUtility + + 15 Apr 2006; Preston Cody <codeman@gentoo.org> ChangeLog: + adding initial daemon screen + + 15 Apr 2006; Preston Cody <codeman@gentoo.org> ChangeLog: + adding initial files for configfiles screen + small updates to the other screens. + + 15 Apr 2006; Andrew Gaffney <agaffney@gentoo.org> + webgli/webgliIP.php: + begin conversion + working version + output self-closing tag is value is empty + webgli/XMLParser.php: + initial XML parser superclass + move initialization code to parse() + working version + webgli/configfiles.php: + converted IP code + + 15 Apr 2006; Preston Cody <codeman@gentoo.org> ChangeLog: + adding client config screens to webgli + + 15 Apr 2006; Preston Cody <codeman@gentoo.org> ChangeLog: + added temp copy of webgli stuff + + 12 Apr 2006; Preston Cody <codeman@gentoo.org> ChangeLog: + Changing project name to Scire in various files. + + 26 Mar 2006; Preston Cody <codeman@gentoo.org> ChangeLog: + Adding current state of my webserver GIMLI directory + includes phpGACL code and smarty, both of which + are necessary to install. nothing works either + without the database + + 24 Mar 2006; Preston Cody <codeman@gentoo.org> ChangeLog: + Testing echangelog. Adding two db table creation commands. + + 23 Mar 2006; Andrew Gaffney <agaffney@gentoo.org> ChangeLog: + initial ChangeLog commit @@ -0,0 +1,3 @@ +TODO LIST FOR Scire +User Management Section: + <blackace> codeman: it also seems somewhat strange that I can't edit group membership from the edit group screen diff --git a/client/scireclient.pl b/client/scireclient.pl index b4b0227..a9cfe20 100755 --- a/client/scireclient.pl +++ b/client/scireclient.pl @@ -37,6 +37,24 @@ sub run_main { } } + my @new_jobs = glob("$conf{job_dir}/queue/*.job"); + for (@new_jobs) { + my $job = Scire::Job->new(); + $job->load_jobfile($_); + $job->set_stdout_file("$conf{job_dir}/queue/$job->{jobid}.out"); + $job->set_stderr_file("$conf{job_dir}/queue/$job->{jobid}.err"); + $job->set_script_file("$conf{job_dir}/queue/$job->{jobid}.script"); + my $exitcode = $job->run(); + if(!$exitcode) { + # Successful job completion + system("mv $conf{job_dir}/queue/$job->{jobid}.* $conf{job_dir}/done/"); + } else { + # Job failed + system("mv $conf{job_dir}/queue/$job->{jobid}.* $conf{job_dir}/failed/"); + } + } + + talk_to_server(); } sub talk_to_server { @@ -196,15 +214,19 @@ sub get_jobs { sub scan_jobs_dir { #Scan the dirs for job files. - my @existing_jobs = glob("$conf{job_dir}/queue/*"); - my @failed_jobs = glob("$conf{job_dir}/failed/*"); - my @done_jobs = glob("$conf{job_dir}/done/*"); + my @existing_jobs = glob("$conf{job_dir}/queue/*.job"); + my @failed_jobs = glob("$conf{job_dir}/failed/*.job"); + my @done_jobs = glob("$conf{job_dir}/done/*.job"); + # XXX: this function should just scan the various job dirs, create a Scire::Job object + # for each job found, and return a structure containing the info, so that another + # function can act on the completed jobs + #Report on those jobs needing reporting. foreach my $job_file (@failed_jobs) { $job_file =~ /(\d+)\.job/; my $jobid = $1; - my ($status, $message) = $comm->send_command("SET_JOB_STATUS $jobid 'Failed'"); + my ($status, $message) = $comm->send_command("SET_JOB_STATUS", $jobid, "Failed"); open(FILE, $job_file) or die "Couldn't open job file $job_file: $!"; my $job_data = join("", <FILE>); close(FILE); @@ -214,7 +236,8 @@ sub scan_jobs_dir { foreach my $job_file (@done_jobs) { $job_file =~ /(\d+)\.job/; my $jobid = $1; - my ($status, $message) = $comm->send_command("SET_JOB_STATUS $jobid 'Done'"); + my ($status, $message) = $comm->send_command("SET_JOB_STATUS", $jobid, "Done"); + # XXX: Send job output } return @existing_jobs; diff --git a/client/test.pl b/client/test.pl index c198964..e5fdcbb 100644 --- a/client/test.pl +++ b/client/test.pl @@ -9,11 +9,11 @@ use Scire::Job; use Scire::Communicator; my $job = Scire::Job->new(); -$job->load_jobfile("/tmp/scirejobs/job1.job"); +$job->load_jobfile("/tmp/scirejobs/queue/39.job"); #print $job->{script_data} . "\n"; -$job->set_stdout_file("/tmp/scire_stdout.txt"); -$job->set_stderr_file("/tmp/scire_stderr.txt"); -$job->set_script_file("/tmp/scirejobs/runjob.sh"); +$job->set_stdout_file("/tmp/scirejobs/result/39_stdout.txt"); +$job->set_stderr_file("/tmp/scirejobs/result/39_stderr.txt"); +$job->set_script_file("/tmp/scirejobs/run/runjob.sh"); my $exitcode = $job->run(); print "Job complete with exit code ${exitcode}\n"; diff --git a/docs/bare_scire.sql b/docs/bare_scire.sql new file mode 100644 index 0000000..689bb73 --- /dev/null +++ b/docs/bare_scire.sql @@ -0,0 +1,1060 @@ +use scire; +-- MySQL dump 10.10 +-- +-- Host: localhost Database: scire +-- ------------------------------------------------------ +-- Server version 5.0.26-log + +/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; +/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; +/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; +/*!40101 SET NAMES utf8 */; +/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; +/*!40103 SET TIME_ZONE='+00:00' */; +/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; +/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; +/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; +/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; + +-- +-- Table structure for table `GLI_profiles` +-- + +DROP TABLE IF EXISTS `GLI_profiles`; +CREATE TABLE `GLI_profiles` ( + `profileid` int(11) NOT NULL auto_increment, + `profile_name` varchar(255) NOT NULL default '', + `location` varchar(255) NOT NULL default '', + `description` varchar(255) default NULL, + PRIMARY KEY (`profileid`), + UNIQUE KEY `profile_name` (`profile_name`) +) ENGINE=MyISAM AUTO_INCREMENT=3 DEFAULT CHARSET=utf8; + +-- +-- Dumping data for table `GLI_profiles` +-- + +LOCK TABLES `GLI_profiles` WRITE; +/*!40000 ALTER TABLE `GLI_profiles` DISABLE KEYS */; +INSERT INTO `GLI_profiles` VALUES (1,'printerserver','/scire/gli_profiles/printerserver.xml','A typical printer server install profile. has like cups and shit.'),(2,'mta','/scire/gli_profiles/mta.xml','A typical MTA install profile. has like very little except mailers.'); +/*!40000 ALTER TABLE `GLI_profiles` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `clients` +-- + +DROP TABLE IF EXISTS `clients`; +CREATE TABLE `clients` ( + `clientid` int(11) NOT NULL, + `assetid` varchar(64) default NULL, + `cert` text, + `hostname` varchar(64) NOT NULL default '', + `mac` varchar(17) NOT NULL default '', + `ip` varchar(15) NOT NULL default '', + `gli_profile` int(11) default NULL, + `osid` int(11) default NULL, + `status` varchar(20) default NULL, + `contact` int(11) default NULL, + `installtime` timestamp NOT NULL default CURRENT_TIMESTAMP, + `digest` varchar(128) default NULL, + PRIMARY KEY (`clientid`), + UNIQUE KEY `assetid` (`assetid`), + UNIQUE KEY `digest` (`digest`), + KEY `osid` (`osid`), + KEY `gli_profile` (`gli_profile`), + KEY `contact` (`contact`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +-- +-- Dumping data for table `clients` +-- + +LOCK TABLES `clients` WRITE; +/*!40000 ALTER TABLE `clients` DISABLE KEYS */; +/*!40000 ALTER TABLE `clients` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `gacl_acl` +-- + +DROP TABLE IF EXISTS `gacl_acl`; +CREATE TABLE `gacl_acl` ( + `id` int(11) NOT NULL default '0', + `section_value` varchar(230) NOT NULL default 'system', + `allow` int(11) NOT NULL default '0', + `enabled` int(11) NOT NULL default '0', + `return_value` text, + `note` text, + `updated_date` int(11) NOT NULL default '0', + PRIMARY KEY (`id`), + KEY `gacl_enabled_acl` (`enabled`), + KEY `gacl_section_value_acl` (`section_value`), + KEY `gacl_updated_date_acl` (`updated_date`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1; + +-- +-- Dumping data for table `gacl_acl` +-- + +LOCK TABLES `gacl_acl` WRITE; +/*!40000 ALTER TABLE `gacl_acl` DISABLE KEYS */; +INSERT INTO `gacl_acl` VALUES (3,'system',1,1,'1','',1156105535),(2,'system',1,1,'1','',1156105485),(4,'system',1,1,'1','',1156105622),(1,'system',1,1,'1','',1156105457),(6,'system',1,1,'1','',1156041570),(7,'system',1,1,'1','',1156105434),(5,'system',1,1,'1','',1156105677); +/*!40000 ALTER TABLE `gacl_acl` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `gacl_acl_sections` +-- + +DROP TABLE IF EXISTS `gacl_acl_sections`; +CREATE TABLE `gacl_acl_sections` ( + `id` int(11) NOT NULL default '0', + `value` varchar(230) NOT NULL default '', + `order_value` int(11) NOT NULL default '0', + `name` varchar(230) NOT NULL default '', + `hidden` int(11) NOT NULL default '0', + PRIMARY KEY (`id`), + UNIQUE KEY `gacl_value_acl_sections` (`value`), + KEY `gacl_hidden_acl_sections` (`hidden`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1; + +-- +-- Dumping data for table `gacl_acl_sections` +-- + +LOCK TABLES `gacl_acl_sections` WRITE; +/*!40000 ALTER TABLE `gacl_acl_sections` DISABLE KEYS */; +INSERT INTO `gacl_acl_sections` VALUES (1,'system',1,'System',0); +/*!40000 ALTER TABLE `gacl_acl_sections` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `gacl_acl_seq` +-- + +DROP TABLE IF EXISTS `gacl_acl_seq`; +CREATE TABLE `gacl_acl_seq` ( + `id` int(11) NOT NULL default '0' +) ENGINE=MyISAM DEFAULT CHARSET=latin1; + +-- +-- Dumping data for table `gacl_acl_seq` +-- + +LOCK TABLES `gacl_acl_seq` WRITE; +/*!40000 ALTER TABLE `gacl_acl_seq` DISABLE KEYS */; +INSERT INTO `gacl_acl_seq` VALUES (8); +/*!40000 ALTER TABLE `gacl_acl_seq` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `gacl_aco` +-- + +DROP TABLE IF EXISTS `gacl_aco`; +CREATE TABLE `gacl_aco` ( + `id` int(11) NOT NULL default '0', + `section_value` varchar(240) NOT NULL default '0', + `value` varchar(240) NOT NULL default '', + `order_value` int(11) NOT NULL default '0', + `name` varchar(255) NOT NULL default '', + `hidden` int(11) NOT NULL default '0', + PRIMARY KEY (`id`), + UNIQUE KEY `gacl_section_value_value_aco` (`section_value`,`value`), + KEY `gacl_hidden_aco` (`hidden`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1; + +-- +-- Dumping data for table `gacl_aco` +-- + +LOCK TABLES `gacl_aco` WRITE; +/*!40000 ALTER TABLE `gacl_aco` DISABLE KEYS */; +INSERT INTO `gacl_aco` VALUES (13,'scire_ui','Edit User Info',1,'Edit User Info',0),(14,'scire_ui','Add User',1,'Add User',0),(15,'scire_ui','Add Client',1,'Add Client',0),(16,'scire_ui','View Clients',1,'View Clients',0),(17,'scire_ui','View Pending Clients',1,'View Pending Clients',0),(18,'scire_ui','Approve/Reject Pending Clients',1,'Approve/Reject Pending Clients',0),(19,'scire_ui','View Jobs',1,'View Jobs',0),(20,'scire_ui','Add Job',1,'Add Job',0); +/*!40000 ALTER TABLE `gacl_aco` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `gacl_aco_map` +-- + +DROP TABLE IF EXISTS `gacl_aco_map`; +CREATE TABLE `gacl_aco_map` ( + `acl_id` int(11) NOT NULL default '0', + `section_value` varchar(230) NOT NULL default '0', + `value` varchar(230) NOT NULL default '', + PRIMARY KEY (`acl_id`,`section_value`,`value`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1; + +-- +-- Dumping data for table `gacl_aco_map` +-- + +LOCK TABLES `gacl_aco_map` WRITE; +/*!40000 ALTER TABLE `gacl_aco_map` DISABLE KEYS */; +INSERT INTO `gacl_aco_map` VALUES (6,'scire_ui','Add User'),(7,'scire_ui','Add Client'),(1,'scire_ui','View Clients'),(2,'scire_ui','View Pending Clients'),(3,'scire_ui','Approve/Reject Pending Clients'),(4,'scire_ui','View Jobs'),(5,'scire_ui','Add Job'); +/*!40000 ALTER TABLE `gacl_aco_map` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `gacl_aco_sections` +-- + +DROP TABLE IF EXISTS `gacl_aco_sections`; +CREATE TABLE `gacl_aco_sections` ( + `id` int(11) NOT NULL default '0', + `value` varchar(230) NOT NULL default '', + `order_value` int(11) NOT NULL default '0', + `name` varchar(230) NOT NULL default '', + `hidden` int(11) NOT NULL default '0', + PRIMARY KEY (`id`), + UNIQUE KEY `gacl_value_aco_sections` (`value`), + KEY `gacl_hidden_aco_sections` (`hidden`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1; + +-- +-- Dumping data for table `gacl_aco_sections` +-- + +LOCK TABLES `gacl_aco_sections` WRITE; +/*!40000 ALTER TABLE `gacl_aco_sections` DISABLE KEYS */; +INSERT INTO `gacl_aco_sections` VALUES (1,'scire_ui',1,'scire_ui',0); +/*!40000 ALTER TABLE `gacl_aco_sections` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `gacl_aco_sections_seq` +-- + +DROP TABLE IF EXISTS `gacl_aco_sections_seq`; +CREATE TABLE `gacl_aco_sections_seq` ( + `id` int(11) NOT NULL default '0' +) ENGINE=MyISAM DEFAULT CHARSET=latin1; + +-- +-- Dumping data for table `gacl_aco_sections_seq` +-- + +LOCK TABLES `gacl_aco_sections_seq` WRITE; +/*!40000 ALTER TABLE `gacl_aco_sections_seq` DISABLE KEYS */; +INSERT INTO `gacl_aco_sections_seq` VALUES (2); +/*!40000 ALTER TABLE `gacl_aco_sections_seq` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `gacl_aco_seq` +-- + +DROP TABLE IF EXISTS `gacl_aco_seq`; +CREATE TABLE `gacl_aco_seq` ( + `id` int(11) NOT NULL default '0' +) ENGINE=MyISAM DEFAULT CHARSET=latin1; + +-- +-- Dumping data for table `gacl_aco_seq` +-- + +LOCK TABLES `gacl_aco_seq` WRITE; +/*!40000 ALTER TABLE `gacl_aco_seq` DISABLE KEYS */; +INSERT INTO `gacl_aco_seq` VALUES (21); +/*!40000 ALTER TABLE `gacl_aco_seq` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `gacl_aro` +-- + +DROP TABLE IF EXISTS `gacl_aro`; +CREATE TABLE `gacl_aro` ( + `id` int(11) NOT NULL default '0', + `section_value` varchar(240) NOT NULL default '0', + `value` varchar(240) NOT NULL default '', + `order_value` int(11) NOT NULL default '0', + `name` varchar(255) NOT NULL default '', + `hidden` int(11) NOT NULL default '0', + PRIMARY KEY (`id`), + UNIQUE KEY `gacl_section_value_value_aro` (`section_value`,`value`), + KEY `gacl_hidden_aro` (`hidden`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1; + +-- +-- Dumping data for table `gacl_aro` +-- + +LOCK TABLES `gacl_aro` WRITE; +/*!40000 ALTER TABLE `gacl_aro` DISABLE KEYS */; +INSERT INTO `gacl_aro` VALUES (1,'users','root',0,'root',0),(2,'users','codeman',1,'codeman',0); +/*!40000 ALTER TABLE `gacl_aro` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `gacl_aro_groups` +-- + +DROP TABLE IF EXISTS `gacl_aro_groups`; +CREATE TABLE `gacl_aro_groups` ( + `id` int(11) NOT NULL default '0', + `parent_id` int(11) NOT NULL default '0', + `lft` int(11) NOT NULL default '0', + `rgt` int(11) NOT NULL default '0', + `name` varchar(255) NOT NULL default '', + `value` varchar(255) NOT NULL default '', + PRIMARY KEY (`id`,`value`), + UNIQUE KEY `gacl_value_aro_groups` (`value`), + KEY `gacl_parent_id_aro_groups` (`parent_id`), + KEY `gacl_lft_rgt_aro_groups` (`lft`,`rgt`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1; + +-- +-- Dumping data for table `gacl_aro_groups` +-- + +LOCK TABLES `gacl_aro_groups` WRITE; +/*!40000 ALTER TABLE `gacl_aro_groups` DISABLE KEYS */; +INSERT INTO `gacl_aro_groups` VALUES (1,0,1,2,'Company Name','Company Name'); +/*!40000 ALTER TABLE `gacl_aro_groups` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `gacl_aro_groups_id_seq` +-- + +DROP TABLE IF EXISTS `gacl_aro_groups_id_seq`; +CREATE TABLE `gacl_aro_groups_id_seq` ( + `id` int(11) NOT NULL default '0' +) ENGINE=MyISAM DEFAULT CHARSET=latin1; + +-- +-- Dumping data for table `gacl_aro_groups_id_seq` +-- + +LOCK TABLES `gacl_aro_groups_id_seq` WRITE; +/*!40000 ALTER TABLE `gacl_aro_groups_id_seq` DISABLE KEYS */; +INSERT INTO `gacl_aro_groups_id_seq` VALUES (2); +/*!40000 ALTER TABLE `gacl_aro_groups_id_seq` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `gacl_aro_groups_map` +-- + +DROP TABLE IF EXISTS `gacl_aro_groups_map`; +CREATE TABLE `gacl_aro_groups_map` ( + `acl_id` int(11) NOT NULL default '0', + `group_id` int(11) NOT NULL default '0', + PRIMARY KEY (`acl_id`,`group_id`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1; + +-- +-- Dumping data for table `gacl_aro_groups_map` +-- + +LOCK TABLES `gacl_aro_groups_map` WRITE; +/*!40000 ALTER TABLE `gacl_aro_groups_map` DISABLE KEYS */; +INSERT INTO `gacl_aro_groups_map` VALUES (1,1),(4,1); +/*!40000 ALTER TABLE `gacl_aro_groups_map` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `gacl_aro_map` +-- + +DROP TABLE IF EXISTS `gacl_aro_map`; +CREATE TABLE `gacl_aro_map` ( + `acl_id` int(11) NOT NULL default '0', + `section_value` varchar(230) NOT NULL default '0', + `value` varchar(230) NOT NULL default '', + PRIMARY KEY (`acl_id`,`section_value`,`value`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1; + +-- +-- Dumping data for table `gacl_aro_map` +-- + +LOCK TABLES `gacl_aro_map` WRITE; +/*!40000 ALTER TABLE `gacl_aro_map` DISABLE KEYS */; +/*!40000 ALTER TABLE `gacl_aro_map` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `gacl_aro_sections` +-- + +DROP TABLE IF EXISTS `gacl_aro_sections`; +CREATE TABLE `gacl_aro_sections` ( + `id` int(11) NOT NULL default '0', + `value` varchar(230) NOT NULL default '', + `order_value` int(11) NOT NULL default '0', + `name` varchar(230) NOT NULL default '', + `hidden` int(11) NOT NULL default '0', + PRIMARY KEY (`id`), + UNIQUE KEY `gacl_value_aro_sections` (`value`), + KEY `gacl_hidden_aro_sections` (`hidden`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1; + +-- +-- Dumping data for table `gacl_aro_sections` +-- + +LOCK TABLES `gacl_aro_sections` WRITE; +/*!40000 ALTER TABLE `gacl_aro_sections` DISABLE KEYS */; +INSERT INTO `gacl_aro_sections` VALUES (1,'users',1,'users',0); +/*!40000 ALTER TABLE `gacl_aro_sections` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `gacl_aro_sections_seq` +-- + +DROP TABLE IF EXISTS `gacl_aro_sections_seq`; +CREATE TABLE `gacl_aro_sections_seq` ( + `id` int(11) NOT NULL default '0' +) ENGINE=MyISAM DEFAULT CHARSET=latin1; + +-- +-- Dumping data for table `gacl_aro_sections_seq` +-- + +LOCK TABLES `gacl_aro_sections_seq` WRITE; +/*!40000 ALTER TABLE `gacl_aro_sections_seq` DISABLE KEYS */; +INSERT INTO `gacl_aro_sections_seq` VALUES (1); +/*!40000 ALTER TABLE `gacl_aro_sections_seq` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `gacl_aro_seq` +-- + +DROP TABLE IF EXISTS `gacl_aro_seq`; +CREATE TABLE `gacl_aro_seq` ( + `id` int(11) NOT NULL default '0' +) ENGINE=MyISAM DEFAULT CHARSET=latin1; + +-- +-- Dumping data for table `gacl_aro_seq` +-- + +LOCK TABLES `gacl_aro_seq` WRITE; +/*!40000 ALTER TABLE `gacl_aro_seq` DISABLE KEYS */; +INSERT INTO `gacl_aro_seq` VALUES (2); +/*!40000 ALTER TABLE `gacl_aro_seq` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `gacl_axo` +-- + +DROP TABLE IF EXISTS `gacl_axo`; +CREATE TABLE `gacl_axo` ( + `id` int(11) NOT NULL default '0', + `section_value` varchar(240) NOT NULL default '0', + `value` varchar(240) NOT NULL default '', + `order_value` int(11) NOT NULL default '0', + `name` varchar(255) NOT NULL default '', + `hidden` int(11) NOT NULL default '0', + PRIMARY KEY (`id`), + UNIQUE KEY `gacl_section_value_value_axo` (`section_value`,`value`), + KEY `gacl_hidden_axo` (`hidden`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1; + +-- +-- Dumping data for table `gacl_axo` +-- + +LOCK TABLES `gacl_axo` WRITE; +/*!40000 ALTER TABLE `gacl_axo` DISABLE KEYS */; +INSERT INTO `gacl_axo` VALUES (1,'scire_ui','scire_ui',1,'scire_ui',0); +/*!40000 ALTER TABLE `gacl_axo` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `gacl_axo_groups` +-- + +DROP TABLE IF EXISTS `gacl_axo_groups`; +CREATE TABLE `gacl_axo_groups` ( + `id` int(11) NOT NULL default '0', + `parent_id` int(11) NOT NULL default '0', + `lft` int(11) NOT NULL default '0', + `rgt` int(11) NOT NULL default '0', + `name` varchar(255) NOT NULL default '', + `value` varchar(255) NOT NULL default '', + PRIMARY KEY (`id`,`value`), + UNIQUE KEY `gacl_value_axo_groups` (`value`), + KEY `gacl_parent_id_axo_groups` (`parent_id`), + KEY `gacl_lft_rgt_axo_groups` (`lft`,`rgt`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1; + +-- +-- Dumping data for table `gacl_axo_groups` +-- + +LOCK TABLES `gacl_axo_groups` WRITE; +/*!40000 ALTER TABLE `gacl_axo_groups` DISABLE KEYS */; +INSERT INTO `gacl_axo_groups` VALUES (1,0,1,2,'Company Name','Company Name'); +/*!40000 ALTER TABLE `gacl_axo_groups` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `gacl_axo_groups_id_seq` +-- + +DROP TABLE IF EXISTS `gacl_axo_groups_id_seq`; +CREATE TABLE `gacl_axo_groups_id_seq` ( + `id` int(11) NOT NULL default '0' +) ENGINE=MyISAM DEFAULT CHARSET=latin1; + +-- +-- Dumping data for table `gacl_axo_groups_id_seq` +-- + +LOCK TABLES `gacl_axo_groups_id_seq` WRITE; +/*!40000 ALTER TABLE `gacl_axo_groups_id_seq` DISABLE KEYS */; +INSERT INTO `gacl_axo_groups_id_seq` VALUES (2); +/*!40000 ALTER TABLE `gacl_axo_groups_id_seq` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `gacl_axo_groups_map` +-- + +DROP TABLE IF EXISTS `gacl_axo_groups_map`; +CREATE TABLE `gacl_axo_groups_map` ( + `acl_id` int(11) NOT NULL default '0', + `group_id` int(11) NOT NULL default '0', + PRIMARY KEY (`acl_id`,`group_id`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1; + +-- +-- Dumping data for table `gacl_axo_groups_map` +-- + +LOCK TABLES `gacl_axo_groups_map` WRITE; +/*!40000 ALTER TABLE `gacl_axo_groups_map` DISABLE KEYS */; +/*!40000 ALTER TABLE `gacl_axo_groups_map` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `gacl_axo_map` +-- + +DROP TABLE IF EXISTS `gacl_axo_map`; +CREATE TABLE `gacl_axo_map` ( + `acl_id` int(11) NOT NULL default '0', + `section_value` varchar(230) NOT NULL default '0', + `value` varchar(230) NOT NULL default '', + PRIMARY KEY (`acl_id`,`section_value`,`value`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1; + +-- +-- Dumping data for table `gacl_axo_map` +-- + +LOCK TABLES `gacl_axo_map` WRITE; +/*!40000 ALTER TABLE `gacl_axo_map` DISABLE KEYS */; +INSERT INTO `gacl_axo_map` VALUES (6,'scire_ui','scire_ui'),(7,'scire_ui','scire_ui'),(1,'scire_ui','scire_ui'),(2,'scire_ui','scire_ui'),(3,'scire_ui','scire_ui'),(4,'scire_ui','scire_ui'),(5,'scire_ui','scire_ui'); +/*!40000 ALTER TABLE `gacl_axo_map` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `gacl_axo_sections` +-- + +DROP TABLE IF EXISTS `gacl_axo_sections`; +CREATE TABLE `gacl_axo_sections` ( + `id` int(11) NOT NULL default '0', + `value` varchar(230) NOT NULL default '', + `order_value` int(11) NOT NULL default '0', + `name` varchar(230) NOT NULL default '', + `hidden` int(11) NOT NULL default '0', + PRIMARY KEY (`id`), + UNIQUE KEY `gacl_value_axo_sections` (`value`), + KEY `gacl_hidden_axo_sections` (`hidden`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1; + +-- +-- Dumping data for table `gacl_axo_sections` +-- + +LOCK TABLES `gacl_axo_sections` WRITE; +/*!40000 ALTER TABLE `gacl_axo_sections` DISABLE KEYS */; +INSERT INTO `gacl_axo_sections` VALUES (2,'clients',1,'clients',0),(1,'scire_ui',2,'scire_ui',0); +/*!40000 ALTER TABLE `gacl_axo_sections` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `gacl_axo_sections_seq` +-- + +DROP TABLE IF EXISTS `gacl_axo_sections_seq`; +CREATE TABLE `gacl_axo_sections_seq` ( + `id` int(11) NOT NULL default '0' +) ENGINE=MyISAM DEFAULT CHARSET=latin1; + +-- +-- Dumping data for table `gacl_axo_sections_seq` +-- + +LOCK TABLES `gacl_axo_sections_seq` WRITE; +/*!40000 ALTER TABLE `gacl_axo_sections_seq` DISABLE KEYS */; +INSERT INTO `gacl_axo_sections_seq` VALUES (3); +/*!40000 ALTER TABLE `gacl_axo_sections_seq` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `gacl_axo_seq` +-- + +DROP TABLE IF EXISTS `gacl_axo_seq`; +CREATE TABLE `gacl_axo_seq` ( + `id` int(11) NOT NULL default '0' +) ENGINE=MyISAM DEFAULT CHARSET=latin1; + +-- +-- Dumping data for table `gacl_axo_seq` +-- + +LOCK TABLES `gacl_axo_seq` WRITE; +/*!40000 ALTER TABLE `gacl_axo_seq` DISABLE KEYS */; +INSERT INTO `gacl_axo_seq` VALUES (2); +/*!40000 ALTER TABLE `gacl_axo_seq` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `gacl_groups_aro_map` +-- + +DROP TABLE IF EXISTS `gacl_groups_aro_map`; +CREATE TABLE `gacl_groups_aro_map` ( + `group_id` int(11) NOT NULL default '0', + `aro_id` int(11) NOT NULL default '0', + PRIMARY KEY (`group_id`,`aro_id`), + KEY `gacl_aro_id` (`aro_id`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1; + +-- +-- Dumping data for table `gacl_groups_aro_map` +-- + +LOCK TABLES `gacl_groups_aro_map` WRITE; +/*!40000 ALTER TABLE `gacl_groups_aro_map` DISABLE KEYS */; +/*!40000 ALTER TABLE `gacl_groups_aro_map` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `gacl_groups_axo_map` +-- + +DROP TABLE IF EXISTS `gacl_groups_axo_map`; +CREATE TABLE `gacl_groups_axo_map` ( + `group_id` int(11) NOT NULL default '0', + `axo_id` int(11) NOT NULL default '0', + PRIMARY KEY (`group_id`,`axo_id`), + KEY `gacl_axo_id` (`axo_id`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1; + +-- +-- Dumping data for table `gacl_groups_axo_map` +-- + +LOCK TABLES `gacl_groups_axo_map` WRITE; +/*!40000 ALTER TABLE `gacl_groups_axo_map` DISABLE KEYS */; +/*!40000 ALTER TABLE `gacl_groups_axo_map` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `gacl_phpgacl` +-- + +DROP TABLE IF EXISTS `gacl_phpgacl`; +CREATE TABLE `gacl_phpgacl` ( + `name` varchar(230) NOT NULL default '', + `value` varchar(230) NOT NULL default '', + PRIMARY KEY (`name`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1; + +-- +-- Dumping data for table `gacl_phpgacl` +-- + +LOCK TABLES `gacl_phpgacl` WRITE; +/*!40000 ALTER TABLE `gacl_phpgacl` DISABLE KEYS */; +INSERT INTO `gacl_phpgacl` VALUES ('version','3.3.6'),('schema_version','2.1'); +/*!40000 ALTER TABLE `gacl_phpgacl` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `hardware` +-- + +DROP TABLE IF EXISTS `hardware`; +CREATE TABLE `hardware` ( + `clientid` int(11) NOT NULL default '0', + `processor` varchar(32) default NULL, + `memory` varchar(32) default NULL, + `hd` varchar(32) default NULL, + `cpu` varchar(64) default NULL, + `mhz` varchar(32) default NULL, + PRIMARY KEY (`clientid`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +-- +-- Dumping data for table `hardware` +-- + +LOCK TABLES `hardware` WRITE; +/*!40000 ALTER TABLE `hardware` DISABLE KEYS */; +/*!40000 ALTER TABLE `hardware` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `hardware_history` +-- + +DROP TABLE IF EXISTS `hardware_history`; +CREATE TABLE `hardware_history` ( + `clientid` int(11) NOT NULL default '0', + `changedate` timestamp NOT NULL default CURRENT_TIMESTAMP, + `field_name` varchar(30) default NULL, + `oldvalue` varchar(255) default NULL, + `newvalue` varchar(255) default NULL, + PRIMARY KEY (`clientid`,`changedate`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +-- +-- Dumping data for table `hardware_history` +-- + +LOCK TABLES `hardware_history` WRITE; +/*!40000 ALTER TABLE `hardware_history` DISABLE KEYS */; +/*!40000 ALTER TABLE `hardware_history` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `job_conditions` +-- + +DROP TABLE IF EXISTS `job_conditions`; +CREATE TABLE `job_conditions` ( + `jobid` int(11) NOT NULL default '0', + `clientid` int(11) NOT NULL default '0', + `job_dependency` int(11) NOT NULL default '0', + `start_time` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, + `start_period` timestamp NOT NULL default '0000-00-00 00:00:00', + `end_period` timestamp NOT NULL default '0000-00-00 00:00:00', + `run_interval` int(11) default NULL, + `last_run` int(11) default NULL, + `last_run_date` timestamp NOT NULL default '0000-00-00 00:00:00', + PRIMARY KEY (`jobid`,`clientid`), + KEY `clientid` (`clientid`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1; + +-- +-- Dumping data for table `job_conditions` +-- + +LOCK TABLES `job_conditions` WRITE; +/*!40000 ALTER TABLE `job_conditions` DISABLE KEYS */; +/*!40000 ALTER TABLE `job_conditions` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `job_history` +-- + +DROP TABLE IF EXISTS `job_history`; +CREATE TABLE `job_history` ( + `jobid` int(11) NOT NULL default '0', + `clientid` int(11) NOT NULL default '0', + `eventtime` timestamp NOT NULL default CURRENT_TIMESTAMP, + `status` varchar(20) NOT NULL default '', + `eventmsg` varchar(255) default NULL, + PRIMARY KEY (`jobid`,`clientid`,`eventtime`), + KEY `clientid` (`clientid`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +-- +-- Dumping data for table `job_history` +-- + +LOCK TABLES `job_history` WRITE; +/*!40000 ALTER TABLE `job_history` DISABLE KEYS */; +/*!40000 ALTER TABLE `job_history` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `jobs` +-- + +DROP TABLE IF EXISTS `jobs`; +CREATE TABLE `jobs` ( + `jobid` int(11) NOT NULL auto_increment, + `priority` int(11) NOT NULL default '0', + `created` timestamp NOT NULL default CURRENT_TIMESTAMP, + `creator` int(11) NOT NULL default '0', + `permission` int(11) NOT NULL default '0', + `script` int(11) NOT NULL default '0', + `description` varchar(255) default NULL, + `pending` int(11) default NULL, + `failed` int(11) default NULL, + PRIMARY KEY (`jobid`), + KEY `creator` (`creator`), + KEY `permission` (`permission`), + KEY `script` (`script`) +) ENGINE=MyISAM AUTO_INCREMENT=31 DEFAULT CHARSET=utf8; + +-- +-- Dumping data for table `jobs` +-- + +LOCK TABLES `jobs` WRITE; +/*!40000 ALTER TABLE `jobs` DISABLE KEYS */; +/*!40000 ALTER TABLE `jobs` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `jobs_clients` +-- + +DROP TABLE IF EXISTS `jobs_clients`; +CREATE TABLE `jobs_clients` ( + `jobid` int(11) NOT NULL default '0', + `clientid` int(11) NOT NULL default '0', + `groupid` int(11) NOT NULL default '0', + PRIMARY KEY (`jobid`,`clientid`,`groupid`), + KEY `groupid` (`groupid`), + KEY `clientid` (`clientid`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +-- +-- Dumping data for table `jobs_clients` +-- + +LOCK TABLES `jobs_clients` WRITE; +/*!40000 ALTER TABLE `jobs_clients` DISABLE KEYS */; +/*!40000 ALTER TABLE `jobs_clients` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `modules` +-- + +DROP TABLE IF EXISTS `modules`; +CREATE TABLE `modules` ( + `id` int(11) NOT NULL default '0', + `name` varchar(50) default NULL, + `long_name` varchar(150) default NULL, + `description` varchar(250) default NULL, + `path` varchar(90) default NULL, + `author` varchar(50) default NULL, + `distribution` varchar(50) default NULL, + `category` varchar(30) default NULL, + `homepage` varchar(90) default NULL, + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1; + +-- +-- Dumping data for table `modules` +-- + +LOCK TABLES `modules` WRITE; +/*!40000 ALTER TABLE `modules` DISABLE KEYS */; +INSERT INTO `modules` VALUES (1,'Quickstart','Quickstart Installation Mangement Daemon','Description goes here and all that good stuff.','quickstart/index.php','Preston Cody','gentoo','deployment','http://www.gentoo.org/proj/en/releng/gli/'),(2,'Exporter','Server Information Exporter','This is a utility that will take selected data from the central server about machines and export it into an XML format.','/Exporter/index.php','Preston Cody',NULL,'information','http://www.gentoo.org/proj/en/releng/gli/'); +/*!40000 ALTER TABLE `modules` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `os` +-- + +DROP TABLE IF EXISTS `os`; +CREATE TABLE `os` ( + `osid` int(11) NOT NULL auto_increment, + `osname` varchar(128) NOT NULL default '', + `update_script` int(11) default NULL, + `install_script` int(11) default NULL, + `uninstall_script` int(11) default NULL, + `rollback_script` int(11) default NULL, + `packagelist_script` int(11) default NULL, + PRIMARY KEY (`osid`), + KEY `update_script` (`update_script`), + KEY `install_script` (`install_script`), + KEY `uninstall_script` (`uninstall_script`), + KEY `rollback_script` (`rollback_script`), + KEY `packagelist_script` (`packagelist_script`) +) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=utf8; + +-- +-- Dumping data for table `os` +-- + +LOCK TABLES `os` WRITE; +/*!40000 ALTER TABLE `os` DISABLE KEYS */; +INSERT INTO `os` VALUES (1,'Gentoo Linux',100,101,102,103,104); +/*!40000 ALTER TABLE `os` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `permissions` +-- + +DROP TABLE IF EXISTS `permissions`; +CREATE TABLE `permissions` ( + `permid` int(11) NOT NULL, + `name` varchar(128) NOT NULL default '', + `description` varchar(255) default NULL, + `creator` int(11) NOT NULL default '0', + `created` timestamp NOT NULL default CURRENT_TIMESTAMP, + `permcategory` varchar(128) NOT NULL default 'Default', + PRIMARY KEY (`permid`), + UNIQUE KEY `name` (`name`), + KEY `creator` (`creator`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +-- +-- Dumping data for table `permissions` +-- + +LOCK TABLES `permissions` WRITE; +/*!40000 ALTER TABLE `permissions` DISABLE KEYS */; +/*!40000 ALTER TABLE `permissions` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `scripts` +-- + +DROP TABLE IF EXISTS `scripts`; +CREATE TABLE `scripts` ( + `scriptid` int(11) NOT NULL auto_increment, + `name` varchar(128) NOT NULL default '', + `description` varchar(255) default NULL, + `location` varchar(255) default NULL, + `script_data` text, + `log_location` varchar(255) default NULL, + `success_code` varchar(32) default NULL, + `run_as` varchar(255) default NULL, + `priority` int(11) default NULL, + `permission` int(11) default NULL, + `pp_location` varchar(255) default NULL, + `pp_script_data` text, + PRIMARY KEY (`scriptid`), + KEY `permission` (`permission`) +) ENGINE=MyISAM AUTO_INCREMENT=107 DEFAULT CHARSET=latin1; + +-- +-- Dumping data for table `scripts` +-- + +LOCK TABLES `scripts` WRITE; +/*!40000 ALTER TABLE `scripts` DISABLE KEYS */; +INSERT INTO `scripts` VALUES (100,'Gentoo Update Script','This script will run emerge sync and emerge -u world, logging the results.','','#!/bin/bash \n emerge sync \n emerge -u world','/var/log/scire/updatelog.txt','0','root',5,1,'',''),(101,'Gentoo Install Package Script','This script will run emerge on a given package and log the results.','','#!/bin/bash\nemerge --nocolor --nospinner --quiet -u world','/var/log/scire/installlog.txt','0','root',2,1,'',''),(102,'Gentoo Uninstall Package Script','This script will run emerge unmerge on a given package and log the results.','','#!/bin/bash \n emerge unmerge','/var/log/scire/uninstalllog.txt','0','root',2,1,'',''),(103,'Gentoo Rollback Script','This script will roll back a given package to its previous version, logging the results.','','#!/bin/bash \n emerge -C && emerge ','/var/log/scire/rollbacklog.txt','0','root',1,1,'',''),(104,'Gentoo PackageList Script','This script will return a list of packages installed on the system and the current version of those packages.','','#!/bin/bash \n %%tag1%% %%tag2%%','/var/log/scire/packagelistlog.txt','0','nobody',8,1,'',''),(105,'install_vim','This will emerge vim for gentoo','Embedded','#!/bin/bash\r\nemerge vim\r\n ','','0','root',1,0,'Embedded',''),(106,'install ufed','this installs ufed, a stupid little prog that helps with USE flags','Embedded','#!/bin/bash\r\nemerge ufed','','0','root',1,0,'Embedded',''); +/*!40000 ALTER TABLE `scripts` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `sessions` +-- + +DROP TABLE IF EXISTS `sessions`; +CREATE TABLE `sessions` ( + `sessionid` varchar(255) NOT NULL default '', + `expiration` int(10) unsigned NOT NULL default '0', + `data` text, + PRIMARY KEY (`sessionid`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +-- +-- Dumping data for table `sessions` +-- + +LOCK TABLES `sessions` WRITE; +/*!40000 ALTER TABLE `sessions` DISABLE KEYS */; +/*!40000 ALTER TABLE `sessions` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `settings` +-- + +DROP TABLE IF EXISTS `settings`; +CREATE TABLE `settings` ( + `userid` int(11) NOT NULL default '0', + `setting_name` varchar(64) NOT NULL default '', + `setting_value` varchar(255) default NULL, + PRIMARY KEY (`userid`,`setting_name`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +-- +-- Dumping data for table `settings` +-- + +LOCK TABLES `settings` WRITE; +/*!40000 ALTER TABLE `settings` DISABLE KEYS */; +INSERT INTO `settings` VALUES (1,'start_page','clients.php'),(1,'theme','std_grey'),(1,'notification','phone'),(1,'per_page','2'),(1,'clients_page_sorton','hostname'),(1,'clients_page_fields','ip,osname,username,groups,hostname,status'),(1,'jobs_page_fields','hostname,priority,created,description,username,scriptname,pending,permname,failed'),(1,'users_page_fields','username,real_name,comment,groups,status'),(1,'users_page_sorton','username'),(1,'jobs_page_sorton','hostname'),(1,'jobs_page_sortdir','asc'); +/*!40000 ALTER TABLE `settings` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `software` +-- + +DROP TABLE IF EXISTS `software`; +CREATE TABLE `software` ( + `clientid` int(11) NOT NULL default '0', + `package` varchar(128) NOT NULL default '', + `current_ver` varchar(64) default NULL, + `rollback_ver` varchar(64) default NULL, + PRIMARY KEY (`package`), + KEY `clientid` (`clientid`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +-- +-- Dumping data for table `software` +-- + +LOCK TABLES `software` WRITE; +/*!40000 ALTER TABLE `software` DISABLE KEYS */; +/*!40000 ALTER TABLE `software` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `users` +-- + +DROP TABLE IF EXISTS `users`; +CREATE TABLE `users` ( + `userid` int(11) NOT NULL, + `username` varchar(64) NOT NULL, + `password` varchar(255) NOT NULL, + `email` varchar(128) NOT NULL, + `phone` varchar(128) default NULL, + `pager` varchar(128) default NULL, + `real_name` varchar(255) default NULL, + `comment` varchar(255) default NULL, + PRIMARY KEY (`userid`), + UNIQUE KEY `username` (`username`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1; + +-- +-- Dumping data for table `users` +-- + +LOCK TABLES `users` WRITE; +/*!40000 ALTER TABLE `users` DISABLE KEYS */; +INSERT INTO `users` VALUES (1,'root','444mwGdhEKuO.','root@localhost.com','','','Root User','This is the comment for the root user.'),(2,'codeman','444mwGdhEKuO.','codeman@localhost.com','','555-1212','Preston Cody','Project lead and developer.'); +/*!40000 ALTER TABLE `users` ENABLE KEYS */; +UNLOCK TABLES; +/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; + +/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; +/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; +/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; +/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; +/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; +/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; +/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; + +-- Dump completed on 2007-03-26 0:59:36 diff --git a/docs/jobs_flow/get_job.png b/docs/jobs_flow/get_job.png Binary files differnew file mode 100644 index 0000000..061deeb --- /dev/null +++ b/docs/jobs_flow/get_job.png diff --git a/docs/jobs_flow/get_jobs.png b/docs/jobs_flow/get_jobs.png Binary files differnew file mode 100644 index 0000000..40d2593 --- /dev/null +++ b/docs/jobs_flow/get_jobs.png diff --git a/docs/jobs_flow/get_jstatus.png b/docs/jobs_flow/get_jstatus.png Binary files differnew file mode 100644 index 0000000..6f8b841 --- /dev/null +++ b/docs/jobs_flow/get_jstatus.png diff --git a/docs/jobs_flow/run_jobs.png b/docs/jobs_flow/run_jobs.png Binary files differnew file mode 100644 index 0000000..80fc69d --- /dev/null +++ b/docs/jobs_flow/run_jobs.png diff --git a/docs/jobs_flow/scirec_main.png b/docs/jobs_flow/scirec_main.png Binary files differnew file mode 100644 index 0000000..d116076 --- /dev/null +++ b/docs/jobs_flow/scirec_main.png diff --git a/docs/jobs_flow/svg/get_job.svg b/docs/jobs_flow/svg/get_job.svg new file mode 100644 index 0000000..76e6356 --- /dev/null +++ b/docs/jobs_flow/svg/get_job.svg @@ -0,0 +1,800 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Created with Inkscape (http://www.inkscape.org/) --> +<svg + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://web.resource.org/cc/" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:xlink="http://www.w3.org/1999/xlink" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + width="744.09448819" + height="1052.3622047" + id="svg2280" + sodipodi:version="0.32" + inkscape:version="0.45" + sodipodi:docbase="/home/disney/gentoo/diagrams" + sodipodi:docname="get_job.svg" + inkscape:output_extension="org.inkscape.output.svg.inkscape" + inkscape:export-filename="/home/disney/gentoo/diagrams/get_job.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90" + sodipodi:modified="TRUE"> + <defs + id="defs2282"> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient3233" + id="linearGradient11111" + gradientUnits="userSpaceOnUse" + x1="110.35865" + y1="84.70903" + x2="122.83298" + y2="205.02553" /> + <linearGradient + inkscape:collect="always" + id="linearGradient3233"> + <stop + style="stop-color:#cccccc;stop-opacity:1;" + offset="0" + id="stop3235" /> + <stop + style="stop-color:#cccccc;stop-opacity:0;" + offset="1" + id="stop3237" /> + </linearGradient> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient3233" + id="linearGradient23523" + gradientUnits="userSpaceOnUse" + x1="110.35865" + y1="84.70903" + x2="122.83298" + y2="205.02553" /> + <marker + inkscape:stockid="TriangleOutL" + orient="auto" + refY="0" + refX="0" + id="TriangleOutL" + style="overflow:visible"> + <path + id="path4305" + d="M 5.77,0 L -2.88,5 L -2.88,-5 L 5.77,0 z " + style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;marker-start:none" + transform="scale(0.8,0.8)" /> + </marker> + </defs> + <sodipodi:namedview + id="base" + pagecolor="#ffffff" + bordercolor="#ffffff" + borderopacity="0.0" + inkscape:pageopacity="0.0" + inkscape:pageshadow="0" + inkscape:zoom="0.98994949" + inkscape:cx="-76.913763" + inkscape:cy="656.78425" + inkscape:document-units="px" + inkscape:current-layer="layer1" + showgrid="true" + inkscape:window-width="1398" + inkscape:window-height="654" + inkscape:window-x="0" + inkscape:window-y="0" /> + <metadata + id="metadata2285"> + <rdf:RDF> + <cc:Work + rdf:about=""> + <dc:format>image/svg+xml</dc:format> + <dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> + </cc:Work> + </rdf:RDF> + </metadata> + <g + inkscape:label="Layer 1" + inkscape:groupmode="layer" + id="layer1"> + <path + sodipodi:type="arc" + style="fill:url(#linearGradient23523);fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + id="path23517" + sodipodi:cx="105.05586" + sodipodi:cy="52.311161" + sodipodi:rx="83.842659" + sodipodi:ry="30.304577" + d="M 188.89852 52.311161 A 83.842659 30.304577 0 1 1 21.213203,52.311161 A 83.842659 30.304577 0 1 1 188.89852 52.311161 z" + transform="matrix(0.6478283,0,0,0.6632677,-347.20102,452.62247)" + inkscape:export-filename="/home/disney/gentoo/diagrams/get_jobs.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90" /> + <text + xml:space="preserve" + style="font-size:20px;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans" + x="-302.91742" + y="493.30472" + id="text23519" + inkscape:export-filename="/home/disney/gentoo/diagrams/get_jobs.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90"><tspan + sodipodi:role="line" + x="-302.91742" + y="493.30472" + id="tspan23521">Start</tspan></text> + <path + style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:#000000;stroke-width:0.96277702px;stroke-linecap:butt;stroke-linejoin:miter;marker-end:url(#TriangleOutL);stroke-opacity:1" + d="M -279.80471,507.35331 L -279.75242,534.62211" + id="path23525" + inkscape:connector-type="polyline" + inkscape:export-filename="/home/disney/gentoo/diagrams/get_jobs.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90" /> + <rect + style="fill:#cccccc;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.13471448;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + id="rect3223" + width="113.46721" + height="113.47605" + x="305.53931" + y="645.06244" + transform="matrix(0.8229751,0.5680775,-0.8230865,0.5679161,0,0)" + inkscape:export-filename="/home/disney/gentoo/diagrams/get_jobs.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90" /> + <text + xml:space="preserve" + style="font-size:20px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:125%;writing-mode:lr-tb;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans" + x="-279.53696" + y="573.79559" + id="text10618" + sodipodi:linespacing="125%" + inkscape:export-filename="/home/disney/gentoo/diagrams/get_jobs.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90"><tspan + sodipodi:role="line" + x="-276.99008" + y="573.79559" + style="font-size:16px;font-family:Courier 10 Pitch" + id="tspan10624"><tspan + id="tspan2313" + style="font-size:16px;font-family:Bitstream Vera Sans">Is the </tspan></tspan><tspan + sodipodi:role="line" + x="-279.53696" + y="592.14761" + style="font-size:16px;font-family:Courier 10 Pitch" + id="tspan2315">origjob</tspan><tspan + sodipodi:role="line" + x="-279.53696" + y="613.79559" + style="font-size:16px;font-family:Bitstream Vera Sans" + id="tspan10626">parameter</tspan><tspan + sodipodi:role="line" + x="-279.53696" + y="633.79559" + style="font-size:16px;font-family:Bitstream Vera Sans" + id="tspan2317"> provided?</tspan></text> + <text + xml:space="preserve" + style="font-size:20px;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans" + x="-166.46484" + y="564.505" + id="text2319"><tspan + sodipodi:role="line" + id="tspan2321" + x="-166.46484" + y="564.505">Yes, so the function is</tspan><tspan + sodipodi:role="line" + x="-166.46484" + y="589.505" + id="tspan2323">being used in query mode.</tspan></text> + <rect + style="font-size:20px;fill:#cccccc;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0.98150337;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + id="rect10616" + width="150.00647" + height="88.946548" + x="117.20412" + y="561.43317" + transform="matrix(0.9999996,8.8502961e-4,-5.7801643e-4,0.9999998,0,0)" + inkscape:export-filename="/home/disney/gentoo/diagrams/get_jobs.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90" /> + <text + xml:space="preserve" + style="font-size:20px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:125%;writing-mode:lr-tb;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans" + x="191.38034" + y="592.75128" + id="text10704" + sodipodi:linespacing="125%" + inkscape:export-filename="/home/disney/gentoo/diagrams/get_jobs.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90"><tspan + sodipodi:role="line" + x="193.60886" + y="592.75128" + id="tspan10710" + style="font-size:14px;font-family:Bitstream Vera Sans">Query DB for </tspan><tspan + sodipodi:role="line" + x="191.38034" + y="610.25128" + style="font-size:14px;font-family:Bitstream Vera Sans" + id="tspan2351">specific instance of</tspan><tspan + sodipodi:role="line" + x="191.38034" + y="626.30929" + style="font-size:14px;font-family:Courier 10 Pitch" + id="tspan2343">origjob</tspan></text> + <path + style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:#000000;stroke-width:0.96277702px;stroke-linecap:butt;stroke-linejoin:miter;marker-end:url(#TriangleOutL);stroke-opacity:1" + d="M -279.86947,669.07712 L -279.81718,696.34592" + id="path10867" + inkscape:connector-type="polyline" + inkscape:export-filename="/home/disney/gentoo/diagrams/get_jobs.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90" /> + <rect + style="font-size:20px;fill:#cccccc;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0.98150337;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + id="rect2377" + width="150.00647" + height="88.946548" + x="-354.05209" + y="702.18213" + transform="matrix(0.9999996,8.850316e-4,-5.7802041e-4,0.9999998,0,0)" + inkscape:export-filename="/home/disney/gentoo/diagrams/get_jobs.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90" /> + <text + xml:space="preserve" + style="font-size:20px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:125%;writing-mode:lr-tb;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans" + x="-279.95724" + y="739.08331" + id="text2379" + sodipodi:linespacing="125%" + inkscape:export-filename="/home/disney/gentoo/diagrams/get_jobs.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90"><tspan + sodipodi:role="line" + x="-279.95724" + y="739.08331" + style="font-size:20px;font-family:Bitstream Vera Sans" + id="tspan2385">Query DB for</tspan><tspan + sodipodi:role="line" + x="-279.95724" + y="764.08331" + style="font-size:20px;font-family:Bitstream Vera Sans" + id="tspan2410">job data</tspan></text> + <path + style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:#000000;stroke-width:0.96277702px;stroke-linecap:butt;stroke-linejoin:miter;marker-end:url(#TriangleOutL);stroke-opacity:1" + d="M -279.86934,790.72987 L -279.81705,817.99867" + id="path2412" + inkscape:connector-type="polyline" + inkscape:export-filename="/home/disney/gentoo/diagrams/get_jobs.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90" /> + <rect + style="font-size:20px;fill:#cccccc;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0.98150337;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + id="rect2414" + width="150.00647" + height="88.946548" + x="-353.98157" + y="823.83484" + transform="matrix(0.9999996,8.8503319e-4,-5.7802359e-4,0.9999998,0,0)" + inkscape:export-filename="/home/disney/gentoo/diagrams/get_jobs.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90" /> + <text + xml:space="preserve" + style="font-size:20px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:125%;writing-mode:lr-tb;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans" + x="-279.95712" + y="850.73608" + id="text2416" + sodipodi:linespacing="125%" + inkscape:export-filename="/home/disney/gentoo/diagrams/get_jobs.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90"><tspan + sodipodi:role="line" + x="-279.95712" + y="850.73608" + style="font-size:18px;font-family:Bitstream Vera Sans" + id="tspan2424">Cast job data as</tspan><tspan + sodipodi:role="line" + x="-277.09189" + y="873.23608" + style="font-size:18px;font-family:Bitstream Vera Sans" + id="tspan2430">string to avoid </tspan><tspan + sodipodi:role="line" + x="-279.95712" + y="895.73608" + style="font-size:18px;font-family:Bitstream Vera Sans" + id="tspan2434">XML-RPC issues</tspan></text> + <rect + style="fill:#cccccc;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.13471448;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + id="rect2436" + width="113.46721" + height="113.47622" + x="662.06061" + y="1002.0456" + transform="matrix(0.8229751,0.5680775,-0.8230865,0.5679161,0,0)" + inkscape:export-filename="/home/disney/gentoo/diagrams/get_jobs.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90" /> + <text + xml:space="preserve" + style="font-size:20px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:125%;writing-mode:lr-tb;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans" + x="-279.95685" + y="979.06274" + id="text2438" + sodipodi:linespacing="125%" + inkscape:export-filename="/home/disney/gentoo/diagrams/get_jobs.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90"><tspan + sodipodi:role="line" + x="-277.40997" + y="979.06274" + style="font-size:16px;font-family:Courier 10 Pitch" + id="tspan2440"><tspan + id="tspan2442" + style="font-size:16px;font-family:Bitstream Vera Sans">Is the </tspan></tspan><tspan + sodipodi:role="line" + x="-279.95685" + y="997.41476" + style="font-size:16px;font-family:Courier 10 Pitch" + id="tspan2444">origjob</tspan><tspan + sodipodi:role="line" + x="-279.95685" + y="1019.0627" + style="font-size:16px;font-family:Bitstream Vera Sans" + id="tspan2446">parameter</tspan><tspan + sodipodi:role="line" + x="-279.95685" + y="1039.0627" + style="font-size:16px;font-family:Bitstream Vera Sans" + id="tspan2448"> provided?</tspan></text> + <path + style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:#000000;stroke-width:0.96277702px;stroke-linecap:butt;stroke-linejoin:miter;marker-end:url(#TriangleOutL);stroke-opacity:1" + d="M -279.9322,1074.3443 L -279.87991,1101.6131" + id="path2450" + inkscape:connector-type="polyline" + inkscape:export-filename="/home/disney/gentoo/diagrams/get_jobs.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90" /> + <path + style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:#000000;stroke-width:0.96277702px;stroke-linecap:butt;stroke-linejoin:miter;marker-end:url(#TriangleOutL);stroke-opacity:1" + d="M -280.04804,912.5057 L -279.99575,939.7745" + id="path2452" + inkscape:connector-type="polyline" + inkscape:export-filename="/home/disney/gentoo/diagrams/get_jobs.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90" /> + <rect + style="fill:#cccccc;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.13471448;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + id="rect2456" + width="113.46721" + height="113.47698" + x="804.86346" + y="1144.8442" + transform="matrix(0.8229751,0.5680775,-0.8230865,0.5679161,0,0)" + inkscape:export-filename="/home/disney/gentoo/diagrams/get_jobs.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90" /> + <path + style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:#000000;stroke-width:0.96277702px;stroke-linecap:butt;stroke-linejoin:miter;marker-end:url(#TriangleOutL);stroke-opacity:1" + d="M -279.94502,1236.5604 L -279.89273,1263.8292" + id="path2470" + inkscape:connector-type="polyline" + inkscape:export-filename="/home/disney/gentoo/diagrams/get_jobs.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90" /> + <rect + style="fill:#cccccc;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.13471448;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + id="rect2472" + width="113.46721" + height="113.47713" + x="946.83398" + y="1286.6479" + transform="matrix(0.8229751,0.5680775,-0.8230865,0.5679161,0,0)" + inkscape:export-filename="/home/disney/gentoo/diagrams/get_jobs.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90" /> + <text + xml:space="preserve" + style="font-size:20px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:125%;writing-mode:lr-tb;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans" + x="-279.84827" + y="1302.4607" + id="text2474" + sodipodi:linespacing="125%" + inkscape:export-filename="/home/disney/gentoo/diagrams/get_jobs.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90"><tspan + sodipodi:role="line" + x="-277.30139" + y="1302.4607" + style="font-size:16px;font-family:Courier 10 Pitch" + id="tspan2476"><tspan + id="tspan2478" + style="font-size:16px;font-family:Bitstream Vera Sans">Is the </tspan></tspan><tspan + sodipodi:role="line" + x="-279.84827" + y="1320.8127" + style="font-size:16px;font-family:Courier 10 Pitch" + id="tspan2480">dup</tspan><tspan + sodipodi:role="line" + x="-279.84827" + y="1342.4607" + style="font-size:16px;font-family:Bitstream Vera Sans" + id="tspan2482">parameter</tspan><tspan + sodipodi:role="line" + x="-279.84827" + y="1362.4607" + style="font-size:16px;font-family:Bitstream Vera Sans" + id="tspan2484">True?</tspan></text> + <path + style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:#000000;stroke-width:0.96277702px;stroke-linecap:butt;stroke-linejoin:miter;marker-end:url(#TriangleOutL);stroke-opacity:1" + d="M -279.82362,1397.7423 L -279.77133,1425.0111" + id="path2486" + inkscape:connector-type="polyline" + inkscape:export-filename="/home/disney/gentoo/diagrams/get_jobs.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90" /> + <text + xml:space="preserve" + style="font-size:20px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:125%;writing-mode:lr-tb;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans" + x="-278.39359" + y="1154.4877" + id="text2500" + sodipodi:linespacing="125%" + inkscape:export-filename="/home/disney/gentoo/diagrams/get_jobs.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90"><tspan + sodipodi:role="line" + x="-275.52835" + y="1154.4877" + style="font-size:18px;font-family:Bitstream Vera Sans" + id="tspan10622">Is the job's </tspan><tspan + sodipodi:role="line" + x="-278.39359" + y="1175.1337" + style="font-size:18px;font-family:Courier 10 Pitch" + id="tspan2503">run_interval</tspan><tspan + sodipodi:role="line" + x="-278.39359" + y="1199.4877" + style="font-size:18px;font-family:Bitstream Vera Sans" + id="tspan2505">value > 0?</tspan></text> + <rect + style="font-size:20px;fill:#cccccc;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0.98150337;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + id="rect2507" + width="150.00647" + height="88.946548" + x="-353.22171" + y="1431.0809" + transform="matrix(0.9999996,8.850343e-4,-5.7802581e-4,0.9999998,0,0)" + inkscape:export-filename="/home/disney/gentoo/diagrams/get_jobs.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90" /> + <text + xml:space="preserve" + style="font-size:20px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:125%;writing-mode:lr-tb;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans" + x="-279.54843" + y="1457.9829" + id="text2509" + sodipodi:linespacing="125%" + inkscape:export-filename="/home/disney/gentoo/diagrams/get_jobs.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90"><tspan + sodipodi:role="line" + x="-279.54843" + y="1457.9829" + style="font-size:16px;font-family:Bitstream Vera Sans" + id="tspan2530">Insert new duped</tspan><tspan + sodipodi:role="line" + x="-277.00156" + y="1477.9829" + style="font-size:16px;font-family:Bitstream Vera Sans" + id="tspan2526">job in DB with </tspan><tspan + sodipodi:role="line" + x="-279.54843" + y="1497.9829" + style="font-size:16px;font-family:Courier 10 Pitch" + id="tspan2538"><tspan + id="tspan2542" + style="font-size:16px;font-family:Bitstream Vera Sans">correct </tspan>origjob</tspan></text> + <path + style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:#000000;stroke-width:0.96277702px;stroke-linecap:butt;stroke-linejoin:miter;marker-end:url(#TriangleOutL);stroke-opacity:1" + d="M -279.63935,1519.7525 L -279.58706,1547.0213" + id="path2517" + inkscape:connector-type="polyline" + inkscape:export-filename="/home/disney/gentoo/diagrams/get_jobs.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90" /> + <rect + style="font-size:20px;fill:#cccccc;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0.98150337;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + id="rect2544" + width="150.00647" + height="88.946548" + x="-353.13437" + y="1553.1658" + transform="matrix(0.9999996,8.8503481e-4,-5.7802683e-4,0.9999998,0,0)" + inkscape:export-filename="/home/disney/gentoo/diagrams/get_jobs.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90" /> + <text + xml:space="preserve" + style="font-size:20px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:125%;writing-mode:lr-tb;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans" + x="-279.5318" + y="1580.068" + id="text2546" + sodipodi:linespacing="125%" + inkscape:export-filename="/home/disney/gentoo/diagrams/get_jobs.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90"><tspan + sodipodi:role="line" + x="-279.5318" + y="1580.068" + style="font-size:16px;font-family:Bitstream Vera Sans" + id="tspan2548">Insert new duped</tspan><tspan + sodipodi:role="line" + x="-276.98492" + y="1600.068" + style="font-size:16px;font-family:Bitstream Vera Sans" + id="tspan2550">job in DB with </tspan><tspan + sodipodi:role="line" + x="-279.5318" + y="1620.068" + style="font-size:16px;font-family:Courier 10 Pitch" + id="tspan2552"><tspan + id="tspan2554" + style="font-size:16px;font-family:Bitstream Vera Sans">correct </tspan>origjob</tspan></text> + <path + style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:#000000;stroke-width:0.96277702px;stroke-linecap:butt;stroke-linejoin:miter;marker-end:url(#TriangleOutL);stroke-opacity:1" + d="M -279.62272,1641.8376 L -279.57043,1669.1064" + id="path2556" + inkscape:connector-type="polyline" + inkscape:export-filename="/home/disney/gentoo/diagrams/get_jobs.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90" /> + <path + sodipodi:type="arc" + style="fill:url(#linearGradient11111);fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + id="path11105" + sodipodi:cx="105.05586" + sodipodi:cy="52.311161" + sodipodi:rx="83.842659" + sodipodi:ry="30.304577" + d="M 188.89852 52.311161 A 83.842659 30.304577 0 1 1 21.213203,52.311161 A 83.842659 30.304577 0 1 1 188.89852 52.311161 z" + transform="matrix(0.6478283,0,0,0.6632677,-347.77245,1782.3802)" + inkscape:export-filename="/home/disney/gentoo/diagrams/get_jobs.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90" /> + <text + xml:space="preserve" + style="font-size:12px;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans" + x="-325.22742" + y="1820.0522" + id="text11107" + inkscape:export-filename="/home/disney/gentoo/diagrams/get_jobs.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90"><tspan + sodipodi:role="line" + x="-325.22742" + y="1820.0522" + id="tspan11109" + style="font-size:12px">Return job data</tspan></text> + <rect + style="font-size:20px;fill:#cccccc;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0.98150337;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + id="rect2619" + width="150.00647" + height="88.946548" + x="-352.93814" + y="1674.4956" + transform="matrix(0.9999996,8.8503536e-4,-5.7802793e-4,0.9999998,0,0)" + inkscape:export-filename="/home/disney/gentoo/diagrams/get_jobs.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90" /> + <text + xml:space="preserve" + style="font-size:14;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:125%;writing-mode:lr-tb;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans" + x="-279.40585" + y="1701.3982" + id="text2621" + sodipodi:linespacing="125%" + inkscape:export-filename="/home/disney/gentoo/diagrams/get_jobs.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90"><tspan + sodipodi:role="line" + x="-279.40585" + y="1701.3982" + style="font-size:14;font-family:Bitstream Vera Sans" + id="tspan2627">Recursively call</tspan><tspan + sodipodi:role="line" + x="-279.40585" + y="1718.8982" + style="font-size:14;font-family:Bitstream Vera Sans" + id="tspan2638"><tspan + style="font-family:Courier 10 Pitch" + id="tspan2650">get_job</tspan> to get data</tspan><tspan + sodipodi:role="line" + x="-279.40585" + y="1737.8402" + style="font-size:14;font-family:Bitstream Vera Sans" + id="tspan2646">for inserted job</tspan></text> + <path + style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:#000000;stroke-width:0.96277702px;stroke-linecap:butt;stroke-linejoin:miter;marker-end:url(#TriangleOutL);stroke-opacity:1" + d="M -279.49679,1763.1678 L -279.4445,1790.4366" + id="path2631" + inkscape:connector-type="polyline" + inkscape:export-filename="/home/disney/gentoo/diagrams/get_jobs.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90" /> + <path + style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:#000000;stroke-width:1.00222671px;stroke-linecap:butt;stroke-linejoin:miter;marker-end:url(#TriangleOutL);stroke-opacity:1" + d="M -186.42746,604.50504 L 111.40559,604.50504" + id="path2652" + inkscape:connector-type="polyline" /> + <path + style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:#000000;stroke-width:1.00240564px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;display:inline" + d="M 190.71429,650.22173 L 190.71429,872.71692" + id="path3623" + inkscape:connector-type="polyline" /> + <path + style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:#000000;stroke-width:1.00644386px;stroke-linecap:butt;stroke-linejoin:miter;marker-end:url(#TriangleOutL);stroke-opacity:1;display:inline" + d="M 191.42535,872.71933 L -198.50476,872.71933" + id="path3625" + inkscape:connector-type="polyline" /> + <path + style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;marker-end:url(#TriangleOutL);stroke-opacity:1;display:inline" + d="M -186.37315,1009.6832 L -93.944187,1009.6832" + id="path5568" + inkscape:connector-type="polyline" /> + <path + style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;marker-end:url(#TriangleOutL);stroke-opacity:1;display:inline" + d="M -186.87823,1171.8622 L -95.459416,1171.8127" + id="path5570" + inkscape:connector-type="polyline" /> + <path + style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;marker-end:url(#TriangleOutL);stroke-opacity:1;display:inline" + d="M -186.62568,1332.8622 L -95.711954,1332.9321" + id="path5572" + inkscape:connector-type="polyline" /> + <path + style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:#000000;stroke-width:1.00111866px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;display:inline" + d="M -89.145962,1008.9256 L -89.286273,1816.8616" + id="path6543" + inkscape:connector-type="polyline" /> + <path + style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:#000000;stroke-width:0.98884124px;stroke-linecap:butt;stroke-linejoin:miter;marker-end:url(#TriangleOutL);stroke-opacity:1;display:inline" + d="M -88.991702,1816.8622 L -220.11431,1816.8622" + id="path6545" + inkscape:connector-type="polyline" /> + <text + xml:space="preserve" + style="font-size:20px;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans" + x="-272.60464" + y="689.51062" + id="text2278" + inkscape:export-filename="/home/disney/gentoo/diagrams/get_jobs.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90"><tspan + sodipodi:role="line" + id="tspan2280" + x="-272.60464" + y="689.51062">No</tspan></text> + <text + xml:space="preserve" + style="font-size:20px;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans" + x="-170.89035" + y="1002.6535" + id="text7518" + inkscape:export-filename="/home/disney/gentoo/diagrams/get_jobs.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90"><tspan + sodipodi:role="line" + id="tspan7520" + x="-170.89035" + y="1002.6535">No</tspan></text> + <text + xml:space="preserve" + style="font-size:20px;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans" + x="-171.17606" + y="1160.9392" + id="text7522" + inkscape:export-filename="/home/disney/gentoo/diagrams/get_jobs.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90"><tspan + sodipodi:role="line" + id="tspan7524" + x="-171.17606" + y="1160.9392">No</tspan></text> + <text + xml:space="preserve" + style="font-size:20px;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans" + x="-172.60463" + y="1325.2249" + id="text7526" + inkscape:export-filename="/home/disney/gentoo/diagrams/get_jobs.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90"><tspan + sodipodi:role="line" + id="tspan7528" + x="-172.60463" + y="1325.2249">No</tspan></text> + <text + xml:space="preserve" + style="font-size:20px;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans" + x="-627.14288" + y="1395.2192" + id="text7530"><tspan + sodipodi:role="line" + id="tspan7532" + x="-627.14288" + y="1395.2192">Yes, so get_job has been called</tspan><tspan + sodipodi:role="line" + x="-627.14288" + y="1420.2192" + id="tspan7534">in execution mode for a recurring </tspan><tspan + sodipodi:role="line" + x="-627.14288" + y="1445.2192" + id="tspan7536">job.</tspan></text> + <text + xml:space="preserve" + style="font-size:20px;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans" + x="-326" + y="1093.7908" + id="text7538"><tspan + sodipodi:role="line" + id="tspan7540" + x="-326" + y="1093.7908">Yes</tspan></text> + <text + xml:space="preserve" + style="font-size:20px;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans" + x="-328.7825" + y="1256.082" + id="text7542"><tspan + sodipodi:role="line" + id="tspan7544" + x="-328.7825" + y="1256.082">Yes</tspan></text> + <text + xml:space="preserve" + style="font-size:20px;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans" + x="-181.82745" + y="350.91531" + id="text7546"><tspan + sodipodi:role="line" + id="tspan7548" + x="-181.82745" + y="350.91531">NB: <tspan + style="font-family:Courier 10 Pitch" + id="tspan7550">get_job()</tspan> has 2 modes. One is a query mode,</tspan><tspan + sodipodi:role="line" + x="-181.82745" + y="377.9753" + id="tspan7554">which will simply return information about a job. The</tspan><tspan + sodipodi:role="line" + x="-181.82745" + y="402.9753" + id="tspan7556">other is execution mode. In this approach, recurring</tspan><tspan + sodipodi:role="line" + x="-181.82745" + y="427.9753" + id="tspan7558">jobs are duplicated into unique job IDs that are tied </tspan><tspan + sodipodi:role="line" + x="-181.82745" + y="452.9753" + id="tspan7560">back to the original job via the <tspan + style="font-family:Courier 10 Pitch" + id="tspan7562">origjob</tspan> field. In exec</tspan><tspan + sodipodi:role="line" + x="-181.82745" + y="480.03528" + id="tspan7564">mode, a recurring job is duplicated into a new ID before</tspan><tspan + sodipodi:role="line" + x="-181.82745" + y="505.03528" + id="tspan7566">returning the info from its query.</tspan></text> + </g> +</svg> diff --git a/docs/jobs_flow/svg/get_jobs.svg b/docs/jobs_flow/svg/get_jobs.svg new file mode 100644 index 0000000..192fce4 --- /dev/null +++ b/docs/jobs_flow/svg/get_jobs.svg @@ -0,0 +1,863 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Created with Inkscape (http://www.inkscape.org/) --> +<svg + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://web.resource.org/cc/" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:xlink="http://www.w3.org/1999/xlink" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + width="744.09448819" + height="1052.3622047" + id="svg10403" + sodipodi:version="0.32" + inkscape:version="0.45" + sodipodi:docbase="/home/disney/gentoo/diagrams" + sodipodi:docname="get_jobs.svg" + inkscape:output_extension="org.inkscape.output.svg.inkscape" + inkscape:export-filename="/home/disney/gentoo/diagrams/get_jobs.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90" + sodipodi:modified="true"> + <defs + id="defs10405"> + <linearGradient + inkscape:collect="always" + id="linearGradient3233"> + <stop + style="stop-color:#cccccc;stop-opacity:1;" + offset="0" + id="stop3235" /> + <stop + style="stop-color:#cccccc;stop-opacity:0;" + offset="1" + id="stop3237" /> + </linearGradient> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient3233" + id="linearGradient10361" + gradientUnits="userSpaceOnUse" + x1="110.35865" + y1="84.70903" + x2="122.83298" + y2="205.02553" /> + <marker + inkscape:stockid="TriangleOutL" + orient="auto" + refY="0" + refX="0" + id="TriangleOutL" + style="overflow:visible"> + <path + id="path4305" + d="M 5.77,0 L -2.88,5 L -2.88,-5 L 5.77,0 z " + style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;marker-start:none" + transform="scale(0.8,0.8)" /> + </marker> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient3233" + id="linearGradient23523" + gradientUnits="userSpaceOnUse" + x1="110.35865" + y1="84.70903" + x2="122.83298" + y2="205.02553" /> + </defs> + <sodipodi:namedview + id="base" + pagecolor="#ffffff" + bordercolor="#ffffff" + borderopacity="0.0" + inkscape:pageopacity="0.0" + inkscape:pageshadow="0" + inkscape:zoom="1.4" + inkscape:cx="134.45269" + inkscape:cy="35.224154" + inkscape:document-units="px" + inkscape:current-layer="layer1" + showgrid="true" + showguides="true" + inkscape:guide-bbox="true" + inkscape:window-width="1398" + inkscape:window-height="654" + inkscape:window-x="0" + inkscape:window-y="0" /> + <metadata + id="metadata10408"> + <rdf:RDF> + <cc:Work + rdf:about=""> + <dc:format>image/svg+xml</dc:format> + <dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> + </cc:Work> + </rdf:RDF> + </metadata> + <g + inkscape:label="Layer 1" + inkscape:groupmode="layer" + id="layer1"> + <rect + style="fill:#cccccc;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.13471448;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + id="rect3223" + width="113.46721" + height="113.47578" + x="661.54346" + y="807.16095" + transform="matrix(0.8229751,0.5680775,-0.8230865,0.5679161,0,0)" + inkscape:export-filename="/home/disney/gentoo/diagrams/get_jobs.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90" /> + <rect + style="font-size:20px;fill:#cccccc;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0.98150337;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + id="rect2160" + width="150.00647" + height="88.946548" + x="-191.84828" + y="470.84952" + transform="matrix(0.9999996,8.8501993e-4,-5.7799707e-4,0.9999998,0,0)" + inkscape:export-filename="/home/disney/gentoo/diagrams/get_jobs.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90" /> + <path + style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:#000000;stroke-width:0.96277702px;stroke-linecap:butt;stroke-linejoin:miter;marker-end:url(#TriangleOutL);stroke-opacity:1" + d="M -122.61932,559.41825 L -122.56703,586.68705" + id="path4416" + inkscape:connector-type="polyline" + inkscape:export-filename="/home/disney/gentoo/diagrams/get_jobs.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90" /> + <text + xml:space="preserve" + style="font-size:20px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:125%;writing-mode:lr-tb;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans" + x="-115.59786" + y="502.84668" + id="text3139" + sodipodi:linespacing="125%" + inkscape:export-filename="/home/disney/gentoo/diagrams/get_jobs.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90"><tspan + sodipodi:role="line" + x="-115.59786" + y="502.84668" + id="tspan3145">Get client ID:</tspan><tspan + sodipodi:role="line" + x="-115.59786" + y="520.4242" + id="tspan10531" + style="font-size:14px;font-family:Courier 10 Pitch">srvmod client.py:</tspan><tspan + sodipodi:role="line" + x="-115.59786" + y="537.9242" + id="tspan10533" + style="font-size:14px;font-family:Courier 10 Pitch">get_clientid</tspan></text> + <rect + style="font-size:20px;fill:#cccccc;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0.98150337;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + id="rect10535" + width="150.00647" + height="88.946548" + x="-191.8132" + y="591.80951" + transform="matrix(0.9999996,8.8501995e-4,-5.7799711e-4,0.9999998,0,0)" + inkscape:export-filename="/home/disney/gentoo/diagrams/get_jobs.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90" /> + <text + xml:space="preserve" + style="font-size:20px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:125%;writing-mode:lr-tb;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans" + x="-118.58022" + y="615.93799" + id="text10554" + sodipodi:linespacing="125%" + inkscape:export-filename="/home/disney/gentoo/diagrams/get_jobs.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90"><tspan + sodipodi:role="line" + x="-118.58022" + y="615.93799" + id="tspan10556">Init looping</tspan><tspan + sodipodi:role="line" + x="-115.39663" + y="640.93799" + id="tspan10572">pointer to DB </tspan><tspan + sodipodi:role="line" + x="-118.58022" + y="665.93799" + id="tspan10560" + style="font-size:20px;font-family:Bitstream Vera Sans">query results</tspan></text> + <rect + style="font-size:20px;fill:#cccccc;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0.98150337;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + id="rect10581" + width="150.00647" + height="88.946548" + x="-189.41798" + y="713.28467" + transform="matrix(0.9999996,8.8502052e-4,-5.7799825e-4,0.9999998,0,0)" + inkscape:export-filename="/home/disney/gentoo/diagrams/get_jobs.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90" /> + <text + xml:space="preserve" + style="font-size:20px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:125%;writing-mode:lr-tb;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans" + x="-116.25535" + y="737.41522" + id="text10583" + sodipodi:linespacing="125%" + inkscape:export-filename="/home/disney/gentoo/diagrams/get_jobs.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90"><tspan + sodipodi:role="line" + x="-113.07175" + y="737.41522" + style="font-size:20px;font-family:Bitstream Vera Sans" + id="tspan10596">Load job from </tspan><tspan + sodipodi:role="line" + x="-113.07175" + y="762.41522" + style="font-size:20px;font-family:Bitstream Vera Sans" + id="tspan10602">DB into </tspan><tspan + sodipodi:role="line" + x="-116.25535" + y="785.35524" + style="font-size:20px;font-family:Courier 10 Pitch" + id="tspan10604">jobs_dict</tspan><tspan + sodipodi:role="line" + x="-116.25535" + y="810.35524" + style="font-size:20px;font-family:Bitstream Vera Sans" + id="tspan10598" /></text> + <rect + style="font-size:20px;fill:#cccccc;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0.98150337;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + id="rect10616" + width="150.00647" + height="88.946548" + x="236.93985" + y="849.13074" + transform="matrix(0.9999996,8.85029e-4,-5.7801521e-4,0.9999998,0,0)" + inkscape:export-filename="/home/disney/gentoo/diagrams/get_jobs.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90" /> + <text + xml:space="preserve" + style="font-size:20px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:125%;writing-mode:lr-tb;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans" + x="-119.9763" + y="882.09253" + id="text10618" + sodipodi:linespacing="125%" + inkscape:export-filename="/home/disney/gentoo/diagrams/get_jobs.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90"><tspan + sodipodi:role="line" + x="-117.11107" + y="882.09253" + style="font-size:18px;font-family:Bitstream Vera Sans" + id="tspan10622">Is the job's </tspan><tspan + sodipodi:role="line" + x="-119.9763" + y="902.73854" + style="font-size:18px;font-family:Courier 10 Pitch" + id="tspan10624">run_interval</tspan><tspan + sodipodi:role="line" + x="-119.9763" + y="927.09253" + style="font-size:18px;font-family:Bitstream Vera Sans" + id="tspan10626">value > 0?</tspan></text> + <rect + style="fill:#cccccc;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + id="rect10636" + width="0" + height="18.182745" + x="150.51273" + y="513.95087" + inkscape:export-filename="/home/disney/gentoo/diagrams/get_jobs.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90" /> + <rect + style="fill:#cccccc;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.13471448;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + id="rect10640" + width="113.46721" + height="113.47796" + x="1134.6199" + y="1278.9987" + transform="matrix(0.8229751,0.5680775,-0.8230865,0.5679161,0,0)" + inkscape:export-filename="/home/disney/gentoo/diagrams/get_jobs.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90" /> + <text + xml:space="preserve" + style="font-size:20px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:125%;writing-mode:lr-tb;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans" + x="-120.89916" + y="1400.8124" + id="text10642" + sodipodi:linespacing="125%" + inkscape:export-filename="/home/disney/gentoo/diagrams/get_jobs.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90"><tspan + sodipodi:role="line" + x="-118.03393" + y="1400.8124" + style="font-size:18px;font-family:Bitstream Vera Sans" + id="tspan10648">Does </tspan><tspan + sodipodi:role="line" + x="-118.03393" + y="1423.3124" + style="font-size:18px;font-family:Bitstream Vera Sans" + id="tspan10655">the client </tspan><tspan + sodipodi:role="line" + x="-118.03393" + y="1445.8124" + style="font-size:18px;font-family:Bitstream Vera Sans" + id="tspan10657">already have </tspan><tspan + sodipodi:role="line" + x="-120.89916" + y="1468.3124" + style="font-size:18px;font-family:Bitstream Vera Sans" + id="tspan10667">the job?</tspan></text> + <rect + style="fill:#cccccc;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.13471448;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + id="rect10669" + width="113.46721" + height="113.47795" + x="1285.3126" + y="1430.3282" + transform="matrix(0.8229751,0.5680775,-0.8230865,0.5679161,0,0)" + inkscape:export-filename="/home/disney/gentoo/diagrams/get_jobs.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90" /> + <text + xml:space="preserve" + style="font-size:20px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:125%;writing-mode:lr-tb;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans" + x="-121.4402" + y="1586.36" + id="text10671" + sodipodi:linespacing="125%" + inkscape:export-filename="/home/disney/gentoo/diagrams/get_jobs.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90"><tspan + sodipodi:role="line" + x="-121.4402" + y="1586.36" + style="font-size:18px;font-family:Bitstream Vera Sans" + id="tspan10690">More</tspan><tspan + sodipodi:role="line" + x="-121.4402" + y="1608.86" + style="font-size:18px;font-family:Bitstream Vera Sans" + id="tspan10694">DB records</tspan><tspan + sodipodi:role="line" + x="-121.4402" + y="1631.36" + style="font-size:18px;font-family:Bitstream Vera Sans" + id="tspan10700">in query?</tspan></text> + <text + xml:space="preserve" + style="font-size:20px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:125%;writing-mode:lr-tb;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans" + x="308.94965" + y="864.55475" + id="text10704" + sodipodi:linespacing="125%" + inkscape:export-filename="/home/disney/gentoo/diagrams/get_jobs.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90"><tspan + sodipodi:role="line" + x="311.17816" + y="864.55475" + id="tspan10710" + style="font-size:14px;font-family:Bitstream Vera Sans">Query DB for </tspan><tspan + sodipodi:role="line" + x="311.17816" + y="882.05475" + style="font-size:14px;font-family:Bitstream Vera Sans" + id="tspan10717">largest job ID </tspan><tspan + sodipodi:role="line" + x="308.94965" + y="899.55475" + style="font-size:14px;font-family:Bitstream Vera Sans" + id="tspan10719">with current job</tspan><tspan + sodipodi:role="line" + x="311.17816" + y="917.05475" + style="font-size:14px;font-family:Bitstream Vera Sans" + id="tspan10721">as the origjob: </tspan><tspan + sodipodi:role="line" + x="308.94965" + y="933.11276" + style="font-size:14px;font-family:Courier 10 Pitch" + id="tspan10733">newjob</tspan></text> + <text + xml:space="preserve" + style="font-size:20px;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans" + x="14.804216" + y="862.0365" + id="text10723" + inkscape:export-filename="/home/disney/gentoo/diagrams/get_jobs.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90"><tspan + sodipodi:role="line" + x="14.804216" + y="862.0365" + id="tspan10727">Yes, so this is a </tspan><tspan + sodipodi:role="line" + x="14.804216" + y="887.0365" + id="tspan10729">recurring job.</tspan></text> + <rect + style="fill:#cccccc;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.13471448;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + id="rect10739" + width="113.46721" + height="113.47813" + x="1068.4481" + y="688.2597" + transform="matrix(0.8229751,0.5680775,-0.8230865,0.5679161,0,0)" + inkscape:export-filename="/home/disney/gentoo/diagrams/get_jobs.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90" /> + <text + xml:space="preserve" + style="font-size:20px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:125%;writing-mode:lr-tb;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans" + x="311.21585" + y="1036.2333" + id="text10741" + sodipodi:linespacing="125%" + inkscape:export-filename="/home/disney/gentoo/diagrams/get_jobs.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90"><tspan + sodipodi:role="line" + x="311.21585" + y="1036.2333" + style="font-size:14px;font-family:Bitstream Vera Sans" + id="tspan10749">Does</tspan><tspan + sodipodi:role="line" + x="311.21585" + y="1052.2913" + style="font-size:14px;font-family:Courier 10 Pitch" + id="tspan10751">newjob</tspan><tspan + sodipodi:role="line" + x="311.21585" + y="1071.2333" + style="font-size:14px;font-family:Courier 10 Pitch" + id="tspan10762"><tspan + style="font-family:Bitstream Vera Sans" + id="tspan10764">have an </tspan>eventtime</tspan><tspan + sodipodi:role="line" + x="311.21585" + y="1090.1753" + style="font-size:14px;font-family:Bitstream Vera Sans" + id="tspan10766">value?</tspan></text> + <rect + style="font-size:20px;fill:#cccccc;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0.98150337;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + id="rect10768" + width="150.00647" + height="88.946548" + x="243.21637" + y="1388.5536" + transform="matrix(0.9999996,8.8502356e-4,-5.7800433e-4,0.9999998,0,0)" + inkscape:export-filename="/home/disney/gentoo/diagrams/get_jobs.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90" /> + <text + xml:space="preserve" + style="font-size:20px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:125%;writing-mode:lr-tb;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans" + x="315.98819" + y="1413.0701" + id="text10770" + sodipodi:linespacing="125%" + inkscape:export-filename="/home/disney/gentoo/diagrams/get_jobs.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90"><tspan + sodipodi:role="line" + x="319.17178" + y="1413.0701" + style="font-size:20px;font-family:Bitstream Vera Sans" + id="tspan10776">Add job to </tspan><tspan + sodipodi:role="line" + x="315.98819" + y="1438.0701" + style="font-size:20px;font-family:Bitstream Vera Sans" + id="tspan10785">queue for</tspan><tspan + sodipodi:role="line" + x="315.98819" + y="1463.0701" + style="font-size:20px;font-family:Bitstream Vera Sans" + id="tspan10787">client</tspan><tspan + sodipodi:role="line" + x="315.98819" + y="1488.0701" + style="font-size:20px;font-family:Bitstream Vera Sans" + id="tspan10778" /></text> + <text + xml:space="preserve" + style="font-size:20px;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans" + x="-8.3630829" + y="1420.2061" + id="text3163" + inkscape:export-filename="/home/disney/gentoo/diagrams/get_jobs.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90"><tspan + sodipodi:role="line" + id="tspan3165" + x="-8.3630829" + y="1420.2061">No</tspan></text> + <text + xml:space="preserve" + style="font-size:20px;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans" + x="-83.309662" + y="1526.4396" + id="text9291" + inkscape:export-filename="/home/disney/gentoo/diagrams/get_jobs.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90"><tspan + sodipodi:role="line" + x="-83.309662" + y="1526.4396" + id="tspan9293">Yes</tspan></text> + <text + xml:space="preserve" + style="font-size:20px;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans" + x="319.12906" + y="1148.8682" + id="text10793" + inkscape:export-filename="/home/disney/gentoo/diagrams/get_jobs.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90"><tspan + sodipodi:role="line" + x="319.12906" + y="1148.8682" + id="tspan10795">Yes</tspan></text> + <text + xml:space="preserve" + style="font-size:20px;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans" + x="-111.10352" + y="1696.9423" + id="text10797" + inkscape:export-filename="/home/disney/gentoo/diagrams/get_jobs.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90"><tspan + sodipodi:role="line" + id="tspan10799" + x="-111.10352" + y="1696.9423">No</tspan></text> + <text + xml:space="preserve" + style="font-size:20px;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans" + x="6.3235712" + y="1092.3763" + id="text10801" + inkscape:export-filename="/home/disney/gentoo/diagrams/get_jobs.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90"><tspan + sodipodi:role="line" + id="tspan10803" + x="6.3235712" + y="1092.3763">No, so it hasn't been</tspan><tspan + sodipodi:role="line" + x="6.3235712" + y="1117.3763" + id="tspan10805">run yet and should run</tspan><tspan + sodipodi:role="line" + x="6.3235712" + y="1142.3763" + id="tspan10807">unconditionally.</tspan></text> + <rect + style="fill:#cccccc;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.13471448;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + id="rect10823" + width="113.46721" + height="113.47874" + x="1224.9142" + y="844.56018" + transform="matrix(0.8229751,0.5680775,-0.8230865,0.5679161,0,0)" + inkscape:export-filename="/home/disney/gentoo/diagrams/get_jobs.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90" /> + <text + xml:space="preserve" + style="font-size:20px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:125%;writing-mode:lr-tb;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans" + x="311.33508" + y="1213.8826" + id="text10825" + sodipodi:linespacing="125%" + inkscape:export-filename="/home/disney/gentoo/diagrams/get_jobs.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90"><tspan + sodipodi:role="line" + x="313.5636" + y="1213.8826" + style="font-size:14px;font-family:Bitstream Vera Sans" + id="tspan10835">Has </tspan><tspan + sodipodi:role="line" + x="313.5636" + y="1231.3826" + style="font-size:14px;font-family:Bitstream Vera Sans" + id="tspan10847">enough time </tspan><tspan + sodipodi:role="line" + x="311.33508" + y="1248.8826" + style="font-size:14px;font-family:Bitstream Vera Sans" + id="tspan10849">elapsed since the</tspan><tspan + sodipodi:role="line" + x="311.33508" + y="1266.3826" + style="font-size:14px;font-family:Bitstream Vera Sans" + id="tspan10851">last run?</tspan></text> + <text + xml:space="preserve" + style="font-size:20px;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans" + x="418.03711" + y="1232.7932" + id="text10853" + inkscape:export-filename="/home/disney/gentoo/diagrams/get_jobs.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90"><tspan + sodipodi:role="line" + id="tspan10855" + x="418.03711" + y="1232.7932">No</tspan></text> + <text + xml:space="preserve" + style="font-size:20px;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans" + x="164.24954" + y="1232.079" + id="text10857" + inkscape:export-filename="/home/disney/gentoo/diagrams/get_jobs.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90"><tspan + sodipodi:role="line" + x="164.24954" + y="1232.079" + id="tspan10859">Yes</tspan></text> + <path + style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:#000000;stroke-width:0.96277702px;stroke-linecap:butt;stroke-linejoin:miter;marker-end:url(#TriangleOutL);stroke-opacity:1" + d="M -121.52266,679.89644 L -121.47037,707.16524" + id="path10861" + inkscape:connector-type="polyline" + inkscape:export-filename="/home/disney/gentoo/diagrams/get_jobs.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90" /> + <path + style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:#000000;stroke-width:0.96277702px;stroke-linecap:butt;stroke-linejoin:miter;marker-end:url(#TriangleOutL);stroke-opacity:1" + d="M -120.04804,802.84357 L -119.99575,830.11237" + id="path10867" + inkscape:connector-type="polyline" + inkscape:export-filename="/home/disney/gentoo/diagrams/get_jobs.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90" /> + <path + style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:#000000;stroke-width:0.99117851px;stroke-linecap:butt;stroke-linejoin:miter;marker-end:url(#TriangleOutL);stroke-opacity:1" + d="M -27.119056,899.06781 L 231.02244,898.94707" + id="path10871" + inkscape:connector-type="polyline" + inkscape:export-filename="/home/disney/gentoo/diagrams/get_jobs.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90" /> + <path + style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:#000000;stroke-width:0.95675451px;stroke-linecap:butt;stroke-linejoin:miter;marker-end:url(#TriangleOutL);stroke-opacity:1" + d="M 311.7902,938.82266 L 312.27103,992.2825" + id="path11844" + inkscape:connector-type="polyline" + inkscape:export-filename="/home/disney/gentoo/diagrams/get_jobs.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90" /> + <path + style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:#000000;stroke-width:0.98423362px;stroke-linecap:butt;stroke-linejoin:miter;marker-end:url(#TriangleOutL);stroke-opacity:1;display:inline" + d="M 220,1239.505 L -113.57143,1238.7908" + id="path12815" + inkscape:connector-type="polyline" + inkscape:export-filename="/home/disney/gentoo/diagrams/get_jobs.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90" /> + <path + style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:#000000;stroke-width:0.98957765px;stroke-linecap:butt;stroke-linejoin:miter;marker-end:url(#TriangleOutL);stroke-opacity:1;display:inline" + d="M -119.76524,963.62234 L -119.28571,1364.505" + id="path13786" + inkscape:connector-type="polyline" + inkscape:export-filename="/home/disney/gentoo/diagrams/get_jobs.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90" /> + <path + style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:#000000;stroke-width:0.99212563px;stroke-linecap:butt;stroke-linejoin:miter;marker-end:url(#TriangleOutL);stroke-opacity:1" + d="M 218.73448,1062.4585 L -113.65224,1063.0765" + id="path14757" + inkscape:connector-type="polyline" + inkscape:export-filename="/home/disney/gentoo/diagrams/get_jobs.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90" /> + <path + style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:#000000;stroke-width:0.99006528px;stroke-linecap:butt;stroke-linejoin:miter;marker-end:url(#TriangleOutL);stroke-opacity:1;display:inline" + d="M -26.016101,1435.3512 L 235.56992,1434.0922" + id="path15728" + inkscape:connector-type="polyline" + inkscape:export-filename="/home/disney/gentoo/diagrams/get_jobs.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90" /> + <path + style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:#000000;stroke-width:0.95567065px;stroke-linecap:butt;stroke-linejoin:miter;marker-end:url(#TriangleOutL);stroke-opacity:1" + d="M -119.17781,1499.6674 L -119.30971,1537.473" + id="path16699" + inkscape:connector-type="polyline" + inkscape:export-filename="/home/disney/gentoo/diagrams/get_jobs.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90" /> + <text + xml:space="preserve" + style="font-size:20px;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans" + x="-247.21107" + y="1594.9423" + id="text17670" + inkscape:export-filename="/home/disney/gentoo/diagrams/get_jobs.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90"><tspan + sodipodi:role="line" + x="-247.21107" + y="1594.9423" + id="tspan17672">Yes</tspan></text> + <path + style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:#000000;stroke-width:0.99190581px;stroke-linecap:butt;stroke-linejoin:miter;marker-end:url(#TriangleOutL);stroke-opacity:1;display:inline" + d="M 314.28571,1477.5046 L 314.28571,1602.3644" + id="path17674" + inkscape:connector-type="polyline" + inkscape:export-filename="/home/disney/gentoo/diagrams/get_jobs.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90" /> + <path + style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:#000000;stroke-width:1.01234651px;stroke-linecap:butt;stroke-linejoin:miter;marker-end:url(#TriangleOutL);stroke-opacity:1;display:inline" + d="M 460.71429,1607.3622 L -21.29938,1607.505" + id="path17676" + inkscape:connector-type="polyline" + inkscape:export-filename="/home/disney/gentoo/diagrams/get_jobs.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90" /> + <path + style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:#000000;stroke-width:0.86938626px;stroke-linecap:butt;stroke-linejoin:miter;marker-end:url(#TriangleOutL);stroke-opacity:1" + d="M 312.53745,1127.2528 L 313.02377,1170.8967" + id="path19620" + inkscape:connector-type="polyline" + inkscape:export-filename="/home/disney/gentoo/diagrams/get_jobs.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90" /> + <path + style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:#000000;stroke-width:0.99093974px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + d="M 406.92463,1239.801 L 460.93252,1239.801" + id="path19622" + inkscape:connector-type="polyline" + inkscape:export-filename="/home/disney/gentoo/diagrams/get_jobs.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90" /> + <path + style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:#000000;stroke-width:0.99699807px;stroke-linecap:butt;stroke-linejoin:miter;marker-end:url(#TriangleOutL);stroke-opacity:1;display:inline" + d="M 460.62953,1239.7441 L 460.71429,1602.2671" + id="path19624" + inkscape:connector-type="polyline" + inkscape:export-filename="/home/disney/gentoo/diagrams/get_jobs.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90" /> + <path + style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:#000000;stroke-width:1.02519643px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;display:inline" + d="M -212.88247,1607.3622 L -270.68898,1607.3622" + id="path21564" + inkscape:connector-type="polyline" + inkscape:export-filename="/home/disney/gentoo/diagrams/get_jobs.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90" /> + <path + style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:#000000;stroke-width:0.99970818px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;display:inline" + d="M -270,1606.6482 L -270,752.86106" + id="path21566" + inkscape:connector-type="polyline" + inkscape:export-filename="/home/disney/gentoo/diagrams/get_jobs.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90" /> + <path + style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:#000000;stroke-width:0.97189611px;stroke-linecap:butt;stroke-linejoin:miter;marker-end:url(#TriangleOutL);stroke-opacity:1;display:inline" + d="M -270.72833,752.36218 L -195.42768,752.36218" + id="path21568" + inkscape:connector-type="polyline" + inkscape:export-filename="/home/disney/gentoo/diagrams/get_jobs.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90" /> + <path + sodipodi:type="arc" + style="fill:url(#linearGradient10361);fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + id="path10355" + sodipodi:cx="105.05586" + sodipodi:cy="52.311161" + sodipodi:rx="83.842659" + sodipodi:ry="30.304577" + d="M 188.89852 52.311161 A 83.842659 30.304577 0 1 1 21.213203,52.311161 A 83.842659 30.304577 0 1 1 188.89852 52.311161 z" + transform="matrix(0.6478283,0,0,0.6632677,-186.24601,1714.6711)" + inkscape:export-filename="/home/disney/gentoo/diagrams/get_jobs.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90" /> + <text + xml:space="preserve" + style="font-size:20px;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans" + x="-141.96242" + y="1754.639" + id="text10357" + inkscape:export-filename="/home/disney/gentoo/diagrams/get_jobs.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90"><tspan + sodipodi:role="line" + x="-141.96242" + y="1754.639" + id="tspan10365">Stop</tspan></text> + <path + style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;marker-end:url(#TriangleOutL)" + d="M -120,1671.5857 L -119.70308,1724.1136" + id="path22546" + inkscape:connector-type="polyline" + inkscape:export-filename="/home/disney/gentoo/diagrams/get_jobs.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90" /> + <path + sodipodi:type="arc" + style="fill:url(#linearGradient23523);fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + id="path23517" + sodipodi:cx="105.05586" + sodipodi:cy="52.311161" + sodipodi:rx="83.842659" + sodipodi:ry="30.304577" + d="M 188.89852 52.311161 A 83.842659 30.304577 0 1 1 21.213203,52.311161 A 83.842659 30.304577 0 1 1 188.89852 52.311161 z" + transform="matrix(0.6478283,0,0,0.6632677,-189.58721,383.91771)" + inkscape:export-filename="/home/disney/gentoo/diagrams/get_jobs.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90" /> + <text + xml:space="preserve" + style="font-size:20px;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans" + x="-145.3036" + y="424.59995" + id="text23519" + inkscape:export-filename="/home/disney/gentoo/diagrams/get_jobs.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90"><tspan + sodipodi:role="line" + x="-145.3036" + y="424.59995" + id="tspan23521">Start</tspan></text> + <path + style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:#000000;stroke-width:0.96277702px;stroke-linecap:butt;stroke-linejoin:miter;marker-end:url(#TriangleOutL);stroke-opacity:1" + d="M -122.1909,438.64855 L -122.13861,465.91735" + id="path23525" + inkscape:connector-type="polyline" + inkscape:export-filename="/home/disney/gentoo/diagrams/get_jobs.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90" /> + <text + xml:space="preserve" + style="font-size:20px;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans" + x="-111.17606" + y="985.22491" + id="text2278" + inkscape:export-filename="/home/disney/gentoo/diagrams/get_jobs.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90"><tspan + sodipodi:role="line" + id="tspan2280" + x="-111.17606" + y="985.22491">No</tspan></text> + </g> +</svg> diff --git a/docs/jobs_flow/svg/get_jstatus.svg b/docs/jobs_flow/svg/get_jstatus.svg new file mode 100644 index 0000000..c671682 --- /dev/null +++ b/docs/jobs_flow/svg/get_jstatus.svg @@ -0,0 +1,428 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Created with Inkscape (http://www.inkscape.org/) --> +<svg + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://web.resource.org/cc/" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:xlink="http://www.w3.org/1999/xlink" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + width="744.09448819" + height="1052.3622047" + id="svg10622" + sodipodi:version="0.32" + inkscape:version="0.45" + sodipodi:docbase="/home/disney/gentoo/diagrams" + sodipodi:docname="get_jstatus.svg" + inkscape:output_extension="org.inkscape.output.svg.inkscape" + inkscape:export-filename="/home/disney/gentoo/diagrams/get_jstatus.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90" + sodipodi:modified="TRUE"> + <defs + id="defs10624"> + <linearGradient + inkscape:collect="always" + id="linearGradient3233"> + <stop + style="stop-color:#cccccc;stop-opacity:1;" + offset="0" + id="stop3235" /> + <stop + style="stop-color:#cccccc;stop-opacity:0;" + offset="1" + id="stop3237" /> + </linearGradient> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient3233" + id="linearGradient23523" + gradientUnits="userSpaceOnUse" + x1="110.35865" + y1="84.70903" + x2="122.83298" + y2="205.02553" /> + <marker + inkscape:stockid="TriangleOutL" + orient="auto" + refY="0" + refX="0" + id="TriangleOutL" + style="overflow:visible"> + <path + id="path4305" + d="M 5.77,0 L -2.88,5 L -2.88,-5 L 5.77,0 z " + style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;marker-start:none" + transform="scale(0.8,0.8)" /> + </marker> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient3233" + id="linearGradient11111" + gradientUnits="userSpaceOnUse" + x1="110.35865" + y1="84.70903" + x2="122.83298" + y2="205.02553" /> + </defs> + <sodipodi:namedview + id="base" + pagecolor="#ffffff" + bordercolor="#ffffff" + borderopacity="0.0" + inkscape:pageopacity="0.0" + inkscape:pageshadow="0" + inkscape:zoom="0.49497475" + inkscape:cx="239.47794" + inkscape:cy="600.33586" + inkscape:document-units="px" + inkscape:current-layer="layer1" + showgrid="true" + inkscape:window-width="1398" + inkscape:window-height="654" + inkscape:window-x="0" + inkscape:window-y="0" /> + <metadata + id="metadata10627"> + <rdf:RDF> + <cc:Work + rdf:about=""> + <dc:format>image/svg+xml</dc:format> + <dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> + </cc:Work> + </rdf:RDF> + </metadata> + <g + inkscape:label="Layer 1" + inkscape:groupmode="layer" + id="layer1"> + <rect + style="font-size:20px;fill:#cccccc;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0.98150337;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + id="rect2160" + width="150.00647" + height="88.946548" + x="-34.910034" + y="116.74475" + transform="matrix(0.9999996,8.8501994e-4,-5.7799709e-4,0.9999998,0,0)" + inkscape:export-filename="/home/disney/gentoo/diagrams/get_jobs.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90" /> + <path + style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:#000000;stroke-width:0.96277702px;stroke-linecap:butt;stroke-linejoin:miter;marker-end:url(#TriangleOutL);stroke-opacity:1" + d="M 34.523535,205.45245 L 34.575825,232.72125" + id="path4416" + inkscape:connector-type="polyline" + inkscape:export-filename="/home/disney/gentoo/diagrams/get_jobs.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90" /> + <text + xml:space="preserve" + style="font-size:20px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:125%;writing-mode:lr-tb;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans" + x="41.544994" + y="148.88087" + id="text3139" + sodipodi:linespacing="125%" + inkscape:export-filename="/home/disney/gentoo/diagrams/get_jobs.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90"><tspan + sodipodi:role="line" + x="41.544994" + y="148.88087" + id="tspan3145">Get client ID:</tspan><tspan + sodipodi:role="line" + x="41.544994" + y="166.45839" + id="tspan10531" + style="font-size:14px;font-family:Courier 10 Pitch">srvmod client.py:</tspan><tspan + sodipodi:role="line" + x="41.544994" + y="183.95839" + id="tspan10533" + style="font-size:14px;font-family:Courier 10 Pitch">get_clientid()</tspan></text> + <path + sodipodi:type="arc" + style="fill:url(#linearGradient23523);fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + id="path23517" + sodipodi:cx="105.05586" + sodipodi:cy="52.311161" + sodipodi:rx="83.842659" + sodipodi:ry="30.304577" + d="M 188.89852 52.311161 A 83.842659 30.304577 0 1 1 21.213203,52.311161 A 83.842659 30.304577 0 1 1 188.89852 52.311161 z" + transform="matrix(0.6478283,0,0,0.6632677,-32.444355,29.951909)" + inkscape:export-filename="/home/disney/gentoo/diagrams/get_jobs.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90" /> + <text + xml:space="preserve" + style="font-size:20px;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans" + x="11.839252" + y="70.634148" + id="text23519" + inkscape:export-filename="/home/disney/gentoo/diagrams/get_jobs.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90"><tspan + sodipodi:role="line" + x="11.839252" + y="70.634148" + id="tspan23521">Start</tspan></text> + <path + style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:#000000;stroke-width:0.96277702px;stroke-linecap:butt;stroke-linejoin:miter;marker-end:url(#TriangleOutL);stroke-opacity:1" + d="M 34.951955,84.682749 L 35.004245,111.95155" + id="path23525" + inkscape:connector-type="polyline" + inkscape:export-filename="/home/disney/gentoo/diagrams/get_jobs.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90" /> + <rect + style="font-size:20px;fill:#cccccc;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0.98150337;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + id="rect10766" + width="150.00647" + height="88.946548" + x="-34.696831" + y="238.45732" + transform="matrix(0.9999996,8.8502042e-4,-5.7799805e-4,0.9999998,0,0)" + inkscape:export-filename="/home/disney/gentoo/diagrams/get_jobs.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90" /> + <path + style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:#000000;stroke-width:0.96277702px;stroke-linecap:butt;stroke-linejoin:miter;marker-end:url(#TriangleOutL);stroke-opacity:1" + d="M 34.666391,327.1654 L 34.718681,354.4342" + id="path10768" + inkscape:connector-type="polyline" + inkscape:export-filename="/home/disney/gentoo/diagrams/get_jobs.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90" /> + <text + xml:space="preserve" + style="font-size:20px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:125%;writing-mode:lr-tb;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans" + x="41.687851" + y="270.59381" + id="text10770" + sodipodi:linespacing="125%" + inkscape:export-filename="/home/disney/gentoo/diagrams/get_jobs.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90"><tspan + sodipodi:role="line" + x="41.687851" + y="270.59381" + id="tspan10778" + style="font-size:18">Get job details:</tspan><tspan + sodipodi:role="line" + x="41.687851" + y="287.66483" + id="tspan10774" + style="font-size:14px;font-family:Courier 10 Pitch">srvmod job.py:</tspan><tspan + sodipodi:role="line" + x="41.687851" + y="305.16483" + id="tspan10776" + style="font-size:14px;font-family:Courier 10 Pitch">get_job()</tspan></text> + <rect + style="fill:#cccccc;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.13471448;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + id="rect3223" + width="113.46721" + height="113.47631" + x="338.06894" + y="295.57553" + transform="matrix(0.8229751,0.5680775,-0.8230865,0.5679161,0,0)" + inkscape:export-filename="/home/disney/gentoo/diagrams/get_jobs.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90" /> + <text + xml:space="preserve" + style="font-size:20px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:125%;writing-mode:lr-tb;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans" + x="34.891605" + y="407.79559" + id="text10618" + sodipodi:linespacing="125%" + inkscape:export-filename="/home/disney/gentoo/diagrams/get_jobs.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90"><tspan + sodipodi:role="line" + x="37.75684" + y="407.79559" + style="font-size:18px;font-family:Bitstream Vera Sans" + id="tspan10622">Is the job's </tspan><tspan + sodipodi:role="line" + x="34.891605" + y="428.44161" + style="font-size:18px;font-family:Courier 10 Pitch" + id="tspan10624">run_interval</tspan><tspan + sodipodi:role="line" + x="34.891605" + y="452.79559" + style="font-size:18px;font-family:Bitstream Vera Sans" + id="tspan10626">value > 0?</tspan></text> + <text + xml:space="preserve" + style="font-size:20px;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans" + x="175.03906" + y="389.30832" + id="text10723" + inkscape:export-filename="/home/disney/gentoo/diagrams/get_jobs.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90"><tspan + sodipodi:role="line" + x="175.03906" + y="389.30832" + id="tspan10727">Yes, so this is a </tspan><tspan + sodipodi:role="line" + x="175.03906" + y="414.30832" + id="tspan10729">recurring job.</tspan></text> + <path + style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:#000000;stroke-width:0.99117851px;stroke-linecap:butt;stroke-linejoin:miter;marker-end:url(#TriangleOutL);stroke-opacity:1" + d="M 128.64161,424.48186 L 386.78311,424.36112" + id="path10871" + inkscape:connector-type="polyline" + inkscape:export-filename="/home/disney/gentoo/diagrams/get_jobs.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90" /> + <rect + style="font-size:20px;fill:#cccccc;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0.98150337;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + id="rect10616" + width="150.00647" + height="88.946548" + x="391.95554" + y="378.19" + transform="matrix(0.9999996,8.8502906e-4,-5.7801533e-4,0.9999998,0,0)" + inkscape:export-filename="/home/disney/gentoo/diagrams/get_jobs.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90" /> + <text + xml:space="preserve" + style="font-size:20px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:125%;writing-mode:lr-tb;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans" + x="466.23749" + y="399.75131" + id="text10704" + sodipodi:linespacing="125%" + inkscape:export-filename="/home/disney/gentoo/diagrams/get_jobs.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90"><tspan + sodipodi:role="line" + x="466.23749" + y="399.75131" + style="font-size:14px;font-family:Bitstream Vera Sans" + id="tspan10733">Query DB, replace</tspan><tspan + sodipodi:role="line" + x="466.23749" + y="417.25131" + style="font-size:14px;font-family:Bitstream Vera Sans" + id="tspan11133">current job ID with</tspan><tspan + sodipodi:role="line" + x="468.466" + y="434.75131" + style="font-size:14px;font-family:Bitstream Vera Sans" + id="tspan11127">largest job ID where </tspan><tspan + sodipodi:role="line" + x="466.23749" + y="452.25131" + style="font-size:14px;font-family:Bitstream Vera Sans" + id="tspan11137">current job==origjob</tspan></text> + <path + style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:#000000;stroke-width:0.96277702px;stroke-linecap:butt;stroke-linejoin:miter;marker-end:url(#TriangleOutL);stroke-opacity:1" + d="M 34.802227,488.18449 L 34.854517,515.45329" + id="path10920" + inkscape:connector-type="polyline" + inkscape:export-filename="/home/disney/gentoo/diagrams/get_jobs.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90" /> + <rect + style="font-size:20px;fill:#cccccc;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0.98150337;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + id="rect2324" + width="150.00647" + height="88.946548" + x="-34.05862" + y="520.53436" + transform="matrix(0.9999996,8.8502096e-4,-5.7799913e-4,0.9999998,0,0)" + inkscape:export-filename="/home/disney/gentoo/diagrams/get_jobs.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90" /> + <path + style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:#000000;stroke-width:0.96277702px;stroke-linecap:butt;stroke-linejoin:miter;marker-end:url(#TriangleOutL);stroke-opacity:1" + d="M 35.141472,609.24375 L 35.193762,636.51255" + id="path2326" + inkscape:connector-type="polyline" + inkscape:export-filename="/home/disney/gentoo/diagrams/get_jobs.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90" /> + <text + xml:space="preserve" + style="font-size:20px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:125%;writing-mode:lr-tb;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans" + x="40.162949" + y="546.67218" + id="text2328" + sodipodi:linespacing="125%" + inkscape:export-filename="/home/disney/gentoo/diagrams/get_jobs.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90"><tspan + sodipodi:role="line" + x="40.162949" + y="546.67218" + style="font-size:20px;font-family:Bitstream Vera Sans" + id="tspan2344">Query DB</tspan><tspan + sodipodi:role="line" + x="40.162949" + y="571.67218" + style="font-size:20px;font-family:Bitstream Vera Sans" + id="tspan11101">for job status</tspan><tspan + sodipodi:role="line" + x="40.162949" + y="596.67218" + style="font-size:20px;font-family:Bitstream Vera Sans" + id="tspan11103">to return</tspan></text> + <path + sodipodi:type="arc" + style="fill:url(#linearGradient11111);fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + id="path11105" + sodipodi:cx="105.05586" + sodipodi:cy="52.311161" + sodipodi:rx="83.842659" + sodipodi:ry="30.304577" + d="M 188.89852 52.311161 A 83.842659 30.304577 0 1 1 21.213203,52.311161 A 83.842659 30.304577 0 1 1 188.89852 52.311161 z" + transform="matrix(0.6478283,0,0,0.6632677,-33.207898,626.85979)" + inkscape:export-filename="/home/disney/gentoo/diagrams/get_jobs.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90" /> + <text + xml:space="preserve" + style="font-size:20px;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans" + x="-12.662875" + y="666.53186" + id="text11107" + inkscape:export-filename="/home/disney/gentoo/diagrams/get_jobs.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90"><tspan + sodipodi:role="line" + x="-12.662875" + y="666.53186" + id="tspan11109" + style="font-size:16px">Return/Stop</tspan></text> + <path + style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:#000000;stroke-width:1.00114262px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;display:inline" + d="M 469.7215,467.86275 L 469.9729,560.66986" + id="path11141" + inkscape:connector-type="polyline" /> + <path + style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:#000000;stroke-width:0.99832714px;stroke-linecap:butt;stroke-linejoin:miter;marker-end:url(#TriangleOutL);stroke-opacity:1;display:inline" + d="M 470.47938,560.41789 L 121.20111,560.41789" + id="path11143" + inkscape:connector-type="polyline" /> + <text + xml:space="preserve" + style="font-size:20px;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans" + x="41.681084" + y="506.94226" + id="text2278" + inkscape:export-filename="/home/disney/gentoo/diagrams/get_jobs.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90"><tspan + sodipodi:role="line" + id="tspan2280" + x="41.681084" + y="506.94226">No</tspan></text> + </g> +</svg> diff --git a/docs/jobs_flow/svg/run_jobs.svg b/docs/jobs_flow/svg/run_jobs.svg new file mode 100644 index 0000000..d623959 --- /dev/null +++ b/docs/jobs_flow/svg/run_jobs.svg @@ -0,0 +1,1194 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Created with Inkscape (http://www.inkscape.org/) --> +<svg + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://web.resource.org/cc/" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:xlink="http://www.w3.org/1999/xlink" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + width="744.09448819" + height="1052.3622047" + id="svg2280" + sodipodi:version="0.32" + inkscape:version="0.45" + sodipodi:docbase="/home/disney/gentoo/diagrams" + sodipodi:docname="run_jobs.svg" + inkscape:output_extension="org.inkscape.output.svg.inkscape" + inkscape:export-filename="/home/disney/gentoo/diagrams/run_jobs.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90" + sodipodi:modified="TRUE"> + <defs + id="defs2282"> + <linearGradient + inkscape:collect="always" + id="linearGradient8529"> + <stop + style="stop-color:#ccffff;stop-opacity:1;" + offset="0" + id="stop8531" /> + <stop + style="stop-color:#ccffff;stop-opacity:0;" + offset="1" + id="stop8533" /> + </linearGradient> + <linearGradient + inkscape:collect="always" + id="linearGradient3233"> + <stop + style="stop-color:#cccccc;stop-opacity:1;" + offset="0" + id="stop3235" /> + <stop + style="stop-color:#cccccc;stop-opacity:0;" + offset="1" + id="stop3237" /> + </linearGradient> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient3233" + id="linearGradient23523" + gradientUnits="userSpaceOnUse" + x1="110.35865" + y1="84.70903" + x2="122.83298" + y2="205.02553" /> + <marker + inkscape:stockid="TriangleOutL" + orient="auto" + refY="0" + refX="0" + id="TriangleOutL" + style="overflow:visible"> + <path + id="path4305" + d="M 5.77,0 L -2.88,5 L -2.88,-5 L 5.77,0 z " + style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;marker-start:none" + transform="scale(0.8,0.8)" /> + </marker> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient8529" + id="linearGradient8535" + x1="100" + y1="130.93361" + x2="170" + y2="130.60306" + gradientUnits="userSpaceOnUse" + gradientTransform="matrix(1,0,0,0.9990606,0,0.12269)" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient3233" + id="linearGradient10488" + gradientUnits="userSpaceOnUse" + x1="110.35865" + y1="84.70903" + x2="122.83298" + y2="205.02553" /> + </defs> + <sodipodi:namedview + id="base" + pagecolor="#ffffff" + bordercolor="#ffffff" + borderopacity="0.0" + inkscape:pageopacity="0.0" + inkscape:pageshadow="0" + inkscape:zoom="1.7632169" + inkscape:cx="372.04724" + inkscape:cy="-808.4065" + inkscape:document-units="px" + inkscape:current-layer="layer1" + showgrid="true" + inkscape:window-width="1398" + inkscape:window-height="654" + inkscape:window-x="0" + inkscape:window-y="0" /> + <metadata + id="metadata2285"> + <rdf:RDF> + <cc:Work + rdf:about=""> + <dc:format>image/svg+xml</dc:format> + <dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> + </cc:Work> + </rdf:RDF> + </metadata> + <g + inkscape:label="Layer 1" + inkscape:groupmode="layer" + id="layer1"> + <rect + style="fill:#ccffff;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0.99426967;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + id="rect2492" + width="533.36627" + height="555.08984" + x="139.39818" + y="442.35931" /> + <path + sodipodi:type="arc" + style="fill:url(#linearGradient23523);fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + id="path23517" + sodipodi:cx="105.05586" + sodipodi:cy="52.311161" + sodipodi:rx="83.842659" + sodipodi:ry="30.304577" + d="M 188.89852 52.311161 A 83.842659 30.304577 0 1 1 21.213203,52.311161 A 83.842659 30.304577 0 1 1 188.89852 52.311161 z" + transform="matrix(0.6478283,0,0,0.6632677,182.65612,6.0510447)" + inkscape:export-filename="/home/disney/gentoo/diagrams/get_jobs.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90" /> + <text + xml:space="preserve" + style="font-size:20px;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans" + x="226.93974" + y="46.733276" + id="text23519" + inkscape:export-filename="/home/disney/gentoo/diagrams/get_jobs.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90"><tspan + sodipodi:role="line" + x="226.93974" + y="46.733276" + id="tspan23521">Start</tspan></text> + <path + style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:#000000;stroke-width:0.96277702px;stroke-linecap:butt;stroke-linejoin:miter;marker-end:url(#TriangleOutL);stroke-opacity:1" + d="M 250.05243,60.781884 L 250.10472,88.050684" + id="path23525" + inkscape:connector-type="polyline" + inkscape:export-filename="/home/disney/gentoo/diagrams/get_jobs.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90" /> + <rect + style="font-size:20px;fill:#cccccc;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0.98150337;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + id="rect2160" + width="150.00647" + height="88.946548" + x="180.07655" + y="93.410286" + transform="matrix(0.9999996,8.8501995e-4,-5.7799711e-4,0.9999998,0,0)" + inkscape:export-filename="/home/disney/gentoo/diagrams/get_jobs.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90" /> + <path + style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:#000000;stroke-width:0.96277702px;stroke-linecap:butt;stroke-linejoin:miter;marker-end:url(#TriangleOutL);stroke-opacity:1" + d="M 249.52354,182.30825 L 249.57583,209.57705" + id="path4416" + inkscape:connector-type="polyline" + inkscape:export-filename="/home/disney/gentoo/diagrams/get_jobs.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90" /> + <text + xml:space="preserve" + style="font-size:20px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:125%;writing-mode:lr-tb;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans" + x="256.54501" + y="125.73669" + id="text3139" + sodipodi:linespacing="125%" + inkscape:export-filename="/home/disney/gentoo/diagrams/get_jobs.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90"><tspan + sodipodi:role="line" + x="256.54501" + y="125.73669" + id="tspan3145">Get job details:</tspan><tspan + sodipodi:role="line" + x="256.54501" + y="143.3142" + id="tspan10531" + style="font-size:14px;font-family:Courier 10 Pitch">srvmod job.py:</tspan><tspan + sodipodi:role="line" + x="256.54501" + y="160.8142" + id="tspan10533" + style="font-size:14px;font-family:Courier 10 Pitch">get_job()</tspan></text> + <rect + style="font-size:20px;fill:#cccccc;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0.98150337;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + id="rect2304" + width="150.00647" + height="88.946548" + x="181.57532" + y="214.83754" + transform="matrix(0.9999996,8.8501995e-4,-5.7799711e-4,0.9999998,0,0)" + inkscape:export-filename="/home/disney/gentoo/diagrams/get_jobs.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90" /> + <path + style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:#000000;stroke-width:0.96277702px;stroke-linecap:butt;stroke-linejoin:miter;marker-end:url(#TriangleOutL);stroke-opacity:1" + d="M 250.95211,303.73683 L 251.0044,331.00563" + id="path2306" + inkscape:connector-type="polyline" + inkscape:export-filename="/home/disney/gentoo/diagrams/get_jobs.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90" /> + <text + xml:space="preserve" + style="font-size:20px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:125%;writing-mode:lr-tb;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans" + x="257.97357" + y="247.16527" + id="text2308" + sodipodi:linespacing="125%" + inkscape:export-filename="/home/disney/gentoo/diagrams/get_jobs.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90"><tspan + sodipodi:role="line" + x="257.97357" + y="247.16527" + id="tspan2310">Sanity check</tspan><tspan + sodipodi:role="line" + x="257.97357" + y="272.16527" + id="tspan2314" + style="font-size:20px;font-family:Bitstream Vera Sans">(stub)</tspan></text> + <rect + style="font-size:20px;fill:#cccccc;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0.98150337;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + id="rect2324" + width="150.00647" + height="88.946548" + x="180.35963" + y="335.83865" + transform="matrix(0.9999996,8.8502034e-4,-5.7799789e-4,0.9999998,0,0)" + inkscape:export-filename="/home/disney/gentoo/diagrams/get_jobs.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90" /> + <path + style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:#000000;stroke-width:0.96277702px;stroke-linecap:butt;stroke-linejoin:miter;marker-end:url(#TriangleOutL);stroke-opacity:1" + d="M 249.66639,424.73683 L 249.71868,452.00563" + id="path2326" + inkscape:connector-type="polyline" + inkscape:export-filename="/home/disney/gentoo/diagrams/get_jobs.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90" /> + <text + xml:space="preserve" + style="font-size:20px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:125%;writing-mode:lr-tb;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans" + x="254.68787" + y="362.16525" + id="text2328" + sodipodi:linespacing="125%" + inkscape:export-filename="/home/disney/gentoo/diagrams/get_jobs.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90"><tspan + sodipodi:role="line" + x="257.87146" + y="362.16525" + id="tspan2330">Write script </tspan><tspan + sodipodi:role="line" + x="254.68787" + y="387.16525" + id="tspan2334" + style="font-size:20px;font-family:Bitstream Vera Sans">to temp file</tspan><tspan + sodipodi:role="line" + x="254.68787" + y="412.16525" + style="font-size:20px;font-family:Bitstream Vera Sans" + id="tspan2344">to run later</tspan></text> + <rect + style="fill:#cccccc;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.13471448;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + id="rect3223" + width="113.46721" + height="113.47588" + x="554.32941" + y="250.68132" + transform="matrix(0.8229751,0.5680775,-0.8230865,0.5679161,0,0)" + inkscape:export-filename="/home/disney/gentoo/diagrams/get_jobs.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90" /> + <text + xml:space="preserve" + style="font-size:20px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:125%;writing-mode:lr-tb;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans" + x="249.82019" + y="505.15274" + id="text10618" + sodipodi:linespacing="125%" + inkscape:export-filename="/home/disney/gentoo/diagrams/get_jobs.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90"><tspan + sodipodi:role="line" + x="249.82019" + y="505.15274" + style="font-size:18px;font-family:Bitstream Vera Sans" + id="tspan10622">Has the job</tspan><tspan + sodipodi:role="line" + x="249.82019" + y="527.65274" + style="font-size:18px;font-family:Bitstream Vera Sans" + id="tspan2369">been cancelled on</tspan><tspan + sodipodi:role="line" + x="249.82019" + y="550.15274" + style="font-size:18px;font-family:Bitstream Vera Sans" + id="tspan10626">the server?</tspan></text> + <path + style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:#000000;stroke-width:0.96277702px;stroke-linecap:butt;stroke-linejoin:miter;marker-end:url(#TriangleOutL);stroke-opacity:1" + d="M 249.80911,586.43427 L 249.8614,613.70307" + id="path2378" + inkscape:connector-type="polyline" + inkscape:export-filename="/home/disney/gentoo/diagrams/get_jobs.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90" /> + <rect + style="fill:#cccccc;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.13471448;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + id="rect2380" + width="113.46721" + height="113.47592" + x="697.00842" + y="393.34079" + transform="matrix(0.8229751,0.5680775,-0.8230865,0.5679161,0,0)" + inkscape:export-filename="/home/disney/gentoo/diagrams/get_jobs.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90" /> + <text + xml:space="preserve" + style="font-size:20px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:125%;writing-mode:lr-tb;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans" + x="249.82033" + y="665.08112" + id="text2382" + sodipodi:linespacing="125%" + inkscape:export-filename="/home/disney/gentoo/diagrams/get_jobs.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90"><tspan + sodipodi:role="line" + x="249.82033" + y="665.08112" + style="font-size:18px;font-family:Bitstream Vera Sans" + id="tspan2397">Are there</tspan><tspan + sodipodi:role="line" + x="249.82033" + y="687.58112" + style="font-size:18px;font-family:Bitstream Vera Sans" + id="tspan2404">dependencies</tspan><tspan + sodipodi:role="line" + x="249.82033" + y="710.08112" + style="font-size:18px;font-family:Bitstream Vera Sans" + id="tspan2406">for the job?</tspan></text> + <path + style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:#000000;stroke-width:0.96277702px;stroke-linecap:butt;stroke-linejoin:miter;marker-end:url(#TriangleOutL);stroke-opacity:1" + d="M 249.95196,748.29142 L 250.00425,775.56022" + id="path2408" + inkscape:connector-type="polyline" + inkscape:export-filename="/home/disney/gentoo/diagrams/get_jobs.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90" /> + <path + style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:#000000;stroke-width:0.96277702px;stroke-linecap:butt;stroke-linejoin:miter;marker-end:url(#TriangleOutL);stroke-opacity:1" + d="M 343.42923,683.83878 L 370.69803,683.78649" + id="path2410" + inkscape:connector-type="polyline" + inkscape:export-filename="/home/disney/gentoo/diagrams/get_jobs.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90" /> + <rect + style="font-size:20px;fill:#cccccc;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0.98150337;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + id="rect2412" + width="150.00647" + height="88.946548" + x="376.81927" + y="636.77484" + transform="matrix(0.9999996,8.8501997e-4,-5.7799715e-4,0.9999998,0,0)" + inkscape:export-filename="/home/disney/gentoo/diagrams/get_jobs.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90" /> + <text + xml:space="preserve" + style="font-size:20px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:125%;writing-mode:lr-tb;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans" + x="453.28125" + y="658.20386" + id="text2414" + sodipodi:linespacing="125%" + inkscape:export-filename="/home/disney/gentoo/diagrams/get_jobs.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90"><tspan + sodipodi:role="line" + x="455.82812" + y="658.20386" + id="tspan2422" + style="font-size:16px">Get job status of </tspan><tspan + sodipodi:role="line" + x="453.28125" + y="678.20386" + id="tspan2426" + style="font-size:16px">dependencies:</tspan><tspan + sodipodi:role="line" + x="453.28125" + y="694.76837" + id="tspan2418" + style="font-size:14px;font-family:Courier 10 Pitch">srvmod job.py:</tspan><tspan + sodipodi:role="line" + x="453.28125" + y="712.26837" + id="tspan2420" + style="font-size:14px;font-family:Courier 10 Pitch">get_jstatus()</tspan></text> + <path + style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:#000000;stroke-width:0.96277702px;stroke-linecap:butt;stroke-linejoin:miter;marker-end:url(#TriangleOutL);stroke-opacity:1" + d="M 454.90518,726.5057 L 454.95747,753.7745" + id="path2428" + inkscape:connector-type="polyline" + inkscape:export-filename="/home/disney/gentoo/diagrams/get_jobs.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90" /> + <rect + style="fill:#cccccc;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.13471448;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + id="rect2430" + width="113.46721" + height="113.47611" + x="944.67792" + y="391.73999" + transform="matrix(0.8229751,0.5680775,-0.8230865,0.5679161,0,0)" + inkscape:export-filename="/home/disney/gentoo/diagrams/get_jobs.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90" /> + <text + xml:space="preserve" + style="font-size:20px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:125%;writing-mode:lr-tb;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans" + x="454.96313" + y="803.08105" + id="text2432" + sodipodi:linespacing="125%" + inkscape:export-filename="/home/disney/gentoo/diagrams/get_jobs.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90"><tspan + sodipodi:role="line" + x="457.82837" + y="803.08105" + style="font-size:18px;font-family:Bitstream Vera Sans" + id="tspan2445">Was the </tspan><tspan + sodipodi:role="line" + x="454.96313" + y="825.58105" + style="font-size:18px;font-family:Bitstream Vera Sans" + id="tspan2449">dependency job</tspan><tspan + sodipodi:role="line" + x="454.96313" + y="848.08105" + style="font-size:18px;font-family:Bitstream Vera Sans" + id="tspan2451">successful?</tspan></text> + <path + style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:#000000;stroke-width:0.96277702px;stroke-linecap:butt;stroke-linejoin:miter;marker-end:url(#TriangleOutL);stroke-opacity:1" + d="M 362.6422,823.48165 L 335.3734,823.42936" + id="path2453" + inkscape:connector-type="polyline" + inkscape:export-filename="/home/disney/gentoo/diagrams/get_jobs.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90" /> + <rect + style="font-size:20px;fill:#cccccc;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0.98150337;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + id="rect2455" + width="150.00647" + height="88.946548" + x="180.9938" + y="781.2691" + transform="matrix(0.9999996,8.8502034e-4,-5.7799789e-4,0.9999998,0,0)" + inkscape:export-filename="/home/disney/gentoo/diagrams/get_jobs.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90" /> + <path + style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:#000000;stroke-width:0.96277702px;stroke-linecap:butt;stroke-linejoin:miter;marker-end:url(#TriangleOutL);stroke-opacity:1" + d="M 250.0431,870.16782 L 250.09539,897.43662" + id="path2457" + inkscape:connector-type="polyline" + inkscape:export-filename="/home/disney/gentoo/diagrams/get_jobs.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90" /> + <text + xml:space="preserve" + style="font-size:20px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:125%;writing-mode:lr-tb;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans" + x="252.03412" + y="817.69775" + id="text2459" + sodipodi:linespacing="125%" + inkscape:export-filename="/home/disney/gentoo/diagrams/get_jobs.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90"><tspan + sodipodi:role="line" + x="255.21771" + y="817.69775" + style="font-size:20px;font-family:Bitstream Vera Sans" + id="tspan2465">Run </tspan><tspan + sodipodi:role="line" + x="252.03412" + y="842.69775" + style="font-size:20px;font-family:Bitstream Vera Sans" + id="tspan2472">script</tspan></text> + <rect + style="font-size:20px;fill:#cccccc;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0.98150337;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + id="rect2474" + width="150.00647" + height="88.946548" + x="181.11292" + y="902.69281" + transform="matrix(0.9999996,8.8502036e-4,-5.7799793e-4,0.9999998,0,0)" + inkscape:export-filename="/home/disney/gentoo/diagrams/get_jobs.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90" /> + <path + style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:#000000;stroke-width:0.96277702px;stroke-linecap:butt;stroke-linejoin:miter;marker-end:url(#TriangleOutL);stroke-opacity:1" + d="M 250.09204,991.59165 L 250.14433,1018.8605" + id="path2476" + inkscape:connector-type="polyline" + inkscape:export-filename="/home/disney/gentoo/diagrams/get_jobs.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90" /> + <text + xml:space="preserve" + style="font-size:20px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:125%;writing-mode:lr-tb;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans" + x="252.08305" + y="939.12158" + id="text2478" + sodipodi:linespacing="125%" + inkscape:export-filename="/home/disney/gentoo/diagrams/get_jobs.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90"><tspan + sodipodi:role="line" + x="252.08305" + y="939.12158" + style="font-size:20px;font-family:Bitstream Vera Sans" + id="tspan2482">Log script</tspan><tspan + sodipodi:role="line" + x="252.08305" + y="964.12158" + style="font-size:20px;font-family:Bitstream Vera Sans" + id="tspan2486">output locally</tspan></text> + <text + xml:space="preserve" + style="font-size:20px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:125%;writing-mode:lr-tb;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans" + x="599.02045" + y="467.48386" + id="text3463" + sodipodi:linespacing="125%"><tspan + sodipodi:role="line" + x="599.02045" + y="467.48386" + id="tspan3467" + style="font-family:Courier 10 Pitch">scirec.py:</tspan><tspan + sodipodi:role="line" + x="599.02045" + y="492.48386" + id="tspan3471" + style="font-family:Courier 10 Pitch">run_job()</tspan></text> + <rect + style="fill:#cccccc;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.13471448;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + id="rect3473" + width="113.46721" + height="113.47613" + x="1053.8943" + y="749.37567" + transform="matrix(0.8229751,0.5680775,-0.8230865,0.5679161,0,0)" + inkscape:export-filename="/home/disney/gentoo/diagrams/get_jobs.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90" /> + <text + xml:space="preserve" + style="font-size:20px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:125%;writing-mode:lr-tb;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans" + x="250.48044" + y="1068.2316" + id="text3475" + sodipodi:linespacing="125%" + inkscape:export-filename="/home/disney/gentoo/diagrams/get_jobs.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90"><tspan + sodipodi:role="line" + x="253.66403" + y="1068.2316" + style="font-size:20;font-family:Bitstream Vera Sans" + id="tspan3481">Job </tspan><tspan + sodipodi:role="line" + x="250.48044" + y="1093.2316" + style="font-size:20;font-family:Bitstream Vera Sans" + id="tspan3488">status:</tspan><tspan + sodipodi:role="line" + x="250.48044" + y="1118.2316" + style="font-size:20;font-family:Bitstream Vera Sans" + id="tspan3490">failed?</tspan></text> + <path + style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:#000000;stroke-width:0.96277702px;stroke-linecap:butt;stroke-linejoin:miter;marker-end:url(#TriangleOutL);stroke-opacity:1" + d="M 250.46979,1153.6834 L 250.52208,1180.9522" + id="path3492" + inkscape:connector-type="polyline" + inkscape:export-filename="/home/disney/gentoo/diagrams/get_jobs.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90" /> + <rect + style="fill:#cccccc;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.13471448;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + id="rect3494" + width="113.46721" + height="113.47615" + x="1196.2568" + y="891.71887" + transform="matrix(0.8229751,0.5680775,-0.8230865,0.5679161,0,0)" + inkscape:export-filename="/home/disney/gentoo/diagrams/get_jobs.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90" /> + <text + xml:space="preserve" + style="font-size:20px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:125%;writing-mode:lr-tb;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans" + x="250.4805" + y="1222.8724" + id="text3496" + sodipodi:linespacing="125%" + inkscape:export-filename="/home/disney/gentoo/diagrams/get_jobs.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90"><tspan + sodipodi:role="line" + x="253.66409" + y="1222.8724" + style="font-size:20px;font-family:Bitstream Vera Sans" + id="tspan3498">Job </tspan><tspan + sodipodi:role="line" + x="250.4805" + y="1247.8724" + style="font-size:20px;font-family:Bitstream Vera Sans" + id="tspan3500">status:</tspan><tspan + sodipodi:role="line" + x="250.4805" + y="1272.8724" + style="font-size:20px;font-family:Bitstream Vera Sans" + id="tspan3502">cancelled?</tspan></text> + <path + style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:#000000;stroke-width:0.96277702px;stroke-linecap:butt;stroke-linejoin:miter;marker-end:url(#TriangleOutL);stroke-opacity:1" + d="M 250.46985,1315.3953 L 250.52214,1342.6641" + id="path3504" + inkscape:connector-type="polyline" + inkscape:export-filename="/home/disney/gentoo/diagrams/get_jobs.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90" /> + <rect + style="fill:#cccccc;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.13471448;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + id="rect3506" + width="113.46721" + height="113.47615" + x="1338.5422" + y="1033.9851" + transform="matrix(0.8229751,0.5680775,-0.8230865,0.5679161,0,0)" + inkscape:export-filename="/home/disney/gentoo/diagrams/get_jobs.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90" /> + <text + xml:space="preserve" + style="font-size:20px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:125%;writing-mode:lr-tb;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans" + x="254.5211" + y="1408.7405" + id="text3508" + sodipodi:linespacing="125%" + inkscape:export-filename="/home/disney/gentoo/diagrams/get_jobs.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90"><tspan + sodipodi:role="line" + x="257.38634" + y="1408.7405" + style="font-size:18;font-family:Bitstream Vera Sans" + id="tspan3518">Return code == </tspan><tspan + sodipodi:role="line" + x="254.5211" + y="1431.2405" + style="font-size:18;font-family:Bitstream Vera Sans" + id="tspan3514">job success?</tspan></text> + <path + style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:#000000;stroke-width:0.96277702px;stroke-linecap:butt;stroke-linejoin:miter;marker-end:url(#TriangleOutL);stroke-opacity:1" + d="M 250.46985,1599.0196 L 250.52214,1626.2884" + id="path3516" + inkscape:connector-type="polyline" + inkscape:export-filename="/home/disney/gentoo/diagrams/get_jobs.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90" /> + <rect + style="font-size:20px;fill:#cccccc;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0.98150337;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + id="rect3539" + width="150.00647" + height="88.946548" + x="181.48566" + y="1631.8379" + transform="matrix(0.9999996,8.8502139e-4,-5.7799999e-4,0.9999998,0,0)" + inkscape:export-filename="/home/disney/gentoo/diagrams/get_jobs.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90" /> + <path + style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:#000000;stroke-width:0.96277702px;stroke-linecap:butt;stroke-linejoin:miter;marker-end:url(#TriangleOutL);stroke-opacity:1" + d="M 250.04309,1720.7368 L 250.09538,1748.0056" + id="path3541" + inkscape:connector-type="polyline" + inkscape:export-filename="/home/disney/gentoo/diagrams/get_jobs.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90" /> + <text + xml:space="preserve" + style="font-size:20px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:125%;writing-mode:lr-tb;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans" + x="252.03412" + y="1668.2667" + id="text3543" + sodipodi:linespacing="125%" + inkscape:export-filename="/home/disney/gentoo/diagrams/get_jobs.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90"><tspan + sodipodi:role="line" + x="252.03412" + y="1668.2667" + style="font-size:20px;font-family:Bitstream Vera Sans" + id="tspan3547">Remove job</tspan><tspan + sodipodi:role="line" + x="252.03412" + y="1693.2667" + style="font-size:20px;font-family:Bitstream Vera Sans" + id="tspan3551">from queue</tspan></text> + <text + xml:space="preserve" + style="font-size:20px;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans" + x="397.85715" + y="1628.7908" + id="text3553"><tspan + sodipodi:role="line" + id="tspan3555" + x="397.85715" + y="1628.7908"></tspan></text> + <rect + style="font-size:20px;fill:#cccccc;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0.98150337;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + id="rect3559" + width="150.00647" + height="88.946548" + x="182.46498" + y="1753.5513" + transform="matrix(0.9999996,8.8502168e-4,-5.7800057e-4,0.9999998,0,0)" + inkscape:export-filename="/home/disney/gentoo/diagrams/get_jobs.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90" /> + <path + style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:#000000;stroke-width:0.96277702px;stroke-linecap:butt;stroke-linejoin:miter;marker-end:url(#TriangleOutL);stroke-opacity:1" + d="M 250.95201,1842.4512 L 251.0043,1869.72" + id="path3561" + inkscape:connector-type="polyline" + inkscape:export-filename="/home/disney/gentoo/diagrams/get_jobs.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90" /> + <text + xml:space="preserve" + style="font-size:20px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:125%;writing-mode:lr-tb;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans" + x="252.94302" + y="1777.9811" + id="text3563" + sodipodi:linespacing="125%" + inkscape:export-filename="/home/disney/gentoo/diagrams/get_jobs.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90"><tspan + sodipodi:role="line" + x="256.12662" + y="1777.9811" + style="font-size:20px;font-family:Bitstream Vera Sans" + id="tspan3567">Remove </tspan><tspan + sodipodi:role="line" + x="256.12662" + y="1802.9811" + style="font-size:20px;font-family:Bitstream Vera Sans" + id="tspan3571">script </tspan><tspan + sodipodi:role="line" + x="252.94302" + y="1827.9811" + style="font-size:20px;font-family:Bitstream Vera Sans" + id="tspan3573">temp file</tspan></text> + <path + style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:#000000;stroke-width:0.99646091px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;display:inline" + d="M 342.85537,521.64613 L 578.5732,522.36395" + id="path3575" + inkscape:connector-type="polyline" /> + <path + style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;display:inline" + d="M 579.28571,521.6479 L 580,1010.2193" + id="path3577" + inkscape:connector-type="polyline" /> + <path + style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:#000000;stroke-width:0.99780935px;stroke-linecap:butt;stroke-linejoin:miter;marker-end:url(#TriangleOutL);stroke-opacity:1;display:inline" + d="M 580.71539,1010.2193 L 255.09344,1010.2193" + id="path3579" + inkscape:connector-type="polyline" /> + <path + style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;display:inline;marker-end:url(#TriangleOutL)" + d="M 455,888.07647 L 455.71429,1005.2193" + id="path4550" + inkscape:connector-type="polyline" /> + <rect + style="font-size:20px;fill:#cccccc;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0.98150337;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + id="rect5521" + width="150.00647" + height="88.946548" + x="182.47363" + y="1509.4076" + transform="matrix(0.9999996,8.8502074e-4,-5.7799869e-4,0.9999998,0,0)" + inkscape:export-filename="/home/disney/gentoo/diagrams/get_jobs.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90" /> + <text + xml:space="preserve" + style="font-size:20px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:125%;writing-mode:lr-tb;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans" + x="253.0932" + y="1545.8375" + id="text5523" + sodipodi:linespacing="125%" + inkscape:export-filename="/home/disney/gentoo/diagrams/get_jobs.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90"><tspan + sodipodi:role="line" + x="256.27679" + y="1545.8375" + style="font-size:20px;font-family:Bitstream Vera Sans" + id="tspan5545">Store job </tspan><tspan + sodipodi:role="line" + x="253.0932" + y="1570.8375" + style="font-size:20px;font-family:Bitstream Vera Sans" + id="tspan5549">status in DB</tspan></text> + <rect + style="font-size:20px;fill:#cccccc;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0.98150337;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + id="rect5529" + width="150.00647" + height="88.946548" + x="378.36115" + y="1367.1019" + transform="matrix(0.9999996,8.850204e-4,-5.7799801e-4,0.9999998,0,0)" + inkscape:export-filename="/home/disney/gentoo/diagrams/get_jobs.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90" /> + <text + xml:space="preserve" + style="font-size:20px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:125%;writing-mode:lr-tb;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans" + x="453.06277" + y="1392.0345" + id="text5531" + sodipodi:linespacing="125%" + inkscape:export-filename="/home/disney/gentoo/diagrams/get_jobs.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90"><tspan + sodipodi:role="line" + x="456.24637" + y="1392.0345" + style="font-size:20px;font-family:Bitstream Vera Sans" + id="tspan5535">Store job </tspan><tspan + sodipodi:role="line" + x="456.24637" + y="1417.0345" + style="font-size:20px;font-family:Bitstream Vera Sans" + id="tspan5553">status and </tspan><tspan + sodipodi:role="line" + x="453.06277" + y="1442.0345" + style="font-size:20px;font-family:Bitstream Vera Sans" + id="tspan5555">output in DB</tspan></text> + <path + style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:#000000;stroke-width:0.96277702px;stroke-linecap:butt;stroke-linejoin:miter;marker-end:url(#TriangleOutL);stroke-opacity:1" + d="M 250.46979,1476.9322 L 250.52208,1504.201" + id="path5537" + inkscape:connector-type="polyline" + inkscape:export-filename="/home/disney/gentoo/diagrams/get_jobs.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90" /> + <text + xml:space="preserve" + style="font-size:20px;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans" + x="258.03711" + y="603.93182" + id="text2278" + inkscape:export-filename="/home/disney/gentoo/diagrams/get_jobs.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90"><tspan + sodipodi:role="line" + id="tspan2280" + x="258.03711" + y="603.93182">No</tspan></text> + <text + xml:space="preserve" + style="font-size:20px;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans" + x="259.71814" + y="764.54608" + id="text5559" + inkscape:export-filename="/home/disney/gentoo/diagrams/get_jobs.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90"><tspan + sodipodi:role="line" + id="tspan5561" + x="259.71814" + y="764.54608">No</tspan></text> + <text + xml:space="preserve" + style="font-size:20px;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans" + x="459.72833" + y="910.00806" + id="text5563" + inkscape:export-filename="/home/disney/gentoo/diagrams/get_jobs.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90"><tspan + sodipodi:role="line" + id="tspan5565" + x="459.72833" + y="910.00806">No</tspan></text> + <text + xml:space="preserve" + style="font-size:20px;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans" + x="255.67752" + y="1172.6477" + id="text5567" + inkscape:export-filename="/home/disney/gentoo/diagrams/get_jobs.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90"><tspan + sodipodi:role="line" + id="tspan5569" + x="255.67752" + y="1172.6477">No</tspan></text> + <text + xml:space="preserve" + style="font-size:20px;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans" + x="256.68768" + y="1336.2924" + id="text5571" + inkscape:export-filename="/home/disney/gentoo/diagrams/get_jobs.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90"><tspan + sodipodi:role="line" + id="tspan5573" + x="256.68768" + y="1336.2924">No</tspan></text> + <text + xml:space="preserve" + style="font-size:20px;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans" + x="344.57095" + y="1406.9423" + id="text5575" + inkscape:export-filename="/home/disney/gentoo/diagrams/get_jobs.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90"><tspan + sodipodi:role="line" + id="tspan5577" + x="344.57095" + y="1406.9423">No</tspan></text> + <path + style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:#000000;stroke-width:0.99075466px;stroke-linecap:butt;stroke-linejoin:miter;marker-end:url(#TriangleOutL);stroke-opacity:1" + d="M 342.84287,1412.0243 L 371.8248,1411.9722" + id="path5579" + inkscape:connector-type="polyline" + inkscape:export-filename="/home/disney/gentoo/diagrams/get_jobs.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90" /> + <path + style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:#000000;stroke-width:1.00171554px;stroke-linecap:butt;stroke-linejoin:miter;marker-end:url(#TriangleOutL);stroke-opacity:1;display:inline" + d="M 449.51788,1088.7082 L 449.51788,1361.4309" + id="path5581" + inkscape:connector-type="polyline" /> + <path + style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:#000000;stroke-width:0.99763852px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + d="M 344.45966,1088.7277 L 450.02532,1088.7277" + id="path6552" + inkscape:connector-type="polyline" /> + <path + style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + d="M 157.5838,1250.3521 L 115.15739,1250.3521" + id="path6554" + inkscape:connector-type="polyline" /> + <path + style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;display:inline" + d="M 115.15739,1249.847 L 115.66247,1552.3877" + id="path6556" + inkscape:connector-type="polyline" /> + <path + style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:#000000;stroke-width:1.01842511px;stroke-linecap:butt;stroke-linejoin:miter;marker-end:url(#TriangleOutL);stroke-opacity:1" + d="M 115.52439,1551.8622 L 175.68747,1551.8622" + id="path6558" + inkscape:connector-type="polyline" /> + <path + style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + d="M 450.52804,1456.9283 L 449.51788,1677.1415" + id="path7529" + inkscape:connector-type="polyline" /> + <path + style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:#000000;stroke-width:0.99602062px;stroke-linecap:butt;stroke-linejoin:miter;marker-end:url(#TriangleOutL);stroke-opacity:1;display:inline" + d="M 449.50199,1676.8622 L 335.81691,1676.8622" + id="path7531" + inkscape:connector-type="polyline" /> + <rect + style="fill:#cccccc;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.13471448;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + id="rect8502" + width="113.46721" + height="113.47622" + x="1803.416" + y="1498.1364" + transform="matrix(0.8229751,0.5680775,-0.8230865,0.5679161,0,0)" + inkscape:export-filename="/home/disney/gentoo/diagrams/get_jobs.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90" /> + <text + xml:space="preserve" + style="font-size:20px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:125%;writing-mode:lr-tb;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans" + x="251.02336" + y="1930.1797" + id="text8504" + sodipodi:linespacing="125%" + inkscape:export-filename="/home/disney/gentoo/diagrams/get_jobs.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90"><tspan + sodipodi:role="line" + x="251.02336" + y="1930.1797" + style="font-size:20px;font-family:Bitstream Vera Sans" + id="tspan8510">Next</tspan><tspan + sodipodi:role="line" + x="251.02336" + y="1955.1797" + style="font-size:20px;font-family:Bitstream Vera Sans" + id="tspan8519">job?</tspan></text> + <path + style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:#000000;stroke-width:0.96277702px;stroke-linecap:butt;stroke-linejoin:miter;marker-end:url(#TriangleOutL);stroke-opacity:1" + d="M 251.0127,2004.7025 L 251.06499,2031.9713" + id="path8512" + inkscape:connector-type="polyline" + inkscape:export-filename="/home/disney/gentoo/diagrams/get_jobs.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90" /> + <path + style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:#000000;stroke-width:0.96521723px;stroke-linecap:butt;stroke-linejoin:miter;marker-end:url(#TriangleOutL);stroke-opacity:1;display:inline" + d="M 157.9438,1939.7811 L 99.764462,1939.7812" + id="path8521" + inkscape:connector-type="polyline" /> + <path + style="fill:url(#linearGradient8535);fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0.99953014px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;display:inline" + d="M 94.954339,1939.5954 L 94.954339,131.10259" + id="path8523" + inkscape:connector-type="polyline" /> + <path + style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:#000000;stroke-width:1.01607728px;stroke-linecap:butt;stroke-linejoin:miter;marker-end:url(#TriangleOutL);stroke-opacity:1;display:inline" + d="M 94.373749,131.29503 L 174.16591,131.29503" + id="path8538" + inkscape:connector-type="polyline" /> + <text + xml:space="preserve" + style="font-size:20px;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans" + x="253.89648" + y="2023.0903" + id="text10478" + inkscape:export-filename="/home/disney/gentoo/diagrams/get_jobs.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90"><tspan + sodipodi:role="line" + id="tspan10480" + x="253.89648" + y="2023.0903">No</tspan></text> + <path + sodipodi:type="arc" + style="fill:url(#linearGradient10488);fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + id="path10482" + sodipodi:cx="105.05586" + sodipodi:cy="52.311161" + sodipodi:rx="83.842659" + sodipodi:ry="30.304577" + d="M 188.89852 52.311161 A 83.842659 30.304577 0 1 1 21.213203,52.311161 A 83.842659 30.304577 0 1 1 188.89852 52.311161 z" + transform="matrix(0.6478283,0,0,0.6632677,183.18716,2022.8558)" + inkscape:export-filename="/home/disney/gentoo/diagrams/get_jobs.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90" /> + <text + xml:space="preserve" + style="font-size:20px;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans" + x="227.47078" + y="2063.5381" + id="text10484" + inkscape:export-filename="/home/disney/gentoo/diagrams/get_jobs.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90"><tspan + sodipodi:role="line" + x="227.47078" + y="2063.5381" + id="tspan10486">Stop</tspan></text> + <text + xml:space="preserve" + style="font-size:20px;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans" + x="344.49756" + y="516.75269" + id="text10793" + inkscape:export-filename="/home/disney/gentoo/diagrams/get_jobs.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90"><tspan + sodipodi:role="line" + x="344.49756" + y="516.75269" + id="tspan10795">Yes</tspan></text> + <text + xml:space="preserve" + style="font-size:20px;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans" + x="338.79611" + y="679.52338" + id="text10492" + inkscape:export-filename="/home/disney/gentoo/diagrams/get_jobs.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90"><tspan + sodipodi:role="line" + x="338.79611" + y="679.52338" + id="tspan10494">Yes</tspan></text> + <text + xml:space="preserve" + style="font-size:20px;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans" + x="334.85608" + y="817.3396" + id="text10496" + inkscape:export-filename="/home/disney/gentoo/diagrams/get_jobs.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90"><tspan + sodipodi:role="line" + x="334.85608" + y="817.3396" + id="tspan10498">Yes</tspan></text> + <text + xml:space="preserve" + style="font-size:20px;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans" + x="342.85608" + y="1083.5693" + id="text10500" + inkscape:export-filename="/home/disney/gentoo/diagrams/get_jobs.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90"><tspan + sodipodi:role="line" + x="342.85608" + y="1083.5693" + id="tspan10502">Yes</tspan></text> + <text + xml:space="preserve" + style="font-size:20px;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans" + x="123.54951" + y="1245.2357" + id="text10504" + inkscape:export-filename="/home/disney/gentoo/diagrams/get_jobs.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90"><tspan + sodipodi:role="line" + x="123.54951" + y="1245.2357" + id="tspan10506">Yes</tspan></text> + <text + xml:space="preserve" + style="font-size:20px;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans" + x="256.65002" + y="1497.0481" + id="text10508" + inkscape:export-filename="/home/disney/gentoo/diagrams/get_jobs.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90"><tspan + sodipodi:role="line" + x="256.65002" + y="1497.0481" + id="tspan10510">Yes</tspan></text> + <text + xml:space="preserve" + style="font-size:20px;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans" + x="118.20661" + y="1932.9142" + id="text10512" + inkscape:export-filename="/home/disney/gentoo/diagrams/get_jobs.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90"><tspan + sodipodi:role="line" + x="118.20661" + y="1932.9142" + id="tspan10514">Yes</tspan></text> + </g> +</svg> diff --git a/docs/jobs_flow/svg/scirec_main.svg b/docs/jobs_flow/svg/scirec_main.svg new file mode 100644 index 0000000..13f3c9e --- /dev/null +++ b/docs/jobs_flow/svg/scirec_main.svg @@ -0,0 +1,628 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Created with Inkscape (http://www.inkscape.org/) --> +<svg + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://web.resource.org/cc/" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:xlink="http://www.w3.org/1999/xlink" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + width="410.23392" + height="1251.2834" + id="svg2" + sodipodi:version="0.32" + inkscape:version="0.45" + sodipodi:docbase="/home/disney/gentoo/diagrams" + sodipodi:docname="scirec_main.svg" + inkscape:output_extension="org.inkscape.output.svg.inkscape" + version="1.0" + inkscape:export-filename="/home/disney/gentoo/diagrams/scirec_main.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90" + sodipodi:modified="true"> + <defs + id="defs4"> + <marker + inkscape:stockid="TriangleInL" + orient="auto" + refY="0" + refX="0" + id="TriangleInL" + style="overflow:visible"> + <path + id="path4314" + d="M 5.77,0 L -2.88,5 L -2.88,-5 L 5.77,0 z " + style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;marker-start:none" + transform="scale(-0.8,-0.8)" /> + </marker> + <marker + inkscape:stockid="TriangleOutL" + orient="auto" + refY="0" + refX="0" + id="TriangleOutL" + style="overflow:visible"> + <path + id="path4305" + d="M 5.77,0 L -2.88,5 L -2.88,-5 L 5.77,0 z " + style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;marker-start:none" + transform="scale(0.8,0.8)" /> + </marker> + <marker + inkscape:stockid="TriangleOutM" + orient="auto" + refY="0" + refX="0" + id="TriangleOutM" + style="overflow:visible"> + <path + id="path4302" + d="M 5.77,0 L -2.88,5 L -2.88,-5 L 5.77,0 z " + style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;marker-start:none" + transform="scale(0.4,0.4)" /> + </marker> + <linearGradient + inkscape:collect="always" + id="linearGradient3233"> + <stop + style="stop-color:#cccccc;stop-opacity:1;" + offset="0" + id="stop3235" /> + <stop + style="stop-color:#cccccc;stop-opacity:0;" + offset="1" + id="stop3237" /> + </linearGradient> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient3233" + id="linearGradient3239" + x1="110.35865" + y1="84.70903" + x2="122.83298" + y2="205.02553" + gradientUnits="userSpaceOnUse" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient3233" + id="linearGradient10361" + gradientUnits="userSpaceOnUse" + x1="110.35865" + y1="84.70903" + x2="122.83298" + y2="205.02553" /> + </defs> + <sodipodi:namedview + id="base" + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1.0" + gridtolerance="10000" + guidetolerance="10" + objecttolerance="10" + inkscape:pageopacity="0.0" + inkscape:pageshadow="2" + inkscape:zoom="1.4" + inkscape:cx="273.09642" + inkscape:cy="616.90193" + inkscape:document-units="px" + inkscape:current-layer="layer1" + showgrid="true" + inkscape:window-width="1398" + inkscape:window-height="654" + inkscape:window-x="0" + inkscape:window-y="0" + showguides="false" + inkscape:object-paths="true" + inkscape:grid-bbox="false" /> + <metadata + id="metadata7"> + <rdf:RDF> + <cc:Work + rdf:about=""> + <dc:format>image/svg+xml</dc:format> + <dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> + </cc:Work> + </rdf:RDF> + </metadata> + <g + inkscape:label="Layer 1" + inkscape:groupmode="layer" + id="layer1" + transform="translate(18.999994,-21.506585)"> + <rect + style="fill:#cccccc;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.13471448;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + id="rect4414" + width="113.46721" + height="113.47571" + x="593.90295" + y="502.76419" + transform="matrix(0.8229751,0.5680775,-0.8230865,0.5679161,0,0)" /> + <rect + style="fill:#cccccc;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.13471448;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + id="rect3223" + width="113.46721" + height="113.47566" + x="229.24068" + y="136.78836" + transform="matrix(0.8229751,0.5680775,-0.8230865,0.5679161,0,0)" /> + <rect + style="font-size:20px;fill:#cccccc;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0.98150337;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + id="rect3217" + width="150.00647" + height="88.946548" + x="0.83566481" + y="507.79147" + transform="matrix(0.9999996,8.8501992e-4,-5.7799705e-4,0.9999998,0,0)" /> + <rect + style="font-size:20px;fill:#cccccc;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0.98150337;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + id="rect2160" + width="150.00647" + height="88.946548" + x="0.59579605" + y="92.791626" + transform="matrix(0.9999996,8.8501991e-4,-5.7799703e-4,0.9999998,0,0)" /> + <path + sodipodi:type="arc" + style="fill:url(#linearGradient3239);fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + id="path3133" + sodipodi:cx="105.05586" + sodipodi:cy="52.311161" + sodipodi:rx="83.842659" + sodipodi:ry="30.304577" + d="M 188.89852 52.311161 A 83.842659 30.304577 0 1 1 21.213203,52.311161 A 83.842659 30.304577 0 1 1 188.89852 52.311161 z" + transform="matrix(0.6478283,0,0,0.6632677,7.2984399,7.2380794)" /> + <text + xml:space="preserve" + style="font-size:20px;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans" + x="51.582031" + y="47.205933" + id="text3135"><tspan + sodipodi:role="line" + id="tspan3137" + x="51.582031" + y="47.205933">Start</tspan></text> + <text + xml:space="preserve" + style="font-size:20px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:125%;writing-mode:lr-tb;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans" + x="73.070572" + y="116.94228" + id="text3139" + sodipodi:linespacing="125%"><tspan + sodipodi:role="line" + id="tspan3141" + x="76.254166" + y="116.94228">Process </tspan><tspan + sodipodi:role="line" + x="73.070572" + y="141.94228" + id="tspan3143">CLI</tspan><tspan + sodipodi:role="line" + x="73.070572" + y="166.94228" + id="tspan3145">options</tspan></text> + <text + xml:space="preserve" + style="font-size:20px;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans" + x="188.03711" + y="262.07898" + id="text3163"><tspan + sodipodi:role="line" + id="tspan3165" + x="188.03711" + y="262.07898">No</tspan></text> + <text + xml:space="preserve" + style="font-size:20px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:125%;writing-mode:lr-tb;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans" + x="78.490501" + y="542.4967" + id="text3179" + sodipodi:linespacing="125%"><tspan + sodipodi:role="line" + x="78.490501" + y="542.4967" + id="tspan3183">Init XML-RPC</tspan><tspan + sodipodi:role="line" + x="78.490501" + y="567.4967" + id="tspan3185">client object</tspan></text> + <rect + style="font-size:20px;fill:#cccccc;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0.98150337;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + id="rect3219" + width="150.00647" + height="88.946548" + x="239.63451" + y="227.64088" + transform="matrix(0.9999996,8.8501998e-4,-5.7799717e-4,0.9999998,0,0)" /> + <text + xml:space="preserve" + style="font-size:20px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:125%;writing-mode:lr-tb;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans" + x="75.07811" + y="257.07898" + id="text3147" + sodipodi:linespacing="125%"><tspan + sodipodi:role="line" + id="tspan3149" + x="75.07811" + y="257.07898">Does</tspan><tspan + sodipodi:role="line" + x="75.07811" + y="282.07898" + id="tspan3151">keypair</tspan><tspan + sodipodi:role="line" + x="75.07811" + y="307.07898" + id="tspan3153">exist?</tspan></text> + <text + xml:space="preserve" + style="font-size:16px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:125%;writing-mode:lr-tb;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans" + x="74.21563" + y="652.0788" + id="text3189" + sodipodi:linespacing="125%"><tspan + sodipodi:role="line" + id="tspan3191" + x="76.444145" + y="652.0788" + style="font-size:14px">Client </tspan><tspan + sodipodi:role="line" + x="74.21563" + y="669.5788" + id="tspan3193" + style="font-size:14px">status defined?</tspan><tspan + sodipodi:role="line" + x="74.21563" + y="685.63681" + id="tspan10369" + style="font-size:14px;font-family:Courier 10 Pitch">svrmod client.py:</tspan><tspan + sodipodi:role="line" + x="74.21563" + y="703.13681" + style="font-size:14px;font-family:Courier 10 Pitch" + id="tspan10375">register_client()</tspan></text> + <text + xml:space="preserve" + style="font-size:20px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:125%;writing-mode:lr-tb;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans" + x="314.32617" + y="262.20593" + id="text3167" + sodipodi:linespacing="125%"><tspan + sodipodi:role="line" + id="tspan3169" + x="314.32617" + y="262.20593">Generate</tspan><tspan + sodipodi:role="line" + x="314.32617" + y="287.20593" + id="tspan3171">keypair</tspan></text> + <rect + style="font-size:20px;fill:#cccccc;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0.98150337;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + id="rect3227" + width="150.00647" + height="88.946548" + x="240.91367" + y="642.57904" + transform="matrix(0.9999996,8.8501995e-4,-5.7799711e-4,0.9999998,0,0)" /> + <rect + style="font-size:20px;fill:#cccccc;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0.98150337;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + id="rect3229" + width="150.00647" + height="88.946548" + x="0.76919514" + y="392.79153" + transform="matrix(0.9999996,8.8501992e-4,-5.7799705e-4,0.9999998,0,0)" /> + <text + xml:space="preserve" + style="font-size:14px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:125%;writing-mode:lr-tb;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans" + x="314.74188" + y="657.42694" + id="text3195" + sodipodi:linespacing="125%"><tspan + sodipodi:role="line" + x="316.9704" + y="657.42694" + id="tspan3205">Add with client info </tspan><tspan + sodipodi:role="line" + x="316.9704" + y="674.92694" + id="tspan10385">as pending: </tspan><tspan + sodipodi:role="line" + x="314.74188" + y="687.40995" + id="tspan10387" + style="font-family:Courier 10 Pitch;font-size:10">scirec.py: sys_info(),</tspan><tspan + sodipodi:role="line" + x="314.74188" + y="699.90995" + id="tspan10389" + style="font-family:Courier 10 Pitch;font-size:10">svrmod client.py:</tspan><tspan + sodipodi:role="line" + x="314.74188" + y="712.40995" + id="tspan10391" + style="font-family:Courier 10 Pitch;font-size:10">add_client()</tspan></text> + <text + xml:space="preserve" + style="font-size:20px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:125%;writing-mode:lr-tb;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans" + x="70.576187" + y="427.5575" + id="text3173" + sodipodi:linespacing="125%"><tspan + sodipodi:role="line" + id="tspan3175" + x="70.576187" + y="427.5575">Load</tspan><tspan + sodipodi:role="line" + x="70.576187" + y="452.5575" + id="tspan3177">certificate</tspan></text> + <rect + style="font-size:20px;fill:#cccccc;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0.98150337;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + id="rect3231" + width="150.00647" + height="88.946548" + x="1.0119539" + y="812.79138" + transform="matrix(0.9999996,8.8501994e-4,-5.7799709e-4,0.9999998,0,0)" /> + <text + xml:space="preserve" + style="font-size:20px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:125%;writing-mode:lr-tb;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans" + x="76.506531" + y="845.15253" + id="text3207" + sodipodi:linespacing="125%"><tspan + sodipodi:role="line" + x="76.506531" + y="845.15253" + id="tspan3213">Get list of jobs:</tspan><tspan + sodipodi:role="line" + x="76.506531" + y="862.73004" + id="tspan10395" + style="font-size:14px;font-family:Courier 10 Pitch">svrmod job.py:</tspan><tspan + sodipodi:role="line" + x="76.506531" + y="880.23004" + id="tspan10397" + style="font-size:14px;font-family:Courier 10 Pitch">get_jobs()</tspan></text> + <path + style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:#000000;stroke-width:0.93400759px;stroke-linecap:butt;stroke-linejoin:miter;marker-end:url(#TriangleOutL);stroke-opacity:1" + d="M 75.390735,62.333068 L 75.443236,87.897726" + id="path4416" + inkscape:connector-type="polyline" /> + <path + style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:#000000;stroke-width:0.91477418px;stroke-linecap:butt;stroke-linejoin:miter;marker-mid:none;marker-end:url(#TriangleOutL);stroke-opacity:1" + d="M 75.69892,182.25337 L 75.800832,203.08282" + id="path5407" + inkscape:connector-type="polyline" /> + <path + style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:#000000;stroke-width:0.96590352px;stroke-linecap:butt;stroke-linejoin:miter;marker-end:url(#TriangleOutL);stroke-opacity:1" + d="M 170.36077,272.37417 L 234.09696,272.38295" + id="path7349" + inkscape:connector-type="polyline" /> + <path + style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:#000000;stroke-width:0.9155761px;stroke-linecap:butt;stroke-linejoin:miter;marker-end:url(#TriangleOutL);stroke-opacity:1" + d="M 75.833192,337.27561 L 75.667824,387.67812" + id="path8320" + inkscape:connector-type="polyline" /> + <text + xml:space="preserve" + style="font-size:20px;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans" + x="88.681641" + y="366.94226" + id="text9291"><tspan + sodipodi:role="line" + x="88.681641" + y="366.94226" + id="tspan9293">Yes</tspan></text> + <path + style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:#000000;stroke-width:1.00151396px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;display:inline" + d="M 314.42583,317.35732 L 314.28647,436.86143" + id="path9297" + inkscape:connector-type="polyline" /> + <path + style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:#000000;stroke-width:0.98845464px;stroke-linecap:butt;stroke-linejoin:miter;marker-start:url(#TriangleInL);stroke-opacity:1;display:inline" + d="M 154.99774,437.11555 C 208.09565,436.95944 261.19356,436.80333 314.29148,436.64722" + id="path9299" /> + <path + style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:#000000;stroke-width:0.91477418px;stroke-linecap:butt;stroke-linejoin:miter;marker-mid:none;marker-end:url(#TriangleOutL);stroke-opacity:1" + d="M 74.02484,481.8528 L 74.126752,502.68225" + id="path10273" + inkscape:connector-type="polyline" /> + <path + style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:#000000;stroke-width:0.91477418px;stroke-linecap:butt;stroke-linejoin:miter;marker-mid:none;marker-end:url(#TriangleOutL);stroke-opacity:1" + d="M 74.659688,597.38937 L 74.7616,618.21882" + id="path10275" + inkscape:connector-type="polyline" /> + <path + style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:#000000;stroke-width:0.9822917px;stroke-linecap:butt;stroke-linejoin:miter;marker-end:url(#TriangleOutL);stroke-opacity:1" + d="M 168.47328,687.40895 L 234.53071,687.41771" + id="path10277" + inkscape:connector-type="polyline" /> + <path + style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:#000000;stroke-width:1.00151396px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;display:inline" + d="M 314.67383,731.91373 L 314.53447,851.41784" + id="path10279" + inkscape:connector-type="polyline" /> + <path + style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:#000000;stroke-width:0.98845464px;stroke-linecap:butt;stroke-linejoin:miter;marker-start:url(#TriangleInL);stroke-opacity:1;display:inline" + d="M 155.24574,851.67196 C 208.34365,851.51585 261.44156,851.35974 314.53948,851.20363" + id="path10281" /> + <path + style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:#000000;stroke-width:0.9590643px;stroke-linecap:butt;stroke-linejoin:miter;marker-end:url(#TriangleOutL);stroke-opacity:1" + d="M 75.157506,751.4981 L 74.99312,807.1327" + id="path10283" + inkscape:connector-type="polyline" /> + <text + xml:space="preserve" + style="font-size:20px;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans" + x="186.68108" + y="672.36774" + id="text10285"><tspan + sodipodi:role="line" + id="tspan10287" + x="186.68108" + y="672.36774">No</tspan></text> + <text + xml:space="preserve" + style="font-size:20px;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans" + x="91.503204" + y="786.65344" + id="text10289"><tspan + sodipodi:role="line" + x="91.503204" + y="786.65344" + id="tspan10291">Yes</tspan></text> + <rect + style="font-size:20px;fill:#cccccc;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0.98150337;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + id="rect10293" + width="150.00647" + height="88.946548" + x="1.2730629" + y="927.82153" + transform="matrix(0.9999996,8.8501997e-4,-5.7799715e-4,0.9999998,0,0)" /> + <path + style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:#000000;stroke-width:0.91477418px;stroke-linecap:butt;stroke-linejoin:miter;marker-mid:none;marker-end:url(#TriangleOutL);stroke-opacity:1" + d="M 75.622686,901.55047 L 75.724598,922.37992" + id="path10295" + inkscape:connector-type="polyline" /> + <text + xml:space="preserve" + style="font-size:20px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:125%;writing-mode:lr-tb;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans" + x="73.479355" + y="953.41827" + id="text10297" + sodipodi:linespacing="125%"><tspan + sodipodi:role="line" + x="73.479355" + y="953.41827" + id="tspan10301">Run jobs:</tspan><tspan + sodipodi:role="line" + x="73.479355" + y="970.99579" + id="tspan10399" + style="font-family:Courier 10 Pitch;font-size:14">scirec.py:</tspan><tspan + sodipodi:role="line" + x="73.479355" + y="988.49579" + id="tspan10401" + style="font-family:Courier 10 Pitch;font-size:14">run_jobs()</tspan><tspan + sodipodi:role="line" + x="73.479355" + y="1005.9958" + id="tspan10305" /></text> + <rect + style="fill:#cccccc;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.13471448;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + id="rect10307" + width="113.46721" + height="113.47575" + x="963.49048" + y="871.35999" + transform="matrix(0.8229751,0.5680775,-0.8230865,0.5679161,0,0)" /> + <text + xml:space="preserve" + style="font-size:20px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:125%;writing-mode:lr-tb;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans" + x="73.562241" + y="1106.3645" + id="text10309" + sodipodi:linespacing="125%"><tspan + sodipodi:role="line" + x="73.562241" + y="1106.3645" + id="tspan10313">Daemon</tspan><tspan + sodipodi:role="line" + x="73.562241" + y="1131.3645" + id="tspan10321">mode?</tspan></text> + <path + style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:#000000;stroke-width:0.91477418px;stroke-linecap:butt;stroke-linejoin:miter;marker-mid:none;marker-end:url(#TriangleOutL);stroke-opacity:1" + d="M 75.265542,1016.6219 L 75.367454,1037.4513" + id="path10317" + inkscape:connector-type="polyline" /> + <rect + style="font-size:20px;fill:#cccccc;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0.98150337;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + id="rect10323" + width="150.00647" + height="88.946548" + x="241.35118" + y="1062.8234" + transform="matrix(0.9999996,8.8501999e-4,-5.7799719e-4,0.9999998,0,0)" /> + <text + xml:space="preserve" + style="font-size:20px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:125%;writing-mode:lr-tb;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans" + x="315.23236" + y="1096.4672" + id="text10325" + sodipodi:linespacing="125%"><tspan + sodipodi:role="line" + x="315.23236" + y="1096.4672" + id="tspan10331">Sleep for</tspan><tspan + sodipodi:role="line" + x="315.23236" + y="1121.4672" + id="tspan10341">poll_int</tspan></text> + <path + style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:#000000;stroke-width:0.9822917px;stroke-linecap:butt;stroke-linejoin:miter;marker-end:url(#TriangleOutL);stroke-opacity:1" + d="M 168.98987,1106.6394 L 235.0473,1106.6482" + id="path10333" + inkscape:connector-type="polyline" /> + <path + style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:#000000;stroke-width:0.9590643px;stroke-linecap:butt;stroke-linejoin:miter;marker-end:url(#TriangleOutL);stroke-opacity:1" + d="M 75.515,1171.2599 L 75.350614,1226.8945" + id="path10335" + inkscape:connector-type="polyline" /> + <path + style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:#000000;stroke-width:1.04544771px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;display:inline" + d="M 315.51117,872.71982 L 315.41575,1062.8907" + id="path10343" + inkscape:connector-type="polyline" /> + <path + style="fill:none;fill-opacity:0.75;fill-rule:evenodd;stroke:#000000;stroke-width:0.98845464px;stroke-linecap:butt;stroke-linejoin:miter;marker-start:url(#TriangleInL);stroke-opacity:1;display:inline" + d="M 156.04099,873.57188 C 209.1389,873.41577 262.23681,873.25966 315.33473,873.10355" + id="path10345" /> + <text + xml:space="preserve" + style="font-size:20px;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans" + x="99.103874" + y="1206.9929" + id="text10347"><tspan + sodipodi:role="line" + id="tspan10349" + x="99.103874" + y="1206.9929">No</tspan></text> + <text + xml:space="preserve" + style="font-size:20px;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans" + x="184.37054" + y="1093.8558" + id="text10351"><tspan + sodipodi:role="line" + x="184.37054" + y="1093.8558" + id="tspan10353">Yes</tspan></text> + <path + sodipodi:type="arc" + style="fill:url(#linearGradient10361);fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + id="path10355" + sodipodi:cx="105.05586" + sodipodi:cy="52.311161" + sodipodi:rx="83.842659" + sodipodi:ry="30.304577" + d="M 188.89852 52.311161 A 83.842659 30.304577 0 1 1 21.213203,52.311161 A 83.842659 30.304577 0 1 1 188.89852 52.311161 z" + transform="matrix(0.6478283,0,0,0.6632677,5.5132681,1217.6659)" /> + <text + xml:space="preserve" + style="font-size:20px;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans" + x="49.796856" + y="1257.6338" + id="text10357"><tspan + sodipodi:role="line" + x="49.796856" + y="1257.6338" + id="tspan10365">Stop</tspan></text> + </g> +</svg> diff --git a/docs/moria.sql b/docs/moria.sql new file mode 100644 index 0000000..cbe0a7a --- /dev/null +++ b/docs/moria.sql @@ -0,0 +1,96 @@ +--create database moria; +use moria; +drop table if exists modules; +create table modules ( id INT NOT NULL default '0', +name VARCHAR(50), +long_name VARCHAR(150), +description VARCHAR(250), +main_content VARCHAR(90), +author VARCHAR(50), +distribution VARCHAR(50), +category VARCHAR(30), +homepage VARCHAR(90), +PRIMARY KEY (id) +) TYPE=MyISAM; + +drop table if exists clients; +create table clients ( +client_id INT NOT NULL AUTO_INCREMENT, +hostname VARCHAR(30) NOT NULL default 'hostname', +mac VARCHAR(17) NOT NULL default '00:01:02:03:04:05', +ip VARCHAR(15) NOT NULL default 'dhcp', +profile VARCHAR(30), +distribution VARCHAR(50), +administrator VARCHAR(50), +status VARCHAR(100), +PRIMARY KEY (client_id) +) TYPE=MyISAM; + +drop table if exists profiles; +create table profiles ( +profile_name VARCHAR(30), +filename VARCHAR(90) NOT NULL, +description VARCHAR(250), +distribution VARCHAR(50), +PRIMARY KEY (profile_name) +) TYPE=MyISAM; + +drop table if exists groups; +create table groups ( +profile_name VARCHAR(30) NOT NULL, +machine_id INT NOT NULL +) TYPE=MyISAM; + +drop table if exists users; +create table users ( +username VARCHAR(30) NOT NULL, +password VARCHAR(50) NOT NULL default 'invalid', +real_name VARCHAR(60), +comment VARCHAR(90), +PRIMARY KEY (username) +) TYPE=MyISAM; + +drop table if exists permissions; +create table permissions ( +perm_name VARCHAR(30) NOT NULL, +description VARCHAR(90), +creator VARCHAR(30), +PRIMARY KEY (perm_name) +) TYPE=MyISAM; + + + +--INSERT INTO jobs (client, cliengroup, jobtype, priority, jobparam) VALUES ("boxa", "webserver", "pkgupdate", 2, "apache") +--INSERT INTO jobs (client, cliengroup, jobtype, priority, jobparam) VALUES ("boxa", "webserver", "cfgupdate", 3, "scp://server/etc/apache2/httpd2.conf") +--INSERT INTO jobs (client, cliengroup, jobtype, priority, jobparam) VALUES ("boxa", "webserver", "runscript", 4, "scp://server/etc/apache2/updatesomething.sh") + +drop table if exists jobs; +create table jobs ( +job_id INT NOT NULL, +client_id INT NOT NULL, +jobtype VARCHAR(30) NOT NULL, +priority INT NOT NULL default 5, +jobparam VARCHAR(300), +timecreated TIMESTAMP NOT NULL, +timetosend TIMESTAMP NOT NULL, +timesent TIMESTAMP, +timedone TIMESTAMP, +status VARCHAR(50) NOT NULL, +created_by VARCHAR(30) NOT NULL, +description VARCHAR(250), +PRIMARY KEY (job_id) +) TYPE=MyISAM; + +-- by Blackace +DROP TABLE IF EXISTS sessions; +CREATE TABLE sessions ( + sessionid varchar(255) character set utf8 collate utf8_bin NOT NULL default '', + expiration int(10) unsigned NOT NULL default '0', + data text, + PRIMARY KEY (sessionid) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +drop table if exists user_preferences; + +grant all on moria.* to hobbit identified by 'hobbitpassword'; +grant all on moria.* to hobbit@localhost identified by 'hobbitpassword'; diff --git a/docs/moria2.sql b/docs/moria2.sql new file mode 100644 index 0000000..6bb6439 --- /dev/null +++ b/docs/moria2.sql @@ -0,0 +1,23 @@ +use moria; +INSERT INTO modules values (1,'GLIMD','Gentoo Linux Installation Mangement Daemon','Description goes here and all that good stuff.','glimd.txt','Preston Cody','gentoo','deployment','http://www.gentoo.org/proj/en/releng/gli/'); +INSERT INTO modules values (2,'Exporter','Server Information Exporter','This is a utility that will take selected data from the central server about machines and export it into an XML format.','Exporter.php','Preston Cody',NULL,'information','http://www.gentoo.org/proj/en/releng/gli/'); + +INSERT INTO clients values (1, 'testhostlead', '00:0a:0b:0c:0d:0e', '192.168.3.4', 'printerserver', 'gentoo', 'Preston Cody', 'Installed'); + +INSERT INTO clients values (2, 'testhostslave', '00:0a:0a:0a:0d:0e', '192.168.3.5', 'printerserver', 'gentoo', 'Preston Cody', 'Not Installed'); + +INSERT INTO clients values (3, 'testhostmtalead', '0b:0b:0b:0c:0d:0e', '192.168.3.6', 'mta', 'gentoo', 'Preston Cody', 'Installed'); + +INSERT INTO clients values (4, 'testhostmtaslave', '0c:0c:0c:0c:0d:0e', '192.168.3.7', 'mta', 'gentoo', 'Preston Cody', 'Installed'); + +INSERT INTO profiles values ('printerserver', 'printerserverprofile.xml', 'Printer Servers use this profile', 'gentoo'); + +INSERT INTO profiles values ('mta', 'mtaprofile.xml', 'MTAs use this profile', 'gentoo'); + +INSERT INTO users values ('root','444mwGdhEKuO.','Root User'); + +INSERT INTO jobs values (1, 1, 'Update', 5, 'emerge sync', NOW(), NOW(), NOW(), NOW(), 'Scheduled', 'root', 'Regular Update'); +INSERT INTO jobs values (2, 1, 'Install Packages', 5, 'emerge cups', NOW(), NOW(), NOW(), NOW(), 'In Progress', 'root', 'Adding cups'); +INSERT INTO jobs values (3, 2, 'Install Packages', 6, 'emerge cups', NOW(), NOW(), NOW(), NOW(), 'Failed', 'root', 'Adding cups'); +INSERT INTO jobs values (4, 3, 'Update', 2, 'glsa-check', NOW(), NOW(), NOW(), NOW(), 'In Progress', 'root', 'Security Update'); +INSERT INTO jobs values (5, 3, 'Install Packages', 5, 'emerge postrix', NOW(), NOW(), NOW(), NOW(), 'Scheduled', 'root', 'Adding postfix, cause its an mta duh.'); diff --git a/docs/phpgacl_seed.sql b/docs/phpgacl_seed.sql new file mode 100644 index 0000000..f882df7 --- /dev/null +++ b/docs/phpgacl_seed.sql @@ -0,0 +1,104 @@ +use scire; +-- +-- Dumping data for table `gacl_acl` +-- + +LOCK TABLES `gacl_acl` WRITE; +/*!40000 ALTER TABLE `gacl_acl` DISABLE KEYS */; +INSERT INTO `gacl_acl` VALUES (3,'system',1,1,'1','',1156105535),(14,'system',1,1,'1','',1175446075),(4,'system',1,1,'1','',1156105622),(1,'system',1,1,'1','',1156105457),(6,'system',1,1,'1','',1156041570),(7,'system',1,1,'1','',1175469155),(5,'system',1,1,'1','',1156105677),(9,'system',1,1,'1','',1174872568),(13,'system',1,1,'1','',1175444039),(15,'system',1,1,'1','',1175446991),(16,'system',1,1,'1','',1175447252),(17,'system',1,1,'1','',1175447319),(18,'system',1,1,'1','',1175449945),(19,'system',1,1,'1','',1175449997),(20,'system',1,1,'1','',1175451002),(21,'system',1,1,'1','',1175451021),(22,'system',1,1,'1','',1175451722),(23,'system',1,1,'1','',1175462168),(24,'system',1,1,'1','',1175469539); +/*!40000 ALTER TABLE `gacl_acl` ENABLE KEYS */; +UNLOCK TABLES; + +LOCK TABLES `gacl_aco` WRITE; +/*!40000 ALTER TABLE `gacl_aco` DISABLE KEYS */; +INSERT INTO `gacl_aco` VALUES (13,'scire_ui','Edit User Info',1,'Edit User',0),(14,'scire_ui','Add User',1,'Add User',0),(15,'scire_ui','Add Client',1,'Add Client',0),(16,'scire_ui','View Clients',1,'View Clients',0),(17,'scire_ui','View Pending Clients',1,'View Pending Clients',0),(18,'scire_ui','Approve/Reject Pending Clients',1,'Approve/Reject Pending Clients',0),(19,'scire_ui','View Jobs',1,'View Jobs',0),(20,'scire_ui','Add Job',1,'Add Job',0),(22,'scire_ui','View Users',1,'View Users',0),(23,'Tests','Test Permission 1',1,'Test Permission 1',0),(24,'scire_ui','Add ClientGroup',1,'Add ClientGroup',0),(25,'scire_ui','Edit ClientGroup',1,'Edit ClientGroup',0),(26,'scire_ui','Delete ClientGroup',1,'Delete ClientGroup',0),(27,'scire_ui','Assign Permission',1,'Assign Permission',0),(28,'scire_ui','View Permissions',1,'View Permissions',0),(29,'scire_ui','Edit Client',1,'Edit Client',0),(30,'scire_ui','Delete Client',1,'Delete Client',0),(31,'scire_ui','Change User Pass/Name',1,'Change User Pass/Name',0),(32,'scire_ui','Add UserGroup',1,'Add UserGroup',0); +/*!40000 ALTER TABLE `gacl_aco` ENABLE KEYS */; +UNLOCK TABLES; +LOCK TABLES `gacl_aco_map` WRITE; +/*!40000 ALTER TABLE `gacl_aco_map` DISABLE KEYS */; +INSERT INTO `gacl_aco_map` VALUES (1,'scire_ui','View Clients'),(3,'scire_ui','Approve/Reject Pending Clients'),(4,'scire_ui','View Jobs'),(5,'scire_ui','Add Job'),(6,'scire_ui','Add User'),(7,'scire_ui','Add Client'),(9,'scire_ui','View Users'),(13,'scire_ui','Add Client'),(14,'scire_ui','View Pending Clients'),(15,'scire_ui','Add ClientGroup'),(16,'scire_ui','Edit ClientGroup'),(17,'scire_ui','Delete ClientGroup'),(18,'scire_ui','Assign Permission'),(19,'scire_ui','View Permissions'),(20,'scire_ui','Edit Client'),(21,'scire_ui','Delete Client'),(22,'scire_ui','View Clients'),(23,'scire_ui','Change User Pass/Name'),(24,'scire_ui','Add UserGroup'); +/*!40000 ALTER TABLE `gacl_aco_map` ENABLE KEYS */; +UNLOCK TABLES; +LOCK TABLES `gacl_aco_sections` WRITE; +/*!40000 ALTER TABLE `gacl_aco_sections` DISABLE KEYS */; +INSERT INTO `gacl_aco_sections` VALUES (1,'scire_ui',1,'scire_ui',0),(3,'Tests',1,'Tests',0); +/*!40000 ALTER TABLE `gacl_aco_sections` ENABLE KEYS */; +UNLOCK TABLES; + + +LOCK TABLES `gacl_aro` WRITE; +/*!40000 ALTER TABLE `gacl_aro` DISABLE KEYS */; +INSERT INTO `gacl_aro` VALUES (1,'users','root',0,'root',0),(2,'users','codeman',1,'codeman',0); +/*!40000 ALTER TABLE `gacl_aro` ENABLE KEYS */; +UNLOCK TABLES; + + +LOCK TABLES `gacl_aro_map` WRITE; +/*!40000 ALTER TABLE `gacl_aro_map` DISABLE KEYS */; +INSERT INTO `gacl_aro_map` VALUES (7,'users','codeman'),(14,'users','codeman'),(22,'users','codeman'),(24,'users','codeman'); +/*!40000 ALTER TABLE `gacl_aro_map` ENABLE KEYS */; +UNLOCK TABLES; + +LOCK TABLES `gacl_aro_groups` WRITE; +/*!40000 ALTER TABLE `gacl_aro_groups` DISABLE KEYS */; +INSERT INTO `gacl_aro_groups` VALUES (1,0,1,4,'Company Name','Company Name'),(3,1,2,3,'test','test'); +/*!40000 ALTER TABLE `gacl_aro_groups` ENABLE KEYS */; +UNLOCK TABLES; + + +LOCK TABLES `gacl_aro_groups_map` WRITE; +/*!40000 ALTER TABLE `gacl_aro_groups_map` DISABLE KEYS */; +INSERT INTO `gacl_aro_groups_map` VALUES (1,1),(4,1),(9,1),(13,1),(14,1),(15,1),(16,1),(17,1),(18,1),(20,1),(21,1),(24,1); +/*!40000 ALTER TABLE `gacl_aro_groups_map` ENABLE KEYS */; +UNLOCK TABLES; +LOCK TABLES `gacl_aro_sections` WRITE; +/*!40000 ALTER TABLE `gacl_aro_sections` DISABLE KEYS */; +INSERT INTO `gacl_aro_sections` VALUES (1,'users',1,'users',0); +/*!40000 ALTER TABLE `gacl_aro_sections` ENABLE KEYS */; +UNLOCK TABLES; + + + + +LOCK TABLES `gacl_axo` WRITE; +/*!40000 ALTER TABLE `gacl_axo` DISABLE KEYS */; +INSERT INTO `gacl_axo` VALUES (1,'scire_ui','scire_ui',1,'scire_ui',0),(3,'clients','testclient',1,'testclient',0),(5,'clients','testclient2',1,'testclient2',0); +/*!40000 ALTER TABLE `gacl_axo` ENABLE KEYS */; +UNLOCK TABLES; +LOCK TABLES `gacl_axo_groups` WRITE; +/*!40000 ALTER TABLE `gacl_axo_groups` DISABLE KEYS */; +INSERT INTO `gacl_axo_groups` VALUES (1,0,1,2,'Company Name','Company Name'); +/*!40000 ALTER TABLE `gacl_axo_groups` ENABLE KEYS */; +UNLOCK TABLES; +LOCK TABLES `gacl_axo_map` WRITE; +/*!40000 ALTER TABLE `gacl_axo_map` DISABLE KEYS */; +INSERT INTO `gacl_axo_map` VALUES (1,'scire_ui','scire_ui'),(3,'scire_ui','scire_ui'),(4,'scire_ui','scire_ui'),(5,'scire_ui','scire_ui'),(6,'scire_ui','scire_ui'),(7,'scire_ui','scire_ui'),(9,'scire_ui','scire_ui'),(13,'scire_ui','scire_ui'),(14,'scire_ui','scire_ui'),(15,'scire_ui','scire_ui'),(16,'scire_ui','scire_ui'),(17,'scire_ui','scire_ui'),(18,'scire_ui','scire_ui'),(19,'scire_ui','scire_ui'),(20,'scire_ui','scire_ui'),(21,'scire_ui','scire_ui'),(22,'scire_ui','scire_ui'),(23,'scire_ui','scire_ui'),(24,'scire_ui','scire_ui'); +/*!40000 ALTER TABLE `gacl_axo_map` ENABLE KEYS */; +UNLOCK TABLES; +LOCK TABLES `gacl_axo_sections` WRITE; +/*!40000 ALTER TABLE `gacl_axo_sections` DISABLE KEYS */; +INSERT INTO `gacl_axo_sections` VALUES (2,'clients',1,'clients',0),(1,'scire_ui',2,'scire_ui',0); +/*!40000 ALTER TABLE `gacl_axo_sections` ENABLE KEYS */; +UNLOCK TABLES; +LOCK TABLES `gacl_groups_aro_map` WRITE; +/*!40000 ALTER TABLE `gacl_groups_aro_map` DISABLE KEYS */; +INSERT INTO `gacl_groups_aro_map` VALUES (1,1); +/*!40000 ALTER TABLE `gacl_groups_aro_map` ENABLE KEYS */; +UNLOCK TABLES; +LOCK TABLES `gacl_groups_axo_map` WRITE; +/*!40000 ALTER TABLE `gacl_groups_axo_map` DISABLE KEYS */; +INSERT INTO `gacl_groups_axo_map` VALUES (1,3),(1,5); +/*!40000 ALTER TABLE `gacl_groups_axo_map` ENABLE KEYS */; +UNLOCK TABLES; + +-- SEQUENCES + +INSERT INTO `gacl_acl_seq` VALUES (24); +INSERT INTO `gacl_aco_seq` VALUES (32); +INSERT INTO `gacl_aco_sections_seq` VALUES (3); +INSERT INTO `gacl_aro_groups_id_seq` VALUES (3); +INSERT INTO `gacl_aro_sections_seq` VALUES (1); +INSERT INTO `gacl_aro_seq` VALUES (3); +INSERT INTO `gacl_axo_groups_id_seq` VALUES (2); +INSERT INTO `gacl_axo_sections_seq` VALUES (3); +INSERT INTO `gacl_axo_seq` VALUES (5); diff --git a/docs/scire.conf b/docs/scire.conf new file mode 100644 index 0000000..3f55d1d --- /dev/null +++ b/docs/scire.conf @@ -0,0 +1,7 @@ +[db] +type: mysql +host: localhost +db: scire +user: hobbit +passwd: moria + diff --git a/docs/scire.sql b/docs/scire.sql new file mode 100644 index 0000000..6bd41ba --- /dev/null +++ b/docs/scire.sql @@ -0,0 +1,551 @@ +CREATE DATABASE IF NOT EXISTS scire; +GRANT SELECT, INSERT, UPDATE, DELETE, LOCK TABLES ON scire.* TO 'scire' IDENTIFIED BY 'scire'; +GRANT SELECT, INSERT, UPDATE, DELETE, LOCK TABLES ON scire.* TO 'scire'@'localhost' IDENTIFIED BY 'scire'; +ALTER DATABASE scire DEFAULT CHARACTER SET latin1; +USE scire; + +DROP TABLE IF EXISTS users; +CREATE TABLE users ( + userid INT NOT NULL PRIMARY KEY, + username VARCHAR(64) NOT NULL UNIQUE, + password VARCHAR(255) NOT NULL, + email VARCHAR(128) NOT NULL, + phone VARCHAR(128) NULL, + pager VARCHAR(128) NULL, + real_name VARCHAR(255), + comment VARCHAR(255) +) ENGINE = MyISAM; + +DROP TABLE IF EXISTS clients; +CREATE TABLE clients ( + clientid INT NOT NULL PRIMARY KEY, + assetid VARCHAR(64) UNIQUE, + digest VARCHAR(128) UNIQUE, + hostname VARCHAR(64) NOT NULL, + mac VARCHAR(17) NOT NULL, + ip VARCHAR(15) NOT NULL, + gli_profile INT, + osid INT, + status INT, + contact INT, + installtime TIMESTAMP NOT NULL DEFAULT NOW(), # date the clients first was set up + FOREIGN KEY (osid) REFERENCES os.osid, + FOREIGN KEY (status) REFERENCES client_status.statusid, + FOREIGN KEY (gli_profile) REFERENCES GLI_profiles.profileid, + FOREIGN KEY (contact) REFERENCES users.userid +) ENGINE = MyISAM; + +DROP TABLE IF EXISTS client_status; +CREATE TABLE client_status ( + statusid INT NOT NULL, + statusname VARCHAR(30), + PRIMARY KEY (statusid) +) ENGINE = MyISAM; + + +DROP TABLE IF EXISTS permissions; +CREATE TABLE permissions ( + permid INT NOT NULL PRIMARY KEY, + name VARCHAR(128) NOT NULL UNIQUE, + description VARCHAR(255), + permcategory VARCHAR(128) NOT NULL DEFAULT 'Default', + creator INT NOT NULL, + created TIMESTAMP NOT NULL DEFAULT NOW(), + FOREIGN KEY (creator) REFERENCES users.userid +) ENGINE = MyISAM; + +DROP TABLE IF EXISTS jobs; +CREATE TABLE jobs ( + jobid INT NOT NULL PRIMARY KEY, + priority INT NOT NULL DEFAULT 0, + created TIMESTAMP NOT NULL DEFAULT NOW(), + creator INT NOT NULL, + permission INT NOT NULL, + script INT NOT NULL, + description VARCHAR(255), + pending INT, + failed INT, + INDEX (creator), + FOREIGN KEY (creator) REFERENCES users.userid, + FOREIGN KEY (permission) REFERENCES permissions.permid, + FOREIGN KEY (script) REFERENCES scripts.scriptid +) ENGINE = MyISAM; + +DROP TABLE IF EXISTS job_history; +CREATE TABLE job_history ( + jobid INT NOT NULL, + clientid INT NOT NULL, + eventtime TIMESTAMP NOT NULL DEFAULT NOW(), + statusid INT NOT NULL, + eventmsg VARCHAR(255), + PRIMARY KEY (jobid, clientid, eventtime,statusid), + FOREIGN KEY (jobid) REFERENCES jobs.jobid, + FOREIGN KEY (clientid) REFERENCES clients.clientid, + FOREIGN KEY (statusid) REFERENCES jobs_status.statusid +) ENGINE = MyISAM; + +DROP TABLE IF EXISTS jobs_status; +CREATE TABLE jobs_status ( + statusid INT NOT NULL, + statusname VARCHAR(30), + PRIMARY KEY (statusid) +) ENGINE = MyISAM; + + +DROP TABLE IF EXISTS jobs_clients; +CREATE TABLE jobs_clients ( + jobid INT NOT NULL, + clientid INT, + groupid INT, + PRIMARY KEY (jobid, clientid, groupid), + FOREIGN KEY (jobid) REFERENCES jobs.jobid, + FOREIGN KEY (groupid) REFERENCES groups.gropuid, + FOREIGN KEY (clientid) REFERENCES clients.clientid +) ENGINE = MyISAM; +# Either clienid or groupid is required, if 1 is provided the other MUST be NULL + +DROP TABLE IF EXISTS recurring_jobs_clients; +CREATE TABLE recurring_jobs_clients ( + jobid INT NOT NULL, + clientid INT, + groupid INT, + PRIMARY KEY (jobid, clientid, groupid), + FOREIGN KEY (jobid) REFERENCES jobs.jobid, + FOREIGN KEY (groupid) REFERENCES groups.gropuid, + FOREIGN KEY (clientid) REFERENCES clients.clientid +) ENGINE = MyISAM; +# Either clienid or groupid is required, if 1 is provided the other MUST be NULL + +DROP TABLE IF EXISTS job_conditions; +CREATE TABLE job_conditions ( + jobid INT NOT NULL, + job_dependency INT, + deploy_time DATETIME, + expiration_time DATETIME, + run_schedule VARCHAR(255), #a cron-like string showing the schedule to run. min interval of 1 minute. + validity_period INT, # how many minutes will the job be available + last_run INT, + last_run_date DATETIME, +# conditions here (TBD) +# other types of dependencies: +# right now time and proccess (other jobs) +# might also include data (partition full?) + + PRIMARY KEY (jobid), + FOREIGN KEY (jobid) REFERENCES jobs.jobid +) ENGINE = MyISAM; + +DROP TABLE IF EXISTS scripts; +CREATE TABLE scripts ( + scriptid INT NOT NULL PRIMARY KEY, + name VARCHAR(128) NOT NULL, + description VARCHAR(255), + location VARCHAR(255), + script_data TEXT, + log_location VARCHAR(255), + success_code VARCHAR(32), + run_as VARCHAR(255), + priority INT, + permission INT, + pp_location VARCHAR(255), + pp_script_data TEXT, + return_output INT DEFAULT 0, + FOREIGN KEY (permission) REFERENCES permissions.permid +) ENGINE = MyISAM; + +DROP TABLE IF EXISTS os; +CREATE TABLE os ( + osid INT NOT NULL AUTO_INCREMENT PRIMARY KEY, + osname VARCHAR(128) NOT NULL, + update_script INT, + install_script INT, + uninstall_script INT, + rollback_script INT, + packagelist_script INT, + FOREIGN KEY (update_script) REFERENCES scripts.scriptid, + FOREIGN KEY (install_script) REFERENCES scripts.scriptid, + FOREIGN KEY (uninstall_script) REFERENCES scripts.scriptid, + FOREIGN KEY (rollback_script) REFERENCES scripts.scriptid, + FOREIGN KEY (packagelist_script) REFERENCES scripts.scriptid +) ENGINE = MyISAM; + +DROP TABLE IF EXISTS sessions; +CREATE TABLE sessions ( + sessionid VARCHAR(255) NOT NULL DEFAULT '' PRIMARY KEY, + expiration INT(10) UNSIGNED NOT NULL DEFAULT '0', + data TEXT +) ENGINE = MyISAM; + +DROP TABLE IF EXISTS settings; +CREATE TABLE settings ( + userid INT NOT NULL, + setting_name VARCHAR(64), + setting_value VARCHAR(255), + PRIMARY KEY (userid, setting_name), + FOREIGN KEY (userid) REFERENCES users.userid + +) ENGINE = MyISAM; + +DROP TABLE IF EXISTS hardware; +CREATE TABLE hardware ( + clientid INT NOT NULL PRIMARY KEY, + processor VARCHAR(32), + memory VARCHAR(32), # size of the installed memory in MB + hd VARCHAR(32), # size of harddisk in MB +# partitions: data about the partitions + cpu VARCHAR(64), # type of cpu + mhz VARCHAR(32), # speed of the cpu +# netcards: product names of the installed network cards +# graficcard: information about the grafic card +# soundcard: name of the sound card +# isa: information about ISA components +# dmi: DMI information +# ram , +#.. steal the rest from Zen or m23 + FOREIGN KEY (clientid) REFERENCES clients.clientid +) ENGINE = MyISAM; + +DROP TABLE IF EXISTS hardware_history; +CREATE TABLE hardware_history ( + clientid INT NOT NULL, + changedate TIMESTAMP NOT NULL DEFAULT NOW(), + field_name VARCHAR(30), + oldvalue VARCHAR(255), + newvalue VARCHAR(255), + PRIMARY KEY (clientid,changedate), + FOREIGN KEY (clientid) REFERENCES clients.clientid +) ENGINE = MyISAM; + +DROP TABLE IF EXISTS software; +CREATE TABLE software ( + clientid INT NOT NULL, + package VARCHAR(128) NOT NULL PRIMARY KEY, + current_ver VARCHAR(64), + rollback_ver VARCHAR(64), + #dependencies + FOREIGN KEY (clientid) REFERENCES clients.clientid +) ENGINE = MyISAM; + + + +DROP TABLE IF EXISTS GLI_profiles; +CREATE TABLE GLI_profiles ( + profileid INT NOT NULL AUTO_INCREMENT PRIMARY KEY, + profile_name VARCHAR(255) NOT NULL UNIQUE, + location VARCHAR(255) NOT NULL, + description VARCHAR(255) +) ENGINE = MyISAM; + +DROP TABLE IF EXISTS dyn_tags; +CREATE TABLE dyn_tags ( + scriptid INT NOT NULL, + tag VARCHAR(30) NOT NULL, + tag_value VARCHAR(255), + PRIMARY KEY (scriptid, tag), + FOREIGN KEY (scriptid) REFERENCES scripts.scriptid +) ENGINE = MyISAM; + +drop table if exists modules; +create table modules ( +id INT NOT NULL default '0', +name VARCHAR(50), +long_name VARCHAR(150), +description VARCHAR(250), +path VARCHAR(90), +author VARCHAR(50), +distribution VARCHAR(50), +category VARCHAR(30), +homepage VARCHAR(90), +PRIMARY KEY (id) +) TYPE=MyISAM; + + +#########PHPGACL CODE########## +DROP TABLE IF EXISTS gacl_phpgacl; +CREATE TABLE gacl_phpgacl ( + name VARCHAR(230) NOT NULL, + value VARCHAR(230) NOT NULL, + PRIMARY KEY (name) +); + +DELETE FROM gacl_phpgacl WHERE name='version'; + +INSERT INTO gacl_phpgacl (name,value) VALUES ('version','3.3.6'); + +DELETE FROM gacl_phpgacl WHERE name='schema_version'; + +INSERT INTO gacl_phpgacl (name,value) VALUES ('schema_version','2.1'); + +DROP TABLE IF EXISTS gacl_acl; +CREATE TABLE gacl_acl ( + id INTEGER NOT NULL DEFAULT 0, + section_value VARCHAR(230) NOT NULL DEFAULT 'system', + allow INTEGER NOT NULL DEFAULT 0, + enabled INTEGER NOT NULL DEFAULT 0, + return_value TEXT, + note TEXT, + updated_date INTEGER NOT NULL DEFAULT 0, + PRIMARY KEY (id) +); + +ALTER TABLE gacl_acl ADD INDEX gacl_enabled_acl (enabled); + +ALTER TABLE gacl_acl ADD INDEX gacl_section_value_acl (section_value); + +ALTER TABLE gacl_acl ADD INDEX gacl_updated_date_acl (updated_date); + +DROP TABLE IF EXISTS gacl_acl_sections; +CREATE TABLE gacl_acl_sections ( + id INTEGER NOT NULL DEFAULT 0, + value VARCHAR(230) NOT NULL, + order_value INTEGER NOT NULL DEFAULT 0, + name VARCHAR(230) NOT NULL, + hidden INTEGER NOT NULL DEFAULT 0, + PRIMARY KEY (id) +); + +ALTER TABLE gacl_acl_sections ADD UNIQUE INDEX gacl_value_acl_sections (value); + +ALTER TABLE gacl_acl_sections ADD INDEX gacl_hidden_acl_sections (hidden); + +DELETE FROM gacl_acl_sections WHERE id=1 AND value='system'; + +INSERT INTO gacl_acl_sections (id,value,order_value,name) VALUES (1,'system',1,'System'); + +DELETE FROM gacl_acl_sections WHERE id=2 AND value='user'; + +INSERT INTO gacl_acl_sections (id,value,order_value,name) VALUES (2,'user',2,'User'); + +DROP TABLE IF EXISTS gacl_aco; +CREATE TABLE gacl_aco ( + id INTEGER NOT NULL DEFAULT 0, + section_value VARCHAR(240) NOT NULL DEFAULT '0', + value VARCHAR(240) NOT NULL, + order_value INTEGER NOT NULL DEFAULT 0, + name VARCHAR(255) NOT NULL, + hidden INTEGER NOT NULL DEFAULT 0, + PRIMARY KEY (id) +); + +ALTER TABLE gacl_aco ADD UNIQUE INDEX gacl_section_value_value_aco (section_value, value); + +ALTER TABLE gacl_aco ADD INDEX gacl_hidden_aco (hidden); + +DROP TABLE IF EXISTS gacl_aco_map; +CREATE TABLE gacl_aco_map ( + acl_id INTEGER NOT NULL DEFAULT 0, + section_value VARCHAR(230) NOT NULL DEFAULT '0', + value VARCHAR(230) NOT NULL, + PRIMARY KEY (acl_id, section_value, value) +); + +DROP TABLE IF EXISTS gacl_aco_sections; +CREATE TABLE gacl_aco_sections ( + id INTEGER NOT NULL DEFAULT 0, + value VARCHAR(230) NOT NULL, + order_value INTEGER NOT NULL DEFAULT 0, + name VARCHAR(230) NOT NULL, + hidden INTEGER NOT NULL DEFAULT 0, + PRIMARY KEY (id) +); + +ALTER TABLE gacl_aco_sections ADD UNIQUE INDEX gacl_value_aco_sections (value); + +ALTER TABLE gacl_aco_sections ADD INDEX gacl_hidden_aco_sections (hidden); + +DROP TABLE IF EXISTS gacl_aro; +CREATE TABLE gacl_aro ( + id INTEGER NOT NULL DEFAULT 0, + section_value VARCHAR(240) NOT NULL DEFAULT '0', + value VARCHAR(240) NOT NULL, + order_value INTEGER NOT NULL DEFAULT 0, + name VARCHAR(255) NOT NULL, + hidden INTEGER NOT NULL DEFAULT 0, + PRIMARY KEY (id) +); + +ALTER TABLE gacl_aro ADD UNIQUE INDEX gacl_section_value_value_aro (section_value, value); + +ALTER TABLE gacl_aro ADD INDEX gacl_hidden_aro (hidden); + +DROP TABLE IF EXISTS gacl_aro_map; +CREATE TABLE gacl_aro_map ( + acl_id INTEGER NOT NULL DEFAULT 0, + section_value VARCHAR(230) NOT NULL DEFAULT '0', + value VARCHAR(230) NOT NULL, + PRIMARY KEY (acl_id, section_value, value) +); + +DROP TABLE IF EXISTS gacl_aro_sections; +CREATE TABLE gacl_aro_sections ( + id INTEGER NOT NULL DEFAULT 0, + value VARCHAR(230) NOT NULL, + order_value INTEGER NOT NULL DEFAULT 0, + name VARCHAR(230) NOT NULL, + hidden INTEGER NOT NULL DEFAULT 0, + PRIMARY KEY (id) +); + +ALTER TABLE gacl_aro_sections ADD UNIQUE INDEX gacl_value_aro_sections (value); + +ALTER TABLE gacl_aro_sections ADD INDEX gacl_hidden_aro_sections (hidden); + +DROP TABLE IF EXISTS gacl_axo; +CREATE TABLE gacl_axo ( + id INTEGER NOT NULL DEFAULT 0, + section_value VARCHAR(240) NOT NULL DEFAULT '0', + value VARCHAR(240) NOT NULL, + order_value INTEGER NOT NULL DEFAULT 0, + name VARCHAR(255) NOT NULL, + hidden INTEGER NOT NULL DEFAULT 0, + PRIMARY KEY (id) +); + +ALTER TABLE gacl_axo ADD UNIQUE INDEX gacl_section_value_value_axo (section_value, value); + +ALTER TABLE gacl_axo ADD INDEX gacl_hidden_axo (hidden); + +DROP TABLE IF EXISTS gacl_axo_map; +CREATE TABLE gacl_axo_map ( + acl_id INTEGER NOT NULL DEFAULT 0, + section_value VARCHAR(230) NOT NULL DEFAULT '0', + value VARCHAR(230) NOT NULL, + PRIMARY KEY (acl_id, section_value, value) +); + +DROP TABLE IF EXISTS gacl_axo_sections; +CREATE TABLE gacl_axo_sections ( + id INTEGER NOT NULL DEFAULT 0, + value VARCHAR(230) NOT NULL, + order_value INTEGER NOT NULL DEFAULT 0, + name VARCHAR(230) NOT NULL, + hidden INTEGER NOT NULL DEFAULT 0, + PRIMARY KEY (id) +); + +ALTER TABLE gacl_axo_sections ADD UNIQUE INDEX gacl_value_axo_sections (value); + +ALTER TABLE gacl_axo_sections ADD INDEX gacl_hidden_axo_sections (hidden); + +DROP TABLE IF EXISTS gacl_aro_groups; +CREATE TABLE gacl_aro_groups ( + id INTEGER NOT NULL DEFAULT 0, + parent_id INTEGER NOT NULL DEFAULT 0, + lft INTEGER NOT NULL DEFAULT 0, + rgt INTEGER NOT NULL DEFAULT 0, + name VARCHAR(255) NOT NULL, + value VARCHAR(255) NOT NULL, + PRIMARY KEY (id, value) +); + +ALTER TABLE gacl_aro_groups ADD INDEX gacl_parent_id_aro_groups (parent_id); + +ALTER TABLE gacl_aro_groups ADD UNIQUE INDEX gacl_value_aro_groups (value); + +ALTER TABLE gacl_aro_groups ADD INDEX gacl_lft_rgt_aro_groups (lft, rgt); + +DROP TABLE IF EXISTS gacl_groups_aro_map; +CREATE TABLE gacl_groups_aro_map ( + group_id INTEGER NOT NULL DEFAULT 0, + aro_id INTEGER NOT NULL DEFAULT 0, + PRIMARY KEY (group_id, aro_id) +); + +ALTER TABLE gacl_groups_aro_map ADD INDEX gacl_aro_id (aro_id); + +DROP TABLE IF EXISTS gacl_aro_groups_map; +CREATE TABLE gacl_aro_groups_map ( + acl_id INTEGER NOT NULL DEFAULT 0, + group_id INTEGER NOT NULL DEFAULT 0, + PRIMARY KEY (acl_id, group_id) +); + +DROP TABLE IF EXISTS gacl_axo_groups; +CREATE TABLE gacl_axo_groups ( + id INTEGER NOT NULL DEFAULT 0, + parent_id INTEGER NOT NULL DEFAULT 0, + lft INTEGER NOT NULL DEFAULT 0, + rgt INTEGER NOT NULL DEFAULT 0, + name VARCHAR(255) NOT NULL, + value VARCHAR(255) NOT NULL, + PRIMARY KEY (id, value) +); + +ALTER TABLE gacl_axo_groups ADD INDEX gacl_parent_id_axo_groups (parent_id); + +ALTER TABLE gacl_axo_groups ADD UNIQUE INDEX gacl_value_axo_groups (value); + +ALTER TABLE gacl_axo_groups ADD INDEX gacl_lft_rgt_axo_groups (lft, rgt); + +DROP TABLE IF EXISTS gacl_groups_axo_map; +CREATE TABLE gacl_groups_axo_map ( + group_id INTEGER NOT NULL DEFAULT 0, + axo_id INTEGER NOT NULL DEFAULT 0, + PRIMARY KEY (group_id, axo_id) +); + +ALTER TABLE gacl_groups_axo_map ADD INDEX gacl_axo_id (axo_id); + +DROP TABLE IF EXISTS gacl_axo_groups_map; +CREATE TABLE gacl_axo_groups_map ( + acl_id INTEGER NOT NULL DEFAULT 0, + group_id INTEGER NOT NULL DEFAULT 0, + PRIMARY KEY (acl_id, group_id) +); + + +#########SEQUENCES (both PHPGACL and scire)########## +DROP TABLE IF EXISTS `gacl_acl_seq`; +CREATE TABLE `gacl_acl_seq` ( + `id` int(11) NOT NULL default '0' +) ENGINE=MyISAM DEFAULT CHARSET=latin1; + +DROP TABLE IF EXISTS `gacl_aco_sections_seq`; +CREATE TABLE `gacl_aco_sections_seq` ( + `id` int(11) NOT NULL default '0' +) ENGINE=MyISAM DEFAULT CHARSET=latin1; + +DROP TABLE IF EXISTS `gacl_aco_seq`; +CREATE TABLE `gacl_aco_seq` ( + `id` int(11) NOT NULL default '0' +) ENGINE=MyISAM DEFAULT CHARSET=latin1; + +DROP TABLE IF EXISTS `gacl_aro_groups_id_seq`; +CREATE TABLE `gacl_aro_groups_id_seq` ( + `id` int(11) NOT NULL default '0' +) ENGINE=MyISAM DEFAULT CHARSET=latin1; + +DROP TABLE IF EXISTS `gacl_aro_sections_seq`; +CREATE TABLE `gacl_aro_sections_seq` ( + `id` int(11) NOT NULL default '0' +) ENGINE=MyISAM DEFAULT CHARSET=latin1; + +DROP TABLE IF EXISTS `gacl_aro_seq`; +CREATE TABLE `gacl_aro_seq` ( + `id` int(11) NOT NULL default '0' +) ENGINE=MyISAM DEFAULT CHARSET=latin1; + +DROP TABLE IF EXISTS `gacl_axo_groups_id_seq`; +CREATE TABLE `gacl_axo_groups_id_seq` ( + `id` int(11) NOT NULL default '0' +) ENGINE=MyISAM DEFAULT CHARSET=latin1; + +DROP TABLE IF EXISTS `gacl_axo_sections_seq`; +CREATE TABLE `gacl_axo_sections_seq` ( + `id` int(11) NOT NULL default '0' +) ENGINE=MyISAM DEFAULT CHARSET=latin1; + +DROP TABLE IF EXISTS `gacl_axo_seq`; +CREATE TABLE `gacl_axo_seq` ( + `id` int(11) NOT NULL default '0' +) ENGINE=MyISAM DEFAULT CHARSET=latin1; + + +DROP TABLE IF EXISTS `jobs_seq`; +CREATE TABLE `jobs_seq` ( + `id` int(11) NOT NULL default '0' +) ENGINE=MyISAM DEFAULT CHARSET=latin1; +DROP TABLE IF EXISTS `scripts_seq`; +CREATE TABLE `scripts_seq` ( + `id` int(11) NOT NULL default '0' +) ENGINE=MyISAM DEFAULT CHARSET=latin1; diff --git a/docs/scire2.sql b/docs/scire2.sql new file mode 100644 index 0000000..4d6251c --- /dev/null +++ b/docs/scire2.sql @@ -0,0 +1,47 @@ +use scire; + +INSERT INTO users (userid, username, password, email, phone, pager, real_name, comment) values (1, 'root','444mwGdhEKuO.', 'root@localhost.com', '', '', 'Root User', 'This is the comment for the root user.'); +INSERT INTO users (userid, username, password, email, phone, pager, real_name, comment) values (2, 'codeman','444mwGdhEKuO.', 'codeman@localhost.com', '', '', 'Preston Cody', 'Project lead and developer.'); + +INSERT INTO client_status (statusid, statusname) values (1, 'Pending'); +INSERT INTO client_status (statusid, statusname) values (2, 'Active'); +INSERT INTO client_status (statusid, statusname) values (3, 'Inactive'); +INSERT INTO client_status (statusid, statusname) values (4, 'Rejected'); +INSERT INTO client_status (statusid, statusname) values (5, 'Retired'); + +INSERT INTO jobs_status (statusid, statusname) values (1, 'Pending'); +INSERT INTO jobs_status (statusid, statusname) values (2, 'Downloaded'); +INSERT INTO jobs_status (statusid, statusname) values (3, 'Running'); +INSERT INTO jobs_status (statusid, statusname) values (4, 'Failed'); +INSERT INTO jobs_status (statusid, statusname) values (5, 'Finished'); +INSERT INTO jobs_status (statusid, statusname) values (6, 'Cancelled'); + +INSERT INTO `permissions` VALUES (0,'View Users','Able to list the users',1,'2007-03-26 01:29:28','Default'),(23,'Test Permission 1','this is only a test.',1,'2007-03-26 02:20:40','Default'),(24,'Add ClientGroup','In the clients section, lets you add a group of clients.',2,'2007-04-01 17:03:11','Default'),(25,'Edit ClientGroup','Allows editing of the name and parent of a clientgroup.',2,'2007-04-01 17:07:32','Default'),(26,'Delete ClientGroup','deleting of a clientgroup. clients within move to parent.',2,'2007-04-01 17:08:39','Default'),(27,'Assign Permission','allows assigning permissions of users to clients. This is a very important permission!',2,'2007-04-01 17:52:25','Default'),(28,'View Permissions','see the list of active permissions.',2,'2007-04-01 17:53:17','Default'),(29,'Edit Client','edit client information.',2,'2007-04-01 18:10:02','Default'),(30,'Delete Client','remove a client.',2,'2007-04-01 18:10:21','Default'),(31,'Change User Pass/Name','If set, the ability to change a user\'s password will be enabled.',1,'2007-04-01 21:16:08','Default'),(32,'Add UserGroup','allows creation of usergroups.',1,'2007-04-01 23:18:59','Default'); + +INSERT INTO `scripts` VALUES (100,'Gentoo Update Script','This script will run emerge sync and emerge -u world, logging the results.','','#!/bin/bash \n emerge sync \n emerge -u world','/var/log/scire/updatelog.txt','0','root',5,1,'','',0),(101,'Gentoo Install Package Script','This script will run emerge on a given package and log the results.','','#!/bin/bash\nemerge --nocolor --nospinner --quiet -u world','/var/log/scire/installlog.txt','0','root',2,1,'','',0),(102,'Gentoo Uninstall Package Script','This script will run emerge unmerge on a given package and log the results.','','#!/bin/bash \n emerge unmerge','/var/log/scire/uninstalllog.txt','0','root',2,1,'','',0),(103,'Gentoo Rollback Script','This script will roll back a given package to its previous version, logging the results.','','#!/bin/bash \n emerge -C && emerge ','/var/log/scire/rollbacklog.txt','0','root',1,1,'','',0),(104,'Gentoo PackageList Script','This script will return a list of packages installed on the system and the current version of those packages.','','#!/bin/bash \n %%tag1%% %%tag2%%','/var/log/scire/packagelistlog.txt','0','nobody',8,1,'','',0),(105,'install_vim','This will emerge vim for gentoo','Embedded','#!/bin/bash\r\nemerge vim\r\n ','','0','root',1,0,'Embedded','',0),(106,'install ufed','this installs ufed, a stupid little prog that helps with USE flags','Embedded','#!/bin/bash\r\nemerge ufed','','0','root',1,0,'Embedded','',0),(107,'get package list','lists all installed gentoo packages and their versions. stores this info in the DB', 'Embedded', '#!/bin/bash\r\nfind /var/db/pkg -mindepth 2 -maxdepth 2 -type d | sed \'s:^/var/db/pkg/::;s:-\([0-9.]\+.*$\,0):|\1:\'','','0','nobody',5,0,'get_package_list','',0); + +INSERT INTO os (osid, osname, update_script, install_script, uninstall_script, rollback_script, packagelist_script) values (1,'Gentoo Linux',100 ,101 ,102 ,103, 104 ); + +INSERT INTO GLI_profiles (profileid, profile_name, location, description) values (1, 'printerserver', '/scire/gli_profiles/printerserver.xml', 'A typical printer server install profile. has like cups and shit.'); +INSERT INTO GLI_profiles (profileid, profile_name, location, description) values (2, 'mta', '/scire/gli_profiles/mta.xml', 'A typical MTA install profile. has like very little except mailers.'); + +INSERT INTO `clients` VALUES (3,'ASSET02','sampledigest','testclient','00:01:02:03:04:0A','1.2.3.4',1,1,2,2,'0000-00-00 00:00:00'),(5,'ASSET05','testdigest','testclient2','00:01:02:03:04:05','192.168.1.11',1,1,2,1,'0000-00-00 00:00:00'); + +INSERT INTO jobs (jobid, priority, created, creator, permission, script, description, pending, failed) values (1, 1, NOW(), 2, 1, 100, 'Upgrading a package on mtalead', 1,0); +INSERT INTO jobs_clients (jobid, clientid) values (1, 3); +INSERT INTO job_conditions (jobid, job_dependency, run_schedule, validity_period) values (1, 0, '*/15 * * * *', 4); +INSERT INTO jobs_seq VALUES (10); +INSERT INTO scripts_seq VALUES (10); + + +INSERT INTO settings (userid, setting_name, setting_value) values (1, 'start_page', 'users.php'); +INSERT INTO settings (userid, setting_name, setting_value) values (1, 'theme', 'light_blue'); +INSERT INTO settings (userid, setting_name, setting_value) values (2, 'clients_page_fields', 'hostname,ip,profile_name,osname,username,installtime,status'); + + +#INSERT INTO jobs values (2, 1, 'Install Packages', 5, 'emerge cups', NOW(), NOW(), NOW(), NOW(), 3, 'root', 'Adding cups'); +#INSERT INTO jobs values (3, 2, 'Install Packages', 6, 'emerge cups', NOW(), NOW(), NOW(), NOW(), 4, 'root', 'Adding cups'); +#INSERT INTO jobs values (4, 3, 'Update', 2, 'glsa-check', NOW(), NOW(), NOW(), NOW(), 3, 'root', 'Security Update'); +#INSERT INTO jobs values (5, 3, 'Install Packages', 5, 'emerge postfix', NOW(), NOW(), NOW(), NOW(), 1, 'root', 'Adding postfix, cause its an mta duh.'); +#INSERT INTO modules values (1,'Quickstart','Quickstart Installation Mangement Daemon','Description goes here and all that good stuff.','quickstart/index.php','Preston Cody','gentoo','deployment','http://www.gentoo.org/proj/en/releng/gli/'); +#INSERT INTO modules values (2,'Exporter','Server Information Exporter','This is a utility that will take selected data from the central server about machines and export it into an XML format.','Exporter/index.php','Preston Cody',NULL,'information','http://www.gentoo.org/proj/en/releng/gli/'); diff --git a/docs/scire3.sql b/docs/scire3.sql new file mode 100644 index 0000000..0f2007b --- /dev/null +++ b/docs/scire3.sql @@ -0,0 +1,20 @@ +drop table if exists user_pref; +create table user_pref ( +user_id INT NOT NULL, +jobs_layout VARCHAR(250), +jobs_fields VARCHAR(250), +PRIMARY KEY (user_id) +) Type=MyISAM; +--example. user_id = 1234 +-- jobs_layout = csv of field_ids = "5,7,8,1,2,55,24" +-- jobs_fields = csv of sort order+direction. 0 = not sorted. = "0a,0a,1d,3a,2d,0a,0a" + +drop table if exists jobs_fields; +create table jobs_fields ( +field_id INT NOT NULL, +field_name VARCHAR(50), +field_desc VARCHAR(200), +PRIMARY KEY (field_id) +) Type=MyISAM; +--example (5, "Priority", "Shows the priority of the job.") + diff --git a/docs/scire4.sql b/docs/scire4.sql new file mode 100644 index 0000000..36c3a4c --- /dev/null +++ b/docs/scire4.sql @@ -0,0 +1,7 @@ +DROP TABLE IF EXISTS `sessions`; +CREATE TABLE `sessions` ( + `sessionid` varchar(255) character set utf8 collate utf8_bin NOT NULL default '', + `expiration` int(10) unsigned NOT NULL default '0', + `data` text, + PRIMARY KEY (`sessionid`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 diff --git a/docs/scire_client_backend_details.txt b/docs/scire_client_backend_details.txt new file mode 100644 index 0000000..428d564 --- /dev/null +++ b/docs/scire_client_backend_details.txt @@ -0,0 +1,27 @@ +The client program will be made as simple as possible, keeping the duplication +of code to a minimum while allowing full functional control of the client +machine. The RPC calls that the client program will make will need to be +locked with a semaphore because the program will have multiple processes. The +client program can be run in two modes, daemon and normal. In daemon mode, the +client will start the XMLRPC server and keep it active indefinitatly. This +mode will accept poll_now requests from the scire server. In normal mode, +there will be a process of steps that will execute and then the program will +end. + +The program will fork off a subprocess to handle polling and downloading of +jobs. This process will register and make an RPC call to the scire server +asking for jobs. If the scire server replies with jobs it will download the +XML file and save it in the queue. When done downloading all jobs, the +polling process will sleep for the interval of the poll_interval variable. +After that time if the main process is not currently making an RPC call, and +the client program is still running, it will poll the scire server again for +jobs. This procedure will continue as long as the program is running. + +The main thread will stat the queue directory after forking the polling +subprocess. It will look in sorted order at the queue and if it finds a job it +will take the highest priority, oldest job first. When the job is complete it +will send an RPC call (or wait until it is able to) to the scire server +updating the status of the job, and then stat the queue directory again and +execute the next job (if there is one). In normal mode it will continue in +this process until at least one poll/download has completed and there are no +remaining jobs and then quit. In daemon mode it will continue until stopped. diff --git a/docs/scire_server_backend_details.txt b/docs/scire_server_backend_details.txt new file mode 100644 index 0000000..0bcdbc8 --- /dev/null +++ b/docs/scire_server_backend_details.txt @@ -0,0 +1,45 @@ +Scire Server Backend Design Details: + +Single points of failure: +Database. workaround: db replication +one server daemon. workaround: run multiple server daemons connecting to the +same databse. The configuration scripts will be made to handle failing over +from a primary server daemon to an alternate. + +On startup, the server will need to check and deal with the possibility that +it needs to recover from failure. This could include making a query to check +for jobs that are to be sent to client programs running in daemon mode. +This could also include checking for jobs that were sent but did not return a +response saying they were received. + +After recovery procedures, the server program will start the XMLRPC server +(over a secure socket of course), register itself to the network, and await +connections. + +If a client program is configured to run in daemon mode (which is not +advised), and a job is "pushed" to a client, this is done by sending a small +RPC to the client program demanding that it ask for work immediately rather +than on its normal schedule. + +Clients will be able to register/connect to the XMLRPC server for many +purposes. Most will be to either ask for work or to report the status of a +job that was sent to a client. + +Asking for work: +When a client program registers and makes a connection to the server, it will +fork a thread on the server program for that client. Max-threads will be +define-able if necessary. Inside the thread, a query will be made to the +database to find jobs waiting to be sent to that client. All pending jobs +will be then checked against the ACL for the correct permissions. If the +check fails, update the status in the database and log accordingly. If the +check passes, reply to the client RPC by creating an XML job file on the fly +from the contents of the database row. Await a reply from the client that it +received this job and is waiting for more jobs. Send more jobs accordingly. +If the client does not reply saying it receives a message, ??? + +Updating the status of a job: +Don't know about threads here. May not be necessary. The client will connect +and state the job id# and the status of that job in an XML file. The server +program will parse and process the contents and update the database. The +server program will then reply to the client acknowledging the receipt of the +status message. diff --git a/docs/screenshots/cron.jpg b/docs/screenshots/cron.jpg Binary files differnew file mode 100644 index 0000000..06261ee --- /dev/null +++ b/docs/screenshots/cron.jpg diff --git a/docs/screenshots/edit_user.png b/docs/screenshots/edit_user.png Binary files differnew file mode 100644 index 0000000..fddac41 --- /dev/null +++ b/docs/screenshots/edit_user.png diff --git a/docs/screenshots/edit_user2.png b/docs/screenshots/edit_user2.png Binary files differnew file mode 100644 index 0000000..d0507d8 --- /dev/null +++ b/docs/screenshots/edit_user2.png diff --git a/docs/screenshots/login.png b/docs/screenshots/login.png Binary files differnew file mode 100644 index 0000000..df154ff --- /dev/null +++ b/docs/screenshots/login.png diff --git a/docs/screenshots/user_addgroup.png b/docs/screenshots/user_addgroup.png Binary files differnew file mode 100644 index 0000000..3d3cbf9 --- /dev/null +++ b/docs/screenshots/user_addgroup.png diff --git a/docs/screenshots/user_assign_permission.png b/docs/screenshots/user_assign_permission.png Binary files differnew file mode 100644 index 0000000..f11d8c1 --- /dev/null +++ b/docs/screenshots/user_assign_permission.png diff --git a/docs/screenshots/users.png b/docs/screenshots/users.png Binary files differnew file mode 100644 index 0000000..f377636 --- /dev/null +++ b/docs/screenshots/users.png diff --git a/docs/screenshots/users_groups.png b/docs/screenshots/users_groups.png Binary files differnew file mode 100644 index 0000000..3f912d7 --- /dev/null +++ b/docs/screenshots/users_groups.png diff --git a/docs/screenshots/usertour/Users.png b/docs/screenshots/usertour/Users.png Binary files differnew file mode 100644 index 0000000..6ebf6d9 --- /dev/null +++ b/docs/screenshots/usertour/Users.png diff --git a/docs/screenshots/usertour/clients.png b/docs/screenshots/usertour/clients.png Binary files differnew file mode 100644 index 0000000..5d0779f --- /dev/null +++ b/docs/screenshots/usertour/clients.png diff --git a/docs/screenshots/usertour/clients2.png b/docs/screenshots/usertour/clients2.png Binary files differnew file mode 100644 index 0000000..2b9530d --- /dev/null +++ b/docs/screenshots/usertour/clients2.png diff --git a/docs/screenshots/usertour/clients_pending.png b/docs/screenshots/usertour/clients_pending.png Binary files differnew file mode 100644 index 0000000..677bc08 --- /dev/null +++ b/docs/screenshots/usertour/clients_pending.png diff --git a/docs/screenshots/usertour/clients_permissions.png b/docs/screenshots/usertour/clients_permissions.png Binary files differnew file mode 100644 index 0000000..79cd75c --- /dev/null +++ b/docs/screenshots/usertour/clients_permissions.png diff --git a/docs/screenshots/usertour/delete_user.png b/docs/screenshots/usertour/delete_user.png Binary files differnew file mode 100644 index 0000000..3e5bce9 --- /dev/null +++ b/docs/screenshots/usertour/delete_user.png diff --git a/docs/screenshots/usertour/edit_user.png b/docs/screenshots/usertour/edit_user.png Binary files differnew file mode 100644 index 0000000..8dc6d05 --- /dev/null +++ b/docs/screenshots/usertour/edit_user.png diff --git a/docs/screenshots/usertour/login.png b/docs/screenshots/usertour/login.png Binary files differnew file mode 100644 index 0000000..21104ce --- /dev/null +++ b/docs/screenshots/usertour/login.png diff --git a/docs/screenshots/usertour/settings.png b/docs/screenshots/usertour/settings.png Binary files differnew file mode 100644 index 0000000..da004d0 --- /dev/null +++ b/docs/screenshots/usertour/settings.png diff --git a/docs/screenshots/usertour/settings1.png b/docs/screenshots/usertour/settings1.png Binary files differnew file mode 100644 index 0000000..e6b6dd1 --- /dev/null +++ b/docs/screenshots/usertour/settings1.png diff --git a/docs/screenshots/usertour/settings_clients.png b/docs/screenshots/usertour/settings_clients.png Binary files differnew file mode 100644 index 0000000..187a0c0 --- /dev/null +++ b/docs/screenshots/usertour/settings_clients.png diff --git a/docs/screenshots/usertour/ui_perms.png b/docs/screenshots/usertour/ui_perms.png Binary files differnew file mode 100644 index 0000000..37cd2c0 --- /dev/null +++ b/docs/screenshots/usertour/ui_perms.png diff --git a/docs/screenshots/usertour/ui_perms_addperm.png b/docs/screenshots/usertour/ui_perms_addperm.png Binary files differnew file mode 100644 index 0000000..92e2b77 --- /dev/null +++ b/docs/screenshots/usertour/ui_perms_addperm.png diff --git a/docs/screenshots/usertour/user_addgroup.png b/docs/screenshots/usertour/user_addgroup.png Binary files differnew file mode 100644 index 0000000..6aa2e5e --- /dev/null +++ b/docs/screenshots/usertour/user_addgroup.png diff --git a/docs/screenshots/usertour/user_assign_permission.png b/docs/screenshots/usertour/user_assign_permission.png Binary files differnew file mode 100644 index 0000000..0495c19 --- /dev/null +++ b/docs/screenshots/usertour/user_assign_permission.png diff --git a/docs/screenshots/usertour/users_addgroup.png b/docs/screenshots/usertour/users_addgroup.png Binary files differnew file mode 100644 index 0000000..6ef30cc --- /dev/null +++ b/docs/screenshots/usertour/users_addgroup.png diff --git a/docs/screenshots/usertour/users_editgroup.png b/docs/screenshots/usertour/users_editgroup.png Binary files differnew file mode 100644 index 0000000..718314f --- /dev/null +++ b/docs/screenshots/usertour/users_editgroup.png diff --git a/docs/screenshots/usertour/users_groups.png b/docs/screenshots/usertour/users_groups.png Binary files differnew file mode 100644 index 0000000..1d51cab --- /dev/null +++ b/docs/screenshots/usertour/users_groups.png diff --git a/docs/screenshots/usertour/users_groups2.png b/docs/screenshots/usertour/users_groups2.png Binary files differnew file mode 100644 index 0000000..b72f6a9 --- /dev/null +++ b/docs/screenshots/usertour/users_groups2.png diff --git a/docs/screenshots/usertour/users_permissions.png b/docs/screenshots/usertour/users_permissions.png Binary files differnew file mode 100644 index 0000000..2d31129 --- /dev/null +++ b/docs/screenshots/usertour/users_permissions.png diff --git a/docs/server_be_job_transfer.txt b/docs/server_be_job_transfer.txt new file mode 100755 index 0000000..cebe361 --- /dev/null +++ b/docs/server_be_job_transfer.txt @@ -0,0 +1,29 @@ +make DB connection
+
+Validate client_id and token.
+Client will also send a list of job_id's it already has. store as ids_client_already_has.
+
+query = "SELECT * FROM jobs WHERE client_id="+client_id+" and status='pending' ORDER BY priority"
+foreach row in results:
+ if job_id in ids_client_already_has: continue
+ Serialize job. keep in memory. as jobs[job_id]
+ write job to disk as XML. md5 it. store in memory as md5s[job_id]
+ push job_id onto list of jobs_to_send.
+
+while jobs_to_send:
+ pop current_job from jobs_to_send
+ send jobs[current_job]
+ send md5s[current_job]
+ wait a bit for a response... if timeout, push current_job back onto jobs_to_send.
+ if response == "BadMD5":
+ log event to error log.
+ push current_job onto jobs_to_send
+ # job will get resent the next time around.
+ # moves to bottom of queue incase it is a recurring problem
+ # so it doesn't hold up all the other jobs?
+ # this is OK because it will be resorted by priority on the client's end.
+ if response == "OK":
+ query = "UPDATE jobs SET status='received' WHERE job_id="+current_job
+ continue #move onto next job. This is in the client's hands now.
+
+close DB connection.
\ No newline at end of file diff --git a/scire/.lib/DB.php b/scire/.lib/DB.php new file mode 100644 index 0000000..1cbdd24 --- /dev/null +++ b/scire/.lib/DB.php @@ -0,0 +1,232 @@ +<?php + +require_once($ADOdb_path . 'adodb-exceptions.inc.php'); +require_once($ADOdb_path . 'adodb.inc.php'); + +class DB { + private $dbi; + private $error; + + + ####################################################################### + function __construct($db_host, $db_username, $db_password, $db_name, $db_type) { + + + try { + $dbi = NewADOConnection($db_type); + $dbi->Connect($db_host, $db_username, $db_password, $db_name); + $dbi->SetFetchMode(ADODB_FETCH_ASSOC); + } catch (exception $e) { + print_r($e); + } + $this->dbi = $dbi; + } + + ####################################################################### + function __get($name) { + switch ($name) { + case 'error': + return $this->error; + break; + default: + return false; + break; + } + } + + ####################################################################### + function __set($name, $value) { + return false; + } + + function __isset($name) { + switch ($name) { + case 'error': + if ($this->error && strlen($this->error) > 0) { + return true; + } + break; + default: + return false; + break; + } + } + + ####################################################################### + function __unset($name) { + return false; + } + + # $table = 'table1' OR array('table1', 'table2') + # $select = '*' OR 'column1' OR array('column1', 'column2') + # $query = 'SELECT * FROM table WHERE column = \'value\' OR column = (SELECT * FROM table2 WHERE column = \'value\')' + # $set = array('setcolumn' => 'value') + # $update = array('updatecolumn' => 'value') + # $where = '`matchcolumn` = \'criteria\'' + # insert($table, $set) + # update($table, $update) + # update($table, $update, $where) + # delete($table, $where) + # select($select, $table) + # select($select, $table, $where) + # select($query) + + ####################################################################### + function __call($method, $args) { + $dbi = $this->dbi; + #print "DEBUG: $method <BR>"; + #print_r($args); + + switch ($method) { + case 'insert': + try { + $result = $dbi->AutoExecute($args[0], $args[1], 'INSERT'); + } catch (exception $e) { + print_r($e); + } + if (!$result) { + print $dbi->ErrorMsg(); + return false; + } else { + return $result; + } + break; + case 'update': + try { + $result = $dbi->AutoExecute($args[0], $args[1], 'UPDATE', $args[2] ); + } catch (exception $e) { + print_r($e); + } + if (!$result) { + print $dbi->ErrorMsg(); + return false; + } else { + return $result; + } + break; + + break; + case 'delete': + if ($args && count($args) == 2) { + $query = strtoupper($method); + $query .= ' FROM `' . $args[0] . '`'; + $query .= ' WHERE ' . $args[1]; + #print $query . "<BR>"; #for debugging. + try { + # $sql = $dbi->Prepare($query); + $recordSet = $dbi->Execute($query); + } catch (exception $e) { + print_r($e); + } + if (!$recordSet) { + print $dbi->ErrorMsg(); + return false; + } else { + return $recordSet->RecordCount(); + } + } else { + return false; + } + break; + case 'select': + if ($args && (count($args) >= 1 && count($args) <= 3)) { + if (count($args) == 1) { + $query = $args[0]; + } else { + $query = strtoupper($method); + if (is_array($args[0])) { + foreach ($args[0] as $value) { + $query .= ' ' . $value . ', '; + } + } else { + $query .= '*'; + } + $query = preg_replace('/, $/', '', $query); + $query .= ' FROM ' . $args[1] ; + if (count($args) == 3) { + $query .= ' WHERE ' . $args[2]; + } + } + #print $query; #for debugging. + try { + $sql = $dbi->Prepare($query); + $recordSet = $dbi->Execute($sql); + } catch (exception $e) { + print_r($e); + } + if (!$recordSet) { + print $dbi->ErrorMsg(); + return false; + } else { + $rows = array(); + while (!$recordSet->EOF) { + $rows[] = $recordSet->fields; + $recordSet->MoveNext(); + } + $recordSet->Close(); # optional + #print_r($rows); + return $rows; + } + + } else { + return false; + } + break; + + case 'query': + if (count($args) > 2) { + return false; + } + + $query = $args[0]; + #print $query . "<BR>"; #for debugging. + try { + $sql = $dbi->Prepare($query); + if (count($args) == 2) { + $recordSet = $dbi->Execute($sql,$args[1]); + } else { + $recordSet = $dbi->Execute($sql); + } + } catch (exception $e) { + print_r($e); + } + if (!$recordSet) { + print $dbi->ErrorMsg(); + return false; + } else { + $rows = array(); + while (!$recordSet->EOF) { + #print_r($recordSet->fields); + $rows[] = $recordSet->fields; + $recordSet->MoveNext(); + } + $recordSet->Close(); # optional + return $rows; + } + break; + + case 'get_next_id': + if (!$args[0]) { + return false; + } + try { + $id = $dbi->GenID($args[0],10); #Generate an ID for the table, start at 10 if not defined yet. + } catch (exception $e) { + print_r($e); + } + return $id; + case 'now': + try { + $time = $dbi->DBDate(time()); + } catch (exception $e) { + print_r($e); + } + default: + $this->error = 'unknown method'; + return false; + break; + } + } +} + +?> diff --git a/scire/.lib/DB_functions.php b/scire/.lib/DB_functions.php new file mode 100755 index 0000000..1278552 --- /dev/null +++ b/scire/.lib/DB_functions.php @@ -0,0 +1,541 @@ +<?php + +function get_scire_modules() { + global $db; + $result = $db->select('*', 'modules'); + if ($result && count($result) > 0) { + return $result; + } else { + return array(); + } +} + +function get_scire_module_list() { + global $db; + $result = $db->select(array('main_content', 'name'), 'modules'); + if ($result && count($result) > 0) { + return $result; + } else { + return array(); + } +} + +function get_profile_list() { + global $db; + $result = $db->select('profile_name', 'GLI_profiles'); + if ($result && count($result) > 0) { + return $result; + } else { + return array(); + } +} + +function get_group_clients($group) { + global $db; + $result = $db->select('*', 'clients', '`gli_profile` = \'' . $group . '\''); + if ($result && count($result) > 0) { + return $result; + } else { + return array(); + } +} + +function get_scire_clients($orderby, $direction, $status='Active') { + global $db; + if ($status == "All") { + $where = ""; #Don't filter on status. + } elseif ($status) { + $where = " WHERE cs.statusname='$status' "; + } else { + $where = " WHERE cs.statusname='Active' "; + } + if ($orderby) { + $where .= "ORDER BY `$orderby` $direction"; + } else { + $where .= ''; + } + $result = $db->select('SELECT c.clientid, c.assetid, c.digest, c.hostname, c.mac, c.ip, cs.statusname as status, c.installtime, p.profile_name, o.osname, u.username FROM clients AS c LEFT JOIN GLI_profiles AS p ON (c.gli_profile=p.profileid) LEFT JOIN os AS o ON (c.osid=o.osid) LEFT JOIN users AS u ON (c.contact=u.userid) LEFT JOIN client_status AS cs ON (c.status=cs.statusid) '.$where); + if ($result && count($result) > 0) { + return $result; + } else { + return array(); + } +} + +function get_scire_client($clientid) { + global $db; + $result = $db->select('*', 'clients', '`clientid` = \'' . $clientid . '\''); + if ($result && count($result) > 0) { + return $result[0]; + } else { + return false; + } +} + +function get_client_statuses() { + global $db; + $result = $db->select('*', 'client_status'); + if ($result && count($result) > 0) { + return $result; + } else { + return array(); + } +} + +function scire_add_client($clientid, $digest, $hostname, $mac, $ip, $profileid, $osid, $contact, $status, $installtime, $assetid) { +#clientid, assetid, digest, cert, hostname, mac, ip, gli_profile, osid, status, contact, installtime + if (!$installtime) {$installtime = $db->now(); } + global $db; + #we need to add the client to the axo table first and then to the clients + $result = $db->insert('clients', array('clientid' => $clientid, 'digest' => $digest, 'hostname' => $hostname, 'mac' => $mac, 'ip' => $ip, 'gli_profile' => $profileid, 'osid' => $osid, 'contact' => $contact, 'status' => $status, 'installtime' => $installtime, 'assetid' => $assetid)); + if ($result) { + return true; + } else { + return $db->error; + } +} + +function scire_edit_client($clientid, $fields) { + global $db; + if (isset($fields['status'])) { + $res = $db->select(array('statusid'), 'client_status', '`statusname` = \'' . $fields['status'] . '\''); + var_dump($res); + if ($res && count($res)>0) + $fields['status'] = $res[0]['statusid']; + else + unset($fields['status']); + } + $result = $db->update('clients', $fields, "`clientid` = $clientid"); + if ($result) { + return true; + } else { + return $db->error; + } +} + +function scire_del_client($client_id) { + global $db; + $result = $db->delete('clients', "`clientid` = $client_id"); + if ($result) { + return true; + } else { + return $db->error; + } +} + +function get_scire_users($orderby, $direction) { + #we don't want to store the password for security reasons. <- ??? + global $db; + if ($orderby) { + $where = "1 ORDER BY `$orderby` $direction"; + } else { + $where = '1'; + } + $result = $db->select(array('userid', 'username', 'comment', 'real_name'), 'users', $where); + if ($result && count($result) > 0) { + return $result; + } else { + return array(); + } +} + +function get_scire_user($userid) { + global $db; + $result = $db->select('*', 'users', '`userid` = ' . $userid . ''); + if ($result && count($result) > 0) { + return $result[0]; + } else { + return false; + } +} + +function scire_add_user($userid, $username, $password, $real_name, $comment, $email, $phone, $pager) { + global $db; + $result = $db->insert('users', array('userid' => $userid, 'username' => $username, 'password' => crypt($password, 447470567), 'comment' => $comment, 'real_name' => $real_name, 'email' => $email, 'phone' => $phone, 'pager' => $pager)); + if ($result) { + return true; + } else { + return $db->error; + } +} + +function scire_edit_user($userid, $fields) { + global $db; + $result = $db->update('users', $fields, '`userid` = \'' . $userid . '\''); + if ($result) { + return true; + } else { + return $db->error; + } +} + +function scire_del_user($userid) { + global $db; + $result = $db->delete('users', '`userid` = \'' . $userid . '\''); + if ($result) { + return true; + } else { + return $db->error; + } +} + +function scire_add_permission($permid, $perm_name, $desc, $created_by) { + global $db; + $result = $db->insert('permissions', array('permid' => $permid, 'name' => $perm_name, 'description' => $desc, 'creator' => $created_by)); + if ($result) { + return true; + } else { + return $db->error; + } +} + +function scire_edit_permission($perm_name, $desc) { + global $db; + $result = $db->update('permissions', array('description' => $desc), '`perm_name` = \'' . $perm_name . '\''); + if ($result) { + return true; + } else { + return $db->error; + } +} + +function scire_del_permission($perm_name) { + global $db; + $result = $db->delete('permissions', '`perm_name` = \'' . $perm_name . '\''); + if ($result) { + return true; + } else { + return $db->error; + } +} + +function get_scire_permissions() { + global $db; + $result = $db->select('*', 'permissions'); + if ($result && count($result) > 0) { + return $result; + } else { + return array(); + } +} + +function get_scire_permission_by_name($permname) { + global $db; + $result = $db->select('*', 'permissions', "`name` = '$permname'"); + if ($result && count($result) > 0) { + return $result[0]; + } else { + return false; + } + +} +function get_scire_ui_permissions() { + global $db; + $result = $db->select('*', 'permissions', "`permcategory` = 'scire_ui'"); + if ($result && count($result) > 0) { + return $result; + } else { + return array(); + } +} + +function get_scire_gli_profiles() { + global $db; + $result = $db->select(array('profile_name','profileid'), 'GLI_profiles'); + if ($result && count($result) > 0) { + return $result; + } else { + return array(); + } +} + +function get_scire_oss() { + global $db; + $result = $db->select(array('osname','osid'), 'os'); + if ($result && count($result) > 0) { + return $result; + } else { + return array(); + } +} + +function get_scire_script($scriptid) { + global $db; + $scriptid = (int) $scriptid; + $result = $db->select('*', 'scripts', "`scriptid` = $scriptid"); + if ($result && count($result) > 0) { + return $result[0]; + } else { + return false; + } +} + +function get_scire_scripts() { + global $db; + $result = $db->select('*', 'scripts'); + if ($result && count($result) > 0) { + return $result; + } else { + return array(); + } +} + +function get_scire_settings($userid) { + global $db; + $result = $db->select('*', 'settings', "`userid` = $userid"); + if ($result && count($result) > 0) { + $result2 = array(); + foreach($result as $row) { + $result2[$row['setting_name']] = $row['setting_value']; + } + return $result2; + } else { + return array(); + } +} + +function scire_set_setting($userid, $name, $value) { + global $db; + $result = $db->update('settings',array('setting_value' => $value), "`userid` = '$userid' AND `setting_name`='$name'"); + if ($result) { + return true; + } else { + return $db->error; + } +} + +function scire_add_setting($userid, $name, $value) { + global $db; + $result = $db->insert('settings',array('userid' => $userid, 'setting_name' => $name, 'setting_value' => $value )); + if ($result) { + return true; + } else { + return $db->error; + } +} + +function scire_approve_client($clientid) { + global $db; + $clientid = (int) $clientid; + $res = $db->select(array('statusid'), 'client_status', '`statusname` = \'Active\''); + + if ($clientid) { + $result = $db->update('clients',array('status' => $res[0]['statusid']), "`clientid` = '$clientid'"); + if ($result) { + return true; + } else { + return $db->error; + } + } else { + return false; + } +} + +function scire_reject_client($clientid) { + global $db; + if (int($clientid) != $clientid) {return false;} + $res = $db->select(array('statusid'), 'client_status', '`statusname` = \'Rejected\''); + + $result = $db->update('clients',array('status' => $res[0]['statusid']), "`clientid` = '$clientid'"); + if ($result) { + return true; + } else { + return $db->error; + } +} + +function scire_add_job($script, $priority, $creator, $permission, $description, $pending, $clients, $clientgroups, $job_dependency, $run_schedule, $validity_period) { + global $db; + #First make the job id + $jobid = $db->get_next_id('jobs_seq'); + print "Got a Job ID, it is $jobid <br>"; + $result = $db->insert('jobs', array('jobid' => $jobid, 'script' => $script, 'priority' => $priority, 'created' => $db->now(), 'creator' => $creator, 'permission' => $permission, 'description' => $description, 'pending' => $pending )); + if (!$result) { + return $db->error; + } + + if ($run_schedule != "") { + print "Run schedule is $run_schedule<br>"; + $cron = new CronParser($run_schedule); + $nextRun = $cron->calculateNextRun(); + var_dump($nextRun); + $nextRun = mktime( $nextRun[1], $nextRun[0], 0, $nextRun[3], $nextRun[2], $nextRun[4] ); + $expTime = $nextRun + ( $validity_period * 60); + $nextRun = strftime( '%Y-%m-%d %T', $nextRun ); + $expTime = strftime( '%Y-%m-%d %T', $expTime ); + } else { + $nextRun = strftime( '%Y-%m-%d %T', time()); + $expTime = ""; + } + # Add conditions + $result = $db->insert('job_conditions', array('jobid' => $jobid, 'job_dependency' => $job_dependency, 'run_schedule' => $run_schedule, 'deploy_time' => $nextRun, 'expiration_time' => $expTime, 'validity_period' => $validity_period)); + if (!$result) { + return $db->error; + } + + # Add history entry only if the job is assigned to a specific + # client. Managing groups require a different approach + #Now add the clients. + $status = get_statusid('Pending'); + if ($clients) { + foreach ($clients as $client) { + $result = $db->insert('job_history', array('jobid' => $jobid, 'clientid' => $client, + 'statusid' => $status, + 'eventmsg' => 'Job created')); + if (!$result) { + return $db->error; + } + $result = $db->insert('jobs_clients', array('jobid' => $jobid, 'clientid' => $client)); + if (!$result) { + return $db->error; + } + if ($run_schedule != "") { + $result = $db->insert('recurring_jobs_clients', array('jobid' => $jobid, 'clientid' => $client)); + if (!$result) { + return $db->error; + } + } + } + } + + if ($clientgroups) { + foreach ($clientgroups as $cgroup) { + $result = $db->insert('jobs_clients', array('jobid' => $jobid, 'groupid' => $cgroup)); + if (!$result) { + return $db->error; + } + if ($run_schedule != "") { + $result = $db->insert('recurring_jobs_clients', array('jobid' => $jobid, 'groupid' => $cgroup)); + if (!$result) { + return $db->error; + } + } + } + } + return 0; #Success +} + +function get_scire_jobs($orderby, $direction, $status='Pending') { + global $db; + + if ($status == "All") { + $where = ""; #Don't filter on pending status. + } elseif ($status == "Pending") { + $where = " AND j.pending > 0 "; + } else { + $where = " "; + } + if ($orderby) { + $where .= " ORDER BY `$orderby` $direction"; + } else { + $where .= ''; + } + + $result = $db->select('SELECT j.*,jc.groupid,c.hostname,s.name as scriptname, u.username, p.name as permname '. + 'FROM jobs AS j '. + 'JOIN jobs_clients AS jc ON (j.jobid=jc.jobid) '. + 'JOIN clients AS c ON (jc.clientid=c.clientid) '. + 'LEFT JOIN scripts AS s ON (j.script=s.scriptid) '. + 'JOIN users AS u ON (j.creator=u.userid) '. + 'LEFT JOIN permissions AS p ON (j.permission=p.permid) '. + ' '.$where); + if ($result && count($result) > 0) { + return $result; + } else { + return array(); + } +} + +function get_scire_job($jobid) { + global $db; + # Falta el job history y el job clients + $result = $db->select('SELECT j.jobid, j.priority, j.script, j.description, u.username as creator, p.name as permission, jc.validity_period, jc.run_schedule ' . + 'FROM jobs AS j '. + 'JOIN users AS u ON (j.creator=u.userid) '. + 'LEFT JOIN job_conditions AS jc ON (j.jobid=jc.jobid) '. + 'LEFT JOIN permissions AS p ON (j.permission=p.permid) '. + ' WHERE j.jobid=\'' . (int) $jobid . '\''); + if ($result && count($result) > 0) { + return $result[0]; + } else { + return false; + } +} + +function scire_edit_job($jobid, $fields) { + global $db; + $jobConditions = array(); + if (isset($fields["run_schedule"])) { + $jobConditions["run_schedule"] = $fields["run_schedule"]; + unset($fields["run_schedule"]); + } + if (isset($fields["validity_period"])) { + $jobConditions["validity_period"] = $fields["validity_period"]; + unset($fields["validity_period"]); + } + $result = $db->update('jobs', $fields, '`jobid` = \'' . $jobid . '\''); + + if (count($jobConditions) > 0) { + $result = $result && $db->update('job_conditions', $jobConditions, '`jobid` = \'' . $jobid . '\''); + } + + if ($result) { + return true; + } else { + return $db->error; + } +} + +function get_statusid($statusname) { + global $db; + $name = htmlentities($statusname); + $result = $db->select('SELECT statusid FROM jobs_status WHERE statusname = \'' . $name . '\''); + + if ($result) { + var_dump( $result[0]['statusid'] ); + + return $result[0]['statusid']; + } + else { + return $db->error; + } +} + +function scire_add_script($name, $desc, $location, $script_data, $log_location, $success_code, $run_as, $priority, $permission, $pp_location, $pp_script_data, $script_tags) { + global $db; + # First make the script ID + $scriptid = $db->get_next_id('scripts_seq'); + print "Got a Script ID, it is $scriptid<br>"; + + $result = $db->insert('scripts', array('scriptid' => $scriptid, 'name' => $name, 'description' => $desc, 'location' => $location, 'script_data' => $script_data, 'log_location' => $log_location, 'success_code' => $success_code, 'run_as' => $run_as, 'priority' => $priority, 'permission' => $permission, 'pp_location' => $pp_location, 'pp_script_data' => $pp_script_data )); + if (!$result) { + return $db->error; + } + + #Now add the tags. + if ($script_tags) { + foreach ($script_tags as $name => $value) { + $result = $db->insert('dyn_tags', array('scriptid' => $scriptid, 'tag' => $name, 'tag_value' => $value) ); + if (!$result) { + return $db->error; + } + } + } + + return 0; #Success +} + +function get_dyn_tag_value($scriptid,$tag) { + global $db; + $scriptid = (int) $scriptid; + $result = $db->select('tag_value', 'dyn_tags', "`scriptid` = $scriptid AND `tag` = '$tag'"); + if ($result && count($result) > 0) { + return $result[0]['tag_value']; + } else { + return false; + } +} + + + +?> diff --git a/scire/.lib/Session.php b/scire/.lib/Session.php new file mode 100644 index 0000000..af12d18 --- /dev/null +++ b/scire/.lib/Session.php @@ -0,0 +1,116 @@ +<?php + +class Session { + private $db; + private $table; + private $maxidle; + private $error; + function __construct($db, $table) { + $this->db = $db; + $this->table = $table; + session_set_save_handler(array(&$this, '_open'), array(&$this, '_close'), array(&$this, '_read'), array(&$this, '_write'), array(&$this, '_destroy'), array(&$this, '_gc')); + session_start(); + } + function __destruct() { + session_write_close(); + } + function __get($name) { + switch ($name) { + case 'error': + return $this->error; + break; + default: + return false; + break; + } + } + function __set($name, $value) { + return false; + } + function __isset($name) { + switch ($name) { + case 'error': + if ($this->error && strlen($this->error) > 0) { + return true; + } + break; + default: + return false; + break; + } + } + function __unset($name) { + return false; + } + function _open($savepath, $sname) { + #$this->maxidle = get_cfg_var('session.gc_maxlifetime'); + $this->maxidle = 3600; + } + function _close() { + $this->_gc($this->maxidle); + } + function _read($sid) { + $result = $this->db->select(array('data'), $this->table, '`sessionid` = \'' . $sid . '\' AND `expiration` > \'' . time() . '\''); + if ($result && (count($result) > 0 && array_key_exists('data', $result[0]))) { + return $result[0]['data']; + } else { + $this->error = $this->db->error; + return ''; + } + } + function _write($sid, $sdata) { + $expiration = time() + $this->maxidle; + $result = $this->db->query("INSERT INTO `".$this->table."` (`sessionid`,`expiration`, `data`) VALUES (?,?,?) ON DUPLICATE KEY UPDATE `expiration`=?, `data`=?", array($sid, $expiration, $sdata, $expiration, $sdata) ); + #$result = $this->db->insert($this->table, array('sessionid' => $sid, 'expiration' => $expiration, 'data' => $sdata), array('expiration' => $expiration, 'data' => $sdata)); + if ($result) { + return true; + } else { + $this->error = $this->db->error; + return false; + } + } + function _destroy($sid) { + $username = ''; + $result = $this->db->select(array('data'), $this->table, '`sessionid` = \'' . $sid . '\''); + if ($result && (count($result) > 0 && array_key_exists('data', $result[0]))) { + if (preg_match('/^.*username\|s:[0-9]+:"([^"]+)".*$/', $result[0]['data'], $matches)) { + $username = $matches[1]; + } + } + $result = $this->db->delete($this->table, '`sessionid` = \'' . $sid . '\''); + if ($result) { + if (strlen($username) > 0) { + $result = $this->db->delete($this->table, '`data` regexp \'^.*username\|s:[0-9]+:"' . $username . '".*$\''); + if ($result) { + return true; + } else { + $this->error = $this->db->error; + return false; + } + } else { + return true; + } + } else { + $this->error = $this->db->error; + return false; + } + } + function _gc($smaxidle) { + $result = $this->db->delete($this->table, '`expiration` < \'' . time() . '\''); + if ($result) { + return true; + } else { + $this->error = $this->db->error; + return false; + } + } + function destroy() { + $_SESSION = array(); + if (isset($_COOKIE[session_name()])) { + setcookie(session_name(), '', time()-420000, '/'); + } + session_destroy(); + } +} + +?> diff --git a/scire/.lib/common.php b/scire/.lib/common.php new file mode 100644 index 0000000..032597f --- /dev/null +++ b/scire/.lib/common.php @@ -0,0 +1,73 @@ +<?php + +$CONFIG_DIR='/etc/scire'; + +# 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_DIR.'/config.php'); + +# Functions +require_once('functions.php'); + +# Clean config +$basedir = normalize_path($basedir); +$baseurl = normalize_path($baseurl); +$smarty_dir = normalize_path($smarty_dir); + +# Smarty +require_once('smarty.php'); + +# Database class +require_once('DB.php'); +$db = new DB($db_host, $db_username, $db_password, $db_name, $db_type); +if (isset($db->error)) { + header('Content-type: text/html; charset=UTF-8'); + $smarty->assign('title', 'Database Error'); + $smarty->assign('message', $db->error); + $smarty->display('message.tpl'); + exit(0); +} + +# Database functions +require_once('DB_functions.php'); + +# Session class +require_once('Session.php'); +$session = new Session($db, $db_sessions_table); +if (isset($session->error)) { + header('Content-type: text/html; charset=UTF-8'); + $smarty->assign('title', 'Session Error'); + $smarty->assign('message', $session->error); + $smarty->display('message.tpl'); + exit(0); +} + +# ACL class +require_once('phpGACL.php'); + +# Check login +if (!isset($_SESSION['username'])) { + header('Location: ' . $baseurl . 'login.php?afterlogin=' . urlencode($_SERVER['REQUEST_URI'])); + exit(0); +} else { + $smarty->assign('userid', $_SESSION['userid']); + $smarty->assign('username', $_SESSION['username']); + $smarty->assign('useremail', $_SESSION['useremail']); + #Set Theme + $smarty->assign('theme', $_SESSION['settings']['theme']); +} + +?> diff --git a/scire/.lib/config.php.example b/scire/.lib/config.php.example new file mode 100644 index 0000000..f9b4674 --- /dev/null +++ b/scire/.lib/config.php.example @@ -0,0 +1,25 @@ +<?php + +# Base directory +$basedir = '/var/www/localhost/htdocs/scire/'; + +# Base URL +$baseurl = '/scire/'; + +# Database +$db_name = 'scire'; +$db_host = 'localhost'; +$db_username = 'USERNAME GOES HERE'; +$db_password = 'PASSWORD GOES HERE'; +$db_sessions_table = 'sessions'; + +# ADOdb path +$ADOdb_path = '/usr/share/php5/adodb/'; +$db_type = 'mysql'; + +# Smarty directory +$smarty_dir = '/usr/share/php/smarty/'; + +# Permissions filter +$scire_ui_section = "scire_ui"; +?> diff --git a/scire/.lib/functions.php b/scire/.lib/functions.php new file mode 100644 index 0000000..7a1996f --- /dev/null +++ b/scire/.lib/functions.php @@ -0,0 +1,147 @@ +<?php + +function normalize_path($path) { + if ($path && strlen($path) > 0) { + return preg_replace('/^(.*?)[\/]?$/', '$1/', $path); + } else { + return $path; + } +} + +function dumper($var) { + ob_start(); + var_dump($var); + return ob_get_clean(); +} + +function pre_var_dump($var) { + print "<pre>"; + var_dump($var); + print "</pre>"; +} + +function add_leftbar(&$leftbar_menu, $entry_name, $entry_link) { + $temp_menu_entry['name'] = $entry_name; + $temp_menu_entry['link'] = $entry_link; + array_push($leftbar_menu, $temp_menu_entry); +} + +function get_clients_fields() { + $fields['hostname'] = array('name' => 'Hostname', 'sortable' => True); + $fields['ip'] = array('name' => 'IP Address', 'sortable' => True); + $fields['mac'] = array('name' => 'MAC Address', 'sortable' => True); + $fields['digest'] = array('name' => 'Cert Digest', 'sortable' => False); + $fields['profile_name'] = array('name' => 'GLI Profile', 'sortable' => True); + $fields['osname'] = array('name' => 'OS Name', 'sortable' => True); + $fields['username'] = array('name' => 'User Contact', 'sortable' => True); + $fields['installtime'] = array('name' => 'Install Time', 'sortable' => True); + $fields['status'] = array('name' => 'Status', 'sortable' => True); + $fields['groups'] = array('name' => 'Client Groups', 'sortable' => False); + 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); + $fields['comment'] = array('name' => 'Comment', 'sortable' => False); + $fields['status'] = array('name' => 'Status', 'sortable' => True); + $fields['groups'] = array('name' => 'User Groups', 'sortable' => False); + 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); + $fields['created'] = array('name' => 'Created', 'sortable' => True); + $fields['username'] = array('name' => 'Created By', 'sortable' => True); + $fields['scriptname'] = array('name' => 'Script Name', 'sortable' => True); + $fields['pending'] = array('name' => '# Pending', 'sortable' => True); + $fields['failed'] = array('name' => '# Failed', 'sortable' => True); + $fields['permname'] = array('name' => 'Permission', 'sortable' => True); + $fields['description'] = array('name' => 'Description', 'sortable' => False); + 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'); +} + +function get_cron_times() { + # Minutes array + $minutes = array( +# "*" => "Every minute", +# "*/2" => "Every other minute", + "*/5" => "Every five minutes", + "*/10" => "Every ten minutes", + "*/15" => "Every fifteen minutes", + ); + foreach (range(0,59) as $val) { + $minutes[(string)$val] = $val; + } + $minutes["other"] = "other"; + + # Hours array + $hours = array( + "*" => "Every hour", + "*/2" => "Every other hour"); + foreach (range(0,11) as $val) { + $hours[(string)$val] = (string)$val . " A.M."; + } + $hours["12"] = "12 Noon"; + foreach (range(13,23) as $val) { + $hours[(string)$val] = (string)($val-12) . " P.M."; + } + $hours["other"] = "other"; + + # Days + $days = array( + "*" => "Every day", + "*/2" => "Every other day"); + foreach (range(1,31) as $val) { + $days[(string)$val] = (string)($val); + } + $days["other"] = "other"; + + # Weekdays + $weekdays = array( + "*" => "Every weekday", + "0" => "Sunday", + "1" => "Monday", + "2" => "Tuesday", + "3" => "Wednesday", + "4" => "Thursday", + "5" => "Friday", + "6" => "Saturday"); + $weekdays["other"] = "other"; + + # Months + $months = array("*" => "Every month", + "1" => "January", + "2" => "February", + "3" => "March", + "4" => "April", + "5" => "May", + "6" => "June", + "7" => "July", + "8" => "August", + "9" => "October", + "10" => "September", + "11" => "November", + "12" => "December"); + $months["other"] = "other"; + return array($minutes,$hours,$days,$weekdays,$months); +} + +?> diff --git a/scire/.lib/module_common.php b/scire/.lib/module_common.php new file mode 100644 index 0000000..1c51549 --- /dev/null +++ b/scire/.lib/module_common.php @@ -0,0 +1,4 @@ +<?php +$path = "../"; +require_once('common.php'); +?> diff --git a/scire/.lib/oldDB.php.blackace b/scire/.lib/oldDB.php.blackace new file mode 100644 index 0000000..a0deb28 --- /dev/null +++ b/scire/.lib/oldDB.php.blackace @@ -0,0 +1,190 @@ +<?php + +class DB { + private $db; + private $error; + function __construct($host, $user, $pass, $db) { + if ($this->db = @mysql_connect($host, $user, $pass)) { + if (!@mysql_select_db($db, $this->db)) { + $this->error = 'mysql select db failed'; + if ($mysqlerror = mysql_error($this->db)) { + $this->error .= ' (' . $mysqlerror . ')'; + } + } + } else { + $this->error = 'mysql connect failed'; + if ($mysqlerror = mysql_error()) { + $this->error .= ' (' . $mysqlerror . ')'; + } + } + } + function __get($name) { + switch ($name) { + case 'error': + return $this->error; + break; + default: + return false; + break; + } + } + function __set($name, $value) { + return false; + } + function __isset($name) { + switch ($name) { + case 'error': + if ($this->error && strlen($this->error) > 0) { + return true; + } + break; + default: + return false; + break; + } + } + function __unset($name) { + return false; + } + # $table = 'table1' OR array('table1', 'table2') + # $select = '*' OR 'column1' OR array('column1', 'column2') + # $query = 'SELECT * FROM table WHERE column = \'value\' OR column = (SELECT * FROM table2 WHERE column = \'value\')' + # $set = array('setcolumn' => 'value') + # $update = array('updatecolumn' => 'value') + # $where = '`matchcolumn` = \'criteria\'' + # insert($table, $set) + # insert($table, $set, $update) + # update($table, $update) + # update($table, $update, $where) + # delete($table, $where) + # select($select, $table) + # select($select, $table, $where) + # select($query) + function __call($method, $args) { + switch ($method) { + case 'insert': + case 'update': + if ($args && (count($args) == 2 || count($args) == 3)) { + $query = strtoupper($method); + if ($method == 'insert') { + $query .= ' INTO'; + } + $query .= ' `' . $args[0] . '` SET '; + foreach ($args[1] as $column => $value) { + $query .= '`' . $column . '`=\'' . $value . '\', '; + } + $query = preg_replace('/, $/', '', $query); + if (count($args) == 3) { + if ($method == 'insert') { + $query .= ' ON DUPLICATE KEY UPDATE '; + foreach ($args[2] as $column => $value) { + if ($value == "NOW") { + $query .= '`' . $colnum . '` = NOW(), '; + } else { + $query .= '`' . $column . '`=\'' . $value . '\', '; + } + } + $query = preg_replace('/, $/', '', $query); + } elseif ($method == 'update') { + $query .= ' WHERE ' . $args[2]; + } + } + #print $query; #for debugging. + if (@mysql_query($query, $this->db)) { + return mysql_affected_rows($this->db); + } else { + $this->error = 'mysql ' . $method . ' failed'; + if ($mysqlerror = mysql_error($this->db)) { + $this->error .= ' (' . $mysqlerror . ')'; + } + return false; + } + } else { + return false; + } + break; + case 'delete': + if ($args && count($args) == 2) { + $query = strtoupper($method); + $query .= ' FROM `' . $args[0] . '`'; + $query .= ' WHERE ' . $args[1]; + if (@mysql_query($query, $this->db)) { + return mysql_affected_rows($this->db); + } else { + $this->error = 'mysql ' . $method . ' failed'; + if ($mysqlerror = mysql_error($this->db)) { + $this->error .= ' (' . $mysqlerror . ')'; + } + return false; + } + } else { + return false; + } + break; + case 'select': + if ($args && (count($args) >= 1 && count($args) <= 3)) { + if (count($args) == 1) { + $query = $args[0]; + } else { + $query = strtoupper($method); + if (is_array($args[0])) { + foreach ($args[0] as $value) { + $query .= ' ' . $value . ', '; + } + } else { + $query .= '*'; + } + $query = preg_replace('/, $/', '', $query); + $query .= ' FROM ' . $args[1] ; + if (count($args) == 3) { + $query .= ' WHERE ' . $args[2]; + } + } + #print $query; #for debugging. + if ($result = @mysql_query($query, $this->db)) { + $rows = array(); + while ($row = @mysql_fetch_assoc($result)) { + $rows[] = $row; + } + mysql_free_result($result); + return $rows; + } else { + $this->error = 'mysql ' . $method . ' failed'; + if ($mysqlerror = mysql_error($this->db)) { + $this->error .= ' (' . $mysqlerror . ')'; + } + return false; + } + } else { + return false; + } + break; + case 'query': + if (count($args) == 1) { + $query = $args[0]; + } else { + return false; + } + print $query . "<BR>"; #for debugging. + if ($result = @mysql_query($query, $this->db)) { + $rows = array(); + while ($row = @mysql_fetch_assoc($result)) { + $rows[] = $row; + } + mysql_free_result($result); + return $rows; + } else { + $this->error = 'mysql ' . $method . ' failed'; + if ($mysqlerror = mysql_error($this->db)) { + $this->error .= ' (' . $mysqlerror . ')'; + } + return false; + } + default: + $this->error = 'unknown method'; + return false; + } + } +} + +?> diff --git a/scire/.lib/phpGACL.php b/scire/.lib/phpGACL.php new file mode 100644 index 0000000..dfceebf --- /dev/null +++ b/scire/.lib/phpGACL.php @@ -0,0 +1,47 @@ +<?php + +require_once($path . './phpgacl/gacl.class.php'); +require_once($path . './phpgacl/gacl_api.class.php'); + +$gacl_options = array( + 'db_type' => 'mysql', + 'db_host' => $db_host, + 'db_user' => $db_username, + 'db_password' => $db_password, + 'db_name' => $db_name, + 'db_table_prefix' => 'gacl_', +# 'caching' => 'FALSE', + 'smarty_dir' => preg_replace('/\/$/', '', $smarty_dir), + 'smarty_template_dir' => 'templates', + 'smarty_compile_dir' => 'templates_c' +); + +$acl = new gacl_api($gacl_options); #can be gacl_api + +function check_access($permname) { + global $acl; + global $scire_ui_section; + if ($_SESSION['username'] == "root") { return True; } #godmode + if ($acl->acl_check($scire_ui_section, $permname, "users", $_SESSION['username'],$scire_ui_section, $scire_ui_section) ) { + return True; + } else { + return False; + } + return False; +} + +function check_action_access($permname) { #Same as above but aborts the page for you. + global $acl; + global $scire_ui_section; + if ($_SESSION['username'] == "root") { return True; } #iddqd + $result = $acl->acl_check($scire_ui_section, $permname, "users", $_SESSION['username'],$scire_ui_section, $scire_ui_section); + if ($result) { + #print "Access Granted! $result"; + return True; + } else { + header('Location: ' . $baseurl . 'access_error.php?perm=' . urlencode($permname)); + exit(0); + #print "DENIED! " + $result; + } +} +?> diff --git a/scire/.lib/smarty.php b/scire/.lib/smarty.php new file mode 100644 index 0000000..4d9d3c5 --- /dev/null +++ b/scire/.lib/smarty.php @@ -0,0 +1,34 @@ +<?php + +require_once($smarty_dir . 'Smarty.class.php'); + +$smarty = new Smarty(); +$smarty->template_dir = $basedir . '.smarty/templates'; +$smarty->compile_dir = $basedir . '.smarty/templates_c'; +$smarty->cache_dir = $basedir . '.smarty/cache'; +$smarty->config_dir = $basedir . '.smarty/config'; + +$smarty->assign('baseurl', $baseurl); + +# Top navigation bar +$topbar_left = array( + array('name' => 'Overview', 'link' => 'index.php'), + array('name' => 'Jobs', 'link' => 'jobs.php'), + array('name' => 'Clients', 'link' => 'clients.php') +); + +$topbar_right = array( + array('name' => 'Settings', 'link' => 'settings.php'), + array('name' => 'Help', 'link' => 'help.php') +); + +#if ($_SESSION['username'] eq 'is in the administrators group') { + $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); + +?> diff --git a/scire/.smarty/.svnignore b/scire/.smarty/.svnignore new file mode 100644 index 0000000..198e853 --- /dev/null +++ b/scire/.smarty/.svnignore @@ -0,0 +1 @@ +templates_c diff --git a/scire/.smarty/templates/access_error.tpl b/scire/.smarty/templates/access_error.tpl new file mode 100644 index 0000000..f38e992 --- /dev/null +++ b/scire/.smarty/templates/access_error.tpl @@ -0,0 +1,9 @@ +{include file="header.tpl" title="Access Denied"} +<p> +An error has occurred.<br> +Unfortunatly, {$user} does not have sufficient permission to perform this action.<br> +The requried permission was: {$perm}<br> +Why don't you complain to your admin? +{$message|escape:"htmlall"} +</p> +{include file="footer.tpl"} diff --git a/scire/.smarty/templates/add_job.tpl b/scire/.smarty/templates/add_job.tpl new file mode 100755 index 0000000..bee7e2f --- /dev/null +++ b/scire/.smarty/templates/add_job.tpl @@ -0,0 +1,351 @@ +{include file="header.tpl" title="Add A Job"} +<form action="" method="post" name="add_jobform"> + Step 1: select a script.<br> + Step 2: select a client or multiple clients and/or clientgroups.<br> + Step 3: set +<hr> + <table width="100%" border="0" cellspacing="0" cellpadding="5"> + <tr> + <td align="left" valign="top"> + <table class="box" width="90%" border="1" cellspacing="0" cellpadding="0"> + <tr> + <td class="boxtitle">Script Selection</td> + </tr> + <tr> + <td> + <table border="0" cellspacing="0" cellpadding="5"> + <tr> + <td><label for="scripts">Scripts:</label></td> + </tr> + <tr> + {if isset($get.scriptid)} + + <td>Selected script:</td> + <td><input type="hidden" name="script" value="{$script.scriptid}">{$script.name}</td> + {else} + <td>Categories will go here</td> + <td> + <select name="script" size="10" > + {foreach from=$scripts item=script key=key} + <option value="{$script.scriptid}"> + {$script.name}</option> + {/foreach} + </select> + </td> + {/if} + </tr> + {if !isset($get.scriptid)} + <tr> + <td colspan="2">Or just type in the ID of the script: <input type="text" name="scriptID" ></td> + </tr> + {/if} + <tr> + <td colspan="2"><hr><h4>Override Script default values:</h4><br> + Permission: <select size="1" name="permission"> + {foreach from=$perms item=perm key=id} + <option value="{$perm}" + {if isset($script.permission)} + {if $perm eq $script.permission} selected {/if} + {/if} + >{$perm}</option> + {/foreach} + </select><br> + + Set Priority: <select size="1" name="priority"> + {foreach from=$priorities item=priority key=id} + <option value="{$priority}" + {if isset($script.priority)} + {if $priority eq $script.priority} selected {/if} + {/if} + >{$priority}</option> + {/foreach} + </select><br> + Log Location: <input type="text" name="log_location" value="{$script.log_location}"><br> + Success Code: (not worrying bout this now)<br> + Set dynamic content: <br> + </td> + </tr> + </table> + </td> + </tr> + </table> + </td> + + <td align="right" valign="top"> + <table class="box" width="50%" border="1" cellspacing="0" cellpadding="0"> + <tr> + <td class="boxtitle">Client Selection</td> + </tr> + <tr> + <td> + <table border="0" cellspacing="0" cellpadding="5"> + <tr> + {if isset($get.clientid)} + + <td>Selected client:</td> + <td><input type="hidden" name="clients[]" value="{$client.hostname}">{$client.hostname}</td> + {elseif isset($get.cgroupid)} + <td>Selected clientgroup:</td> + <td><input type="hidden" name="cgroups[]" value="{$get.cgroupid}">NAME HERE</td> + {else} + <td><label for="clientgroups">Clientgroups:</label></td> + <td><label for="clients">Clients:</label></td> + </tr> + <tr> + <td> + <select name="clientgroups[]" size="18" multiple="multiple"> + {foreach from=$cgroups item=cgroup key=id} + <option value="{$id}">{$cgroup}</option> + {/foreach} + </select> + </td> + <td> + <select name="clients[]" size="18" multiple="multiple"> + {section loop=$clients name=clients} + <option value="{$clients[clients].clientid}">{$clients[clients].hostname}</option> + {/section} + </select> + </td> + {/if} + </tr> + </table> + </td> + </tr> + </table> + Input staging client hostname (optional): <input type="text" name="staging"><br> + Staging success: <input type="radio" name="staging_success" value="result">Positive Result Code <input type="radio" name="staging_success" value="user">Manually approved + </td> + </tr> + </table> + <hr> + <table> + {if $dyn_tags} + <tr> + <th>Dynamic Tag</th><th>Value</th> + </tr> + {foreach from=$dyn_tags item=tag key=tagnum} + <tr> + <td>Tag: <b>{$tag}</b></td><td><input type="text" name="tag_{$tag}" value="{$tag_values[$tag]}" /></td> + </tr> + {/foreach} + {/if} +</table> +<hr> +Job Description: <br><textarea name="description" rows="3" cols="40"></textarea><br> +<hr> +Recurring stuff here. <b>You need to select all of them to get it to save the schedule!</b><br> +<table> +<tr><td>Minute(s):<br> +<select multiple name=minute1 size=10> +<!-- <option value=*> Every Minute +<option value=*/2> Every Other Minute --> +<option value=*/5> Every Five Minutes +<option value=*/10> Every Ten Minutes +<option value=*/15> Every Fifteen Minutes +<option value=0> 0 +<option value=1> 1 + +<option value=2> 2 +<option value=3> 3 +<option value=4> 4 +<option value=5> 5 +<option value=6> 6 +<option value=7> 7 +<option value=8> 8 +<option value=9> 9 +<option value=10> 10 + +<option value=11> 11 +<option value=12> 12 +<option value=13> 13 +<option value=14> 14 +<option value=15> 15 +<option value=16> 16 +<option value=17> 17 +<option value=18> 18 +<option value=19> 19 + +<option value=20> 20 +<option value=21> 21 +<option value=22> 22 +<option value=23> 23 +<option value=24> 24 +<option value=25> 25 +<option value=26> 26 +<option value=27> 27 +<option value=28> 28 + +<option value=29> 29 +<option value=30> 30 +<option value=31> 31 +<option value=32> 32 +<option value=33> 33 +<option value=34> 34 +<option value=35> 35 +<option value=36> 36 +<option value=37> 37 + +<option value=38> 38 +<option value=39> 39 +<option value=40> 40 +<option value=41> 41 +<option value=42> 42 +<option value=43> 43 +<option value=44> 44 +<option value=45> 45 +<option value=46> 46 + +<option value=47> 47 +<option value=48> 48 +<option value=49> 49 +<option value=50> 50 +<option value=51> 51 +<option value=52> 52 +<option value=53> 53 +<option value=54> 54 +<option value=55> 55 + +<option value=56> 56 +<option value=57> 57 +<option value=58> 58 +<option value=59> 59 +</select><br> +</td> +<td>Hour(s):<br> +<select multiple name=hour1 size=5> +<option value=*> Every Hour +<option value=*/2> Every Other Hour + +<option value=*/4> Every Four Hours +<option value=*/6> Every Six Hours +<option value=0> 0 = 12 AM/Midnight +<option value=1> 1 = 1 AM +<option value=2> 2 = 2 AM +<option value=3> 3 = 3 AM +<option value=4> 4 = 4 AM +<option value=5> 5 = 5 AM +<option value=6> 6 = 6 AM + +<option value=7> 7 = 7 AM +<option value=8> 8 = 8 AM +<option value=9> 9 = 9 AM +<option value=10> 10 = 10 AM +<option value=11> 11 = 11 AM +<option value=12> 12 = 12 PM/Noon +<option value=13> 13 = 1 PM +<option value=14> 14 = 2 PM +<option value=15> 15 = 3 PM + +<option value=16> 16 = 4 PM +<option value=17> 17 = 5 PM +<option value=18> 18 = 6 PM +<option value=19> 19 = 7 PM +<option value=20> 20 = 8 PM +<option value=21> 21 = 9 PM +<option value=22> 22 = 10 PM +<option value=23> 23 = 11 PM +</select> + +<br><br>Day(s):<br> +<select multiple name=day1 size=5> +<option value=*> Every Day +<option value=1> 1 +<option value=2> 2 +<option value=3> 3 +<option value=4> 4 +<option value=5> 5 +<option value=6> 6 + +<option value=7> 7 +<option value=8> 8 +<option value=9> 9 +<option value=10> 10 +<option value=11> 11 +<option value=12> 12 +<option value=13> 13 +<option value=14> 14 +<option value=15> 15 + +<option value=16> 16 +<option value=17> 17 +<option value=18> 18 +<option value=19> 19 +<option value=20> 20 +<option value=21> 21 +<option value=22> 22 +<option value=23> 23 +<option value=24> 24 + +<option value=25> 25 +<option value=26> 26 +<option value=27> 27 +<option value=28> 28 +<option value=29> 29 +<option value=30> 30 +<option value=31> 31 +</select><br><br> +</td><td>Months(s):<br> + +<select multiple name=month1 size=5> +<option value=*> Every Month +<option value=1> January +<option value=2> February +<option value=3> March +<option value=4> April +<option value=5> May +<option value=6> June +<option value=7> July + +<option value=8> August +<option value=9> September +<option value=10> October +<option value=11> November +<option value=12> December +</select> +<br><br>Weekday(s):<br> +<select multiple name=weekday1 size=5> +<option value=*> Every Weekday +<option value=0> Sunday + +<option value=1> Monday +<option value=2> Tuesday +<option value=3> Wednesday +<option value=4> Thursday +<option value=5> Friday +<option value=6> Saturday +</select> +</td></tr> +<tr><td> +<hr> +<label for="validity_period">Validity Period (in minutes?): </label><input type="text" name="validity_period" /> +</td></tr> + +<tr><td> +<script language="JavaScript" src="calendar/calendar3.js"></script><!-- Date only with year scrolling --> +<label for="deploy_time">Start time: <input type="Text" name="deploy_time" value=""> + <a href="javascript:cal1.popup();"><img src="calendar/img/cal.gif" width="16" height="16" border="0" alt="Click Here to Pick up the date"></a></label> +</td> +<td> +<label for="expiration_time">End time: <input type="Text" name="expiration_time" value=""> + <a href="javascript:cal2.popup();"><img src="calendar/img/cal.gif" width="16" height="16" border="0" alt="Click Here to Pick up the date"></a></label> +<script language="JavaScript"> + <!-- // create calendar object(s) just after form tag closed + // specify form element as the only parameter (document.forms['formname'].elements['inputname']); + // note: you can have as many calendar objects as you need for your application + var cal1 = new calendar3(document.forms['add_jobform'].elements['deploy_time']); + cal1.year_scroll = false; + cal1.time_comp = true; + var cal2 = new calendar3(document.forms['add_jobform'].elements['expiration_time']); + cal2.year_scroll = false; + cal2.time_comp = true; + //--> + </script> +</td> +</tr> +</table> +<hr> +Job dependency stuff here.<B>CODE ME</B><br> +<!-- Set notification email address: <input type="radio" name="notify_addr" value="{$useremail}">{$useremail}</input><input type="radio" name="notify_addr" value="new"><input type="text" name="notify_new"></input> --> +<input type="submit" name="ADD" value="ADD JOB!!!"> +</form> +{include file="footer.tpl"} diff --git a/scire/.smarty/templates/admin.tpl b/scire/.smarty/templates/admin.tpl new file mode 100644 index 0000000..e03cfb7 --- /dev/null +++ b/scire/.smarty/templates/admin.tpl @@ -0,0 +1,29 @@ +{include file="header.tpl" title="Scire - Administration Page"} +Admin-y page here. +List of administrative tasks: +<hr> +<table> +<tr><td><a href="admin/create_user.php">Create a User</a></td></tr> +<tr><td><a href="admin/edit_user.php">Edit a User</a></td></tr> +<tr><td><a href="admin/delete_user.php">Delete a User</a></td></tr> +<tr><td></td></tr> +<tr><td><a href="admin/create_usergroup.php">Create a UserGroup</a></td></tr> +<tr><td><a href="admin/edit_usergroup.php">Edit a UserGroup</a></td></tr> +<tr><td><a href="admin/delete_usergroup.php">Delete a UserGroup</a></td></tr> +<tr><td></td></tr> +<tr><td><a href="admin/add_permission.php">Add Permission</a></td></tr> +<tr><td><a href="admin/edit_permission.php">Edit Permission</a></td></tr> +<tr><td><a href="admin/delete_permission.php">Delete Permission</a></td></tr> +<tr><td></td></tr> +<tr><td><a href="admin/add_client.php">Add Client Manually</a></td></tr> +<tr><td><a href="admin/edit_client.php">Edit Clients</a></td></tr> +<tr><td><a href="admin/delete_client.php">Delete Client from Scire</a></td></tr> +<tr><td></td></tr> +<tr><td><a href="admin/create_clientgroup.php">Create a ClientGroup</a></td></tr> +<tr><td><a href="admin/edit_clientgroup.php">Edit a ClientGroup</a></td></tr> +<tr><td><a href="admin/delte_clientgroup.php">Delete a ClientGroup</a></td></tr> +<tr><td></td></tr> +<tr><td><a href="admin/assign_permissions.php">Assign Permissions</a></td></tr> +</table> +<hr> +Maybe some Certificate Authority tasks? diff --git a/scire/.smarty/templates/assign_permission.tpl b/scire/.smarty/templates/assign_permission.tpl new file mode 100755 index 0000000..3b219e6 --- /dev/null +++ b/scire/.smarty/templates/assign_permission.tpl @@ -0,0 +1,217 @@ +{include file="header.tpl" title="Assign A Permission"} +<form action="" method="post" name="add_permform"> +{if $Action eq "delete"} +<b>Are you absolutely SURE you want to delete this ACL?</b> +<input type="hidden" name="aclid" value="{$aclid}"> +<input type="submit" name="delete_confirm" value="Yes, that's why I clicked 'Delete', duh!"><input type="submit" name="delete_cancel" value="No wait!"> +{else} +Instructions:<br> +1. Select a set of users and/or usergroups (any combination, they are exclusive)<br> +2. Select a permission category and then the permission to use, or choose to create a new one<br> +3. Select a set of clients and/or clientgroups (again, groups are exclusive from individual clients)<br> +4. Select options below and give a note for the permission. + <table width="100%" border="0" cellspacing="0" cellpadding="5"> + <tr> + <td align="left" valign="top"> + <table class="box" width="50%" border="1" cellspacing="0" cellpadding="0"> + <tr> + <td class="boxtitle">User Selection</td> + </tr> + <tr> + <td> + <table border="0" cellspacing="0" cellpadding="5"> + <tr> + <td><label for="usergroups">Usergroups:</label></td> + <td><label for="users">Users:</label></td> + </tr> + <tr> + {if isset($get.username)} + <td>Selected User:</td> + <td><input type="hidden" name="users[]" value="{$get.username}">{$get.username}</td> + {elseif isset($get.usergroup)} + {else} + <td> + <select name="usergroups[]" size="18" multiple="multiple"> + {foreach from=$ugroups item=ugroup key=id} + <option value="{$id}" + {if isset($acl)} + {foreach from=$acl.aro_groups item=group key=groupid} + {if $id eq $group} selected {/if} + {/foreach} + {/if} + >{$ugroup}</option> + {/foreach} + </select> + </td> + <td> + <select name="users[]" size="18" multiple="multiple"> + {section loop=$users name=users} + <option value="{$users[users].username}" + {if isset($acl)} + {foreach from=$acl.aro.users item=user key=key2} + {if $users[users].username eq $user} selected {/if} + {/foreach} + {/if} + >{$users[users].username}</option> + {/section} + </select> + </td> + {/if} + </tr> + </table> + </td> + </tr> + </table> + </td> + <td align="center" valign="top"> + <table class="box" width="50%" border="1" cellspacing="0" cellpadding="0"> + <tr> + <td class="boxtitle">Permission Selection</td> + </tr> + <tr> + <td> + <table border="0" cellspacing="0" cellpadding="5"> + <tr> + <td><label for="perm_category">Category:</label> </td> + </tr> + <tr> + <td> + <select name="perm_category"> + {foreach from=$perm_categories item=cat } + <option value="{$cat}" + {if isset($acl)} + {foreach from=$acl.aco item=ignore key=perm_category} + {if $cat eq $perm_category} selected {/if} + {/foreach} + {/if} + >{$cat}</option> + {/foreach} + <option value="new">New (specify below)</option> + </select> + </td> + </tr> + <tr> + <td><label for="perm">Permissions (choose an existing or create a new one):</label></td> + </tr> + <tr> + <td> + <select name="perm" size="7"> + {foreach from=$perms item=perm key=id} + <option value="{$perm}" + {if isset($acl)} + {foreach from=$acl.aco item=ignore key=perm_category} + {if $perm eq $acl.aco.$perm_category[0]} selected {/if} + {/foreach} + {/if} + >{$perm}</option> + {/foreach} + </select> + </td> + </tr> + <tr> + <td><label for="newpermname">New Category (optional):</label><input name="newpermcat" type="text" size="20"></td> + </tr> + <tr> + <td><label for="newpermname">New Permission Name:</label><input name="newpermname" type="text" size="20"></td> + </tr> + <tr> + <td><label for="newpermdesc">New Permission Description:</label></td> + </tr> + <tr> + <td><textarea name="newpermdesc" rows="3" cols="20"></textarea></td> + </tr> + </table> + </td> + </tr> + </table + </td> + <td align="right" valign="top"> + <table class="box" width="50%" border="1" cellspacing="0" cellpadding="0"> + <tr> + <td class="boxtitle">Client Selection</td> + </tr> + <tr> + <td> + <table border="0" cellspacing="0" cellpadding="5"> + <tr> + <td><label for="clientgroups">Clientgroups:</label></td> + <td><label for="clients">Clients:</label></td> + </tr> + <tr> + {if isset($get.hostname)} + <td>Selected Client:</td> + <td><input type="hidden" name="clients[]" value="{$get.hostname}">{$get.hostname}</td> + {elseif isset($get.clientgroup)} + {else} + <td> + <select name="clientgroups[]" size="18" multiple="multiple"> + {foreach from=$cgroups item=cgroup key=id} + <option value="{$id}" + {if isset($acl)} + {foreach from=$acl.axo_groups item=group key=groupid} + {if $id eq $group} selected {/if} + {/foreach} + {/if} + >{$cgroup}</option> + {/foreach} + </select> + </td> + <td> + <select name="clients[]" size="18" multiple="multiple"> + {section loop=$clients name=clients} + <option value="{$clients[clients].hostname}" + {if isset($acl)} + {foreach from=$acl.axo.clients item=client key=key2} + {if $clients[clients].hostname eq $client} selected {/if} + {/foreach} + {/if} + >{$clients[clients].hostname}</option> + {/section} + </select> + </td> + {/if} + </tr> + </table> + </td> + </tr> + </table> + </td> + </tr> + <tr> + <td align="center"><input type="radio" name="allow" value="1" + {if isset($acl)} + {if $acl.allow} checked {/if} + {else} + checked + {/if} + >Allow + <input type="radio" name="allow" value="0" + {if isset($acl)} + {if (!$acl.allow)} checked {/if} + {/if} + >Deny</td> + <td align="center"><input type="checkbox" name="active" value="1" + {if isset($acl)} + {if $acl.enabled} checked {/if} + {else} + checked + {/if} + >Active (vs. hidden)</td> + <td align="right" valign="bottom"> + <label for="note">Note:</label><input type="text" name="note" + {if isset($acl)} + value="{$acl.note}" + {/if} + > + {if isset($acl)} + <input type="hidden" name="editing" value="{$acl.acl_id}"> + <input type="submit" name="editperm_submit" value="Update Permission"> + {else} + <input type="submit" name="addperm_submit" value="Assign Permission"> + {/if} + </td> + </tr> +</table> +{/if} +</form> +{include file="footer.tpl"} diff --git a/scire/.smarty/templates/client.tpl b/scire/.smarty/templates/client.tpl new file mode 100755 index 0000000..39d4bd1 --- /dev/null +++ b/scire/.smarty/templates/client.tpl @@ -0,0 +1,255 @@ +{include file="header.tpl" title="Clients"} +<form action="" method="post" name="edit_clientform"> +{if $Action eq "addgroup"} + <table width="100%" border="0" cellspacing="0" cellpadding="5"> + <tr><td class="boxtitle">Add client to group</td></tr> + <tr> + <td colspan="2" align="center" valign="top"> + <table class="box" width="100%" border="1" cellspacing="0" cellpadding="0"> + <tr> + <td class="boxtitle" width="15">Add</td><td class="boxtitle">Group Name</td> + </tr> + {foreach from=$groups name=ugroup item=item key=id} + <tr> + <td><input type="checkbox" name="addgroupid[]" value="{$id}" + {if isset($ingroups)} {if in_array($id, $ingroups)} checked {/if} {/if} + ></td> + <td>{$item}</td> + </tr> + {/foreach} + <tr><td> + <input type="hidden" name="clientid" value="{$clientid}"> + <input type="submit" name="addgroup_confirm" value="Save Changes"> + </td></tr> + </table> + </td> + </tr> + </table> +{elseif $Action eq "create"} +<table width="100%" border="0" cellspacing="0" cellpadding="5"> + <tr> + <td colspan="2" align="center" valign="top"> + <table class="box" width="100%" border="1" cellspacing="0" cellpadding="0"> + <tr> + <td class="boxtitle">Client</td><td class="boxtitle">Groups</td> + </tr> + <tr> + <td> + <table border="0" cellspacing="0" cellpadding="5"> + <tr> + <td><label for="addhostname">*Hostname:</label></td> + <td><input type="text" id="addhostname" name="addhostname" /></td> + <td><label for="ip">*IP Address:</label></td> + <td><input type="text" id="ip" name="ip" /></td> + + </tr> + <tr> + <td><label for="assetid">Asset ID:</label></td> + <td><input type="text" id="assetid" name="assetid" /></td> + <td><label for="mac">*MAC:</label></td> + <td><input type="text" id="mac" name="mac" /></td> + + </tr> + <tr> + <td><label for="digest">Digest (DO NOT EDIT):</label></td> + <td colspan="3"><input type="text" id="digest" name="digest" size="58"></td> + </tr> + <tr> + <td><label for="gli_profile">GLI Profile:</label></td> + <td><select name="gli_profile" size="1"> + {section name=p loop=$gli_profiles} + <option value="{$gli_profiles[p].profileid}">{$gli_profiles[p].profile_name}</option> + {/section} + </select> + </td> + <td><label for="status">Status:</label></td> + <td><select id="status" name="status" size="1"> + {section name=s loop=$client_statuses} + <option value="{$client_statuses[s].statusid}">{$client_statuses[s].statusname}</option> + {/section} + </select> + </td> + </tr> + <tr> + <td><label for="osid">OS:</label></td> + <td><select name="osid" size="1"> + {section name=o loop=$oss} + <option value="{$oss[o].osid}">{$oss[o].osname}</option> + {/section} + </select> + </td> + <td><label for="contact">Contact:</label></td> + <td><select name="contact" size="1"> + {section name=con loop=$users} + <option value="{$users[con].userid}">{$users[con].username}</option> + {/section} + </select></td> + </tr> + <tr> + <td><label for="installtime">Install Time <br>(leave blank for NOW):</label></td> + <td colspan="3"><input type="text" id="installtime" name="installtime" size="25"/></td> + </tr> + </table> + <p><input type="submit" name="AddClientSubmit" value="Add Client" /></p> + </td> + <td> + <table> + <tr><td>Assign client to the following groups:</td></tr> + <tr><td> + <select name="groups[]" size="10" multiple="multiple" id="groups"> + {foreach from=$groups item=ugroup key=id} + <option value="{$id}">{$ugroup}</option> + {/foreach} + </select> + </td> + </tr></table> + </td> + </tr> + </table> + </td> + </tr> +{elseif $Action eq "edit"} +<h1>EDITING</h1> + <table width="100%" border="0" cellspacing="0" cellpadding="5"> + <tr> + <td colspan="2" align="center" valign="top"> + <table class="box" width="100%" border="1" cellspacing="0" cellpadding="0"> + <tr> + <td class="boxtitle">Client</td> + </tr> + <tr> + <td> + <table border="0" cellspacing="0" cellpadding="5"> + <tr> + <td><label for="addhostname">*Hostname:</label></td> + <td><input type="text" id="edithostname" name="edithostname" value="{$client.hostname}" /></td> + <td><label for="ip">*IP Address:</label></td> + <td><input type="text" id="ip" name="ip" value="{$client.ip}" /></td> + + </tr> + <tr> + <td><label for="assetid">Asset ID:</label></td> + <td><input type="text" id="assetid" name="assetid" value="{$client.assetid}" /></td> + <td><label for="mac">*MAC:</label></td> + <td><input type="text" id="mac" name="mac" value="{$client.mac}" /></td> + + </tr> + <tr> + <td><label for="digest">Digest (DO NOT EDIT):</label></td> + <td colspan="3"><input type="text" id="digest" name="digest" size="55" value="{$client.digest}" /></td> + </tr> + <tr> + <td><label for="gli_profile">GLI Profile:</label></td> + <td><select name="gli_profile" size="1"> + {section name=p loop=$gli_profiles} + <option value="{$gli_profiles[p].profileid}" {if $gli_profiles[p].profileid eq $client.gli_profile} selected {/if} + >{$gli_profiles[p].profile_name}</option> + {/section} + </select> + </td> + <td><label for="status">Status:</label></td> + <td><select id="status" name="status" size="1"> + {section name=s loop=$client_statuses} + <option value="{$client_statuses[s].statusid}" {if $client_statuses[s].statusid eq $client.status} selected {/if}>{$client_statuses[s].statusname}</option> + {/section} + </select> + </td> + </tr> + <tr> + <td><label for="osid">OS:</label></td> + <td><select name="osid" size="1"> + {section name=o loop=$oss} + <option value="{$oss[o].osid}" {if $oss[o].osid eq $client.osid} selected {/if} + >{$oss[o].osname}</option> + {/section} + </select> + </td> + <td><label for="contact">Contact:</label></td> + <td><select name="contact" size="1"> + {section name=con loop=$users} + <option value="{$users[con].userid}" {if $users[con].userid eq $client.contact} selected {/if} + >{$users[con].username}</option> + {/section} + </select></td> + </tr> + <tr> + <td><label for="installtime">Install Time <br>(leave blank for NOW):</label></td> + <td colspan="3"><input type="text" id="installtime" name="installtime" size="25" value="{$client.installtime}" /></td> + </tr> + </table><input type="hidden" name="clientid" value="{$client.clientid}"> + <p><input type="submit" name="EditClientSubmit" value="Save Changes" /></form></p> + </td> + </tr> + </table> + </td> + </tr> + <tr> + <td align="center" valign="top"> + <table class="box" width="100%" border="1" cellspacing="0" cellpadding="0"> + <tr> + <td class="boxtitle">Groups</td> + </tr> + <tr> + <td> + <table class="table" width="100%" border="1" cellspacing="0" cellpadding="0"> + <tr> + <th>Groupname</th> + <th>Actions</th> + </tr> + {section name=group loop=$groups} + <tr> + <td>{$groups[group].name}{if $groups[group].parent} (subgroup of {$groups[group].parent}){/if}</td> + <td><form id="form1" name="form1" method="post" action=""><input type="hidden" name="group_id" value="{$groups[group].id}"><input type="submit" name="remove_ug" value="Remove"></form></td> + </tr> + {/section} + <tr><td><a href="client.php?clientid={$client.clientid}&Action=addgroup">Add client to a group</a></td></tr> + </table> + </td> + </tr> + </table> + </td> + <td align="center" valign="top"> + <table class="box" width="100%" border="1" cellspacing="0" cellpadding="0"> + <tr> + <td class="boxtitle">Permissions</td> + </tr> + <tr> + <td> + <table class="table" width="100%" border="1" cellspacing="0" cellpadding="0"> + <tr> + <th>Category -> Permission</th> + <th>From User(s)</th> + <th>Actions</th> + </tr> + {foreach from=$acls item=acl key=k} + <tr> + <td>{foreach from=$acl.aco item=perm key=category}{$category} -> {$perm[0]}{/foreach}</td> + <td> + {if $acl.aro} <!-- we have individual users --> + {foreach from=$acl.aro.users item=user key=key2} + <font style="background-color:#A0F8FF">User: {$user}</font><br> + {/foreach} + {/if} + {foreach from=$acl.aro_groups item=group key=groupid} + <font style="background-color:#FFFACD">UserGroup: {$ugroups[$group]} </font><br> + {/foreach} + </td> + <td><form id="form1" name="form1" method="post" action=""><input type="hidden" name="perm_id" value="{$acl.acl_id}" /><input type="submit" name="submit" value="Remove" /></form></td> + </tr> + {/foreach} + <tr><td><a href="assign_permission.php?hostname={$client.hostname}">Assign a permission for this client</a></td></tr> + </table> + </td> + </tr> + </table> + </td> + </tr> +</table> +{elseif $Action eq "delete"} +<h1>DELETING</h1> +<b>Are you absolutely SURE you want to delete client {$client.hostname}?</b> +<input type="hidden" name="clientid" value="{$client.clientid}"> +<input type="submit" name="delete_confirm" value="Yes, get rid of the bastard!"><input type="submit" name="delete_cancel" value="No wait!"> +{/if} + +{include file="footer.tpl"} diff --git a/scire/.smarty/templates/clients.tpl b/scire/.smarty/templates/clients.tpl new file mode 100755 index 0000000..8626c4e --- /dev/null +++ b/scire/.smarty/templates/clients.tpl @@ -0,0 +1,72 @@ +{include file="header.tpl" title="Clients"} +<form action="" method="post" name="clientsform"> +<p> + <strong>Search filter: + <input type="text" name="searchfield"> + </strong> + {if check_access("View Pending Clients")} + <strong>Status Filter: + <select name="statusfilter" size="1"> + {html_options values=$statusfilters output=$statusfilters selected=$View} + </select> + <input type="submit" name="submit" value="Update"> + </strong> + {/if} +</p> +{if $clients} + <table class="box" width="100%" border="1" cellpadding="0" cellspacing="0"> + <tr><td class="boxtitle">Clients</td></tr> + <tr><td> + + <table class="table" width="100%" border="1" cellspacing="0" cellpadding="0"> + <tr> + {foreach from=$fields item=i key=k} + <th> + <a href="clients.php{if $f_attr[$i].sortable}?sorton={$i}&sortdir={if $sorton eq $i and $sortdir eq "desc"}asc{else}desc{/if}{/if}">{$f_attr[$i].name}</a> {if $f_attr[$i].sortable}<img src="images/sort_{if $sorton eq $i and $sortdir eq "desc"}desc{else}asc{/if}.png">{/if} + </th> + {/foreach} + + <th>Actions</th> + {if $View eq "Pending"} + <th>Approve/Deny</th> + {/if} + </tr> + {section name=clients loop=$clients} + <tr> + {foreach from=$fields item=item key=key} + {if $item eq "hostname"} + <td><a href="client.php?clientid={$clients[clients].clientid}&Action=edit">{$clients[clients].hostname}</a></td> + {else} + <td>{$clients[clients].$item}</td> + {/if} + {/foreach} + <td> + {if check_access("Edit Client") } + <a href="client.php?clientid={$clients[clients].clientid}&Action=edit">Edit</a> + {/if} + {if ($View eq "Pending") and check_access("Approve/Reject Pending Clients")} + <a href="client.php?clientid={$clients[clients].clientid}&Action=assign">Assign</a> + {else} + <a href="client.php?clientid={$clients[clients].clientid}&Action=delete">Delete</a> + {/if} + </td> + {if $View eq "Pending" and check_access("Approve/Reject Pending Clients")} + <td> + <input type="checkbox" name="pending_ids[]" value="{$clients[clients].clientid}"> + </td> + {/if} + </tr> + {/section} + + </td></tr> + + </table> + {if $View eq "Pending" and check_access("Approve/Reject Pending Clients")} + <tr> + <td align="right"><input type="submit" name="pend_approve" value="Approve"> + <input type="submit" name="pend_reject" value="Reject"></td> + </tr> + {/if} +{/if} +</form> +{include file="footer.tpl"} diff --git a/scire/.smarty/templates/clients_groups.tpl b/scire/.smarty/templates/clients_groups.tpl new file mode 100644 index 0000000..bb9c776 --- /dev/null +++ b/scire/.smarty/templates/clients_groups.tpl @@ -0,0 +1,74 @@ +{include file="header.tpl" title="Clients"} +<form action="" method="post" name="clientsgroupsform"> +{if $Action eq "create"} + <table class="box" width="100%" border="1" cellpadding="0" cellspacing="0"> + <tr><td class="boxtitle">Create a Client Group</td></tr> + <tr><td> + + <table class="table" width="100%" border="1" cellspacing="0" cellpadding="0"> + <tr> + <td class="boxtitle">Add Client Group</td><td class="boxtitle">Parent Group</td> + </tr> + <tr> + <td> + <label for="addgroupname">Name:</label> + <input type="text" name="addgroupname" id="addgroupname"> + </td> + <td> + <select name="parentgroup" id="parentgroup"> + {foreach item=cgroup key=ckey from=$groups} + <option value="{$ckey}">{$cgroup}</option> + {/foreach} + </select> + </td> + </tr> + <tr><td>as a subgroup of ---></td></tr> + <tr><td></td><td><input type="submit" name="addgroup" value="Add Client Group"></td></tr> + </table> + </table> + {elseif $Action eq "edit"} + <input type="hidden" name="groupid" value="{$groupid}"> + <table class="box" width="100%" border="1" cellpadding="0" cellspacing="0"> + <tr><td class="boxtitle">Edit Client Group {$groupdata[3]}</td></tr> + <tr><td> + + <table class="table" width="100%" border="1" cellspacing="0" cellpadding="0"> + <tr> + <td class="boxtitle">Edit Client Group</td><td class="boxtitle">Parent Group</td> + </tr> + <tr> + <td> + <label for="editgroupname">Name:</label> + <input type="text" name="editgroupname" id="editgroupname" value="{$groupdata[3]}"> + </td> + <td> + <select name="parentgroup" id="parentgroup"> + {foreach item=cgroup key=ckey from=$groups} + <option value="{$ckey}" {if $groupdata[1] == $ckey} selected {/if}>{$cgroup}</option> + {/foreach} + </select> + </td> + </tr> + <tr><td>as a subgroup of ---></td></tr> + <tr><td></td><td><input type="submit" name="editgroup" value="Save Changes"></td></tr> + </table> + </table> + {elseif $Action eq "delete"} + <h1>Delete</h1> + <b>Are you absolutely SURE you want to delete this group?</b> + <input type="hidden" name="delgroup" value="{$groupid}"> +<input type="submit" name="delgroup_confirm" value="Yes, remove the group"><input type="submit" name="delete_cancel" value="No wait! Cancel!"> + {else} + <table class="box" width="100%" border="1" cellpadding="0" cellspacing="0"> + <tr><td class="boxtitle">Client Groups</td></tr> + <tr><td> + + <table class="table" width="100%" border="1" cellspacing="0" cellpadding="0"> + <tr><td class="boxtitle">Group Name</td><td class="boxtitle">Edit</td><td class="boxtitle">Delete</td></tr> + {foreach item=group key=key from=$groups} + <tr><td>{$group}</td><td><a href="clients.php?View=groups&Action=edit&groupid={$key}">Edit</a></td><td><a href="clients.php?View=groups&Action=delete&groupid={$key}">Delete</a></td></tr> + {/foreach} + {/if} <!-- action --> + +</form> +{include file="footer.tpl"} diff --git a/scire/.smarty/templates/footer.tpl b/scire/.smarty/templates/footer.tpl new file mode 100644 index 0000000..010c5f8 --- /dev/null +++ b/scire/.smarty/templates/footer.tpl @@ -0,0 +1,9 @@ + <!-- end content --> + </td> + </tr> + </table> + </td> + </tr> + </table> + </body> +</html> diff --git a/scire/.smarty/templates/header.tpl b/scire/.smarty/templates/header.tpl new file mode 100644 index 0000000..d0d40b5 --- /dev/null +++ b/scire/.smarty/templates/header.tpl @@ -0,0 +1,91 @@ +{assign var="baseurl" value=$baseurl|default:"/"} +{assign var="leftbar" value=$leftbar|default:"off"} +{assign var="title" value=$title|default:""} +{assign var="subtitle" value=$subtitle|default:""} +{assign var="desc" value=$desc|default:""} +{assign var="theme" value=$theme|default:"std_grey"} +<?xml version="1.0" encoding="ISO-8859-1"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> + <head> + <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"/> + <title>Scire{if ($title ne "")} - {$title}{if ($subtitle ne "")} - {$subtitle}{/if}{/if}</title> + <link rel="icon" href="{$baseurl}favicon.ico" type="image/x-icon" /> + <link rel="shortcut icon" href="{$baseurl}favicon.ico" type="image/x-icon" /> + <link rel="stylesheet" href="{$baseurl}{$theme}.css" type="text/css" /> + +{if isset($head)}{$head}{/if} + </head> + <body link="#000000" alink="#ffffff"> + <table width="100%" bgcolor="#ffffff" border="0" cellspacing="0" cellpadding="0"> + <tr> + <td colspan="2"> + <table id="logobar" width="100%" border="0" cellspacing="0" cellpadding="10"> + <tr> + <td width="80"> + <a href="{$baseurl}index.php"><img src="{$baseurl}images/scire_trans.png" alt="Scire" border="0" width="80" height="80" /></a> + </td> + <td align="right" valign="top"> + <form id="search" name="search" method="post" action="{$baseurl}search.php"> + <label for="s">Search:</label> + <input type="text" id="s" name="s" size="16" /> + <input type="submit" name="g" value="go" /> + </form> + </td> + </tr> + </table> + </td> + </tr> + <tr> + <td id="topbar" colspan="2" height="22"> + <table width="100%" border="0" cellspacing="0" cellpadding="0"> + <tr> + <td><font color="#ffffff"> {section name=topbar_left loop=$topbar_left}<a href="{$baseurl}{$topbar_left[topbar_left].link}"><font color="#ffffff">{$topbar_left[topbar_left].name}</font></a>{if !$smarty.section.topbar_left.last} | {/if}{/section}</font></td> + <td align="right"><font color="#ffffff">{if isset($username)}<a href="{$baseurl}login.php?logout=True"><font color="#ffffff">Logout [{$username}]</font></a> | {/if}{section name=topbar_right loop=$topbar_right}<a href="{$baseurl}{$topbar_right[topbar_right].link}"><font color="#ffffff">{$topbar_right[topbar_right].name}</font></a>{if !$smarty.section.topbar_right.last} | {/if}{/section} </font></td> + </tr> + </table> + </td> + </tr> + <tr> +{if $leftbar eq "on"} + <td id="leftbar" valign="top" bgcolor="#a6afc2"> +{if isset($leftbar_menu)} + <ul id="menu"> +{section name=leftbar_menu loop=$leftbar_menu} + <li><a class="menuitem" href="{$baseurl}{$leftbar_menu[leftbar_menu].link}">{$leftbar_menu[leftbar_menu].name}</a></li> +{/section} + </ul> +{/if} +{if isset($leftbar_submenu)} + <p></p> + <ul id="submenu"> +{if isset($leftbar_submenu_title) && $leftbar_submenu_title ne ""} + <li>{$leftbar_submenu_title}</li> +{/if} +{section name=leftbar_submenu loop=$leftbar_submenu} + <li><a class="menuitem" href="{$baseurl}{$leftbar_submenu[leftbar_submenu].link}">{$leftbar_submenu[leftbar_submenu].name}</a></li> +{/section} + </ul> +{/if} + </td> +{/if} + <td width="100%" valign="top"> + <table width="100%" border="0" cellspacing="0" cellpadding="0"> + <tr> + <td id="header" bgcolor="#d8d4e2"> + <table width="100%" border="0" cellspacing="0" cellpadding="0"> + <tr> + <td> +{if $title ne ""} <h1>{$title}{if $subtitle ne ""} - {$subtitle}{/if}</h1>{/if} +{if $desc ne ""} <h2>{$desc}</h2>{/if} + </td> + <td align="right" valign="top"> +{if isset($status)} <p>{$status}</p>{/if} + </td> + </tr> + </table> + </td> + </tr> + <tr> + <td id="content" height="100%" valign="top" bgcolor="#ffffff"> + <!-- begin content --> diff --git a/scire/.smarty/templates/index.tpl b/scire/.smarty/templates/index.tpl new file mode 100644 index 0000000..bb57553 --- /dev/null +++ b/scire/.smarty/templates/index.tpl @@ -0,0 +1,8 @@ +{include file="header.tpl" title="Main Page"} +<p> +Welcome to Scire, {$user}<br> +This is the index page. It has index-y stuff on it. ok? +back off man it's not finished. +{$message|escape:"htmlall"} +</p> +{include file="footer.tpl"} diff --git a/scire/.smarty/templates/job.tpl b/scire/.smarty/templates/job.tpl new file mode 100644 index 0000000..8919f02 --- /dev/null +++ b/scire/.smarty/templates/job.tpl @@ -0,0 +1,307 @@ +{include file="header.tpl" title="Jobs"} +{if $Action eq "create"} +<h1>Add a Job</h1> +<form action="" method="post" name="add_jobform"> +<table width="100%" border="0" cellspacing="0" cellpadding="5"> + <tr> + <td align="left" valign="top"> + <table class="box" width="90%" border="1" cellspacing="0" cellpadding="0"> + <tr> + <td class="boxtitle">Script Selection</td> + </tr> + <tr> + <td> + <table border="0" cellspacing="0" cellpadding="5"> + <tr> + <td><label for="scripts">Scripts:</label></td> + </tr> + <tr> + {if isset($get.scriptid)} + + <td>Selected script:</td> + <td><input type="hidden" name="script" value="{$script.scriptid}">{$script.name}</td> + {else} + <td>Categories will go here</td> + <td> + <select name="script" size="1" > + {foreach from=$scripts item=script key=key} + <option value="{$script.scriptid}"> + {$script.name}</option> + {/foreach} + </select> + </td> + {/if} + </tr> + {if !isset($get.scriptid)} + <tr> + <td colspan="2">Or just type in the ID of the script: <input type="text" name="scriptID" ></td> + </tr> + {/if} + <tr> + <td colspan="2"><hr><h4>Override Script default values:</h4><br> + Permission: <select size="1" name="permission"> + {foreach from=$perms item=perm key=id} + <option value="{$perm}" + {if isset($script.permission)} + {if $perm eq $script.permission} selected {/if} + {/if} + >{$perm}</option> + {/foreach} + </select><br> + + Set Priority: <select size="1" name="priority"> + {foreach from=$priorities item=priority key=id} + <option value="{$priority}" + {if isset($script.priority)} + {if $priority eq $script.priority} selected {/if} + {/if} + >{$priority}</option> + {/foreach} + </select><br> + Log Location: <input type="text" name="log_location" value="{$script.log_location}"><br> + Success Code: (not worrying bout this now)<br> + Set dynamic content: <br> + </td> + </tr> + </table> + </td> + </tr> + </table> + </td> + + <td align="right" valign="top"> + <table class="box" width="50%" border="1" cellspacing="0" cellpadding="0"> + <tr> + <td class="boxtitle">Client Selection</td> + </tr> + <tr> + <td> + <table border="0" cellspacing="0" cellpadding="5"> + <tr> + {if isset($get.clientid)} + + <td>Selected client:</td> + <td><input type="hidden" name="clients[]" value="{$client.hostname}">{$client.hostname}</td> + {elseif isset($get.cgroupid)} + <td>Selected clientgroup:</td> + <td><input type="hidden" name="cgroups[]" value="{$get.cgroupid}">NAME HERE</td> + {else} + <td><label for="clientgroups">Clientgroups:</label></td> + <td><label for="clients">Clients:</label></td> + </tr> + <tr> + <td> + <select name="clientgroups[]" size="18" multiple="multiple"> + {foreach from=$cgroups item=cgroup key=id} + <option value="{$id}">{$cgroup}</option> + {/foreach} + </select> + </td> + <td> + <select name="clients[]" size="18" multiple="multiple"> + {section loop=$clients name=clients} + <option value="{$clients[clients].clientid}">{$clients[clients].hostname}</option> + {/section} + </select> + </td> + {/if} + </tr> + </table> + </td> + </tr> + </table> + Input staging client hostname (optional): <input type="text" name="staging"><br> + Staging success: <input type="radio" name="staging_success" value="result">Positive Result Code <input type="radio" name="staging_success" value="user">Manually approved + </td> + </tr> + </table> + <hr> + <table> + {if $dyn_tags} + <tr> + <th>Dynamic Tag</th><th>Value</th> + </tr> + {foreach from=$dyn_tags item=tag key=tagnum} + <tr> + <td>Tag: <b>{$tag}</b></td><td><input type="text" name="tag_{$tag}" value="{$tag_values[$tag]}" /></td> + </tr> + {/foreach} + {/if} +</table> +<hr> +Job Description: <br><textarea name="description" rows="3" cols="40"></textarea><br> +<table><tr> + <td><label for="runs_chedule">Run schedule:</label></td> + <td><input type="text" id="run_schedule" name="run_schedule" size="25" value="{$job.run_schedule}" /></td> + <td><label for="validity_period">Validity Period:<br>(in minutes)</label></td> + <td><input type="text" id="validity_period" name="validity_period" size="25" value="{$job.validity_period}" /></td> +</tr></table> + <fieldset> + <legend>Run Schedule</legend> + <table> + <tr> + <td> + <p>Minute(s):</p> + {html_options name=minutes options=$minutes selected=$selectedMinute size=6} + </td> + <td> </td> + <td> + <p>Hour(s):</p> + {html_options name=hours options=$hours selected=$selectedHour size=6} + </td> + <td> </td> + <td> + <p>Month(s):</p> + {html_options name=months options=$months selected=$selectedMonth size=6} + </td> + </tr> + + <tr> + <td> + <p>Day(s):</p> + {html_options name=days options=$days selected=$selectedDay size=6} + </td> + <td></td> + <td></td> + <td></td> + <td> + <p>Weekday(s):</p> + {html_options name=weekdays options=$weekdays selected=$selectedWeekday size=6} + </td> + </tr> + </table> + + </fieldset> +<table> +<tr><td> +<script language="JavaScript" src="calendar/calendar3.js"></script><!-- Date only with year scrolling --> +<label for="deploy_time">Start time: <input type="Text" name="deploy_time" value=""> + <a href="javascript:cal1.popup();"><img src="calendar/img/cal.gif" width="16" height="16" border="0" alt="Click Here to Pick up the date"></a></label> +</td> +<td> +<label for="expiration_time">End time: <input type="Text" name="expiration_time" value=""> + <a href="javascript:cal2.popup();"><img src="calendar/img/cal.gif" width="16" height="16" border="0" alt="Click Here to Pick up the date"></a></label> +<script language="JavaScript"> + <!-- // create calendar object(s) just after form tag closed + // specify form element as the only parameter (document.forms['formname'].elements['inputname']); + // note: you can have as many calendar objects as you need for your application + var cal1 = new calendar3(document.forms['add_jobform'].elements['deploy_time']); + cal1.year_scroll = false; + cal1.time_comp = true; + var cal2 = new calendar3(document.forms['add_jobform'].elements['expiration_time']); + cal2.year_scroll = false; + cal2.time_comp = true; + //--> + </script> +</td> +</tr> +</table> +<hr> +Job dependency stuff here.<B>CODE ME</B><br> +<!-- Set notification email address: <input type="radio" name="notify_addr" value="{$useremail}">{$useremail}</input><input type="radio" name="notify_addr" value="new"><input type="text" name="notify_new"></input> --> +<input type="submit" name="ADD" value="ADD JOB!!!"> +</form> +{elseif $Action eq "edit"} +<h1>Edit Job</h1> +<form action="" method="post" name="edit_jobform"> +<table width="100%" border="0" cellspacing="0" cellpadding="5"> + <tr> + <td colspan="2" align="center" valign="top"> + <table class="box" width="100%" border="1" cellspacing="0" cellpadding="0"> + <tr> + <td class="boxtitle">Job</td> + </tr> + <tr> + <td> + <table border="0" cellspacing="0" cellpadding="5"> + <tr> + <td><label for="addpriority">*Priority:</label></td> + <td><input type="text" id="editpriority" name="editpriority" value="{$job.priority}" /></td> + <td><label for="creator">Creator:</label></td> + <td><input type="text" id="creator" disabled name="creator" value="{$job.creator}" /></td> + + </tr> + <tr> + <td><label for="permission:">Permission:</label></td> + <td><input type="text" id="permission" name="permission" value="{$job.permission}" /></td> + + </tr> + <tr> + <td><label for="description">Description:</label></td> + <td colspan="3"><textarea id="description" name="description" cols="55" rows="5" > {$job.description}</textarea></td> + </tr> + <tr> + <td><label for="script">Script:</label></td> + <td><select id="script" name="script" size="1"> + {foreach item=sc from=$scripts } + {if $sc.scriptid eq $job.script} + <option value="{$sc.scriptid}" selected="selected">{$sc.name}</option> + {else} + <option value="{$sc.scriptid}">{$sc.name}</option> + {/if} + {/foreach} + </select> + </td> + </tr> + <tr> + <td><label for="runs_chedule">Run schedule:</label></td> + <td><input type="text" id="run_schedule" name="run_schedule" size="25" value="{$job.run_schedule}" /></td> + <td><label for="validity_period">Validity Period:<br>(in minutes)</label></td> + <td><input type="text" id="validity_period" name="validity_period" size="25" value="{$job.validity_period}" /></td> + </tr> + </table> + + <fieldset> + <legend>Run Schedule</legend> + <table> + <tr> + <td> + <p>Minute(s):</p> + {html_options name=minutes options=$minutes selected=$selectedMinute size=6} + </td> + <td> </td> + <td> + <p>Hour(s):</p> + {html_options name=hours options=$hours selected=$selectedHour size=6} + </td> + <td> </td> + <td> + <p>Month(s):</p> + {html_options name=months options=$months selected=$selectedMonth size=6} + </td> + </tr> + + <tr> + <td> + <p>Day(s):</p> + {html_options name=days options=$days selected=$selectedDay size=6} + </td> + <td></td> + <td></td> + <td></td> + <td> + <p>Weekday(s):</p> + {html_options name=weekdays options=$weekdays selected=$selectedWeekday size=6} + </td> + </tr> + </table> + + </fieldset> + + + <input type="hidden" name="jobid" value="{$job.jobid}"> + <p><input type="submit" name="EditJobSubmit" value="Save Changes" /></form></p> + </td> + </tr> + </table> + </td> + </tr> +</table> +{elseif $Action eq "delete"} +<h1>DELETING</h1> +<b>Are you absolutely SURE you want to delete job {$jobid}:<br>Description:{$job.description}?</b> +<input type="hidden" name="jobid" value="{$jobid}"> +<input type="submit" name="delete_confirm" value="Yes, get rid of it!"><input type="submit" name="delete_cancel" value="No wait!"> +{/if} + +{include file="footer.tpl"} diff --git a/scire/.smarty/templates/jobs.tpl b/scire/.smarty/templates/jobs.tpl new file mode 100755 index 0000000..9f9b586 --- /dev/null +++ b/scire/.smarty/templates/jobs.tpl @@ -0,0 +1,46 @@ +{include file="header.tpl" title="Jobs"} +<form action="" method="post" name="jobsform"> +<p> + <strong>Search filter: + <input type="text" name="searchfield"> + </strong> +</p> +{if $jobs} + <table class="box" width="100%" border="1" cellpadding="0" cellspacing="0"> + <tr><td class="boxtitle">Jobs</td></tr> + <tr><td> + + <table class="table" width="100%" border="1" cellspacing="0" cellpadding="0"> + <tr> + {foreach from=$fields item=i key=k} + <th> + <a href="jobs.php{if $f_attr[$i].sortable}?sorton={$i}&sortdir={if $sorton eq $i and $sortdir eq "desc"}asc{else}desc{/if}{/if}">{$f_attr[$i].name}</a> {if $f_attr[$i].sortable}<img src="images/sort_{if $sorton eq $i and $sortdir eq "desc"}desc{else}asc{/if}.png">{/if} + </th> + {/foreach} + + <th>Actions</th> + </tr> + {section name=jobs loop=$jobs} + <tr> + {foreach from=$fields item=item key=key} + {if $item eq "hostname"} + <td><a href="job.php?jobid={$jobs[jobs].jobid}&Action=edit">{$jobs[jobs].hostname}</a></td> + {else} + <td>{$jobs[jobs].$item}</td> + {/if} + {/foreach} + <td> + <a href="job.php?jobid={$jobs[jobs].jobid}&Action=view">View Details</a> + <a href="job.php?jobid={$jobs[jobs].jobid}&Action=edit">Edit</a> + <a href="job.php?jobid={$jobs[jobs].jobid}&Action=delete">Delete</a> + + </td> + </tr> + {/section} + + </td></tr> + + </table> +{/if} +</form> +{include file="footer.tpl"} diff --git a/scire/.smarty/templates/login.tpl b/scire/.smarty/templates/login.tpl new file mode 100644 index 0000000..d8c729c --- /dev/null +++ b/scire/.smarty/templates/login.tpl @@ -0,0 +1,39 @@ +{include file="header.tpl" title="Login"} + +<div style="display: table; width: 100%; height: 100%; _position: relative; overflow: hidden;"> +<div style="_position: absolute; _top: 50%; display: table-cell; vertical-align: middle;"> +<div style="_position: relative; _top: -50%;"> +<table class="box" align="center" border="1" cellspacing="0" cellpadding="0"> + <tr> + <td class="boxtitle">Please Login to use Scire</td> + </tr> + <tr> + <td> + <form id="login" name="login" method="post" action=""> + <table border="0" cellspacing="5" cellpadding="5"> + <tr> + + <td><label for="username">Username:</label></td> + <td><input type="text" id="username" name="username" value="" /></td> + </tr> + <tr> + <td><label for="passwd">Password:</label></td> + <td><input type="password" id="passwd" name="passwd" /></td> + </tr> + <tr> + + <td colspan="2" align="center"> + <input type="submit" name="submit" value="Login" /> + </td> + </tr> + </table> + </form> + </td> + </tr> + </table> + +</div> +</div> +</div> + +{include file="footer.tpl"} diff --git a/scire/.smarty/templates/message.tpl b/scire/.smarty/templates/message.tpl new file mode 100644 index 0000000..de37cdb --- /dev/null +++ b/scire/.smarty/templates/message.tpl @@ -0,0 +1,6 @@ +{include file="header.tpl"} + + <p> + {$message|escape:"htmlall"} + </p> +{include file="footer.tpl"}
\ No newline at end of file diff --git a/scire/.smarty/templates/modules.tpl b/scire/.smarty/templates/modules.tpl new file mode 100755 index 0000000..e70ed62 --- /dev/null +++ b/scire/.smarty/templates/modules.tpl @@ -0,0 +1,4 @@ +{include file="header.tpl" title="Modules"} +<form action="" method="post" name="modulesform"> +</form> +{include file="footer.tpl"} diff --git a/scire/.smarty/templates/modules/Exporter/index.tpl b/scire/.smarty/templates/modules/Exporter/index.tpl new file mode 100644 index 0000000..93cb8e5 --- /dev/null +++ b/scire/.smarty/templates/modules/Exporter/index.tpl @@ -0,0 +1,36 @@ +{include file="header.tpl" title="Server Information Exporter"} +List of clients in group: +<form name="form1" method="post" action="#"> +<select name="group" size="1"> +<option value=""></option> +<!-- +foreach ($profile_list as $profile) + print "<option value=\"". $profile['profileid']."\">".$profile['profile_name']."</option>\n"; +?> --> +</select> +<input type="submit" name="ChangeView" value="Go, because i hate doing it with javascript."> +</form> +<form name="form2" method="post" action="ExportedData.php"> +<table><tr> + <th>HOSTNAME</th> + <th>STATUS</th> + <th>IP</th> + <th>MAC</th> + <th>ASSET ID</th> + <th>INSTALL TIME</th> + </tr> +<!-- +foreach ($clients as $client) + print "<tr><td>".$client['hostname']."</td>\n"; + print "<td>".$client['status']."</td>\n"; + print "<td>".$client['ip']."</td>\n"; + print "<td>".$client['mac']."</td>\n"; + print "<td>".$client['assetid']."</td>\n"; + print "<td>".$client['installtime']."</td>\n"; +?> --> +</table> +<hr> +<input type="submit" name="ExportToXML" value="Export To XML"> +<input type="submit" name="ExportToCSV" value="Export To CSV"> +<input type="submit" name="ExportToTXT" value="Export To TXT"> +{include file="footer.tpl"} diff --git a/scire/.smarty/templates/modules/quickstart/index.tpl b/scire/.smarty/templates/modules/quickstart/index.tpl new file mode 100644 index 0000000..8440724 --- /dev/null +++ b/scire/.smarty/templates/modules/quickstart/index.tpl @@ -0,0 +1,86 @@ +{include file="header.tpl" title="Quickstart Server"} +<h3>Quickstart Server Status Overview</h3> +<form name="form1" method="post" action="#"> +List of clients currently installing:<br> +<table class="table" border="2"> + <tr> + <th>MAC</th> + <th>IP</th> + <th>PROFILE</th> + <th>STATUS</th> + </tr> +{foreach from=$clients item=client key=key} + {if $client.status eq 'Installing'} + <tr> + <td>{$client.mac}</td> + <td>{$client.ip}</td> + <td>{$client.profile}</td> + <td>{$client.status}</td> + </tr> + + {/if} +{/foreach} +</table> +List of clients pending installation:<br> +<table class="table"> + <tr> + <th>MAC</th> + <th>IP</th> + <th>PROFILE</th> + <th>STATUS</th> + </tr> +{foreach from=$clients item=client key=key} + {if $client.status eq 'Scheduled for Install'} + <tr> + <td>{$client.mac}</td> + <td>{$client.ip}</td> + <td>{$client.profile}</td> + <td>{$client.status}</td> + </tr> + + {/if} +{/foreach} +</table> +List of completed installations:<br> +<table class="table"> + <tr> + <th>MAC</th> + <th>IP</th> + <th>PROFILE</th> + <th>STATUS</th> + </tr> +{foreach from=$clients item=client key=key} + {if $client.status eq 'Install Complete'} + <tr> + <td>{$client.mac}</td> + <td>{$client.ip}</td> + <td>{$client.profile}</td> + <td>{$client.status}</td> + </tr> + + {/if} +{/foreach} +</table> +List of available profiles:<br> +<table class="table"> + <tr> + <th>Profile ID</th> + <th>Profile Name</th> + <th>Filename/URI</th> + <th>Description</th> + </tr> +{foreach from=$profiles item=profile key=key} + <tr> + <td>{$profile.profileid}</td> + <td>{$profile.profile_name}</td> + <td>{$profile.location}</td> + <td>{$profile.description}</td> + </tr> + +{/foreach} +</table> + + +<input type="submit" name="Submit" value="Submit"> +</form> +{include file="footer.tpl"} diff --git a/scire/.smarty/templates/permissions.tpl b/scire/.smarty/templates/permissions.tpl new file mode 100644 index 0000000..d6b1103 --- /dev/null +++ b/scire/.smarty/templates/permissions.tpl @@ -0,0 +1,94 @@ +{include file="header.tpl" title="Permissions"} +<form action="" method="post" name="userspermsform"> +<table class="box" width="100%" border="1" cellpadding="0" cellspacing="0"> + <tr><td class="boxtitle">Permissions</td></tr> + <tr><td> + + <table class="table" width="100%" border="1" cellspacing="0" cellpadding="0"> + <tr> + <th>{if $type eq "clients"}Client(s){else}User(s){/if}</th> + <th>Perm. Name</th> + <th>{if $type eq "clients"}from User(s){else}on Client(s){/if}</th> + <th width="7%">Allow/Deny</th> + <th>Active</th> + <th>Actions</th> + </tr> + {foreach from=$acls item=acl key=k} + <tr bgcolor="{cycle values="#eeeeee,#dddddd"}"> + <td> + {if $type eq "clients"} + {if $acl.axo} <!-- we have individual clients --> + {foreach from=$acl.axo.clients item=client key=key2} + <font style="background-color:#A0F8FF">Client: {$client}</font><br> + {/foreach} + {/if} + {foreach from=$acl.axo_groups item=group key=groupid} + <font style="background-color:#FFFACD">ClientGroup: {$cgroups[$group]} </font><br> + {/foreach} + {else} + + {if $acl.aro} <!-- we have individual users --> + {foreach from=$acl.aro.users item=user key=key2} + <font style="background-color:#A0F8FF">User: {$user}</font><br> + {/foreach} + {/if} + {foreach from=$acl.aro_groups item=group key=groupid} + <font style="background-color:#FFFACD">UserGroup: {$ugroups[$group]} </font><br> + {/foreach} + {/if} + </td> + <td> + {foreach from=$acl.aco item=ignore key=perm_category} + {$acl.aco.$perm_category[0]} + {/foreach} + </td> + <td> + {if $type eq "clients"} + {if $acl.aro} <!-- we have individual users --> + {foreach from=$acl.aro.users item=user key=key2} + <font style="background-color:#A0F8FF">User: {$user}</font><br> + {/foreach} + {/if} + {foreach from=$acl.aro_groups item=group key=groupid} + <font style="background-color:#FFFACD">UserGroup: {$ugroups[$group]} </font><br> + {/foreach} + {else} + {if $acl.axo} <!-- we have individual clients --> + {foreach from=$acl.axo.clients item=client key=key2} + <font style="background-color:#A0F8FF">Client: {$client}</font><br> + {/foreach} + {/if} + {foreach from=$acl.axo_groups item=group key=groupid} + <font style="background-color:#FFFACD">ClientGroup: {$cgroups[$group]} </font><br> + {/foreach} + {/if} + </td> + {if $acl.allow} + <td style="background-color: #008000">Allow</td> + {else} + <td style="background-color: #DC143C">Deny</td> + {/if} + <td> + {if $acl.enabled}Yes{else}No{/if} + </td> + <td> + <a href="assign_permission.php?Action=edit&aclid={$acl.acl_id}">Edit</a> + <a href="assign_permission.php?Action=delete&aclid={$acl.acl_id}">Delete</a> + </td> + </tr> + {/foreach} + + </table><hr> + </tr> + <tr> + <table><tr> + <td> + Blue = Single User/Client<br> + Tan = UserGroup/ClientGroup + </td> + <td align="right"><a href="assign_permission.php">Assign a Permission</a></td> + </tr> + </table> + </tr> +</form> +{include file="footer.tpl"} diff --git a/scire/.smarty/templates/script.tpl b/scire/.smarty/templates/script.tpl new file mode 100644 index 0000000..c4f19ec --- /dev/null +++ b/scire/.smarty/templates/script.tpl @@ -0,0 +1,107 @@ +{include file="header.tpl" title="Script"} +<form action="" method="post" name="scriptform"> +{if $Action eq "create"} + <table class="box" width="100%" border="1" cellpadding="0" cellspacing="0"> + <tr><td class="boxtitle">Create a Script</td></tr> + <tr><td> + + <table class="table" width="100%" border="1" cellspacing="0" cellpadding="0"> + <tr> + <td><label for="addname">*Script Name:</label></td> + <td><input type="text" id="addname" name="addname" value="{$addname}" /></td> + </tr><tr> + <td><label for="desc">*Description:</label></td> + <td><input type="text" id="desc" name="desc" size="50" value="{$desc}" /></td> + + </tr> + <tr> + <td><label for="runas">System user to run as (can be overwritten by job):</label></td> + <td colspan="3">Manual: <input type="text" id="runas" name="runas" value="{$runas}" /></td> + </tr> + <tr> + <td><input type="radio" name="runas_radio" value="root">root + <input type="radio" name="runas_radio" value="nobody">nobody</td> + <td><input type="radio" name="runas_radio" value="httpd">httpd + <input type="radio" name="runas_radio" value="apache">apache</td> + </tr> + <tr> + <td><label for="priority">Recommended Priority:</label></td> + <td><select name="priority" size="1"> + {foreach from=$priorities item=pri key=key} + <option value="{$pri}" {if $pri eq $priority}selected{/if}>{$pri}</option> + {/foreach} + </select> + </td> + <td><label for="permission">Recommended Permission:</label></td> + <td> + <select name="permission" size="7"> + {foreach from=$perms item=perm key=id} + <option value="{$perm.id}" {if $perm.id eq $permission}selected{/if}>{$perm.name}</option> + {/foreach} + </select> + </td> + </tr> + <tr> + <td><hr></td> + </tr> + <tr> + <td>*Actual Script to run on client: </td> + <td><input type="radio" name="script_data_type" value="load" disabled>Load from file <input type="upload" name="script_data_upload"></td> + </tr> + <tr> + <td></td> + <td><input type="radio" name="script_data_type" value="manual" checked>Input manually below</td> + </tr> + <tr> + <td colspan="2"><textarea name="script_data_manual" rows="10" cols="80" > +{$script_data} + </textarea> </td> + </tr> + + <tr> + <td><input type="submit" name="continue" value="Find Dynamic Tags">this button will take input above and parse and look for dynamic tags. it will then generate the table below + </td> + </tr> + + </table> + <table class="table" width="100%" border="1" cellspacing="0" cellpadding="0"> + {if $dyn_tags} + <tr> + <th>Dynamic Tag</th><th>Default Value</th> + </tr> + {foreach from=$dyn_tags item=tag key=tagnum} + <tr> + <td>Tag: <b>{$tag}</b></td><td><input type="text" name="tag_{$tag}" value="" /></td> + </tr> + {/foreach} + <tr> + <td><hr></td> + </tr> + {/if} + <tr> + <td>Success return code (default 0): <input type="text" name="success_code" value="0"> + </td> + </tr> + <tr> + <td>Post Processing Script:</td><td><input type="radio" name="pps_type" value="none" checked>No post-processing needed, this script just returns.</td> + </tr> + <tr> + <td></td><td><input type="radio" name="pps_type" value="load" disabled >Load from file: <input type="upload" name="pps_load"></td> + </tr> + <tr> + <td></td><td><input type="radio" name="pps_type" value="manual" >Input Manually below</td> + </tr> + <tr> + <td colspan="2"><textarea name="pps_data" rows="6" cols="80"></textarea></td> + </tr> + + </table> + </td></tr> + <input type="submit" name="add_script" value="Add Script"> +{/if} + + + + +</form> +{include file="footer.tpl"} diff --git a/scire/.smarty/templates/script_library.tpl b/scire/.smarty/templates/script_library.tpl new file mode 100644 index 0000000..be796f5 --- /dev/null +++ b/scire/.smarty/templates/script_library.tpl @@ -0,0 +1,32 @@ +{include file="header.tpl" title="Script Library"} +<form action="" method="post" name="scriptsform"> + + <table class="box" width="100%" border="1" cellpadding="0" cellspacing="0"> + <tr><td class="boxtitle" colspan="6">Scripts</td></tr> + <tr class="table"> + <th>Name</th><th>Description</th><th>Last Used</th><th>OS</th><th>Permissions</th><th>Actions</th> + </tr> + {foreach from=$scripts item=script key=key} + <tr class="table"> + <td>{$script.name}</td> + <td>{$script.description}</td> + <td>LAST USED HERE</td> + <td>ADD OS TO SCRIPT TABLE</td> + <td>{$script.permission}</td> + <td><a href="job.php?Action=create&scriptid={$script.scriptid}">Create Job</a>|<a href="script.php?Action=Edit&scriptid={$script.scriptid}">Edit</a>|<a href="script.php?Action=Delete&scriptid={$script.scriptid}">Delete</a><a href="script.php?Action=Copy&scriptid={$script.scriptid}">Copy as New</a></td> + </tr> + {/foreach} + <tr class="table"> + <td>Install Package</td> + <td>This will install a specified package to the client.</td> + <td>Today</td> + <td>Gentoo</td> + <td>Install</td> + <td><a href="add_job.php?scriptid=1">Create Job</a>|<a href="script.php?Action=Edit&scriptid=1">Edit</a>|<a href="script.php?Action=Delete&scriptid=1">Delete</a><a href="script.php?Action=Copy%scriptid=1">Copy as New</a></td> + + </tr> + + </table> + +</form> +{include file="footer.tpl"} diff --git a/scire/.smarty/templates/settings.tpl b/scire/.smarty/templates/settings.tpl new file mode 100755 index 0000000..a4d4742 --- /dev/null +++ b/scire/.smarty/templates/settings.tpl @@ -0,0 +1,50 @@ +{include file="header.tpl" title="Settings"} +<form action="" method="post" name="settingsform"> + + <table class="box" width="100%" border="1" cellpadding="0" cellspacing="0"> + <tr><td class="boxtitle">Settings</td></tr> + <tr><td> + + <table class="table" width="100%" border="1" cellspacing="0" cellpadding="0"> + <tr> + <td><label for="start_page">Start Page:</label></td> + <td><input type="text" name="start_page" value="{$start_page}"></td> + </tr> + <tr> + <td><label for="theme">Theme:</label></td> + <td><select name="theme"> + {section name=theme loop=$themes} + <option value="{$themes[theme].link}" {if $themes[theme].link eq $theme} selected {/if} + >{$themes[theme].name}</option> + {/section} + </select></td> + </tr> + <tr> + <td><label for="language">Language (not yet available):</label></td> + <td><select name="language"> + {section name=lang loop=$languages} + <option value="{$languages[lang].value}">{$languages[lang].name}</option> + {/section} + </select></td> + </tr> + <tr> + <td><label for="notification">Send Notifications to:</label></td> + <td><input type="radio" name="notification" value="phone" {if $notification eq "phone"} checked {/if}>Phone</td> + <td><input type="radio" name="notification" value="pager" {if $notification eq "pager"} checked {/if}>Pager</td> + </tr> + <tr> + <td><label for="per_page">Max Jobs/Clients to show per page:</label></td> + <td><input type="radio" name="per_page" value="2" {if $per_page eq "2"} checked {/if}>25</td> + <td><input type="radio" name="per_page" value="3" {if $per_page eq "3"} checked {/if}>50</td> + <td><input type="radio" name="per_page" value="10" {if $per_page eq "10"} checked {/if}>100</td> + </tr> + <tr> + <td><label for="vacation">On Vacation, contact:</label> + + </td></tr> + <tr><td><input type="submit" name="save_settings" value="Save Settings"></td> + </tr> + </table> + +</form> +{include file="footer.tpl"} diff --git a/scire/.smarty/templates/settings_page.tpl b/scire/.smarty/templates/settings_page.tpl new file mode 100644 index 0000000..1700377 --- /dev/null +++ b/scire/.smarty/templates/settings_page.tpl @@ -0,0 +1,32 @@ +{include file="header.tpl" title="$View Page Settings"} +<form action="" method="post" name="settingsform"> + + <table class="box" width="100%" border="1" cellpadding="0" cellspacing="0"> + <tr><td class="boxtitle" width="3%">Sort On</td><td class="boxtitle" width="10%">View Order (blank to not show)</td><td class="boxtitle">Field Name</td></tr> + {foreach from=$fields item=item key=key} + <tr class="table"> + <td>{if $item.sortable} + <input type="radio" name="sorton" value="{$key}" + {if $sorton eq $key} checked {/if} + >{/if} + </td> + <td><input type="text" name="{$View}_{$key}" + value="{if $curr_list[$key]}{$curr_list[$key]}{/if}" + size="5"></td> + <td>{$item.name}</td> + </tr> + {/foreach} + <tr> + <td><label for="sortdir">Sort Direction:</label></td> + <td> + <select name="sortdir"> + <option value="asc" {if $sortdir eq "asc"} selected {/if}>Ascending</option> + <option value="desc" {if $sortdir eq "desc"} selected {/if}>Descending</option> + </select> + </td> + </tr> + <tr><td><input type="submit" name="save_{$View}_settings" value="Save Settings"></td></tr> + </table> + +</form> +{include file="footer.tpl"} diff --git a/scire/.smarty/templates/ui_permissions.tpl b/scire/.smarty/templates/ui_permissions.tpl new file mode 100755 index 0000000..b6f7b13 --- /dev/null +++ b/scire/.smarty/templates/ui_permissions.tpl @@ -0,0 +1,196 @@ +{include file="header.tpl" title="Scire User Interface Permissions"} +<form action="" method="post" name="ui_permform"> +{if $Action eq "delete"} +<b>Are you absolutely SURE you want to delete this ACL?</b> +<input type="hidden" name="aclid" value="{$aclid}"> +<input type="submit" name="delete_confirm" value="Yes, that's why I clicked 'Delete', duh!"><input type="submit" name="delete_cancel" value="No wait!"> +{elseif $Action eq "add" or $Action eq "edit"} +<table width="100%" border="0" cellspacing="0" cellpadding="5"> + <tr> + <td align="center" valign="top"> + <table class="box" width="50%" border="1" cellspacing="0" cellpadding="0"> + <tr> + <td class="boxtitle">User Selection</td> + </tr> + <tr> + <td> + <table border="0" cellspacing="0" cellpadding="5"> + <tr> + <td><label for="usergroups">Usergroups:</label></td> + <td><label for="users">Users:</label></td> + </tr> + <tr> + {if isset($get.username)} + <td>Selected User:</td> + <td><input type="hidden" name="users[]" value="{$get.username}">{$get.username}</td> + {elseif isset($get.usergroup)} + {else} + <td> + <select name="usergroups[]" size="18" multiple="multiple"> + {foreach from=$ugroups item=ugroup key=id} + <option value="{$id}" + {if isset($acl)} + {foreach from=$acl.aro_groups item=group key=groupid} + {if $id eq $group} selected {/if} + {/foreach} + {/if} + >{$ugroup}</option> + {/foreach} + </select> + </td> + <td> + <select name="users[]" size="18" multiple="multiple"> + {section loop=$users name=users} + <option value="{$users[users].username}" + {if isset($acl)} + {foreach from=$acl.aro.users item=user key=key2} + {if $users[users].username eq $user} selected {/if} + {/foreach} + {/if} + >{$users[users].username}</option> + {/section} + </select> + </td> + {/if} + </tr> + </table> + </td> + </tr> + </table> + </td> + <td align="center" valign="top"> + <table class="box" width="50%" border="1" cellspacing="0" cellpadding="0"> + <tr> + <td class="boxtitle">Permission Selection</td> + </tr> + <tr> + <td> + <table border="0" cellspacing="0" cellpadding="5"> + <tr> + <td><label for="perm">Permissions (choose an existing or create a new one):</label></td> + </tr> + <tr> + <td> + <select name="perm" size="7"> + {foreach from=$perms item=perm key=id} + <option value="{$perm}" + {if isset($acl)} + {foreach from=$acl.aco item=ignore key=perm_category} + {if $perm eq $acl.aco.$perm_category[0]} selected {/if} + {/foreach} + {/if} + >{$perm}</option> + {/foreach} + </select> + </td> + </tr> + <tr> + <td><label for="newpermname">New Permission Name:</label><input name="newpermname" type="text" size="20"></td> + </tr> + <tr> + <td><label for="newpermdesc">New Permission Description:</label></td> + </tr> + <tr> + <td><textarea name="newpermdesc" rows="3" cols="20"></textarea></td> + </tr> + </table> + </td> + </tr> + </table + </td> + </tr> + <tr> + <td align="center"><input type="radio" name="allow" value="1" + {if isset($acl)} + {if $acl.allow} checked {/if} + {else} + checked + {/if} + >Allow + <input type="radio" name="allow" value="0" + {if isset($acl)} + {if (!$acl.allow)} checked {/if} + {/if} + >Deny</td> + <td align="center"><input type="checkbox" name="active" value="1" + {if isset($acl)} + {if $acl.enabled} checked {/if} + {else} + checked + {/if} + >Active (vs. hidden)</td> + <td align="right" valign="bottom"> + <label for="note">Note:</label><input type="text" name="note" + {if isset($acl)} + value="{$acl.note}" + {/if} + > + {if isset($acl)} + <input type="hidden" name="editing" value="{$acl.acl_id}"> + <input type="submit" name="editperm_submit" value="Update Permission"> + {else} + <input type="submit" name="addperm_submit" value="Assign Permission"> + {/if} + </td> + </tr> +</table> +{else} +<table class="box" width="100%" border="1" cellpadding="0" cellspacing="0"> + <tr><td class="boxtitle">Scire User Interface Permissions</td></tr> + <tr><td> + + <table class="table" width="100%" border="1" cellspacing="0" cellpadding="0"> + <tr> + <th>User(s)</th> + <th>Perm. Name</th> + <th width="7%">Allow/Deny</th> + <th>Active</th> + <th>Actions</th> + </tr> + {foreach from=$acls item=acl key=k} + <tr bgcolor="{cycle values="#eeeeee,#dddddd"}"> + <td> + {if $acl.aro} <!-- we have individual users --> + {foreach from=$acl.aro.users item=user key=key2} + <font style="background-color:#A0F8FF">User: {$user}</font><br> + {/foreach} + {/if} + {foreach from=$acl.aro_groups item=group key=groupid} + <font style="background-color:#FFFACD">UserGroup: {$ugroups[$group]} </font><br> + {/foreach} + </td> + <td> + {foreach from=$acl.aco item=ignore key=perm_category} + {$acl.aco.$perm_category[0]} + {/foreach} + </td> + {if $acl.allow} + <td style="background-color: #008000">Allow</td> + {else} + <td style="background-color: #DC143C">Deny</td> + {/if} + <td> + {if $acl.enabled}Yes{else}No{/if} + </td> + <td> + <a href="ui_permissions.php?Action=edit&aclid={$acl.acl_id}">Edit</a> + <a href="ui_permissions.php?Action=delete&aclid={$acl.acl_id}">Delete</a> + </td> + </tr> + {/foreach} + + </table><hr> + </tr> + <tr> + <table><tr> + <td> + Blue = Single User/Client<br> + Tan = UserGroup/ClientGroup + </td> + <td align="right"><a href="ui_permissions.php?Action=add">Assign a Permission</a></td> + </tr> + </table> + </tr> +{/if} +</form> +{include file="footer.tpl"} diff --git a/scire/.smarty/templates/user.tpl b/scire/.smarty/templates/user.tpl new file mode 100755 index 0000000..6599bae --- /dev/null +++ b/scire/.smarty/templates/user.tpl @@ -0,0 +1,216 @@ +{include file="header.tpl" title="Users"} +<form action="" method="post" name="edit_userform"> +{if $Action eq "addgroup"} + <table width="100%" border="0" cellspacing="0" cellpadding="5"> + <tr><td class="boxtitle">Add user to group</td></tr> + <tr> + <td colspan="2" align="center" valign="top"> + <table class="box" width="100%" border="1" cellspacing="0" cellpadding="0"> + <tr> + <td class="boxtitle" width="15">Add</td><td class="boxtitle">Group Name</td> + </tr> + {foreach from=$groups name=ugroup item=item key=id} + <tr> + <td><input type="checkbox" name="addgroupid[]" value="{$id}" + {if isset($ingroups)} {if in_array($id, $ingroups)} checked {/if} {/if} + ></td> + <td>{$item}</td> + </tr> + {/foreach} + <tr><td> + <input type="hidden" name="userid" value="{$userid}"> + <input type="submit" name="addgroup_confirm" value="Save Changes"> + </td></tr> + </table> + </td> + </tr> + </table> +{elseif $Action eq "create"} +<table width="100%" border="0" cellspacing="0" cellpadding="5"> + <tr> + <td colspan="2" align="center" valign="top"> + <table class="box" width="100%" border="1" cellspacing="0" cellpadding="0"> + <tr> + <td class="boxtitle">User</td><td class="boxtitle">Groups</td> + </tr> + <tr> + <td> + <table border="0" cellspacing="0" cellpadding="5"> + <tr> + <td><label for="addusername">*Username:</label></td> + <td><input type="text" id="addusername" name="addusername" /></td> + <td><label for="passwd">*Password:</label></td> + <td><input type="password" id="passwd" name="passwd" /></td> + + </tr> + <tr> + <td><label for="real_name">Real name:</label></td> + <td><input type="text" id="real_name" name="real_name" /></td> + <td><label for="passwd2">Confirm Password:</label></td> + <td><input type="password" id="passwd2" name="passwd2" /></td> + + </tr> + <tr> + <td><label for="comment">Comment:</label></td> + <td><input type="text" id="comment" name="comment" /></td> + <td><label for="status">Status:</label></td> + <td><select id="status" name="status" size="1"> + <option value="active" selected="selected">Active</option> + <option value="disabled">Disabled</option> + </select> + </td> + </tr> + <tr> + <td><label for="email">*Email Address:</label></td> + <td><input type="text" id="email" name="email" /></td> + <td><label for="phone">Phone:</label></td> + <td><input type="text" id="phone" name="phone" /></td> + </tr> + <tr> + <td><label for="pager">Pager:</label></td> + <td><input type="text" id="pager" name="pager" /></td> + </tr> + </table> + <p><input type="submit" name="AddUserSubmit" value="Add User" /></p> + </td> + <td> + <table> + <tr><td>Assign user to the following groups:</td></tr> + <tr><td> + <select name="groups[]" size="10" multiple="multiple" id="groups"> + {foreach from=$groups item=ugroup key=id} + <option value="{$id}">{$ugroup}</option> + {/foreach} + </select> + </td> + </tr></table> + </td> + </tr> + </table> + </td> + </tr> +{elseif $Action eq "edit"} + <table width="100%" border="0" cellspacing="0" cellpadding="5"> + <tr> + <td colspan="2" align="center" valign="top"> + <table class="box" width="100%" border="1" cellspacing="0" cellpadding="0"> + <tr> + <td class="boxtitle">User</td> + </tr> + <tr> + <td> + <table border="0" cellspacing="0" cellpadding="5"> + <tr> + {if check_access("Change User Pass/Name") } + <td><label for="editusername">*Username:</label></td> + <td><input type="text" id="editusername" name="editusername" value="{$user.username}"></td> + {else} + <td><label for="editusername">*Username:</label></td> + <td><input type="hidden" id="editusername" name="editusername" value="{$user.username}">{$user.username}</td> + {/if} + <td><label for="passwd">*Password:</label></td> + <td><input type="password" id="passwd" name="passwd" {if !check_access("Change User Pass/Name") }disabled {/if}/></td> + </tr> + <tr> + <td><label for="real_name">Real name:</label></td> + <td><input type="text" id="real_name" name="real_name" value="{$user.real_name}" /></td> + <td><label for="passwd2">Confirm Password:</label></td> + <td><input type="password" id="passwd2" name="passwd2" {if !check_access("Change User Pass/Name") }disabled {/if}/></td> + </tr> + <tr> + <td><label for="comment">Comment:</label></td> + <td><input type="text" id="comment" name="comment" value="{$user.comment}" /></td> + <td><label for="status">Status:</label></td> + <td> + <select id="status" name="status" size="1"> + <option value="active" selected="selected">Active</option> + <option value="disabled">Disabled</option> + </select> + </td> + </tr> + <tr> + <td><label for="email">*Email Address:</label></td> + <td><input type="text" id="email" name="email" value="{$user.email}" /></td> + <td><label for="phone">Phone:</label></td> + <td><input type="text" id="phone" name="phone" value="{$user.phone}" /></td> + </tr> + <tr> + <td><label for="pager">Pager:</label></td> + <td><input type="text" id="pager" name="pager" value="{$user.pager}" /></td> + </tr> + </table><input type="hidden" name="userid" value="{$user.userid}"> + <p><input type="submit" name="EditUserSubmit" value="Update" /></p> + </td> + </tr> + </table> + </td> + </tr> + <tr> + <td align="center" valign="top"> + <table class="box" width="100%" border="1" cellspacing="0" cellpadding="0"> + <tr> + <td class="boxtitle">Groups</td> + </tr> + <tr> + <td> + <table class="table" width="100%" border="1" cellspacing="0" cellpadding="0"> + <tr> + <th>Groupname</th> + <th>Actions</th> + </tr> + {section name=group loop=$groups} + <tr> + <td>{$groups[group].name}{if $groups[group].parent} (subgroup of {$groups[group].parent}){/if}</td> + <td><input type="submit" name="rmug_{$groups[group].id}" value="Remove"></td> + </tr> + {/section} + <tr><td><a href="user.php?userid={$user.userid}&Action=addgroup">Add user to a group</a></td></tr> + </table> + </td> + </tr> + </table> + </td> + <td align="center" valign="top"> + <table class="box" width="100%" border="1" cellspacing="0" cellpadding="0"> + <tr> + <td class="boxtitle">Permissions</td> + </tr> + <tr> + <td> + <table class="table" width="100%" border="1" cellspacing="0" cellpadding="0"> + <tr> + <th>Category -> Permission</th> + <th>On Client(s)</th> + <th>Actions</th> + </tr> + {foreach from=$acls item=acl key=k} + <tr> + <td>{foreach from=$acl.aco item=perm key=category}{$category} -> {$perm[0]}{/foreach}</td> + <td> + {if $acl.axo} <!-- we have individual clients --> + {foreach from=$acl.axo.clients item=client key=key2} + <font style="background-color:#A0F8FF">Client: {$client}</font><br> + {/foreach} + {/if} + {foreach from=$acl.axo_groups item=group key=groupid} + <font style="background-color:#FFFACD">ClientGroup: {$cgroups[$group]} </font><br> + {/foreach} + </td> + <td><form id="form1" name="form1" method="post" action=""><input type="hidden" name="perm_id" value="{$acl.acl_id}" /><input type="submit" name="submit" value="Remove" /></form></td> + </tr> + {/foreach} + <tr><td><a href="assign_permission.php?username={$user.username}">Assign a permission for this user</a></td></tr> + </table> + </td> + </tr> + </table> + </td> + </tr> +</table> +{elseif $Action eq "delete"} +<b>Are you absolutely SURE you want to delete user {$user.username}?</b> +<input type="hidden" name="userid" value="{$user.userid}"> +<input type="submit" name="delete_confirm" value="Yes, get rid of the bastard!"><input type="submit" name="delete_cancel" value="No wait!"> +{/if} +</form> +{include file="footer.tpl"} diff --git a/scire/.smarty/templates/users.tpl b/scire/.smarty/templates/users.tpl new file mode 100755 index 0000000..f197a55 --- /dev/null +++ b/scire/.smarty/templates/users.tpl @@ -0,0 +1,37 @@ +{include file="header.tpl" title="Users"} +<form action="" method="post" name="usersform"> +<p><strong>Search filter: + <input type="text" name="searchfield"> +</strong></p> +{if $users} + <table class="box" width="100%" border="1" cellpadding="0" cellspacing="0"> + <tr><td class="boxtitle">Users</td></tr> + <tr><td> + + <table class="table" width="100%" border="1" cellspacing="0" cellpadding="0"> + <tr> + {foreach from=$fields item=i key=k} + <th> + <a href="users.php{if $f_attr[$i].sortable}?sorton={$i}&sort={if $sorton eq $i and $sortdir eq "desc"}asc{else}desc{/if}{/if}">{$f_attr[$i].name}</a> {if $f_attr[$i].sortable}<img src="images/sort_{if $sorton eq $i and $sortdir eq "desc"}desc{else}asc{/if}.png">{/if} + </th> + {/foreach} + <th>Actions</th> + </tr> + {section name=users loop=$users} + <tr> + {foreach from=$fields item=item key=key} + {if $item eq "username"} + <td><a href="user.php?userid={$users[users].userid}&Action=edit">{$users[users].username}</a></td> + {else} + <td>{$users[users].$item}</td> + {/if} + {/foreach} + <td><a href="user.php?userid={$users[users].userid}&Action=edit">Edit</a> <a href="user.php?userid={$users[users].userid}&Action=delete">Delete</a></td> + </tr> + {/section} + + </td></tr> + </table> +{/if} +</form> +{include file="footer.tpl"} diff --git a/scire/.smarty/templates/users_groups.tpl b/scire/.smarty/templates/users_groups.tpl new file mode 100644 index 0000000..f838ffc --- /dev/null +++ b/scire/.smarty/templates/users_groups.tpl @@ -0,0 +1,74 @@ +{include file="header.tpl" title="Users"} +<form action="" method="post" name="usersgroupsform"> +{if $Action eq "create"} + <table class="box" width="100%" border="1" cellpadding="0" cellspacing="0"> + <tr><td class="boxtitle">Create a User Group</td></tr> + <tr><td> + + <table class="table" width="100%" border="1" cellspacing="0" cellpadding="0"> + <tr> + <td class="boxtitle">Add User Group</td><td class="boxtitle">Parent Group</td> + </tr> + <tr> + <td> + <label for="addgroupname">Name:</label> + <input type="text" name="addgroupname" id="addgroupname"> + </td> + <td> + <select name="parentgroup" id="parentgroup"> + {foreach item=cgroup key=ckey from=$groups} + <option value="{$ckey}">{$cgroup}</option> + {/foreach} + </select> + </td> + </tr> + <tr><td>as a subgroup of ---></td></tr> + <tr><td></td><td><input type="submit" name="addgroup" value="Add User Group"></td></tr> + </table> + </table> + {elseif $Action eq "edit"} + <input type="hidden" name="groupid" value="{$groupid}"> + <table class="box" width="100%" border="1" cellpadding="0" cellspacing="0"> + <tr><td class="boxtitle">Edit User Group {$groupdata[3]}</td></tr> + <tr><td> + + <table class="table" width="100%" border="1" cellspacing="0" cellpadding="0"> + <tr> + <td class="boxtitle">Edit User Group</td><td class="boxtitle">Parent Group</td> + </tr> + <tr> + <td> + <label for="editgroupname">Name:</label> + <input type="text" name="editgroupname" id="editgroupname" value="{$groupdata[3]}"> + </td> + <td> + <select name="parentgroup" id="parentgroup"> + {foreach item=cgroup key=ckey from=$groups} + <option value="{$ckey}" {if $groupdata[1] == $ckey} selected {/if}>{$cgroup}</option> + {/foreach} + </select> + </td> + </tr> + <tr><td>as a subgroup of ---></td></tr> + <tr><td></td><td><input type="submit" name="editgroup" value="Save Changes"></td></tr> + </table> + </table> + {elseif $Action eq "delete"} + <h1>Delete</h1> + <b>Are you absolutely SURE you want to delete this group?</b> + <input type="hidden" name="delgroup" value="{$groupid}"> +<input type="submit" name="delgroup_confirm" value="Yes, remove the group"><input type="submit" name="delete_cancel" value="No wait! Cancel!"> + {else} + <table class="box" width="100%" border="1" cellpadding="0" cellspacing="0"> + <tr><td class="boxtitle">User Groups</td></tr> + <tr><td> + + <table class="table" width="100%" border="1" cellspacing="0" cellpadding="0"> + <tr><td class="boxtitle">Group Name</td><td class="boxtitle">Edit</td><td class="boxtitle">Delete</td></tr> + {foreach item=group key=key from=$groups} + <tr><td>{$group}</td><td><a href="users.php?View=groups&Action=edit&groupid={$key}">Edit</a></td><td><a href="users.php?View=groups&Action=delete&groupid={$key}">Delete</a></td></tr> + {/foreach} + {/if} <!-- action --> + +</form> +{include file="footer.tpl"} diff --git a/scire/2col_leftNav.css b/scire/2col_leftNav.css new file mode 100755 index 0000000..5ced7bd --- /dev/null +++ b/scire/2col_leftNav.css @@ -0,0 +1,307 @@ +/***********************************************/
+/* 2col_leftNav.css */
+/* Use with template 2col_leftNav.html */
+/***********************************************/
+
+/***********************************************/
+/* HTML tag styles */
+/***********************************************/
+
+body{
+ font-family: Arial,sans-serif;
+ color: #333333;
+ line-height: 1.166;
+ margin: 0px;
+ padding: 0px;
+}
+
+a:link, a:visited, a:hover {
+ color: #006699;
+ text-decoration: none;
+}
+
+a:hover {
+ text-decoration: underline;
+}
+/* overrides decoration from previous rule for hovered links */
+
+h1, h2, h3, h4, h5, h6 {
+ font-family: Arial,sans-serif;
+ margin: 0px;
+ padding: 0px;
+}
+
+h1{
+ font-family: Verdana,Arial,sans-serif;
+ font-size: 120%;
+ color: #334d55;
+}
+
+h2{
+ font-size: 114%;
+ color: #006699;
+}
+
+h3{
+ font-size: 100%;
+ color: #334d55;
+}
+
+h4{
+ font-size: 100%;
+ font-weight: normal;
+ color: #333333;
+}
+
+h5{
+ font-size: 100%;
+ color: #334d55;
+}
+
+ul{
+ list-style-type: square;
+}
+
+ul ul{
+ list-style-type: disc;
+}
+
+ul ul ul{
+ list-style-type: none;
+}
+
+label{
+ font: bold 100% Arial,sans-serif;
+ color: #334d55;
+}
+
+
+/***********************************************/
+/* Layout Divs */
+/***********************************************/
+
+#masthead{
+ margin: 0;
+ padding: 10px 0px;
+ border-bottom: 1px solid #cccccc;
+ width: 100%;
+}
+
+#navBar{
+ margin: 0 85% 0 0;
+ padding: 0px;
+ background-color: #eeeeee;
+ border-right: 1px solid #ccc;
+ border-bottom: 1px solid #ccc;
+}
+
+#content{
+ float:right;
+ width: 75%;
+ margin: 0;
+ padding: 0 3% 0 0;
+}
+
+
+/***********************************************/
+/*Component Divs */
+/***********************************************/
+
+#siteName{
+ margin: 0px;
+ padding: 0px 0px 10px 10px;
+}
+
+
+/*************** #pageName styles **************/
+
+#pageName{
+ padding: 0px 0px 10px 10px;
+}
+
+
+/************* #globalNav styles **************/
+
+#globalNav{
+color: #cccccc;
+padding: 0px 0px 0px 10px;
+white-space: nowrap;
+}
+/* 'nowrap' prevents links from line-wrapping if there are too many to fit in one line
+ this will force a horizontal scrollbar if there isn't enough room for all links
+ remove rule or change value to 'normal' if you want the links to line-wrap */
+
+#globalNav img{
+ display: block;
+}
+
+#globalNav a {
+ font-size: 90%;
+ padding: 0px 4px 0px 0px;
+}
+
+
+/************* #breadCrumb styles *************/
+
+#breadCrumb{
+ font-size: 80%;
+ padding: 5px 0px 5px 10px;
+}
+
+
+/************** .feature styles ***************/
+
+.feature{
+ padding: 0px 0px 10px 10px;
+ font-size: 80%;
+}
+
+.feature h3{
+ padding: 30px 0px 5px 0px;
+ text-align: center;
+}
+
+.feature img{
+ float: left;
+ padding: 0px 10px 0px 0px;
+ margin: 0 5px 5px 0;
+}
+/* adjust margins to change separation between the feature image and text flowing around it */
+
+
+/************** .story styles *****************/
+
+.story{
+ clear: both;
+ padding: 10px 0px 0px 10px;
+ font-size: 80%;
+}
+
+.story p{
+ padding: 0px 0px 10px 0px;
+}
+
+
+/************* #siteInfo styles ***************/
+
+#siteInfo{
+ clear: both;
+ border: 1px solid #cccccc;
+ font-size: 75%;
+ color: #cccccc;
+ padding: 10px 10px 10px 10px;
+ margin-top: 0px;
+}
+/* negative top margin pulls siteinfo up so its top border overlaps (and thus lines up with)
+ the bottom border of the navBar in cases where they "touch" */
+
+#siteInfo img{
+ padding: 4px 4px 4px 0px;
+ vertical-align: middle;
+}
+
+
+/************* #search styles ***************/
+
+#search{
+ padding: 5px 0px 5px 10px;
+ border-bottom: 1px solid #cccccc;
+ font-size: 90%;
+}
+
+#search form{
+ margin: 0px;
+ padding: 0px;
+}
+
+#search label{
+ display: block;
+ margin: 0px;
+ padding: 0px;
+}
+
+
+/*********** #navBar link styles ***********/
+
+#navBar ul a:link, #navBar ul a:visited {display: block;}
+#navBar ul {list-style: none; margin: 0; padding: 0;}
+
+/* hack to fix IE/Win's broken rendering of block-level anchors in lists */
+#navBar li {border-bottom: 1px solid #EEE;}
+
+/* fix for browsers that don't need the hack */
+html>body #navBar li {border-bottom: none;}
+
+
+/*********** #sectionLinks styles ***********/
+
+#sectionLinks{
+ position: relative;
+ margin: 0px;
+ padding: 0px;
+ border-bottom: 1px solid #cccccc;
+ font-size: 90%;
+}
+
+#sectionLinks h3{
+ padding: 10px 0px 2px 10px;
+}
+
+#sectionLinks a:link{
+ padding: 2px 0px 2px 10px;
+ border-top: 1px solid #cccccc;
+ width: 100%;
+ voice-family: "\"}\"";
+ voice-family:inherit;
+ width: auto;
+}
+
+#sectionLinks a:visited{
+ border-top: 1px solid #cccccc;
+ padding: 2px 0px 2px 10px;
+}
+
+#sectionLinks a:hover{
+ border-top: 1px solid #cccccc;
+ background-color: #dddddd;
+ padding: 2px 0px 2px 10px;
+}
+
+
+/*********** .relatedLinks styles ***********/
+
+.relatedLinks{
+ margin: 0px;
+ padding: 0px 0px 10px 10px;
+ font-size: 90%;
+}
+
+.relatedLinks h3{
+ padding: 10px 0px 2px 0px;
+}
+
+
+/************** #advert styles **************/
+
+#advert{
+ padding: 10px 0px 0px 10px;
+ font-size: 80%;
+ border-top: 1px solid #cccccc;
+}
+
+#advert img{
+ display: block;
+}
+
+
+/************** #headlines styles **************/
+
+#headlines{
+ margin: 0px;
+ padding: 10px 0px 20px 10px;
+ font-size: 80%;
+}
+
+#headlines p{
+ padding: 5px 0px 5px 0px;
+} diff --git a/scire/DBInterface.php b/scire/DBInterface.php new file mode 100755 index 0000000..ea0658a --- /dev/null +++ b/scire/DBInterface.php @@ -0,0 +1,174 @@ +<?php + +function get_scire_modules() { + global $db; + $result = $db->select('*', 'modules'); + if ($result && count($result) > 0) { + return $result; + } else { + return array(); + } +} + +function get_scire_module_list() { + global $db; + $result = $db->select(array('main_content', 'name'), 'modules'); + if ($result && count($result) > 0) { + return $result; + } else { + return array(); + } +} + +function get_profile_list() { + global $db; + $result = $db->select('profile_name', 'profiles'); + if ($result && count($result) > 0) { + return $result; + } else { + return array(); + } +} + +function get_group_clients($group) { + global $db; + $result = $db->select('*', 'clients', '`profile` = \'' . $group . '\''); + if ($result && count($result) > 0) { + return $result; + } else { + return array(); + } +} + +function get_all_clients() { + global $db; + $result = $db->select('*', 'clients'); + if ($result && count($result) > 0) { + return $result; + } else { + return array(); + } +} + +function get_scire_client($client_id) { + global $db; + $result = $db->select('*', 'clients', '`client_id` = \'' . $client_id . '\''); + if ($result && count($result) > 0) { + return $result[0]; + } else { + return false; + } +} + +function scire_add_client($hostname, $mac, $ip, $profile, $distribution, $admin, $status) { + global $db; + $result = $db->insert('clients', array('hostname' => $hostname, 'mac' => $mac, 'ip' => $ip, 'profile' => $profile, 'distribution' => $distribution, 'administrator' => $admin, 'status' => $status)); + if ($result) { + return true; + } else { + return $db->error; + } +} + +function scire_edit_client($client_id, $fields) { + global $db; + $result = $db->update('clients', $fields, '`client_id` = \'' . $client_id . '\''); + if ($result) { + return true; + } else { + return $db->error; + } +} + +function scire_del_client($client_id) { + global $db; + $result = $db->delete('clients', '`client_id` = \'' . $client_id . '\''); + if ($result) { + return true; + } else { + return $db->error; + } +} + +function get_scire_users() { + #we don't want to store the password for security reasons. <- ??? + global $db; + $result = $db->select(array('username', 'comment', 'real_name'), 'users'); + if ($result && count($result) > 0) { + return $result; + } else { + return array(); + } +} + +function get_scire_user($username) { + global $db; + $result = $db->select('*', 'users', '`username` = \'' . $username . '\''); + if ($result && count($result) > 0) { + return $result[0]; + } else { + return false; + } +} + +function scire_add_user($username, $password, $real_name, $comment) { + global $db; + $result = $db->insert('users', array('username' => $username, 'password' => crypt($password, 447470567), 'comment' => $comment, 'real_name' => $real_name)); + if ($result) { + return true; + } else { + return $db->error; + } +} + +function scire_del_user($username) { + global $db; + $result = $db->delete('users', '`username` = \'' . $username . '\''); + if ($result) { + return true; + } else { + return $db->error; + } +} + +function scire_add_permission($perm_name, $desc, $created_by) { + global $db; + $result = $db->insert('permissions', array('perm_name' => $perm_name, 'description' => $desc, 'creator' => $created_by)); + if ($result) { + return true; + } else { + return $db->error; + } +} + +function scire_edit_permission($perm_name, $desc) { + global $db; + $result = $db->update('permissions', array('description' => $desc), '`perm_name` = \'' . $perm_name . '\''); + if ($result) { + return true; + } else { + return $db->error; + } +} + +function scire_del_permission($perm_name) { + global $db; + $result = $db->delete('permissions', '`perm_name` = \'' . $perm_name . '\''); + if ($result) { + return true; + } else { + return $db->error; + } +} + +function get_scire_permissions() { + global $db; + $result = $db->select('*', 'permissions'); + if ($result && count($result) > 0) { + return $result; + } else { + return array(); + } +} + +?> diff --git a/scire/ExportedData.php b/scire/ExportedData.php new file mode 100755 index 0000000..622f738 --- /dev/null +++ b/scire/ExportedData.php @@ -0,0 +1,35 @@ +<? +#This will be a core component and thus just show within scire. +include('.lib/common.php'); + + +$clients = array(); +if ($_POST['group']) { + print $_POST['group']; + $clients = get_group_clients($_POST['group']); +} else { + print "ALL"; + $clients = get_all_clients(); +} +if ($_POST['ExportToCSV']) { + print "This is a fake CSV. It has no header row.<br>"; + foreach ($clients as $client) { + for ($i=0;$i< count($client);$i++) { + print "$client[$i],"; + } + print "<br>"; + } +} +elseif ($_POST['ExportToXML']) { +} +elseif ($_POST['ExportToTXT']) { + print "This is a fake tab-delimited TXT. It has no header row.<br><pre>"; + foreach ($clients as $client) { + for ($i=0;$i< count($client);$i++) { + print "$client[$i]\t"; + } + print "<br>"; + } + print "</pre>"; +} +?> diff --git a/scire/Exporter.php b/scire/Exporter.php new file mode 100755 index 0000000..1609cdf --- /dev/null +++ b/scire/Exporter.php @@ -0,0 +1,56 @@ + +<? +include('.lib/common.php'); + +$clients = array(); +if ($_POST['group']) { + print $_POST['group']; + $clients = get_group_clients($_POST['group']); +} else { + print "ALL"; + $clients = get_all_clients(); + var_dump($clients); +} + +#Get a list of the groups to put in the select box. +$profile_list = get_profile_list(); + +?> +<h2>Server Information Exporter</h2>List of clients in group: +<form name="form1" method="post" action="#"> +<select name="group" size="1"> +<option value=""></option> +<? +foreach ($profile_list as $profile) +{ + print "<option value=\"". $profile['profileid']."\">".$profile['profile_name']."</option>\n"; +} +?> +</select> +<input type="submit" name="ChangeView" value="Go, because i hate doing it with javascript."> +</form> +<form name="form2" method="post" action="ExportedData.php"> +<table><tr> + <th>HOSTNAME</th> + <th>STATUS</th> + <th>IP</th> + <th>MAC</th> + <th>ASSET ID</th> + <th>INSTALL TIME</th> + </tr> +<? +foreach ($clients as $client) +{ + print "<tr><td>".$client['hostname']."</td>\n"; + print "<td>".$client['status']."</td>\n"; + print "<td>".$client['ip']."</td>\n"; + print "<td>".$client['mac']."</td>\n"; + print "<td>".$client['assetid']."</td>\n"; + print "<td>".$client['installtime']."</td>\n"; +} +?> +</table> +<hr> +<input type="submit" name="ExportToXML" value="Export To XML"> +<input type="submit" name="ExportToCSV" value="Export To CSV"> +<input type="submit" name="ExportToTXT" value="Export To TXT"> diff --git a/scire/access_error.php b/scire/access_error.php new file mode 100644 index 0000000..6e37b26 --- /dev/null +++ b/scire/access_error.php @@ -0,0 +1,11 @@ +<?php + +include('./.lib/common.php'); + +if ($_GET['perm']) { + $smarty->assign('perm',$_GET['perm']); +} + +$smarty->display('access_error.tpl'); + +?> diff --git a/scire/add_job.php b/scire/add_job.php new file mode 100644 index 0000000..a5266e0 --- /dev/null +++ b/scire/add_job.php @@ -0,0 +1,119 @@ +<?php +include('.lib/common.php'); +include('cron2.php'); + +$smarty->assign('leftbar', "on"); +$leftbar_menu = array(); + +add_leftbar($leftbar_menu, "««Cancel", "jobs.php"); + +$status = ""; + +##################################################### +#Deal with submitted forms. +if ($_POST['ADD']) { + if ($_POST['script']) { + $script = get_scire_script($_POST['script']); + if ($_POST['permission']) { + $permission = $_POST['permission']; + $permission = get_scire_permission_by_name($permission); + $permission = $permission['permid']; + # print "Permission is: $permission"; + } else { + $permission = $script['permission']; + } + if ($_POST['priority']) { + $priority = $_POST['priority']; + } else { + $priority = $script['priority']; + } + } else { $status .= "ERROR: No script selected!"; } + if ($_POST['description']) { + $description = $_POST['description']; + } else { + $description = "No description provided."; + } + $pending = sizeof($_POST['clients']) + sizeof($_POST['clientgroups']); + + if (!$status and ($pending or $_POST['clientgroups'])) { #We have a script and clients; + # Get the schedule! All fields are required or else you're SOL + $scheduleComplete = $_POST["minute1"] and $_POST["hour1"] and + $_POST["day1"] and $_POST["month1"] and $_POST["weekday1"]; + if ($scheduleComplete) { + $str = implode(" ", array($_POST["minute1"], $_POST["hour1"], + $_POST["day1"], $_POST["month1"], $_POST["weekday1"])); + } else { + $str = ""; + } +# pre_var_dump($_POST); +# pre_var_dump($scheduleComplete); + pre_var_dump($str); + + try { + $result = scire_add_job($_POST['script'], $priority, $_SESSION['userid'], $permission, $description, $pending, $_POST['clients'], $_POST['clientgroups'], $dependency, $str, $_POST['validity_period']); + + if (!$result) { + $status .= "Job successfully added."; + } else { + $status .= "Error occurred during job addition. $result"; + } + } catch (CronException $e) { print_r($e); } + + } +} + + +######################################################## +if ($_GET['scriptid']) { + $_GET['scriptid'] = (int) $_GET['scriptid']; + $script = get_scire_script($_GET['scriptid']); + $smarty->assign('script', $script); +# print $script['script_data']; + preg_match_all('/%%(.*?)%%/', $script['script_data'], $matches); + $smarty->assign('dyn_tags', $matches[1]); + foreach ($matches[1] as $tag) { + $tag_values[$tag] = get_dyn_tag_value($_GET['scriptid'],$tag); + } + $smarty->assign('tag_values', $tag_values); + + pre_var_dump($tag_values); +} + +if ($_GET['clientid']) { + $_GET['clientid'] = (int) $_GET['clientid']; + $client = get_scire_client($_GET['clientid']); + #$id = $acl->get_object_id("clients",$client['hostname'],'AXO' + + $smarty->assign('client', $client); +} +######################################################## + +$permissions = array(); +$all_permissions = $acl->get_objects(NULL, 1, 'ACO'); +foreach ($all_permissions as $categoryname => $cat) { + #print "Perm: $perm<br>Permname: $permname<br>"; + if ($categoryname != $scire_ui_section) { + foreach ($cat as $perm) { + array_push($permissions, $perm); + } + } +} +$smarty->assign('perms', $permissions); +#pre_var_dump($permissions); +$smarty->assign('priorities', get_priorities()); + + +$scripts = get_scire_scripts(); +$smarty->assign('scripts', $scripts); + +$smarty->assign('cgroups', $acl->format_groups($acl->sort_groups('AXO'), TEXT)); +$clients = get_scire_clients('hostname', 'asc'); +$smarty->assign('clients', $clients); + +$smarty->assign('get', $_GET); +$smarty->assign('leftbar_menu', $leftbar_menu); +$smarty->assign('Action', $_GET['Action']); +$smarty->assign('status', $status); +$smarty->display('add_job.tpl'); +#var_dump($clients); +?> diff --git a/scire/admin/2col_leftNav.css b/scire/admin/2col_leftNav.css new file mode 120000 index 0000000..064a6ba --- /dev/null +++ b/scire/admin/2col_leftNav.css @@ -0,0 +1 @@ +../2col_leftNav.css
\ No newline at end of file diff --git a/scire/admin/add_client.php b/scire/admin/add_client.php new file mode 100644 index 0000000..67d3576 --- /dev/null +++ b/scire/admin/add_client.php @@ -0,0 +1,60 @@ +<?php + include('Smarty.class.php'); + include('../DBInterface.php'); + include('admin_checklogin.php'); + + # PHPGACL CODE + $status = ""; + include('phpgacl_code.php'); #load the GACL_API + + #################################################### + #Load Smarty Template + include('admin_smarty.php'); + + + if($_POST['submit']) { + if (!$_POST['hostname']) { $status .= "ERROR: Hostname required! "; } + if (!$_POST['mac']) { $status .= "ERROR: Hostname required! "; } + if (!$_POST['ip']) { $status .= "ERROR: Hostname required! "; } + if ($_POST['hostname'] and $_POST['mac'] and $_POST['ip']) + { + #Add the client now. + $status .= scire_add_client($_POST['hostname'], $_POST['mac'], $_POST['ip'], $_POST['profile'], $_POST['distribution'], $_POST['administrator'], $_POST['status']); + if (!$status) { $status = "User added to DB successfully.";} + $obj_id = $gacl_api->add_object("clients", $_POST['hostname'], $_POST['hostname'], 1, 0, 'AXO'); + print "Object id: $obj_id <BR>"; + + if ($_POST['groups']) { + print "Adding client to groups ".$_POST['groups']; + foreach( $_POST['groups'] as $group) { + $worked = $gacl_api->add_group_object($group, "clients", $_POST['hostname'], 'AXO'); + if ($worked) { + print "Group $group Addition successfull.<br>"; + } else { + print "ERROR adding group $group <br>"; + } + } + } + } + } + + + $formatted_groups = $gacl_api->format_groups($gacl_api->sort_groups('axo'), TEXT); + + $ids = array(); + $groupnames = array(); + foreach($formatted_groups as $id => $name) { + print "ID: $id Name: $name <br>"; + array_push($ids, $id); + array_push($groupnames, $name); + } + + ################################################### + $smarty->assign('ids',$ids); + $smarty->assign('groupnames', $groupnames); + + $smarty->display('admin/add_client.tpl'); + + + $smarty->display('leftbar.tpl'); +?> diff --git a/scire/admin/add_permission.php b/scire/admin/add_permission.php new file mode 100644 index 0000000..11028bf --- /dev/null +++ b/scire/admin/add_permission.php @@ -0,0 +1,29 @@ +<?php + include('Smarty.class.php'); + include('../DBInterface.php'); + include('admin_checklogin.php'); + + # PHPGACL CODE + $status = ""; + include('phpgacl_code.php'); #load the GACL_API + + #################################################### + #Load Smarty Template + include('admin_smarty.php'); + + + if($_POST['permname'] and $_POST['permdesc']) { + #Add the user now. + $status .= scire_add_permission($_POST['permname'], $_POST['permdesc'],$_SESSION['userid']); + if(!$status) {$status = "User added to DB successfully.";} + $obj_id = $gacl_api->add_object("perms", $_POST['permname'], $_POST['permname'], 1, 0, 'ACO'); + print "Object id: $obj_id <BR>"; + } + + ################################################### + + $smarty->display('admin/add_permission.tpl'); + + + $smarty->display('leftbar.tpl'); +?> diff --git a/scire/admin/admin_checklogin.php b/scire/admin/admin_checklogin.php new file mode 100644 index 0000000..91847d7 --- /dev/null +++ b/scire/admin/admin_checklogin.php @@ -0,0 +1,10 @@ +<?php +session_start(); +if(!isset($_SESSION['userid'])) { + #print "<h1>NO MATCH</h1>"; + header("Location: ../login.php"); +} +else { + print "Welcome $_SESSION[userid]<br>"; +} +?> diff --git a/scire/admin/admin_smarty.php b/scire/admin/admin_smarty.php new file mode 100644 index 0000000..6e15c92 --- /dev/null +++ b/scire/admin/admin_smarty.php @@ -0,0 +1,45 @@ +<?php + #This is the code to set up the SMARTY templates for the Admin pages. + # it has ../ on things and sets the leftbar to show the admin list. + $smarty = new Smarty; + $smarty->template_dir = '../templates'; + $smarty->compile_dir = '../templates_c'; + $smarty->cache_dir = '../cache'; + $smarty->config_dir = '../configs'; + $smarty->assign('topbar', array( + array('name'=> 'Login', 'link' => '../login.php'), + array('name'=> 'Clients', 'link' => '../clients.php'), + array('name'=> 'Jobs/Tasks', 'link' => '../jobs.php'), + array('name'=> 'Modules', 'link' => '../modules.php'), + array('name'=> 'Admin', 'link' => '../admin.php'))); + $smarty->assign('left_section_header',"Admin Functions"); + $smarty->assign('leftnav', array( + array("create_user.php", "Create a User"), + array("edit_user.php","Edit a User"), + array("delete_user.php","Delete a User"), + array("",""), + array("create_usergroup.php","Create a UserGroup"), + array("edit_usergroup.php","Edit a UserGroup"), + array("delete_usergroup.php","Delete a UserGroup"), + array("",""), + array("add_permission.php","Add Permission"), + array("edit_permission.php","Edit Permission"), + array("delete_permission.php","Delete Permission"), + array("",""), + array("add_client.php","Add Client Manually"), + array("edit_client.php","Edit Clients"), + array("delete_client.php","Delete Client from Scire"), + array("",""), + array("create_clientgroup.php","Create a ClientGroup"), + array("edit_clientgroup.php","Edit a ClientGroup"), + array("delete_clientgroup.php","Delete a ClientGroup"), + array("",""), + array("assign_permissions.php","Assign Permissions"), + array("",""), + )); + + + if($status) { + $smarty->assign('error', $status); + } +?> diff --git a/scire/admin/assign_permissions.php b/scire/admin/assign_permissions.php new file mode 100644 index 0000000..7af39d4 --- /dev/null +++ b/scire/admin/assign_permissions.php @@ -0,0 +1,129 @@ +<?php + include('Smarty.class.php'); + include('../DBInterface.php'); + include('admin_checklogin.php'); + + # PHPGACL CODE + $status = ""; + include('phpgacl_code.php'); #load the GACL_API + + #################################################### + #Load Smarty Template + include('admin_smarty.php'); + + ################################################### + #Deal with submitted form + if ($_POST['id']) { + $type = $_POST['id'][0]; + $idnum = substr($_POST['id'],2); + print "Type: $type ID: $idnum <br>"; + $smarty->assign('type', $type); + $smarty->assign('idnum', $idnum); + + if( $type == "u") { + print "found user"; + $selected_user_data = $gacl_api->get_object_data($idnum, 'ARO'); + $smarty->assign('selected_name', $selected_user_data[0][3]); + } + elseif ($type == "g") { + $selected_group_data = $gacl_api->get_group_data($idnum, 'ARO'); + $smarty->assign('selected_name', $selected_group_data[3]); + } + $clients = $gacl_api->format_groups($gacl_api->sort_groups('axo'), TEXT); + $smarty->assign('clientgroups',$clients); + + $client_ids = array(); + $client_groupnames = array(); + foreach($clients as $id => $name) { + print "ID: $id Name: $name <br>"; + array_push($client_ids, $id); + array_push($client_groupnames, $name); + } + + + + #This is an ugly hack to get the users and their groups. + $all_clients = $gacl_api->get_objects("clients",1,'AXO'); + $clientinfo = array(); + foreach ($all_clients as $client) { + foreach ($client as $clientdata) { + $id = $gacl_api->get_object_id("clients",$clientdata,'AXO'); + $groups = $gacl_api->get_object_groups($id,'AXO'); + array_push($clientinfo, array($id,$clientdata,$groups)); + } + } + $smarty->assign('clients', $clientinfo); + + + + + + #For the <select> list of groups. + $smarty->assign('client_ids',$client_ids); + $smarty->assign('client_groupnames', $client_groupnames); + + $permissions = $gacl_api->get_objects("perms",1, 'ACO'); + $permissionsinfo = array(); + foreach ($permissions as $eachpermission) { + foreach ($eachpermission as $singlepermission) { + $id = $gacl_api->get_object_id("perms",$singlepermission, 'ACO'); + array_push($permissionsinfo, array($id, $singlepermission)); + } + } + $smarty->assign('permissions',$permissionsinfo); + } + ################################################### + #Deal with part 2 submitted form + if ($_POST['permissions'] and $_POST['clients']) { + print "Perms: ".$_POST['permissions']." <br>User: ".$_POST['selected_name']; + $aco_array = array(); + $aro_array = array(); + $axo_array = array(); + $axo_group_array = array(); + $aro_group_array = array(); + + $aco_array['perms'] = $_POST['permissions']; + if($_POST['type'] == "u") { + $aro_array['users'] = array($_POST['selected_name']); + } elseif ($_POST['type'] == "g") { + $aro_group_array = array($_POST['idnum']); + } else { + print "ERROR NO TYPE"; + exit; + } + + $axo_group_array = $_POST['clients']; + $worked = $gacl_api->add_acl($aco_array, $aro_array,$aro_group_array,$axo_array,$axo_group_array,1,1,1,"Test ACL","system"); + if($worked) { + print "Addition Successfull! $worked"; + } else { + print "BAD BAD BAD"; + } + # foreach( $_POST['permissions'] as $perm_to_add) { + + # } + # foreach $_POST['clients'] as $client_to_add) { + + # } + } + + ################################################### + #Get the usergroups. + $formatted_groups = $gacl_api->format_groups($gacl_api->sort_groups('aro'), HTML); + $smarty->assign('usergroups',$formatted_groups); + + #This is an ugly hack to get the users and their groups. + $all_users = $gacl_api->get_objects("users",1,'ARO'); + $userinfo = array(); + foreach ($all_users as $user) { + foreach ($user as $userdata) { + $id = $gacl_api->get_object_id("users",$userdata,'ARO'); + $groups = $gacl_api->get_object_groups($id,'ARO'); + array_push($userinfo, array($id,$userdata,$groups)); + } + } + $smarty->assign('users', $userinfo); + + $smarty->display('admin/assign_permissions.tpl'); + $smarty->display('leftbar.tpl'); +?> diff --git a/scire/admin/create_clientgroup.php b/scire/admin/create_clientgroup.php new file mode 100644 index 0000000..27de3cc --- /dev/null +++ b/scire/admin/create_clientgroup.php @@ -0,0 +1,38 @@ +<?php + include('Smarty.class.php'); + include('../Frodo.php'); + include('admin_checklogin.php'); + + # PHPGACL CODE + $status = ""; + include('phpgacl_code.php'); #load the GACL_API + + #Load Smarty Template + include('admin_smarty.php'); + + ### Deal with submitted form here + if ($_POST['groupname'] and $_POST['parentgroup']) { + #Add the group as a subgroup. This is all done in the gacl_api. + $newgroup_id = $gacl_api->add_group($_POST['groupname'], $_POST['groupname'], $_POST['parentgroup'], 'AXO'); + print "Group added successfully, new group id is: $newgroup_id<br>"; + } + + $formatted_groups = $gacl_api->format_groups($gacl_api->sort_groups('axo'), TEXT); + $ids = array(); + $groupnames = array(); + foreach($formatted_groups as $id => $name) { + print "ID: $id Name: $name <br>"; + array_push($ids, $id); + array_push($groupnames, $name); + } + + + #For the <select> list of groups. + $smarty->assign('ids',$ids); + $smarty->assign('groupnames', $groupnames); + + $smarty->display('admin/create_clientgroup.tpl'); + + + $smarty->display('leftbar.tpl'); +?> diff --git a/scire/admin/create_user.php b/scire/admin/create_user.php new file mode 100644 index 0000000..225fa41 --- /dev/null +++ b/scire/admin/create_user.php @@ -0,0 +1,57 @@ +<?php + include('Smarty.class.php'); + include('../DBInterface.php'); + include('admin_checklogin.php'); + + # PHPGACL CODE + $status = ""; + include('phpgacl_code.php'); #load the GACL_API + + #################################################### + #Load Smarty Template + include('admin_smarty.php'); + + + if($_POST['username']) { + if ($_POST['passwd'] == $_POST['passwd2']) { + #Add the user now. + $status .= scire_add_user($_POST['username'], $_POST['passwd'], $_POST['realname'], $_POST['comment']); + # $status = "User added to DB successfully."; + $obj_id = $gacl_api->add_object("users", $_POST['username'], $_POST['username'], 1, 0, 'ARO'); + print "Object id: $obj_id <BR>"; + + if ($_POST['groups']) { + print "Adding user to groups ".$_POST['groups']; + foreach( $_POST['groups'] as $group) { + $worked = $gacl_api->add_group_object($group, "users", $_POST['username'], 'ARO'); + if ($worked) { + print "Group $group Addition successfull.<br>"; + } else { + print "ERROR adding group $group <br>"; + } + } + } + } + else + { + $status = "ERROR: Passwords do not match."; + } + + } + $formatted_groups = $gacl_api->format_groups($gacl_api->sort_groups('aro'), TEXT); + + $ids = array(); + $groupnames = array(); + foreach($formatted_groups as $id => $name) { + print "ID: $id Name: $name <br>"; + array_push($ids, $id); + array_push($groupnames, $name); + } + + ################################################### + $smarty->assign('ids',$ids); + $smarty->assign('groupnames', $groupnames); + + $smarty->display('admin/create_user.tpl'); + $smarty->display('leftbar.tpl'); +?> diff --git a/scire/admin/create_usergroup.php b/scire/admin/create_usergroup.php new file mode 100644 index 0000000..2de2b78 --- /dev/null +++ b/scire/admin/create_usergroup.php @@ -0,0 +1,35 @@ +<?php + include('Smarty.class.php'); + include('../DBInterface.php'); + include('admin_checklogin.php'); + + # PHPGACL CODE + $status = ""; + include('phpgacl_code.php'); #load the GACL_API + + #Load Smarty Template + include('admin_smarty.php'); + + ### Deal with submitted form here + if ($_POST['groupname'] and $_POST['parentgroup']) { + #Add the group as a subgroup. This is all done in the gacl_api. + $newgroup_id = $gacl_api->add_group($_POST['groupname'], $_POST['groupname'], $_POST['parentgroup'], 'ARO'); + print "Group added successfully, new group id is: $newgroup_id<br>"; + } + + $formatted_groups = $gacl_api->format_groups($gacl_api->sort_groups('aro'), TEXT); + $ids = array(); + $groupnames = array(); + foreach($formatted_groups as $id => $name) { + print "ID: $id Name: $name <br>"; + array_push($ids, $id); + array_push($groupnames, $name); + } + + #For the <select> list of groups. + $smarty->assign('ids',$ids); + $smarty->assign('groupnames', $groupnames); + + $smarty->display('admin/create_usergroup.tpl'); + $smarty->display('leftbar.tpl'); +?> diff --git a/scire/admin/delete_client.php b/scire/admin/delete_client.php new file mode 100644 index 0000000..2dd46f3 --- /dev/null +++ b/scire/admin/delete_client.php @@ -0,0 +1,27 @@ +<?php + + include('Smarty.class.php'); + include('../DBInterface.php'); + include('admin_checklogin.php'); + + #Load Smarty Template + include('admin_smarty.php'); + + $status = ""; + if($_POST['delsubmit'] and $_POST['delclient'] and $_POST['iamsure']) { + include('phpgacl_code.php'); + $client_id = $_POST['delclient']; + $client_data = get_scire_client($client_id); + + $status = scire_del_client($client_id); + + $id = $gacl_api->get_object_id("clients", $client_data['hostname'], 'AXO'); + $gacl_api->del_object($id, 'AXO', TRUE); + } + + $clients = get_all_clients(); + $smarty->assign('clients', $clients); + + $smarty->display('admin/delete_client.tpl'); + $smarty->display('leftbar.tpl'); +?> diff --git a/scire/admin/delete_clientgroup.php b/scire/admin/delete_clientgroup.php new file mode 100644 index 0000000..4e2d53b --- /dev/null +++ b/scire/admin/delete_clientgroup.php @@ -0,0 +1,46 @@ +<?php + include('Smarty.class.php'); + include('../DBInterface.php'); + include('admin_checklogin.php'); + + # PHPGACL CODE + $status = ""; + include('phpgacl_code.php'); #load the GACL_API + + #Load Smarty templates. + include('admin_smarty.php'); + + ### Deal with submitted form here + if($_POST['delsubmit'] and $_POST['delgroup'] and $_POST['iamsure']) { + #Check if the group has children. + $result = $gacl_api->del_group($_POST['delgroup'],TRUE, 'AXO'); + if ($result) { + $status = "Group deleted successfully."; + } else { + $status = "ERROR: Group could not be successfully deleted."; + } + + } + + $formatted_groups = $gacl_api->format_groups($gacl_api->sort_groups('axo'), HTML); + $formatted_groups2 = $gacl_api->format_groups($gacl_api->sort_groups('axo'), TEXT); + + $ids = array(); + $groupnames = array(); + foreach($formatted_groups2 as $id => $name) { + #print "ID: $id Name: $name <br>"; + array_push($ids, $id); + array_push($groupnames, $name); + } + + #For the <select> list of groups. + $smarty->assign('ids',$ids); + $smarty->assign('groupnames', $groupnames); + + $smarty->assign('editgroup', $editgroup); + $smarty->assign('editgroupdata', $editgroupdata); + $smarty->assign('clientgroups', $formatted_groups); + + $smarty->display('admin/delete_clientgroup.tpl'); + $smarty->display('leftbar.tpl'); +?> diff --git a/scire/admin/delete_permission.php b/scire/admin/delete_permission.php new file mode 100644 index 0000000..84e5751 --- /dev/null +++ b/scire/admin/delete_permission.php @@ -0,0 +1,36 @@ +<?php + include('Smarty.class.php'); + include('../DBInterface.php'); + include('admin_checklogin.php'); + # PHPGACL CODE + $status = ""; + include('phpgacl_code.php'); #load the GACL_API + + #################################################### + #Load Smarty Template + include('admin_smarty.php'); + + + if($_POST['delperm'] and $_POST['delsubmit'] and $_POST['iamsure']) { + #Delete the user. + $status .= scire_del_permission($_POST['delperm']); + if(!$status) {$status = "User deleted from DB successfully. ";} + #Get the obj ID for edit + $obj_id = $gacl_api->get_object_id("perms",$_POST['delperm'],'ACO'); + $result = $gacl_api->del_object($obj_id, 'ACO', TRUE); + if($result) { + $status .= "Permission deleted from ACLs successfully. "; + } else { + $status .= "ERROR: Permission could not be delted from the ACLs! "; + } + } + + ################################################### + $permissions = get_scire_permissions(); + $smarty->assign('permissions', $permissions); + + $smarty->display('admin/delete_permission.tpl'); + + + $smarty->display('leftbar.tpl'); +?> diff --git a/scire/admin/delete_user.php b/scire/admin/delete_user.php new file mode 100644 index 0000000..52567dd --- /dev/null +++ b/scire/admin/delete_user.php @@ -0,0 +1,27 @@ +<?php + + include('Smarty.class.php'); + include('../DBInterface.php'); + include('admin_checklogin.php'); + + # PHPGACL CODE + $status = ""; + include('phpgacl_code.php'); #load the gacl_api + + #Load Smarty Template + include('admin_smarty.php'); + + if($_POST['delsubmit'] and $_POST['deluser'] and $_POST['iamsure']) { + + $status = scire_del_user($_POST['deluser']); + $id = $gacl_api->get_object_id("users", $_POST['deluser'], 'ARO'); + $gacl_api->del_object($id, 'ARO', TRUE); + } + + + $users = get_scire_users(); + $smarty->assign('users', $users); + + $smarty->display('admin/delete_user.tpl'); + $smarty->display('leftbar.tpl'); +?> diff --git a/scire/admin/delete_usergroup.php b/scire/admin/delete_usergroup.php new file mode 100644 index 0000000..e67132f --- /dev/null +++ b/scire/admin/delete_usergroup.php @@ -0,0 +1,48 @@ +<?php + include('Smarty.class.php'); + include('../DBInterface.php'); + include('admin_checklogin.php'); + + # PHPGACL CODE + $status = ""; + include('phpgacl_code.php'); #load the GACL_API + + #Load Smarty templates. + include('admin_smarty.php'); + + ### Deal with submitted form here + if($_POST['delsubmit'] and $_POST['delgroup'] and $_POST['iamsure']) { + #Check if the group has children. + $result = $gacl_api->del_group($_POST['delgroup'],TRUE, 'ARO'); + if ($result) { + $status = "Group deleted successfully."; + } else { + $status = "ERROR: Group could not be successfully deleted."; + } + + } + + $formatted_groups = $gacl_api->format_groups($gacl_api->sort_groups('aro'), HTML); + $formatted_groups2 = $gacl_api->format_groups($gacl_api->sort_groups('aro'), TEXT); + + $ids = array(); + $groupnames = array(); + foreach($formatted_groups2 as $id => $name) { + #print "ID: $id Name: $name <br>"; + array_push($ids, $id); + array_push($groupnames, $name); + } + + + #For the <select> list of groups. + $smarty->assign('ids',$ids); + $smarty->assign('groupnames', $groupnames); + + $smarty->assign('editgroup', $editgroup); + $smarty->assign('editgroupdata', $editgroupdata); + + $smarty->assign('usergroups', $formatted_groups); + + $smarty->display('admin/delete_usergroup.tpl'); + $smarty->display('leftbar.tpl'); +?> diff --git a/scire/admin/edit_client.php b/scire/admin/edit_client.php new file mode 100644 index 0000000..8b71038 --- /dev/null +++ b/scire/admin/edit_client.php @@ -0,0 +1,35 @@ +<?php + + include('Smarty.class.php'); + include('../DBInterface.php'); + include('admin_checklogin.php'); + + #Load Smarty Template + include('admin_smarty.php'); + + if($_POST['savesubmit']) { + if (!$_POST['hostname']) { $status .= "ERROR: Hostname required! "; } + if (!$_POST['mac']) { $status .= "ERROR: Hostname required! "; } + if (!$_POST['ip']) { $status .= "ERROR: Hostname required! "; } + if ($_POST['hostname'] and $_POST['mac'] and $_POST['ip']) + { + $status .= scire_edit_client($_POST['client_id'], $_POST['hostname'], $_POST['mac'], $_POST['ip'], $_POST['profile'], $_POST['distribution'], $_POST['administrator'], $_POST['status']); + if (!$status) { $status = "User added to DB successfully.";} + } + } + + if($_POST['editsubmit'] and $_POST['editclient']) + { + $client_id = $_POST['editclient']; + $client_data = get_scire_client($client_id); + $smarty->assign('cdata', $client_data); + #Get list of groups. make a SELECT + + } + else{ + $clients = get_all_clients(); + $smarty->assign('clients', $clients); + } + $smarty->display('admin/edit_client.tpl'); + $smarty->display('leftbar.tpl'); +?> diff --git a/scire/admin/edit_clientgroup.php b/scire/admin/edit_clientgroup.php new file mode 100644 index 0000000..d378874 --- /dev/null +++ b/scire/admin/edit_clientgroup.php @@ -0,0 +1,48 @@ +<?php + include('Smarty.class.php'); + include('../DBInterface.php'); + include('admin_checklogin.php'); + + # PHPGACL CODE + $status = ""; + include('phpgacl_code.php'); #load the GACL_API + + #Load Smarty Template + include('admin_smarty.php'); + + ### Deal with submitted form here + if ($_POST['editgroup']) { + $editgroup = $_POST['editgroup']; + $editgroupdata = $gacl_api->get_group_data($editgroup, 'AXO'); + } + + if ($_POST['groupname'] and $_POST['parentgroup']) { + $newgroup_id = $gacl_api->edit_group($_POST['groupid'], $_POST['groupname'], $_POST['groupname'], $_POST['parentgroup'], 'AXO'); + print "Group edited successfully, group id is: $newgroup_id<br>"; + } + + $formatted_groups = $gacl_api->format_groups($gacl_api->sort_groups('axo'), HTML); + $formatted_groups2 = $gacl_api->format_groups($gacl_api->sort_groups('axo'), TEXT); + + $ids = array(); + $groupnames = array(); + foreach($formatted_groups2 as $id => $name) { + #print "ID: $id Name: $name <br>"; + array_push($ids, $id); + array_push($groupnames, $name); + } + + + + #For the <select> list of groups. + $smarty->assign('ids',$ids); + $smarty->assign('groupnames', $groupnames); + + $smarty->assign('editgroup', $editgroup); + $smarty->assign('editgroupdata', $editgroupdata); + + $smarty->assign('clientgroups', $formatted_groups); + + $smarty->display('admin/edit_clientgroup.tpl'); + $smarty->display('leftbar.tpl'); +?> diff --git a/scire/admin/edit_permission.php b/scire/admin/edit_permission.php new file mode 100644 index 0000000..800e47f --- /dev/null +++ b/scire/admin/edit_permission.php @@ -0,0 +1,38 @@ +<?php + include('Smarty.class.php'); + include('../DBInterface.php'); + include('admin_checklogin.php'); + + # PHPGACL CODE + $status = ""; + include('phpgacl_code.php'); #load the GACL_API + + #################################################### + #Load Smarty Template + include('admin_smarty.php'); + + if($_POST['permname'] and $_POST['permdesc']) { + #Add the user now. + $status .= gimli_edit_permission($_POST['permname'], $_POST['permdesc']); + if(!$status) {$status = "User edited to DB successfully.";} + #Get the obj ID for edit + $obj_id = $gacl_api->get_object_id("perms",$_POST['permname'],'ACO'); + $result = $gacl_api->edit_object($obj_id, "perms", $_POST['permname'], $_POST['permname'], 1, 0, 'ACO'); + print "Object id: $obj_id <BR>"; + } + + ################################################### + if($_POST['submit'] and $_POST['editperm']) + { + $permname = $_POST['editperm']; + $smarty->assign('permname', $_POST['editperm']); + $smarty->assign('permdesc', $_POST[$permname.'_desc']); + } + else{ + $permissions = get_gimli_permissions(); + $smarty->assign('permissions', $permissions); + } + + $smarty->display('admin/edit_permission.tpl'); + $smarty->display('leftbar.tpl'); +?> diff --git a/scire/admin/edit_user.php b/scire/admin/edit_user.php new file mode 100644 index 0000000..7142e9f --- /dev/null +++ b/scire/admin/edit_user.php @@ -0,0 +1,26 @@ +<?php + include('Smarty.class.php'); + include('../DBInterface.php'); + include('admin_checklogin.php'); + + #Load Smarty Template + include('admin_smarty.php'); + + + if($_POST['savesubmit'] and $_POST['roledesc']) { + #$status = scire_edit_user($_POST['rolename'], $_POST['roledesc']); + } + + if($_POST['editsubmit'] and $_POST['edituser']) + { + $edituser = $_POST['edituser']; + $smarty->assign('username', $_POST['edituser']); + $smarty->assign('userdesc', $_POST[$edituser.'_desc']); + } + else{ + $users = get_scire_users(); + $smarty->assign('users', $users); + } + $smarty->display('admin/edit_user.tpl'); + $smarty->display('leftbar.tpl'); +?> diff --git a/scire/admin/edit_usergroup.php b/scire/admin/edit_usergroup.php new file mode 100644 index 0000000..0003888 --- /dev/null +++ b/scire/admin/edit_usergroup.php @@ -0,0 +1,46 @@ +<?php + include('Smarty.class.php'); + include('../DBInterface.php'); + include('admin_checklogin.php'); + + # PHPGACL CODE + $status = ""; + include('phpgacl_code.php'); #load the GACL_API + + #Load Smarty Template + include('admin_smarty.php'); + + ### Deal with submitted form here + if ($_POST['editgroup']) { + $editgroup = $_POST['editgroup']; + $editgroupdata = $gacl_api->get_group_data($editgroup, 'ARO'); + } + + if ($_POST['groupname'] and $_POST['parentgroup']) { + $newgroup_id = $gacl_api->edit_group($_POST['groupid'], $_POST['groupname'], $_POST['groupname'], $_POST['parentgroup'], 'ARO'); + print "Group edited successfully, group id is: $newgroup_id<br>"; + } + + $formatted_groups = $gacl_api->format_groups($gacl_api->sort_groups('aro'), HTML); + $formatted_groups2 = $gacl_api->format_groups($gacl_api->sort_groups('aro'), TEXT); + + $ids = array(); + $groupnames = array(); + foreach($formatted_groups2 as $id => $name) { + #print "ID: $id Name: $name <br>"; + array_push($ids, $id); + array_push($groupnames, $name); + } + + #For the <select> list of groups. + $smarty->assign('ids',$ids); + $smarty->assign('groupnames', $groupnames); + + $smarty->assign('editgroup', $editgroup); + $smarty->assign('editgroupdata', $editgroupdata); + + $smarty->assign('usergroups', $formatted_groups); + + $smarty->display('admin/edit_usergroup.tpl'); + $smarty->display('leftbar.tpl'); +?> diff --git a/scire/admin/phpgacl_code.php b/scire/admin/phpgacl_code.php new file mode 100644 index 0000000..d16165c --- /dev/null +++ b/scire/admin/phpgacl_code.php @@ -0,0 +1,28 @@ +<?php + #################################################### PHPGACL CODE + require_once(dirname(__FILE__).'/../phpgacl/gacl.class.php'); + require_once(dirname(__FILE__).'/../phpgacl/gacl_api.class.php'); + require_once(dirname(__FILE__).'/../phpgacl/admin/gacl_admin_api.class.php'); + +// phpGACL Configuration file. +if ( !isset($config_file) ) { +# $config_file = '../gacl.ini.php'; + $config_file = dirname(__FILE__).'/../phpgacl/gacl.ini.php'; +} + +//Values supplied in $gacl_options array overwrite those in the config file. +if ( file_exists($config_file) ) { + $config = parse_ini_file($config_file); + + if ( is_array($config) ) { + if ( isset($gacl_options) ) { + $gacl_options = array_merge($config, $gacl_options); + } else { + $gacl_options = $config; + } + } + unset($config); +} +$gacl_api = new gacl_admin_api($gacl_options); +############################################### +?> diff --git a/scire/admin/s.gif b/scire/admin/s.gif Binary files differnew file mode 100644 index 0000000..5035948 --- /dev/null +++ b/scire/admin/s.gif diff --git a/scire/admin/tux_large.png b/scire/admin/tux_large.png new file mode 120000 index 0000000..f06f852 --- /dev/null +++ b/scire/admin/tux_large.png @@ -0,0 +1 @@ +../tux_large.png
\ No newline at end of file diff --git a/scire/assign_permission.php b/scire/assign_permission.php new file mode 100755 index 0000000..06f0f62 --- /dev/null +++ b/scire/assign_permission.php @@ -0,0 +1,136 @@ +<?php +include('.lib/common.php'); + +$smarty->assign('leftbar', "on"); +$leftbar_menu = array(); + +add_leftbar($leftbar_menu, "««Cancel", "users.php"); + + +$userid = ""; + + +##################################################### +#Deal with submitted forms. + +############################################### +#Adding a permission. +if ($_POST['addperm_submit'] or $_POST['editperm_submit']) { + if ($_POST['newpermname'] and $_POST['newpermdesc']) { #Add a new permission FIXME add check of auth for this. + if ($_POST['perm_category'] == "new") { + if ($_POST['newpermcat']) { #Need to add a section + $acl->add_object_section($_POST['newpermcat'], $_POST['newpermcat'], 1, 0, 'ACO'); + $_POST['perm_category'] = $_POST['newpermcat']; + } else { #BAD user + $status .= "ERROR: No new permission category specified. Using Default"; + $_POST['perm_category'] = "Default"; + } + } + $obj_id = $acl->add_object($_POST['perm_category'], $_POST['newpermname'], $_POST['newpermname'], 1, 0, 'ACO'); + $status .= "Obj id: $obj_id"; + $result = scire_add_permission($obj_id, $_POST['newpermname'],$_POST['newpermdesc'], $_SESSION['userid']); + if ($result == 1) { $status .= "Permission Addition successfull. "; } + $_POST['perm'] = $_POST['newpermname']; + } + #Permission should exist now. + $aco_array[$_POST['perm_category']] = array($_POST['perm']); + $aro_array = array(); + $axo_array = array(); + $axo_group_array = array(); + $aro_group_array = array(); +# if ($_POST['usertype'] == "usergroups") { + $aro_group_array = $_POST['usergroups']; +# } else { + $aro_array['users'] = $_POST['users']; +# } + +# if ($_POST['clienttype'] == "clientgroups") { + $axo_group_array = $_POST['clientgroups']; +# } else { + $axo_array['clients'] = $_POST['clients']; +# } + + if (!$_POST['active']) { + $_POST['active'] = 0; + } + + if ($_POST['addperm_submit']) { + $worked = $acl->add_acl($aco_array, $aro_array,$aro_group_array,$axo_array,$axo_group_array,$_POST['allow'],$_POST['active'],1,$_POST['note'],"system"); + if($worked) { + $status .= "<br><b>Addition Successfull! $worked</b>"; + } else { + $status .= "<br><b>BAD BAD BAD $worked</b>"; + } + } else {#Edit + $worked = $acl->edit_acl($_POST['editing'],$aco_array, $aro_array,$aro_group_array,$axo_array,$axo_group_array,$_POST['allow'],$_POST['active'],1,$_POST['note'],"system"); + if($worked) { + $status .= "<br><b>Edit Successfull! $worked</b>"; + } else { + $status .= "<br><b>BAD BAD BAD $worked</b>"; + } + } + +} +############################################### +#Adding a permission. +elseif ($_POST['delete_confirm']) { + $aclid = $_POST['aclid']; + $worked = $acl->del_acl($aclid); + if($worked) { + $status .= "<br><b>Deletion Successfull. $worked</b>"; + } else { + $status .= "<br><b>BAD BAD BAD $worked</b>"; + } + header('Location: ' . $baseurl . 'users.php?View=permissions'); +} +elseif ($_POST['delete_cancel']) { + header('Location: ' . $baseurl . 'users.php?View=permissions'); +} + + +######################################################## +if ($_GET['Action'] == "delete") { + $smarty->assign('aclid', $_GET['aclid']); +} + +if ($_GET['aclid']) { #For Editing. Load the ACL data. + $smarty->assign('acl',$acl->get_acl($_GET['aclid'])); +} +#$permissions = get_scire_permissions(); + +#foreach ($permissions as $perm) { +# $perm_categories[$perm['permcategory']] = 1; +#} + +$permissions = array(); +$perm_categories = array(); +$all_permissions = $acl->get_objects(NULL, 1, 'ACO'); +foreach ($all_permissions as $categoryname => $cat) { + #print "Perm: $perm<br>Permname: $permname<br>"; + if ($categoryname != $scire_ui_section) { + foreach ($cat as $perm) { + array_push($permissions, $perm); + } + array_push($perm_categories, $categoryname); + } +} +#pre_var_dump($permissions); +#pre_var_dump($perm_categories); +$smarty->assign('perm_categories',$perm_categories); +$smarty->assign('perms', $permissions); + +$smarty->assign('ugroups', $acl->format_groups($acl->sort_groups('aro'), TEXT)); +$smarty->assign('cgroups', $acl->format_groups($acl->sort_groups('AXO'), TEXT)); + +$users = get_scire_users('username', 'asc'); +$smarty->assign('users', $users); +$clients = get_scire_clients('hostname', 'asc'); +$smarty->assign('clients', $clients); + +$smarty->assign('get', $_GET); +$smarty->assign('leftbar_menu', $leftbar_menu); +$smarty->assign('Action', $_GET['Action']); +$smarty->assign('status', $status); +$smarty->display('assign_permission.tpl'); +#pre_var_dump($_POST); +?> diff --git a/scire/calendar/calendar.html b/scire/calendar/calendar.html new file mode 100644 index 0000000..202fb41 --- /dev/null +++ b/scire/calendar/calendar.html @@ -0,0 +1,169 @@ +<!--
+Title: Tigra Calendar
+URL: http://www.softcomplex.com/products/tigra_calendar/
+Version: 3.4 (all formats)
+Date: 01/06/2007
+Note: Permission given to use this script in ANY kind of applications if
+ header lines are left unchanged.
+Note: Script consists of two files: calendar?.js and calendar.html
+-->
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html>
+<head>
+<title>Select Date, Please.</title>
+<style>
+ td {font-family: Tahoma, Verdana, sans-serif; font-size: 12px;}
+ td a {text-decoration: none;}
+</style>
+<script language="JavaScript">
+
+// months as they appear in the calendar's title
+var ARR_MONTHS = ["January", "February", "March", "April", "May", "June",
+ "July", "August", "September", "October", "November", "December"];
+// week day titles as they appear on the calendar
+var ARR_WEEKDAYS = ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"];
+// day week starts from (normally 0-Su or 1-Mo)
+var NUM_WEEKSTART = 1;
+// path to the directory where calendar images are stored. trailing slash req.
+var STR_ICONPATH = 'img/';
+
+var re_urlCur = new RegExp('c=(\\-?\\d+)');
+var re_urlSel = new RegExp('s=(\\-?\\d+)');
+var re_id = new RegExp('id=(\\d+)');
+
+var dt_selected = (re_urlSel.exec(String(window.location))
+ ? new Date(new Number(RegExp.$1)) : new Date());
+var dt_current = (re_urlCur.exec(String(window.location))
+ ? new Date(new Number(RegExp.$1)) : dt_selected);
+var num_id = (re_id.exec(String(window.location))
+ ? new Number(RegExp.$1) : 0);
+
+var obj_caller = (window.opener ? window.opener.calendars[num_id] : null);
+
+if (obj_caller && obj_caller.year_scroll) {
+ // get same date in the previous year
+ var dt_prev_year = new Date(dt_current);
+ dt_prev_year.setFullYear(dt_prev_year.getFullYear() - 1);
+ if (dt_prev_year.getDate() != dt_current.getDate())
+ dt_prev_year.setDate(0);
+
+ // get same date in the next year
+ var dt_next_year = new Date(dt_current);
+ dt_next_year.setFullYear(dt_next_year.getFullYear() + 1);
+ if (dt_next_year.getDate() != dt_current.getDate())
+ dt_next_year.setDate(0);
+}
+
+// get same date in the previous month
+var dt_prev_month = new Date(dt_current);
+if (dt_prev_month.getMonth()) {
+ dt_prev_month.setMonth(dt_prev_month.getMonth() - 1);
+ if (dt_prev_month.getDate() != dt_current.getDate())
+ dt_prev_month.setDate(0);
+}
+else {
+ dt_prev_month.setFullYear(dt_prev_month.getFullYear() - 1);
+ dt_prev_month.setMonth(11);
+}
+
+// get same date in the next month
+var dt_next_month = new Date(dt_current);
+dt_next_month.setMonth(dt_next_month.getMonth() + 1);
+if (dt_next_month.getDate() != dt_current.getDate())
+ dt_next_month.setDate(0);
+
+// get first day to display in the grid for current month
+var dt_firstday = new Date(dt_current);
+dt_firstday.setDate(1);
+dt_firstday.setDate(1 - (7 + dt_firstday.getDay() - NUM_WEEKSTART) % 7);
+
+// function passing selected date to calling window
+function set_datetime(n_datetime, b_close) {
+ if (!obj_caller) return;
+
+ var dt_datetime = obj_caller.prs_time(
+ (document.cal ? document.cal.time.value : ''),
+ new Date(n_datetime)
+ );
+
+ if (!dt_datetime) return;
+ if (b_close) {
+
+ obj_caller.target.value = (document.cal
+ ? obj_caller.gen_tsmp(dt_datetime)
+ : obj_caller.gen_date(dt_datetime)
+ );window.close();
+ }
+ else obj_caller.popup(dt_datetime.valueOf());
+}
+
+</script>
+</head>
+<body bgcolor="#FFFFFF" marginheight="5" marginwidth="5" topmargin="5" leftmargin="5" rightmargin="5">
+<table class="clsOTable" cellspacing="0" border="0" width="100%">
+<tr><td bgcolor="#4682B4">
+<table cellspacing="1" cellpadding="3" border="0" width="100%">
+<tr><td colspan="7"><table cellspacing="0" cellpadding="0" border="0" width="100%">
+<tr>
+<script language="JavaScript">
+document.write(
+'<td nowrap>'+(obj_caller&&obj_caller.year_scroll?'<a href="javascript:set_datetime('+dt_prev_year.valueOf()+')"><img src="'+STR_ICONPATH+'prev_year.gif" width="16" height="16" border="0" alt="previous year"></a> ':'')+'<a href="javascript:set_datetime('+dt_prev_month.valueOf()+')"><img src="'+STR_ICONPATH+'prev.gif" width="16" height="16" border="0" alt="previous month"></a></td>'+
+'<td align="center" width="100%"><font color="#ffffff">'+ARR_MONTHS[dt_current.getMonth()]+' '+dt_current.getFullYear() + '</font></td>'+
+'<td nowrap><a href="javascript:set_datetime('+dt_next_month.valueOf()+')"><img src="'+STR_ICONPATH+'next.gif" width="16" height="16" border="0" alt="next month"></a>'+(obj_caller && obj_caller.year_scroll?' <a href="javascript:set_datetime('+dt_next_year.valueOf()+')"><img src="'+STR_ICONPATH+'next_year.gif" width="16" height="16" border="0" alt="next year"></a>':'')+'</td>'
+);
+</script>
+</tr>
+</table></td></tr>
+<tr>
+<script language="JavaScript">
+
+// print weekdays titles
+for (var n=0; n<7; n++)
+ document.write('<td bgcolor="#87cefa" align="center"><font color="#ffffff">'+ARR_WEEKDAYS[(NUM_WEEKSTART+n)%7]+'</font></td>');
+document.write('</tr>');
+
+// print calendar table
+var dt_current_day = new Date(dt_firstday);
+while (dt_current_day.getMonth() == dt_current.getMonth() ||
+ dt_current_day.getMonth() == dt_firstday.getMonth()) {
+ // print row heder
+ document.write('<tr>');
+ for (var n_current_wday=0; n_current_wday<7; n_current_wday++) {
+ if (dt_current_day.getDate() == dt_selected.getDate() &&
+ dt_current_day.getMonth() == dt_selected.getMonth() &&
+ dt_current_day.getFullYear() == dt_selected.getFullYear())
+ // print current date
+ document.write('<td bgcolor="#ffb6c1" align="center" width="14%">');
+ else if (dt_current_day.getDay() == 0 || dt_current_day.getDay() == 6)
+ // weekend days
+ document.write('<td bgcolor="#dbeaf5" align="center" width="14%">');
+ else
+ // print working days of current month
+ document.write('<td bgcolor="#ffffff" align="center" width="14%">');
+
+ document.write('<a href="javascript:set_datetime('+dt_current_day.valueOf() +', true);">');
+
+ if (dt_current_day.getMonth() == this.dt_current.getMonth())
+ // print days of current month
+ document.write('<font color="#000000">');
+ else
+ // print days of other months
+ document.write('<font color="#606060">');
+
+ document.write(dt_current_day.getDate()+'</font></a></td>');
+ dt_current_day.setDate(dt_current_day.getDate()+1);
+ }
+ // print row footer
+ document.write('</tr>');
+}
+if (obj_caller && obj_caller.time_comp) {
+ document.write('<form onsubmit="javascript:set_datetime('+dt_current.valueOf()+', true)" name="cal"><tr><td colspan="7" bgcolor="#87CEFA"><font color="White" face="tahoma, verdana" size="2">Time: <input type="text" name="time" value="'+obj_caller.gen_time(this.dt_current)+'" size="8" maxlength="8"></font></td></tr></form>');
+ document.forms['cal'].elements['time'].focus();
+}
+</script>
+</table>
+</td></tr></table>
+</body>
+</html>
+
diff --git a/scire/calendar/calendar3.js b/scire/calendar/calendar3.js new file mode 100644 index 0000000..9b88ed2 --- /dev/null +++ b/scire/calendar/calendar3.js @@ -0,0 +1,165 @@ +// Title: Tigra Calendar +// URL: http://www.softcomplex.com/products/tigra_calendar/ +// Version: 3.4 (mySQL format) +// Date: 07/12/2007 +// Note: Permission given to use this script in ANY kind of applications if +// header lines are left unchanged. +// Note: Script consists of two files: calendar?.js and calendar.html + +// if two digit year input dates after this year considered 20 century. +var NUM_CENTYEAR = 30; +// is time input control required by default +var BUL_TIMECOMPONENT = false; +// are year scrolling buttons required by default +var BUL_YEARSCROLL = true; + +var calendars = []; +var RE_NUM = /^\-?\d+$/; + +function calendar3(obj_target) { + + // assigning methods + this.gen_date = cal_gen_date3; + this.gen_time = cal_gen_time3; + this.gen_tsmp = cal_gen_tsmp3; + this.prs_date = cal_prs_date3; + this.prs_time = cal_prs_time3; + this.prs_tsmp = cal_prs_tsmp3; + this.popup = cal_popup3; + + // validate input parameters + if (!obj_target) + return cal_error("Error calling the calendar: no target control specified"); + if (obj_target.value == null) + return cal_error("Error calling the calendar: parameter specified is not valid target control"); + this.target = obj_target; + this.time_comp = BUL_TIMECOMPONENT; + this.year_scroll = BUL_YEARSCROLL; + + // register in global collections + this.id = calendars.length; + calendars[this.id] = this; +} + +function cal_popup3 (str_datetime) { + if (str_datetime) + this.dt_current = this.prs_tsmp(str_datetime); + else + this.dt_selected = this.dt_current = this.prs_tsmp(this.target.value); + + if (!this.dt_current) return; + + var obj_calwindow = window.open( + 'calendar/calendar.html?id=' + this.id + '&s=' + this.dt_selected.valueOf() + '&c=' + this.dt_current.valueOf(), + 'Calendar', 'width=200,height=' + (this.time_comp ? 215 : 190) + + ',status=no,resizable=no,top=200,left=200,dependent=yes,alwaysRaised=yes' + ); + obj_calwindow.opener = window; + obj_calwindow.focus(); +} + +// timestamp generating function +function cal_gen_tsmp3 (dt_datetime) { + return(this.gen_date(dt_datetime) + ' ' + this.gen_time(dt_datetime)); +} + +// date generating function +function cal_gen_date3 (dt_datetime) { + return ( + dt_datetime.getFullYear() + "-" + + (dt_datetime.getMonth() < 9 ? '0' : '') + (dt_datetime.getMonth() + 1) + "-" + + (dt_datetime.getDate() < 10 ? '0' : '') + dt_datetime.getDate() + ); +} +// time generating function +function cal_gen_time3 (dt_datetime) { + return ( + (dt_datetime.getHours() < 10 ? '0' : '') + dt_datetime.getHours() + ":" + + (dt_datetime.getMinutes() < 10 ? '0' : '') + (dt_datetime.getMinutes()) + ":" + + (dt_datetime.getSeconds() < 10 ? '0' : '') + (dt_datetime.getSeconds()) + ); +} + +// timestamp parsing function +function cal_prs_tsmp3 (str_datetime) { + // if no parameter specified return current timestamp + if (!str_datetime) + return (new Date()); + + // if positive integer treat as milliseconds from epoch + if (RE_NUM.exec(str_datetime)) + return new Date(str_datetime); + + // else treat as date in string format + var arr_datetime = str_datetime.split(' '); + return this.prs_time(arr_datetime[1], this.prs_date(arr_datetime[0])); +} + +// date parsing function +function cal_prs_date3 (str_date) { + + var arr_date = str_date.split('-'); + + if (arr_date.length != 3) return alert ("Invalid date format: '" + str_date + "'.\nFormat accepted is yyyy-mm-dd."); + + if (!arr_date[0]) return alert ("Invalid date format: '" + str_date + "'.\nNo year value can be found."); + if (!RE_NUM.exec(arr_date[0])) return alert ("Invalid year value: '" + arr_date[0] + "'.\nAllowed values are unsigned integers."); + + if (!arr_date[1]) return alert ("Invalid date format: '" + str_date + "'.\nNo month value can be found."); + if (!RE_NUM.exec(arr_date[1])) return alert ("Invalid month value: '" + arr_date[1] + "'.\nAllowed values are unsigned integers."); + + if (!arr_date[2]) return alert ("Invalid date format: '" + str_date + "'.\nNo day of month value can be found."); + if (!RE_NUM.exec(arr_date[2])) return alert ("Invalid day of month value: '" + arr_date[2] + "'.\nAllowed values are unsigned integers."); + + + + var dt_date = new Date(); + dt_date.setDate(1); + + if (arr_date[0] < 100) arr_date[0] = Number(arr_date[0]) + (arr_date[0] < NUM_CENTYEAR ? 2000 : 1900); + dt_date.setFullYear(arr_date[0]); + + + if (arr_date[1] < 1 || arr_date[1] > 12) return alert ("Invalid month value: '" + arr_date[1] + "'.\nAllowed range is 01-12."); + dt_date.setMonth(arr_date[1] - 1); + + + var dt_numdays = new Date(arr_date[0], arr_date[1], 0); + dt_date.setDate(arr_date[2]); + if (dt_date.getMonth() != (arr_date[1]-1)) return alert ("Invalid day of month value: '" + arr_date[2] + "'.\nAllowed range is 01-"+dt_numdays.getDate()+"."); + + return (dt_date) +} + +// time parsing function +function cal_prs_time3 (str_time, dt_date) { + + if (!dt_date) return null; + var arr_time = String(str_time ? str_time : '').split(':'); + + if (!arr_time[0]) dt_date.setHours(0); + else if (RE_NUM.exec(arr_time[0])) + if (arr_time[0] < 24) dt_date.setHours(arr_time[0]); + else return cal_error ("Invalid hours value: '" + arr_time[0] + "'.\nAllowed range is 00-23."); + else return cal_error ("Invalid hours value: '" + arr_time[0] + "'.\nAllowed values are unsigned integers."); + + if (!arr_time[1]) dt_date.setMinutes(0); + else if (RE_NUM.exec(arr_time[1])) + if (arr_time[1] < 60) dt_date.setMinutes(arr_time[1]); + else return cal_error ("Invalid minutes value: '" + arr_time[1] + "'.\nAllowed range is 00-59."); + else return cal_error ("Invalid minutes value: '" + arr_time[1] + "'.\nAllowed values are unsigned integers."); + + if (!arr_time[2]) dt_date.setSeconds(0); + else if (RE_NUM.exec(arr_time[2])) + if (arr_time[2] < 60) dt_date.setSeconds(arr_time[2]); + else return cal_error ("Invalid seconds value: '" + arr_time[2] + "'.\nAllowed range is 00-59."); + else return cal_error ("Invalid seconds value: '" + arr_time[2] + "'.\nAllowed values are unsigned integers."); + + dt_date.setMilliseconds(0); + return dt_date; +} + +function cal_error (str_message) { + alert (str_message); + return null; +} diff --git a/scire/calendar/img/cal.gif b/scire/calendar/img/cal.gif Binary files differnew file mode 100644 index 0000000..8526cf5 --- /dev/null +++ b/scire/calendar/img/cal.gif diff --git a/scire/calendar/img/icon_demo.gif b/scire/calendar/img/icon_demo.gif Binary files differnew file mode 100644 index 0000000..b6479eb --- /dev/null +++ b/scire/calendar/img/icon_demo.gif diff --git a/scire/calendar/img/icon_docs.gif b/scire/calendar/img/icon_docs.gif Binary files differnew file mode 100644 index 0000000..f8c401c --- /dev/null +++ b/scire/calendar/img/icon_docs.gif diff --git a/scire/calendar/img/icon_download.gif b/scire/calendar/img/icon_download.gif Binary files differnew file mode 100644 index 0000000..47d15f7 --- /dev/null +++ b/scire/calendar/img/icon_download.gif diff --git a/scire/calendar/img/icon_forum.gif b/scire/calendar/img/icon_forum.gif Binary files differnew file mode 100644 index 0000000..c99a254 --- /dev/null +++ b/scire/calendar/img/icon_forum.gif diff --git a/scire/calendar/img/icon_home.gif b/scire/calendar/img/icon_home.gif Binary files differnew file mode 100644 index 0000000..92a4f2e --- /dev/null +++ b/scire/calendar/img/icon_home.gif diff --git a/scire/calendar/img/logo.gif b/scire/calendar/img/logo.gif Binary files differnew file mode 100644 index 0000000..6b5397d --- /dev/null +++ b/scire/calendar/img/logo.gif diff --git a/scire/calendar/img/next.gif b/scire/calendar/img/next.gif Binary files differnew file mode 100644 index 0000000..bf02152 --- /dev/null +++ b/scire/calendar/img/next.gif diff --git a/scire/calendar/img/next_year.gif b/scire/calendar/img/next_year.gif Binary files differnew file mode 100644 index 0000000..ac12ea1 --- /dev/null +++ b/scire/calendar/img/next_year.gif diff --git a/scire/calendar/img/pixel.gif b/scire/calendar/img/pixel.gif Binary files differnew file mode 100644 index 0000000..46a2cf0 --- /dev/null +++ b/scire/calendar/img/pixel.gif diff --git a/scire/calendar/img/prev.gif b/scire/calendar/img/prev.gif Binary files differnew file mode 100644 index 0000000..211e1fa --- /dev/null +++ b/scire/calendar/img/prev.gif diff --git a/scire/calendar/img/prev_year.gif b/scire/calendar/img/prev_year.gif Binary files differnew file mode 100644 index 0000000..d8145d5 --- /dev/null +++ b/scire/calendar/img/prev_year.gif diff --git a/scire/calendar/img/tc.gif b/scire/calendar/img/tc.gif Binary files differnew file mode 100644 index 0000000..576e148 --- /dev/null +++ b/scire/calendar/img/tc.gif diff --git a/scire/client.php b/scire/client.php new file mode 100755 index 0000000..9e29aba --- /dev/null +++ b/scire/client.php @@ -0,0 +1,207 @@ +<?php +include('.lib/common.php'); + +$smarty->assign('leftbar', "on"); +$leftbar_menu = array(); + +add_leftbar($leftbar_menu, "««Cancel", "clients.php"); + + +$clientid = ""; + + + +##################################################### +#Deal with submitted forms. + +############################################### +#Adding a client to clientgroups. +if ($_POST['addgroup_confirm']) { + $ingroups = $acl->get_object_groups($_POST['clientid'],'AXO'); + $clientdata = $acl->get_object_data($_POST['clientid'], 'AXO'); + $newgroups = $_POST['addgroupid']; + #remove first. + foreach ($ingroups as $ingroup) { + if (!in_array($ingroup, $newgroups)) { + $acl->del_group_object($ingroup, $clientdata[0][0], $clientdata[0][1], 'AXO'); + } + } + foreach ($newgroups as $newgroup) { + print "newgroup: $newgroup"; + $acl->add_group_object($newgroup, $clientdata[0][0], $clientdata[0][1], 'AXO'); + } + $_GET['Action'] = "edit"; + $_GET['clientid'] = $_POST['clientid']; +} + +############################################### +# Adding a client. +if ($_POST['addhostname']) { + if ($_POST['addhostname'] and $_POST['ip'] and $_POST['mac']) { + check_action_access("Add Client");#Access check + #First just incase, we need to check if the object already exists (so we don't make duplicates) + $obj_id = ""; + if ($acl->get_object_id("clients", $_POST['addhostname'], 'AXO') ) { #client already exists + $obj_id = $acl->get_object_id("clients", $_POST['addhostname'], 'AXO'); + $status .= "Found existing object with objectid $obj_id <br>"; + } else { + $obj_id = $acl->add_object("clients", $_POST['addhostname'], $_POST['addhostname'], 1, 0, 'AXO'); + $status .= "Object id: $obj_id <BR>"; + } + $result = scire_add_client($obj_id, $_POST['digest'], $_POST['addhostname'], $_POST['mac'], $_POST['ip'], $_POST['gli_profile'], $_POST['osid'], $_POST['contact'], $_POST['status'], $_POST['installtime'], $_POST['assetid']); + if ($result == 1) { + $status .= "Client Addition successfull<br>"; + } else { + $status .= "Error during addition!: $result <br>"; + } + + if ($_POST['groups']) { + $status .= "Adding client to groups ".$_POST['groups']; + foreach( $_POST['groups'] as $group) { + $worked = $acl->add_group_object($group, "clients", $_POST['addhostname'], 'AXO'); + if ($worked) { + $status .= "Group $group Addition successfull.<br>"; + } else { + $status .= "ERROR adding group $group <br>"; + } + } + } + } else { + $status = "Error required fields are not filled!"; + } + #header('Location: ' . $baseurl . 'clients.php'); +} +############################################### +# Editing a client's information. +if ($_POST['edithostname']) { + check_action_access("Edit Client"); + $clientinfo = get_scire_client($_GET['clientid']); + $smarty->assign('client', $clientinfo); + + if ($_POST['digest'] and ($_POST['digest'] != $clientinfo['digest'])) { + $fields['digest'] = $_POST['digest']; + } + if ($_POST['mac'] and ($_POST['mac'] != $clientinfo['mac'])){ + $fields['mac'] = $_POST['mac']; + } + if ($_POST['ip'] and ($_POST['ip'] != $clientinfo['ip'])) { + $fields['ip'] = $_POST['ip']; + } + if ($_POST['gli_profile'] and ($_POST['gli_profile'] != $clientinfo['gli_profile'])) { + $fields['gli_profile'] = $_POST['gli_profile']; + } + if ($_POST['osid'] and ($_POST['osid'] != $clientinfo['osid'])) { + $fields['osid'] = $_POST['osid']; + } + if ($_POST['contact'] and ($_POST['contact'] != $clientinfo['contact'])) { + $fields['contact'] = $_POST['contact']; + } + if ($_POST['status'] and ($_POST['status'] != $clientinfo['status'])) { + $fields['status'] = $_POST['status']; + } + if ($_POST['installtime'] and ($_POST['installtime'] != $clientinfo['installtime'])) { + $fields['installtime'] = $_POST['installtime']; + } + if ($_POST['assetid'] and ($_POST['assetid'] != $clientinfo['assetid'])) { + $fields['assetid'] = $_POST['assetid']; + } + #special case for hostname, must change the ACLs + if ($_POST['edithostname'] and ($_POST['edithostname'] != $clientinfo['hostname'])) { + $fields['hostname'] = $_POST['edithostname']; + $result = $acl->edit_object($_POST['clientid'],"clients", $_POST['edithostname'], $_POST['edithostname'],1, 0, 'AXO'); + } + $status = scire_edit_client($_POST['clientid'], $fields); + $_GET['Action'] = "edit"; + $_GET['clientid'] = $_POST['clientid']; +} + +############################################### +# Delete a client. +if ($_POST['delete_confirm']) { + check_action_access("Delete Client"); + $status = scire_del_client($_POST['clientid']); + $acl->del_object($_POST['clientid'], 'AXO', TRUE); #True means erase referencing objects. + header('Location: ' . $baseurl . 'clients.php'); +} + +switch($_GET['Action']) { + case "addgroup": + $smarty->assign('desc', "Add a client to a client group."); + $smarty->assign('clientid', $_GET['clientid']); + $smarty->assign('groups', $acl->format_groups($acl->sort_groups('AXO'), TEXT)); + $ingroups = array(); + $ingroups = $acl->get_object_groups($_GET['clientid'],'AXO'); + var_dump($ingroups); + $smarty->assign('ingroups', $ingroups); + case "create": + check_action_access("Add Client");#Access check + $smarty->assign('desc', "Add a client."); + $smarty->assign('groups', $acl->format_groups($acl->sort_groups('AXO'), TEXT)); + $smarty->assign('gli_profiles', get_scire_gli_profiles()); + $smarty->assign('oss', get_scire_oss()); + $smarty->assign('users', get_scire_users('username', 'desc')); + break; + case "edit": + check_action_access("Edit Client");#Access check + $acls = array(); + #make the topbar look good + $smarty->assign('desc', "Edit client information."); + $clientinfo = get_scire_client($_GET['clientid']); + $smarty->assign('client', $clientinfo); + $smarty->assign('clientid', $_GET['clientid']); + $smarty->assign('gli_profiles', get_scire_gli_profiles()); + $smarty->assign('oss', get_scire_oss()); + $smarty->assign('users', get_scire_users('username', 'desc')); + + $clientgroups = array(); + $groups = $acl->get_object_groups($_GET['clientid'],'AXO'); + if ($groups) { + foreach ($groups as $group) { + $group_data = $acl->get_group_data($group, 'AXO'); + $clientgroups_entry['name'] = $group_data[3]; + $clientgroups_entry['id'] = $group_data[0]; + if ($group_data[1]) { + $parent_group_data = $acl->get_group_data($group_data[1],'AXO'); + $clientgroups_entry['parent'] = $parent_group_data[3]; + } else { + $clientgroups_entry['parent'] = ""; + } + array_push($clientgroups, $clientgroups_entry); + $result_acl_ids = $acl->search_acl(FALSE,FALSE, + FALSE,FALSE,FALSE, + FALSE,FALSE,$group_data[3],FALSE); + foreach ($result_acl_ids as $acl_id) { + array_push($acls, $acl->get_acl($acl_id)); + } + } + } + $smarty->assign('groups', $clientgroups); + + $ugroups = $acl->format_groups($acl->sort_groups('aro'), 'ARRAY'); + $smarty->assign('ugroups', $ugroups); + + #Format of search: aco_section, aco_value, aro_section, aro_value, aro_group_name, axo_section, axo_value, axo_group_name, return_value + $result_acl_ids = $acl->search_acl(FALSE,FALSE, + FALSE,FALSE,FALSE, + 'clients',$clientinfo['hostname'],FALSE,FALSE); + foreach ($result_acl_ids as $acl_id) { + array_push($acls, $acl->get_acl($acl_id)); + } + #pre_var_dump($acls); + $smarty->assign('acls',$acls); + break; + case "delete": + check_action_access("Delete Client");#Access check + $clientinfo = get_scire_client($_GET['clientid']); + $smarty->assign('client', $clientinfo); + $smarty->assign('clientid', $_GET['clientid']); + break; +} + +$smarty->assign('client_statuses', get_client_statuses() ); +$smarty->assign('leftbar_menu', $leftbar_menu); +$smarty->assign('Action', $_GET['Action']); +$smarty->assign('status', $status); +$smarty->display('client.tpl'); +#pre_var_dump($client_statuses); +?> diff --git a/scire/clients.php b/scire/clients.php new file mode 100755 index 0000000..1f447b2 --- /dev/null +++ b/scire/clients.php @@ -0,0 +1,231 @@ +<?php +include('.lib/common.php'); + +$smarty->assign('leftbar', "on"); +$leftbar_menu = array(); +$leftbar_submenu = array(); +$template = "clients.tpl"; +$status = ""; +$smarty->assign('statusfilters', array('', 'Pending','Active','Inactive','Rejected','Retired', 'All')); +check_action_access("View Clients"); +############################################ +## Deal with submitted forms first. +if ($_POST['addgroupname']) { #Adding a group. + check_action_access("Add ClientGroup"); + if (!$_POST['parentgroup']) { + $_POST['parentgroup'] = 0; + } + $newgroup_id = $acl->add_group($_POST['addgroupname'], $_POST['addgroupname'], $_POST['parentgroup'], 'AXO'); + $_GET['Action'] = "added"; + $_GET['View'] = "groups"; + $status = "Client Group Added Successfully."; +} +if ($_POST['editgroupname']) { + check_action_access("Edit ClientGroup"); + $group_id = $acl->edit_group($_POST['groupid'], $_POST['editgroupname'], $_POST['editgroupname'], $_POST['parentgroup'], 'AXO'); + $_GET['Action'] = "edited"; + $_GET['View'] = "groups"; + $status = "Client Group Edited Successfully."; +} +if($_POST['delgroup_confirm']) { + check_action_access("Delete ClientGroup"); + #Check if the group has children. + $result = $acl->del_group($_POST['delgroup'],TRUE, 'AXO'); + if ($result) { + $status = "Group deleted successfully."; + } else { + $status = "ERROR: Group could not be successfully deleted."; + } + $_GET['Action'] = "deleted"; + $_GET['View'] = "groups"; +} +#Admin access only. +if($_POST['pend_approve']) { + check_action_access("Approve/Reject Pending Clients"); + foreach ($_POST['pending_ids'] as $pend_id) { + $result = scire_approve_client($pend_id); + if ($result) { + $status .= "Client $pend_id approved successfully."; + $clientinfo = get_scire_client($pend_id); + $obj_id = $acl->add_object("clients", $clientinfo['hostname'], $clientinfo['hostname'], 1, 0, 'AXO'); + print "Object id: $obj_id <BR>"; + } else { + $status .= "ERROR: Client $pend_id could not be successfully approved."; + } + } +} +if($_POST['pend_reject']) { + check_action_access("Approve/Reject Pending Clients"); + foreach ($_POST['pending_ids'] as $pend_id) { + $result = scire_reject_client($pend_id); + if ($result) { + $status .= "Client $pend_id rejected!"; + } else { + $status .= "ERROR: Client $pend_id could not be successfully rejected."; + } + } +} + + +if($_POST['statusfilter']) { + if ( check_access("View Pending Clients") ) { + $_GET['View'] = $_POST['statusfilter']; + } +} + +$smarty->assign('desc', "View, create, edit, and delete clients"); + +######################################## +# Generate content + +switch($_GET['View']) { + case "groups": + $template = "clients_groups.tpl"; + switch($_GET['Action']) { + case "create": + add_leftbar($leftbar_menu, "««Cancel", "clients.php?View=groups"); + $smarty->assign('groups', $acl->format_groups($acl->sort_groups('AXO'), TEXT)); + break; + case "edit": + add_leftbar($leftbar_menu, "««Cancel", "clients.php?View=groups"); + $smarty->assign('groups', $acl->format_groups($acl->sort_groups('AXO'), TEXT)); + $smarty->assign('groupid', $_GET['groupid']); + $smarty->assign('groupdata', $acl->get_group_data($_GET['groupid'], 'AXO')); + break; + case "delete": + add_leftbar($leftbar_menu, "««Cancel", "clients.php?View=groups"); + $smarty->assign('groupid', $_GET['groupid']); + break; + default: #Show clientgroups. + add_leftbar($leftbar_menu, "Clients", "clients.php"); + add_leftbar($leftbar_menu, "Permissions", "clients.php?View=permissions"); + $smarty->assign('leftbar_submenu_title', "Actions"); + if ( check_access("Add ClientGroup") ) { + add_leftbar($leftbar_submenu, "Add Client Group", "clients.php?View=groups&Action=create"); + } + + + $groups = $acl->format_groups($acl->sort_groups('AXO'), HTML); + $smarty->assign('groups', $groups); + + break; + } + break; + case "permissions": + $smarty->assign('leftbar_submenu_title', "Actions"); + check_action_access("View Permissions"); + if ( check_access("Assign Permission") ) { + add_leftbar($leftbar_submenu, "Assign Permission", "assign_permission.php"); + } + $template = "permissions.tpl"; + $smarty->assign('type','clients'); + $ugroups = $acl->format_groups($acl->sort_groups('aro'), 'ARRAY'); + $smarty->assign('ugroups', $ugroups); + $cgroups = $acl->format_groups($acl->sort_groups('axo'), 'ARRAY'); + $smarty->assign('cgroups', $cgroups); + + #pre_var_dump($groups); + + $acls = array(); + #Format of search: aco_section, aco_value, aro_section, aro_value, aro_group_name, axo_section, axo_value, axo_group_name, return_value + $result_acl_ids = $acl->search_acl(FALSE,FALSE, + FALSE,FALSE,FALSE, + FALSE,FALSE,FALSE,FALSE); + foreach ($result_acl_ids as $acl_id) { + $this_acl = $acl->get_acl($acl_id); + if ($this_acl['aco']['scire_ui']) { + next; + } else { + array_push($acls, $this_acl); + } + } + #pre_var_dump($acls); + $smarty->assign('acls',$acls); + break; + case "Pending": + case "Inactive": + case "Rejected": + case "Retired": + case "All": + #Will need to grab only pending clients. Will need to hardcode the field list unless making settings for it. + add_leftbar($leftbar_menu, "View Groups", "clients.php?View=groups"); + add_leftbar($leftbar_menu, "View Permissions", "clients.php?View=permissions"); + + #Set information about the fields (display name, sortable) + $f_attr = get_clients_fields(); + $smarty->assign('f_attr', $f_attr); + + if (!$_GET['sorton']) { + $_GET['sorton'] = 'installtime'; + } + if (!$_GET['sortdir']) { + $_GET['sortdir'] = 'asc'; + } + $smarty->assign('sorton', $_GET['sorton']); + $smarty->assign('sortdir', $_GET['sortdir']); + + #Grab the field list. + $fields = explode(',', $_SESSION['settings']['clients_page_fields']); + $fields = array("hostname", "ip", "mac", "digest", "status", "installtime"); + $smarty->assign('fields',$fields); + + $clients = get_scire_clients($_GET['sorton'], $_GET['sortdir'], $_GET['View']); + $smarty->assign('clients', $clients); + break; + default: #Show clients. + add_leftbar($leftbar_menu, "View Groups", "clients.php?View=groups"); + add_leftbar($leftbar_menu, "View Permissions", "clients.php?View=permissions"); + $smarty->assign('leftbar_submenu_title', "Actions"); + if ( check_access("Add Client") ) { + add_leftbar($leftbar_submenu, "Create Client", "client.php?Action=create"); + } + ############################################ + ## Deal with sorting for the query. + if (!$_GET['sorton']) { + $_GET['sorton'] = $_SESSION['settings']['clients_page_sorton']; + } + if (!$_GET['sortdir']) { + $_GET['sortdir'] = $_SESSION['settings']['clients_page_sortdir']; + } + $smarty->assign('sorton', $_GET['sorton']); + $smarty->assign('sortdir', $_GET['sortdir']); + + $clients = get_scire_clients($_GET['sorton'], $_GET['sortdir']); + #var_dump($clients); + foreach ($clients as $key => $client) { + $id = $acl->get_object_id("clients",$client['hostname'],'AXO'); + $groups = $acl->get_object_groups($id,'AXO'); + $group_string = ""; + if ($groups) { + foreach ($groups as $group) { + $group_data = $acl->get_group_data($group, 'AXO'); + $group_string .= $group_data[3]. " | "; + } + } + $clients[$key]['groups'] = $group_string; + } + + #Set information about the fields (display name, sortable) + $f_attr = get_clients_fields(); + $smarty->assign('f_attr', $f_attr); + + #Grab the field list. + if ($_SESSION['settings']['clients_page_fields']) { + $fields = explode(',', $_SESSION['settings']['clients_page_fields']); + } else { + $fields = explode(',', get_default_clients_fields()); + } + $smarty->assign('fields',$fields); + + $smarty->assign('clients', $clients); + break; +} + +$smarty->assign('leftbar_menu', $leftbar_menu); +$smarty->assign('leftbar_submenu', $leftbar_submenu); +$smarty->assign('View', $_GET['View']); +$smarty->assign('Action', $_GET['Action']); +$smarty->assign('status', $status); +$smarty->display($template); +#var_dump($_POST); +?> diff --git a/scire/cron.php b/scire/cron.php new file mode 100644 index 0000000..10ba80d --- /dev/null +++ b/scire/cron.php @@ -0,0 +1,672 @@ +<?php
+ /*
+ * Mick Sear, eCreate, May 2005
+ * http://www.ecreate.co.uk
+ * Modified by: Rodrigo Lazo, June 2007
+ * License: GPL
+ * Version: 1.1
+ */
+
+ /*
+ * Added functinality :
+ *
+ * - Input validation.
+ * - Support for step argument ("/")
+ * - Cron Exception for non-recoveral errors
+ * - Field expansion (given a month, generate all the possible
+ * values for every other field)
+ */
+
+ /*$cron = "15,33,48 1-10 * * *";
+ $cp = new CronParser($cron);
+ echo "Cron $cron last ran on:";
+ print_r($cp->getLastRan());
+ echo nl2br($cp->getDebug());*/
+
+ //
+ // Know bugs:
+ //
+ // It can't handle too complex step arguments.
+ //
+ // */12 or 1-3/4 are ok
+ // 1,4-5/20,2 or 1,2,3,4,5,10-30/5 isn't supported
+ //
+
+class CronException extends Exception {
+ // Redefine the exception so message isn't optional
+ public function __construct($message, $code = 0) {
+ // some code
+
+ // make sure everything is assigned properly
+ parent::__construct($message, $code);
+ }
+
+ // custom string representation of object
+ public function __toString() {
+ return __CLASS__ . ": [{$this->code}]: {$this->message}\n";
+ }
+
+ }
+
+
+class CronParser{
+
+ var $bits = Array(); //exploded String like 0 1 * * *
+ var $now= Array(); //Array of cron-style entries for time()
+ var $lastRan; //Timestamp of last ran time.
+ var $taken;
+ var $debug;
+
+
+ function CronParser($string, $now = false, $validate_only = false){
+ $tstart = microtime();
+ $this->debug("<b>Working on cron schedule: $string</b>");
+ $this->bits = @explode(" ", $this->sanitize_input($string));
+ $this->validate();
+ if ($validate_only)
+ return;
+ if ($now)
+ $this->now = explode(",", $now);
+ else
+ $this->getNow();
+ $this->calcLastRan();
+ $this->calcNextRun();
+ $tend = microtime();
+ $this->taken = $tend-$tstart;
+ $this->debug("Parsing $string taken ".$this->taken." seconds");
+
+ }
+
+ function sanitize_input($string) {
+ $tmp = trim($string);
+ $output = "";
+ $jump = false;
+ for ($i=0; $i<strlen($tmp); $i++) {
+ if ($tmp[$i] != ' ') {
+ $output = $output . $tmp[$i];
+ $jump = false;
+ }
+ else
+ if (!$jump) {
+ $output = $output . $tmp[$i];
+ $jump = true;
+ }
+ }
+ return $output;
+ }
+
+ function validate(){
+ $min = array(0,0,1,1,0);
+ $max = array(59,23,31,12,7);
+ $pattern = "/^\d+((\d+)?(,\d)?(\-\d+($|\/\d+$)?)?)+$/";
+ $range_pattern = "/^\*(\/\d+)?$/";
+ if (count($this->bits) != 5){
+ throw new CronException("Wrong number of parameters.");
+ }
+ $i=0;
+ foreach ($this->bits as $piece){
+ if ($piece == "*" || preg_match($range_pattern, $piece)) {
+ continue;
+ }
+ if (!preg_match($pattern, $piece)){
+ throw new CronException("Bad formatted entry: " . $piece);
+ }
+ foreach (explode(",",$piece) as $molecule) {
+ foreach (explode("-", $molecule) as $atom) {
+ if ($atom > $max[$i] || $atom < $min[$i]){
+ throw new CronException("Parameter out of range: " . $atom);
+ }
+ }
+ }
+ $i++;
+ }
+ }
+
+ function expandValues(){
+ $sol = array();
+ $minutes = $this->bits[0];
+ $hours = $this->bits[1];
+ $months = $this->bits[3];
+
+ if ($minutes == "*") {
+ $minutes = range(0,59);
+ } else if (strstr($minutes, "*/")) {
+ $tmp = explode("/", $minutes);
+ $minutes = $this->expand_ranges("0-59/".$tmp[1]);
+ }
+ else {
+ $minutes = $this->expand_ranges($minutes);
+ }
+
+ if ($hours == "*") {
+ $hours = range(0, 23);
+ } else if (strstr($hours, "*/")) {
+ $tmp = explode("/", $hours);
+ $minutes = $this->expand_ranges("0-23/".$tmp[1]);
+ }
+ else {
+ $hours = $this->expand_ranges($hours);
+ }
+
+ if ($months == "*") {
+ $months = range(1,12);
+ } else if (strstr($months, "*/")) {
+ $tmp = explode("/", $months);
+ $minutes = $this->expand_ranges("0-12/".$tmp[1]);
+ }
+ else {
+ $months = $this->expand_ranges($months);
+ }
+
+ return array("minutes" => $minutes, "hours" => $hours, "months" => $months);
+
+ }
+
+ function getNextArray($arr, $current) {
+ if (is_array($arr)) {
+ foreach ($arr as $v) {
+ if ($v > $current)
+ return $v;
+ }
+ }
+ return false;
+ }
+
+ function calcNextRun(){
+ $lastRan = $this->getLastRan();
+ $values = $this->expandValues();
+ $days = $this->getDaysArray($lastRan[3]);
+
+ var_dump($values);
+ ob_start();var_dump($values);$output=ob_get_contents();ob_end_clean();
+
+ $this->debug("<b>NextRun!</b> dump" . $output);
+
+ ob_start();var_dump($days);$output=ob_get_contents();ob_end_clean();
+ $this->debug("<b>dias:</b> " . $output);
+
+ $minute = $this->getNextArray($values["minutes"], $lastRan[0]);
+ if ($minute) {
+ $this->nextRun = mktime($lastRan[1], $minute, 0, $lastRan[3], $lastRan[2], $lastRan[5]);
+ return;
+ }
+ else {
+ $minute = $values["minutes"][0];
+ }
+ $this->debug("Next minute -> " . $minute);
+
+
+ $hour = $this->getNextArray($values["hours"], $lastRan[1]);
+ if ($hour) {
+ $this->nextRun = mktime($hour, $minute, 0, $lastRan[3], $lastRan[2], $lastRan[5]);
+ return;
+ }
+ else {
+ $hour = $values["hours"][0];
+ }
+
+ $day = $this->getNextArray($days, $lastRan[2]);
+ if ($day) {
+ $this->nextRun = mktime($hour, $minute, 0, $lastRan[3], $day, $lastRan[5]);
+ return;
+ }
+
+ // In this case we don't have an else statement because we
+ // need to calculate the next month first so we know wich day is the needed
+
+ $month = $this->getNextArray($values["months"], $lastRan[3]);
+ if ($month) {
+ $day = $this->getDaysArray($month);
+ $this->nextRun = mktime($hour, $minute, 0,$month, $day, $lastRan[5]);
+ return;
+ }
+ else {
+ $month = $values["months"][0];
+ $day = $this->getDaysArray($month, $lastRan[5]+1);
+ $this->nextRun = mktime($hour, $minute, 0,$month, $day, $lastRan[5]+1);
+ }
+
+ ob_start();var_dump($this->nextRun);$output=ob_get_contents();ob_end_clean();
+ $this->debug("<b>output</b> " . $output);
+
+// var_dump($this->nextRan);
+ }
+
+ function getNow(){
+ $t = strftime("%M,%H,%d,%m,%w,%Y", time()); //Get the values for now in a format we can use
+ $this->now = explode(",", $t); //Make this an array
+ //$this->debug($this->now);
+ }
+
+ function getLastRan(){
+ return explode(",", strftime("%M,%H,%d,%m,%w,%Y", $this->lastRan)); //Get the values for now in a format we can use
+ }
+
+ function getNextRun(){
+ return explode(",", strftime("%M,%H,%d,%m,%w,%Y", $this->nextRun)); //Get the values for now in a format we can use
+ }
+
+ function getDebug(){
+ return $this->debug;
+ }
+
+ function debug($str){
+ if (is_array($str)){
+ $this->debug .= "\nArray: ";
+ foreach($str as $k=>$v){
+ $this->debug .= "$k=>$v, ";
+ }
+
+ } else {
+ $this->debug .= "\n$str";
+ }
+ //echo nl2br($this->debug);
+
+ }
+
+
+ function getExtremeMonth($extreme){
+
+ if ($extreme == "END"){
+ $year = $this->now[5] - 1;
+ } else {
+ $year = $this->now[5];
+ }
+
+ //Now determine start or end month in the last year
+ if ($this->bits[3] == "*" && $extreme == "END"){//Check month format
+ $month = 12;
+ } else if ($this->bits[3] == "*" && $extreme == "START"){
+ $month = 1;
+ } else {
+ $months = $this->expand_ranges($this->bits[3]);
+ if ($extreme == "END"){
+ sort($months);
+ } else {
+ rsort($months);
+ }
+ $month = array_pop($months);
+ }
+
+ //Now determine the latest day in the specified month
+ $day=$this->getExtremeOfMonth($month, $year, $extreme);
+ $this->debug("Got day $day for $extreme of $month, $year");
+ $hour = $this->getExtremeHour($extreme);
+ $minute = $this->getExtremeMinute($extreme);
+
+ return mktime($hour, $minute, 0, $month, $day, $year);
+ }
+
+ /**
+ * Assumes that value is not *, and creates an array of valid numbers that
+ * the string represents. Returns an array.
+ */
+ function expand_ranges($str){
+ //$this->debug("Expanding $str");
+ //echo var_dump($str);
+
+ if (strstr($str, "/")){
+ $val = explode("/", $str);
+ $str = $val[0];
+ $step = $val[1];
+ if (count($val) != 2) {
+ throw new CronException("Bad formatted entry (step): " . $str);
+ }
+ }
+
+ if (strstr($str, ",")){
+ $tmp1 = explode(",", $str);
+ //$this->debug($tmp1);
+ $count = count($tmp1);
+ for ($i=0;$i<$count;$i++){//Loop through each comma-separated value
+ if (strstr($tmp1[$i], "-")){ //If there's a range in this place, expand that too
+ $tmp2 = explode("-", $tmp1[$i]);
+ //$this->debug("Range:");
+ //$this->debug($tmp2);
+ for ($j=$tmp2[0];$j<=$tmp2[1];$j++){
+ $ret[] = $j;
+ }
+ } else {//Otherwise, just add the value
+ $ret[] = $tmp1[$i];
+ }
+ }
+ } else if (strstr($str, "-")){//There might only be a range, no comma sep values at all. Just loop these
+ $range = explode("-", $str);
+ for ($i=$range[0];$i<=$range[1];$i++){
+ $ret[] = $i;
+ }
+ } else {//Otherwise, it's a single value
+ $ret[] = $str;
+ return $ret;
+ }
+ sort($ret);
+ if (isset($step)) {
+ $sol = array();
+ foreach (range(0,count($ret),$step) as $i) {
+ $sol[] = $ret[$i];
+ }
+ $ret = $sol;
+ }
+ return $ret;
+ }
+
+ /**
+ * Given a string representation of a set of weekdays, returns an array of
+ * possible dates.
+ */
+ function getWeekDays($str, $month, $year){
+ $daysInMonth = $this->daysinmonth($month, $year);
+
+ if (strstr($str, ",")){
+ $tmp1 = explode(",", $str);
+ $count = count($tmp1);
+ for ($i=0;$i<$count;$i++){//Loop through each comma-separated value
+ if (strstr($tmp1[$i], "-")){ //If there's a range in this place, expand that too
+ $tmp2 = explode("-", $tmp1[$i]);
+
+ for ($j=$start;$j<=$tmp2[1];$j++){
+ for ($n=1;$n<=$daysInMonth;$n++){
+ if ($j == jddayofweek(gregoriantojd ( $month, $n, $year),0)){
+ $ret[] = $n;
+ }
+ }
+ }
+ } else {//Otherwise, just add the value
+ for ($n=1;$n<=$daysInMonth;$n++){
+ if ($tmp1[$i] == jddayofweek(gregoriantojd ( $month, $n, $year),0)){
+ $ret[] = $n;
+ }
+ }
+ }
+ }
+ } else if (strstr($str, "-")){//There might only be a range, no comma sep values at all. Just loop these
+ $range = explode("-", $str);
+ for ($i=$start;$i<=$range[1];$i++){
+ for ($n=1;$n<=$daysInMonth;$n++){
+ if ($i == jddayofweek(gregoriantojd ( $month, $n, $year),0)){
+ $ret[] = $n;
+ }
+ }
+ }
+ } else {//Otherwise, it's a single value
+ for ($n=1;$n<=$daysInMonth;$n++){
+ if ($str == jddayofweek(gregoriantojd ( $month, $n, $year),0)){
+ $ret[] = $n;
+ }
+ }
+ }
+
+ return $ret;
+ }
+
+ function daysinmonth($month, $year){
+ if(checkdate($month, 31, $year)) return 31;
+ if(checkdate($month, 30, $year)) return 30;
+ if(checkdate($month, 29, $year)) return 29;
+ if(checkdate($month, 28, $year)) return 28;
+ return 0; // error
+ }
+
+ /**
+ * Get the timestamp of the last ran time.
+ */
+ function calcLastRan(){
+ $values = $this->expandValues();
+ echo "Calculating last ran \n";
+ echo var_dump($this->now);
+ $now = mktime($this->now[1],$this->now[0],0,$this->now[3],$this->now[2],$this->now[5]);
+ echo "Now -> ";
+ echo var_dump($now[0]);
+ if ($now < $this->getExtremeMonth("START")){
+ echo "\nCron is not due to have this year\n";
+ //The cron isn't due to have run this year yet. Getting latest last year
+ $this->debug("Last ran last year");
+ $tsLatestLastYear = $this->getExtremeMonth("END");
+
+ $this->debug("Timestamp of latest scheduled time last year is ".$tsLatestLastYear);
+ $this->lastRan = $tsLatestLastYear;
+
+ $year = date("Y", $this->lastRan);
+ $month = date("m", $this->lastRan);
+ $day = date("d", $this->lastRan);
+ $hour = date("h", $this->lastRan);
+ $minute = date("i", $this->lastRan);
+
+
+ } else { //Cron was due to run this year. Determine when it was last due
+ echo "\nCron is this year\n";
+ $this->debug("Cron was due to run earlier this year");
+ $year = $this->now[5];
+ echo "Anho: ".$year;
+ /*
+ $arMonths = $this->expand_ranges($this->bits[3]);
+ */
+ $arMonths = $values["months"];
+ echo "\nMeses: ";
+ echo var_dump($arMonths);
+ echo "\nValue Meses: ";
+ echo var_dump($values["months"]);
+ if (!in_array($this->now[3], $arMonths) && $this->bits[3] != "*"){//Not due to run this month. Get latest of last month
+ $this->debug("Cron was not due to run this month at all. This month is ".$this->now[3]);
+ $this->debug("Months array: ");
+ $this->debug($arMonths);
+ sort($arMonths);
+ do{
+ $month = array_pop($arMonths);
+ } while($month > $this->now[3]);
+ $day = $this->getExtremeOfMonth($month, $this->now[5], "END");
+ $hour = $this->getExtremeHour("END");
+ $minute = $this->getExtremeMinute("END");
+ } else if ($now < $this->getExtremeOfMonth($this->now[3], $this->now[5], "START")){ //It's due in this month, but not yet.
+ $this->debug("It's due in this month, but not yet.");
+ sort($arMonths);
+ do{
+ $month = array_pop($arMonths);
+ } while($month > $this->now[3]);
+ $day = $this->getExtremeOfMonth($month, $this->now[5], "END");
+ $hour = $this->getExtremeHour("END");
+ $minute = $this->getExtremeMinute("END");
+ } else {//It has been due this month already
+ $this->debug("Cron has already been due to run this month (".$month = $this->now[3].")");
+ $month = $this->now[3];
+ $this->debug("Getting days array");
+ $days = $this->getDaysArray($this->now[3]);
+
+ if (!in_array($this->now[2], $days)){
+ $this->debug("Today not in the schedule. Getting latest last due day");
+ //No - Get latest last scheduled day
+ sort($days);
+ do{
+ $day = array_pop($days);
+ } while($day > $this->now[2]);
+
+ $hour = $this->getExtremeHour("END");
+ $minute = $this->getExtremeMinute("END");
+
+ } else if($this->now[1] < $this->getExtremeHour("START")){//Not due to run today yet
+ $this->debug("Cron due today, but not yet. Getting latest on last day");
+ sort($days);
+ do{
+ $day = array_pop($days);
+ } while($day >= $this->now[2]);
+
+ $hour = $this->getExtremeHour("END");
+ $minute = $this->getExtremeMinute("END");
+ } else {
+ $this->debug("Cron has already been due to run today");
+ $day = $this->now[2];
+ //Yes - Check if this hour is in the schedule?
+
+ $arHours = $this->expand_ranges($this->bits[1]);
+
+ if (!in_array($this->now[1], $arHours) && $this->bits[1] != "*"){
+ $this->debug("Cron not due in this hour, getting latest in last scheduled hour");
+ //No - Get latest last hour
+ sort($arHours);
+ do{
+ $hour = array_pop($arHours);
+ //$this->debug("hour is $hour, now is ".$this->now[1]);
+ } while($hour > $this->now[1]);
+
+ $minute = $this->getExtremeMinute("END");
+
+ } else if ($now < $this->getExtremeMinute("START") && $this->bits[1] != "*"){ //Not due to run this hour yet
+ sort($arHours);
+ do{
+ $hour = array_pop($arHours);
+ } while($hour >= $this->now[1]);
+ $minute = $this->getExtremeMinute("END");
+ } else {
+ //Yes, it is supposed to have run this hour already - Get last minute
+ $hour = $this->now[1];
+ if ($this->bits[0] != "*"){
+ $arMinutes = $this->expand_ranges($this->bits[0]);
+ $this->debug($arMinutes);
+ do{
+ $minute = array_pop($arMinutes);
+ } while($minute >= $this->now[0]);
+
+ //If the first time in the hour that the cron is due to run is later than now, return latest last hour
+ if($minute > $this->now[1] || $minute == ""){
+ $this->debug("Valid minute not set");
+ $minute = $this->getExtremeMinute("END"); //The minute will always be the last valid minute in an hour
+ //Get the last hour.
+ if ($this->bits[1] == "*"){
+ $hour = $this->now[1] - 1;
+ } else {
+ $arHours = $this->expand_ranges($this->bits[1]);
+ $this->debug("Array of hours:");
+ $this->debug($arHours);
+ sort($arHours);
+ do{
+ $hour = array_pop($arHours);
+ } while($hour >= $this->now[1]);
+ }
+ }
+
+ } else {
+ $minute = $this->now[0] -1;
+ }
+ }
+
+ }
+
+ }
+ }
+ echo "Last Ran calculated";
+ echo "\n##########################\n\n";
+ $this->debug("LAST RAN: $hour:$minute on $day/$month/$year");
+ //echo var_dump($this->getDebug());
+ $this->lastRan = mktime($hour, $minute, 0, $month, $day, $year);
+
+ }
+
+ function getExtremeOfMonth($month, $year, $extreme){
+ $daysInMonth = $this->daysinmonth($month, $year);
+ if ($this->bits[2] == "*"){
+ if ($this->bits[4] == "*"){//Is there a day range?
+ //$this->debug("There were $daysInMonth days in $month, $year");
+ if ($extreme == "END"){
+ $day = $daysInMonth;
+ } else {
+ $day=1;
+ }
+ } else {//There's a day range. Ignore the dateDay range and just get the list of possible weekday values.
+ $days = $this->getWeekDays($this->bits[4],$month, $year);
+ $this->debug($this->bits);
+ $this->debug("Days array for ".$this->bits[4].", $month, $year:");
+ $this->debug($days);
+ if ($extreme == "END"){
+ sort($days);
+ } else {
+ rsort($days);
+ }
+ $day = array_pop($days);
+ }
+ } else {
+ $days = $this->expand_ranges($this->bits[2]);
+ if ($extreme == "END"){
+ sort($days);
+ } else {
+ rsort($days);
+ }
+
+ do {
+ $day = array_pop($days);
+ } while($day > $daysInMonth);
+ }
+ //$this->debug("$extreme day is $day");
+ return $day;
+ }
+
+ function getDaysArray($month, $year=0){
+ if ($year == 0) {
+ $year = $this->now[5];
+ }
+ $this->debug("Getting days for $month");
+ $days = array();
+
+ if ($this->bits[4] != "*"){
+ $days = $this->getWeekDays($this->bits[4], $month, $year);
+ $this->debug("Weekdays:");
+ $this->debug($days);
+ }
+ if ($this->bits[2] != "*" && $this->bits[4] == "*") {
+ $days = $this->expand_ranges($this->bits[2]);
+ }
+ if ($this->bits[2] == "*" && $this->bits[4] == "*"){
+ //Just return every day of the month
+ $daysinmonth = $this->daysinmonth($month, $year);
+ $this->debug("Days in ".$month.", ".$year.": ".$daysinmonth);
+ for($i = 1;$i<=$daysinmonth;$i++){
+ $days[] = $i;
+ }
+ }
+ $this->debug($days);
+
+ return $days;
+ }
+
+ function getExtremeHour($extreme){
+ if ($this->bits[1] == "*"){
+ if ($extreme == "END"){
+ $hour = 23;
+ } else {
+ $hour = 0;
+ }
+ } else {
+ $hours = $this->expand_ranges($this->bits[1]);
+ if ($extreme == "END"){
+ sort($hours);
+ } else {
+ rsort($hours);
+ }
+ $hour = array_pop($hours);
+ }
+ //$this->debug("$extreme hour is $hour");
+ return $hour;
+ }
+
+ function getExtremeMinute($extreme){
+ if ($this->bits[0] == "*"){
+ if ($extreme == "END"){
+ $minute = 59;
+ } else {
+ $minute = 0;
+ }
+ } else {
+ $minutes = $this->expand_ranges($this->bits[0]);
+ if ($extreme == "END"){
+ sort($minutes);
+ } else {
+ rsort($minutes);
+ }
+ $minute = array_pop($minutes);
+ }
+ //$this->debug("$extreme minute is $minute");
+ return $minute;
+ }
+
+}
+
+?>
\ No newline at end of file diff --git a/scire/cron2.php b/scire/cron2.php new file mode 100644 index 0000000..eee90f0 --- /dev/null +++ b/scire/cron2.php @@ -0,0 +1,467 @@ +<?php + + /* + * Crontab-syntax support + * Single elements : * 12 + * Multiple elements : 1,2,3 4,6,1 + * Ranged elements: 1-4 9-12 + * Steped ranges : 1-16/2 *\/2 + * + * Not supported + * Compound elements : 1,4,9-14 2,4-29,31 3,9-15,29 + */ + +class CronException extends Exception { + // Redefine the exception so message isn't optional + public function __construct($message, $code = 0) { + + // make sure everything is assigned properly + parent::__construct($message, $code); + } + + // custom string representation of object + public function __toString() { + return __CLASS__ . ": [{$this->code}]: {$this->message}\n"; + } + } + +class Debug { + private $debugLevel; + private $debugMessage = ""; + private $functionScope = "main"; + + public function __construct($debugLevel = 0) { + if ($debugLevel <= 0) { + $this->debugLevel = 0; + } + else if ($debugLevel >= 2) { + $this->debugLevel = 2; + } + else + $this->debugLevel = 1; + } + + public function addDebugMessage($message, $function = "") { + // If we change of scope we need to record the new scope + if ($function != "") + $this->functionScope = $function; + // What level of debugging are we in? + if ($this->debugLevel == 0) + return; + if ($this->debugLevel >= 2) { + print $this->functionScope; + print "------------"; + if (is_string($message)) + print $message; + else + echo var_dump($message); + print "------------"; + } + + $this->debugMessage .= "\n". $this->functionScope . ": "; + if (is_array($message)) { + ob_start();var_dump($message);$output=ob_get_contents();ob_end_clean(); + $this->debugMessage .= $output; + } else + $this->debugMessage .= $message; + } + + public function __toString() { + echo $this->debugMessage; + } +} + +class CronParser { + private $input; + private $elements = array(); + private $isValid = true; + private $_elementsRanges; + private $_elementPattern; + private $_elementRangePattern; + private $_elementRangeStepPattern; + private $_now; + public $debug; + + function __construct($str, $debug = 1) { + $this->_initialize(); + $this->debug = new Debug($debug); + $this->input = $str; + $this->_preprocessInput(); + } + + /*! Initialize some variables + */ + private function _initialize() { + $this->isValid = false; + $this->_elementsRanges = array ( + "minutes" => array ( + "min" => 0, + "max" => 59), + "hours" => array ( + "min" => 0, + "max" => 23), + "days" => array ( + "min" => 1, + "max" => 31), + "months" => array ( + "min" => 1, + "max" => 12), + "weekdays" => array( + "min" => 0, + "max" => 6)); + // This patter may add experimental support to compound elements + //$this->_elementPattern = "/^\d+((\d+)?(,\d)?(\-\d+($|\/\d+$)?)?)+$/"; + $this->_elementPattern = "/^\d+(,\d+)*$/"; + $this->_elementRangeStepPattern = "/^(\*|\d+-\d+)\/\d+$/"; + $this->_elementRangePattern = "/^\d+-\d+$/"; + } + + /*! Preprocess the input so it can be used + * + * This preprocessing involves: triming, eliminating useless + * blank spaces between elements of the entry, validation, + * ranges expansion, step calculation. + */ + private function _preprocessInput() { + $this->debug->addDebugMessage("Entering function", "preprocessInput"); + + // Trim extra space from the beginning and end of $input + $tmp = trim($this->input); + $output= ""; + $this->debug->addDebugMessage("Finished triming : " . $tmp); + + // Eliminate extra spaces inside $input + $jump = false; + for ($i=0; $i<strlen($tmp); $i++) { + if ($tmp[$i] != ' ') { + $output = $output . $tmp[$i]; + $jump = false; + } + else + if (!$jump) { + $output = $output . $tmp[$i]; + $jump = true; + } + } + $this->debug->addDebugMessage("Cleaning finished : " . $output); + + // Split $input into its elements + $tmp = explode(" ", $output); + if (count($tmp) != 5) + throw new CronException("Wrong number of parameters." . $output); + $this->elements = array ( "minutes" => $tmp[0], + "hours" => $tmp[1], + "days" => $tmp[2], + "months" => $tmp[3], + "weekdays" => $tmp[4]); + $this->debug->addDebugMessage("Input splitted : "); + $this->debug->addDebugMessage($this->elements); + + // Validate input and expand values + foreach (array("minutes", "hours", "days", "months", "weekdays") as $elementName) { + $currentElement =& $this->elements[$elementName]; + $currentRange =& $this->_elementsRanges[$elementName]; + // It is the whole range? + if ($currentElement == "*") + { + // Days calculation is different + if (in_array($elementName, array("days", "weekdays"))) + continue; + + $currentElement = range($currentRange["min"], + $currentRange["max"]); + } + // It is a range with a step? + else if (preg_match($this->_elementRangeStepPattern, $currentElement)) { + $pieces = explode("/", $currentElement); + // if an asterix range + if ($pieces[0] == "*") { + $totalRange = range($currentRange["min"], + $currentRange["max"]); + } + // it *has* to be an numeric range + else { + $atoms = explode("-", $pieces[0]); + $atoms[0] = (int)$atoms[0]; + $atoms[1] = (int)$atoms[1]; + if ($atoms[0] > $atoms[1] || + $atoms[0] < $currentRange["min"] || $atoms[0] > $currentRange["max"] || + $atoms[1] < $currentRange["min"] || $atoms[1] > $currentRange["max"]) { + throw new CronException("Bad formatted entry(range): " . $currentElement); + } + $totalRange = range($atoms[0], $atoms[1]); + } + $sol = array(); + // now use the step to filter the range + foreach (range(0,count($totalRange),(int)$pieces[1]) as $i) { + if (isset($totalRange[$i])) + $sol[] = $totalRange[$i]; + } + $currentElement = $sol; + } + // it is a range withouth step + else if (preg_match($this->_elementRangePattern, $currentElement)) { + $atoms = explode("-", $currentElement); + $atoms[0] = (int)$atoms[0]; + $atoms[1] = (int)$atoms[1]; + if ($atoms[0] > $atoms[1] || + $atoms[0] < $currentRange["min"] || $atoms[0] > $currentRange["max"] || + $atoms[1] < $currentRange["min"] || $atoms[1] > $currentRange["max"]) { + throw new CronException("Bad formatted entry(range): " . $currentElement); + } + $currentElement = range($atoms[0], $atoms[1]); + } + // It is an element + else if (preg_match($this->_elementPattern, $currentElement)){ + $sol = array(); + if (preg_match("/^\d+$/", $currentElement)) { + if ((int)$currentElement > $currentRange["max"] || (int)$currentElement < $currentRange["min"]){ + throw new CronException("Parameter out of range: " . $atom . " of " . $this->input); + } + $currentElement = array((int)$currentElement); + } + else { + foreach (explode(",",$currentElement) as $atom) { + if ((int)$atom > $currentRange["max"] || (int)$atom < $currentRange["min"]){ + throw new CronException("Parameter out of range: " . $atom . " of " . $this->input); + } + $sol[] = (int)$atom; + } + $currentElement = $sol; + } + } + else { + throw new CronException("Bad formatted entry (element): " . $currentElement); + } + } + $this->isValid = true; + } + + /*! Defines the $now of the class + * + * The only pourpuse of this function is to let the user define + * what time should the class take as reference to calculate Next + * and Prev + */ + public function setNow(&$now) { + $this->_now = explode(",", $now); + } + + /*! Returns the reference NOW time + * + * This function returns the reference NOW that is used by the + * class to make its computations. If the var is not set by the + * getNow method, it return time() properly formatted; + */ + public function getNow() { + if (isset($this->_now)) { + return $this->_now; + } + else { + $t = strftime("%M,%H,%d,%m,%w,%Y", time()); //Get the values for now in a format we can use + return explode(",", $t); //Make this an array + } + } + + + private function getWeekDays($month, $year){ + $ret = array(); + echo"gettingWeekdays: all days"; + $days = range($this->_elementsRanges["days"]["min"], + $this->daysInMonth($month, $year)); + var_dump($days); + foreach ($days as $day){ + if (in_array(jddayofweek(gregoriantojd($month, $day, $year),0), $this->elements["weekdays"])){ + $ret[] = $day; + } + } + echo "sol:"; + var_dump($ret); + return $ret; + } + + /*! Computes the last day of a Month + * + * Given a month and a year, this function calculates the last + * day of the month. It supports leap years (february 29) + */ + private function daysInMonth($month, $year){ + if(checkdate($month, 31, $year)) return 31; + if(checkdate($month, 30, $year)) return 30; + if(checkdate($month, 29, $year)) return 29; + if(checkdate($month, 28, $year)) return 28; + return 0; // error + } + + /*! Computes the Days of a Month + * + * Given a month, it calculates the days that fulfill the + * requirements of the cron string + */ + private function getDaysArray($month, $year = 0) { + $now = $this->getNow(); + if ($year == 0) { + $year = $now[5]; + } +// $this->debug("Getting days for $month"); + $days = array(); + + if (is_array($this->elements["weekdays"])) { + $days = $this->getWeekDays($month, $year); +// $this->debug("Weekdays:"); +// $this->debug($days); + if (is_array($this->elements["days"])) { + $days += $this->elements["days"]; + } + } + else { + if (is_array($this->elements["days"])) + $days = $this->elements["days"]; + else + $days = range($this->_elementsRanges["days"]["min"], + $this->daysInMonth($month, $year)); + } +// $this->debug($days); + return $days; + } + + /*! Retrieves the next element of the array + * + * Given an array and an element, it calculates the next element + * of the array and returns it, false otherwise + */ + private function getNextArray($arr, $current) { + if (is_array($arr)) { + foreach ($arr as $v) { + if ($v >= $current) + return $v; + } + } + return false; + } + + /*! Retrieves the next element of the array + * + * Given an array and an element, it calculates the previous element + * of the array and returns it, false otherwise + */ + private function getPrevArray($arr, $current) { + if (is_array($arr)) { + foreach ($arr as $v) { + if ($v <= $current) + return $v; + } + } + return false; + } + + private function getNextMonth(&$sol){ + //month + $tmp = $this->getNextArray($this->elements["months"], $sol["month"]); + echo "next month: " ; + echo var_dump($tmp); + if ($tmp === false) { + $days = $this->getDaysArray($this->elements["months"][0], $sol["year"]+1); + return array($this->elements["minutes"][0], + $this->elements["hours"][0], + $days[0], + $this->elements["months"][0], + $sol["year"]+1); + } + else if ($tmp != $sol["month"]) { + $days = $this->getDaysArray($tmp, $sol["year"]); + return array($this->elements["minutes"][0], + $this->elements["hours"][0], + $days[0], + $tmp, + $sol["year"]); + } + $sol["month"] = $tmp; + return $this->getNextDay($sol); + } + + private function getNextDay(&$sol) { + $tmp = $this->getNextArray($this->getDaysArray($sol["month"], $year), $sol["day"]); + echo "next day:"; + echo var_dump($tmp); + if ($tmp === false) { + $sol["month"] += 1; + $sol["day"] = $this->_elementsRanges["days"]["min"]; + return $this->getNextMonth($sol); + } + else if ($tmp != $sol["day"]) { + return array($this->elements["minutes"][0], + $this->elements["hours"][0], + $tmp, + $sol["month"], + $sol["year"]); + } + $sol["day"] = $tmp; + return $this->getNextHour($sol); + + } + + private function getNextHour(&$sol) { + $tmp = $this->getNextArray($this->elements["hours"], $sol["hour"]); + echo "next hour:"; + echo var_dump($tmp); + if ($tmp === false) { + $sol["day"] += 1; + $sol["hour"] = $this->_elementsRanges["hours"]["min"]; + return $this->getNextDay($sol); + } + else if ($tmp != $sol["hour"]) { + return array($this->elements["minutes"][0], + $tmp, + $sol["day"], + $sol["month"], + $sol["year"]); + } + $sol["hour"] = $tmp; + return $this->getNextMinute($sol); + } + + private function getNextMinute(&$sol) { + $tmp = $this->getNextArray($this->elements["minutes"], $sol["minute"]); + echo "next minute:"; + echo var_dump($tmp); + if ($tmp === false) { + $sol["hour"] += 1; + $sol["minute"] = $this->_elementsRanges["minutes"]["min"]; + return $this->getNextHour($sol); + } + return array($tmp, + $sol["hour"], + $sol["day"], + $sol["month"], + $sol["year"]); + } + + public function calculateNextRun() { + if (!$this->isValid) { + throw new CronException("Invalid input"); + } + $tmp = $this->getNow(); + $sol = array ( + "minute" => $tmp[0], + "hour" => $tmp[1], + "day" => $tmp[2], + "month" => $tmp[3], + "weekday" => $tmp[4], + "year" => $tmp[5]); + echo "now :"; + echo var_dump($sol); + return $this->getNextMonth($sol); + + } + + public function calculatePrevRun() { + if (!$this->isValid) { + throw new CronException("Invalid input"); + } + } + + +} + +?>
\ No newline at end of file diff --git a/scire/favicon.ico b/scire/favicon.ico Binary files differnew file mode 100644 index 0000000..0d01a39 --- /dev/null +++ b/scire/favicon.ico diff --git a/scire/images/scire.png b/scire/images/scire.png Binary files differnew file mode 100644 index 0000000..cf63903 --- /dev/null +++ b/scire/images/scire.png diff --git a/scire/images/scire_trans.png b/scire/images/scire_trans.png Binary files differnew file mode 100644 index 0000000..e25d580 --- /dev/null +++ b/scire/images/scire_trans.png diff --git a/scire/images/sort_asc.png b/scire/images/sort_asc.png Binary files differnew file mode 100644 index 0000000..aacd970 --- /dev/null +++ b/scire/images/sort_asc.png diff --git a/scire/images/sort_desc.png b/scire/images/sort_desc.png Binary files differnew file mode 100644 index 0000000..5d2ec1d --- /dev/null +++ b/scire/images/sort_desc.png diff --git a/scire/index.php b/scire/index.php new file mode 100755 index 0000000..525a2a9 --- /dev/null +++ b/scire/index.php @@ -0,0 +1,21 @@ +<?php + +include('./.lib/common.php'); + +#Database structure for scire modules +#Table: modules +#Desc: +# id = unique int; auto_increment +# name = varchar(20) +# long_name = varchar(90) +# description = varchar(500) +# path = varchar(90) # path to the page. +# author = varchar(50) +# creation_date = +# distribution = varchar(30) +# group? like categorizing them? +# homepage = varchar(90) #misc modules should have a website + +$smarty->display('index.tpl'); + +?> diff --git a/scire/job.php b/scire/job.php new file mode 100644 index 0000000..8adc957 --- /dev/null +++ b/scire/job.php @@ -0,0 +1,274 @@ +<?php +include('.lib/common.php'); +include('cron2.php'); + +$smarty->assign('leftbar', "on"); +$leftbar_menu = array(); + +add_leftbar($leftbar_menu, "««Cancel", "jobs.php"); + + +$jobid = ""; + +list($minutes,$hours,$days,$weekdays,$months) = get_cron_times(); + + +function scheduleUIHelper($cronString) { + $bits = explode(" ", $cronString); + if ($bits[0] != $_POST["minutes"] and $_POST["minutes"] != "other") { + $bits[0] = $_POST["minutes"]; + } + if ($bits[1] != $_POST["hours"] and $_POST["hours"] != "other") { + $bits[1] = $_POST["hours"]; + } + if ($bits[2] != $_POST["days"] and $_POST["days"] != "other") { + $bits[2] = $_POST["days"]; + } + if ($bits[3] != $_POST["months"] and $_POST["months"] != "other") { + $bits[3] = $_POST["months"]; + } + if ($bits[4] != $_POST["weekdays"] and $_POST["weekdays"] != "other") { + $bits[4] = $_POST["weekdays"]; + } + print_r($bits); + + return implode(" ",$bits); +} + +##################################################### +#Deal with submitted forms. + +if ($_POST['ADD']) { + check_action_access("Add Job"); + if ($_POST['script']) { + $script = get_scire_script($_POST['script']); + if ($_POST['permission']) { + $permission = $_POST['permission']; + $permission = get_scire_permission_by_name($permission); + $permission = $permission['permid']; + # print "Permission is: $permission"; + } else { + $permission = $script['permission']; + } + if ($_POST['priority']) { + $priority = $_POST['priority']; + } else { + $priority = $script['priority']; + } + } else { $status .= "ERROR: No script selected!"; } + if ($_POST['description']) { + $description = $_POST['description']; + } else { + $description = "No description provided."; + } + $pending = sizeof($_POST['clients']) + sizeof($_POST['clientgroups']); + + if (!$status and ($pending or $_POST['clientgroups'])) { #We have a script and clients; + # Get the schedule! All fields are required or else you're SOL + $scheduleComplete = $_POST["minute1"] and $_POST["hour1"] and + $_POST["day1"] and $_POST["month1"] and $_POST["weekday1"]; + if ($scheduleComplete) { + $str = implode(" ", array($_POST["minute1"], $_POST["hour1"], + $_POST["day1"], $_POST["month1"], $_POST["weekday1"])); + } else { + $str = ""; + } +# pre_var_dump($_POST); +# pre_var_dump($scheduleComplete); + pre_var_dump($str); + + try { + $result = scire_add_job($_POST['script'], $priority, $_SESSION['userid'], $permission, $description, $pending, $_POST['clients'], $_POST['clientgroups'], $dependency, $str, $_POST['validity_period']); + + if (!$result) { + $status .= "Job successfully added."; + } else { + $status .= "Error occurred during job addition. $result"; + } + } catch (CronException $e) { print_r($e); } + + } +} + +############################################### + + +############################################### +# Editing a job's information. +if ($_POST['EditJobSubmit']) { + check_action_access("Edit Job"); + $jobinfo = get_scire_job($_GET['jobid']); + $smarty->assign('job', $jobinfo); + + if (isset($_POST['editpriority']) and ($_POST['editpriority'] != $jobinfo['priority'])) { + $fields['priority'] = $_POST['editpriority']; + } + if ($_POST['permission'] and ($_POST['permission'] != $jobinfo['permission'])){ + $fields['permission'] = $_POST['permission']; + } + if ($_POST['description'] and ($_POST['description'] != $jobinfo['description'])) { + $fields['description'] = trim($_POST['description']); + } + if ($_POST['script'] and ($_POST['script'] != $jobinfo['script'])) { + $fields['script'] = $_POST['script']; + } + if ($_POST['run_schedule'] and ($_POST['run_schedule'] != $jobinfo['run_schedule'])) { + try{ + $c = new CronParser($_POST['run_schedule']); + $fields['run_schedule'] = $_POST['run_schedule']; + } catch (CronException $e) {} + } else { + $isScheduleUI = $_POST["minutes"] and $_POST["hours"] and $_POST["days"] and $_POST["months"] and $_POST["weekdays"]; + if ($isScheduleUI) + try{ + $tmp = scheduleUIHelper($jobinfo["run_schedule"]); + $c = new CronParser($tmp); + $fields['run_schedule'] = $tmp; + } catch (CronException $e) {} + } + if ($_POST['validity_period'] and ($_POST['validity_period'] != $jobinfo['validity_period'])) { + $fields['validity_period'] = $_POST['validity_period']; + } + $status = scire_edit_job($_POST['jobid'], $fields); + $_GET['Action'] = "edit"; + $_GET['jobid'] = $_POST['jobid']; +} + +############################################### +# Delete a job. +if ($_POST['delete_confirm']) { + check_action_access("Delete Job"); +# $status = scire_del_job($_POST['jobid']); + header('Location: ' . $baseurl . 'jobs.php'); +} +if ($_POST['delete_cancel']) { + header('Location: ' . $baseurl . 'jobs.php'); +} + +######################################################## +################## MAIN SWITCH ######################### +switch($_GET['Action']) { + case "create": + check_action_access("Add Job"); #Access check + add_leftbar($leftbar_menu, "««Cancel", "jobs.php"); + + if ($_GET['scriptid']) { + $_GET['scriptid'] = (int) $_GET['scriptid']; + $script = get_scire_script($_GET['scriptid']); + $smarty->assign('script', $script); + # print $script['script_data']; + preg_match_all('/%%(.*?)%%/', $script['script_data'], $matches); + $smarty->assign('dyn_tags', $matches[1]); + foreach ($matches[1] as $tag) { + $tag_values[$tag] = get_dyn_tag_value($_GET['scriptid'],$tag); + } + $smarty->assign('tag_values', $tag_values); + + pre_var_dump($tag_values); + } + + if ($_GET['clientid']) { + $_GET['clientid'] = (int) $_GET['clientid']; + $client = get_scire_client($_GET['clientid']); + #$id = $acl->get_object_id("clients",$client['hostname'],'AXO' + + $smarty->assign('client', $client); + } + ######################################################## + + $permissions = array(); + $all_permissions = $acl->get_objects(NULL, 1, 'ACO'); + foreach ($all_permissions as $categoryname => $cat) { + #print "Perm: $perm<br>Permname: $permname<br>"; + if ($categoryname != $scire_ui_section) { + foreach ($cat as $perm) { + array_push($permissions, $perm); + } + } + } + $smarty->assign('perms', $permissions); + #pre_var_dump($permissions); + $smarty->assign('priorities', get_priorities()); + + + $scripts = get_scire_scripts(); + $smarty->assign('scripts', $scripts); + + $smarty->assign('cgroups', $acl->format_groups($acl->sort_groups('AXO'), TEXT)); + $clients = get_scire_clients('hostname', 'asc'); + $smarty->assign('clients', $clients); + $smarty->assign('minutes', $minutes); + $smarty->assign('hours', $hours); + $smarty->assign('days', $days); + $smarty->assign('months', $months); + $smarty->assign('weekdays', $weekdays); + + break; + case "edit": + check_action_access("Edit Job");#Access check + $acls = array(); + #make the topbar look good + $smarty->assign('desc', "Edit client information."); + $jobinfo = get_scire_job($_GET['jobid']); + $smarty->assign('job', $jobinfo); + $smarty->assign('jobid', $_GET['jobid']); + $smarty->assign('scripts', get_scire_scripts()); +// $cron = new CronParser("*/2 7-18/3 * * *"); +// $smarty->assign('cron', $cron); + $smarty->assign('minutes', $minutes); + $smarty->assign('hours', $hours); + $smarty->assign('days', $days); + $smarty->assign('months', $months); + $smarty->assign('weekdays', $weekdays); + + $bits = explode(" ", $jobinfo["run_schedule"]); + $smarty->assign('selectedMinute', array_key_exists($bits[0], $minutes) ? $bits[0] : "other" ); + $smarty->assign('selectedHour', array_key_exists($bits[1], $hours) ? $bits[1] : "other" ); + $smarty->assign('selectedDay', array_key_exists($bits[2], $days) ? $bits[2] : "other" ); + $smarty->assign('selectedMonth', array_key_exists($bits[3], $months) ? $bits[3] : "other" ); + $smarty->assign('selectedWeekday', array_key_exists($bits[4], $minutes) ? $bits[4] : "other" ); + +// $smarty->assign('gli_profiles', get_scire_gli_profiles()); +// $smarty->assign('oss', get_scire_oss()); +// $smarty->assign('users', get_scire_users('username', 'desc')); + +// $clientgroups = array(); + $groups = $acl->get_object_groups($_GET['jobid'],'AXO'); + if ($groups) { + foreach ($groups as $group) { + $group_data = $acl->get_group_data($group, 'AXO'); + $clientgroups_entry['name'] = $group_data[3]; + $clientgroups_entry['id'] = $group_data[0]; + if ($group_data[1]) { + $parent_group_data = $acl->get_group_data($group_data[1],'AXO'); + $clientgroups_entry['parent'] = $parent_group_data[3]; + } else { + $clientgroups_entry['parent'] = ""; + } + array_push($clientgroups, $clientgroups_entry); + $result_acl_ids = $acl->search_acl(FALSE,FALSE, + FALSE,FALSE,FALSE, + FALSE,FALSE,$group_data[3],FALSE); + foreach ($result_acl_ids as $acl_id) { + array_push($acls, $acl->get_acl($acl_id)); + } + } + } + $smarty->assign('groups', $clientgroups); + + case "delete": + check_action_access("Delete Job");#Access check + $jobinfo = get_scire_job($_GET['jobid']); + $smarty->assign('job', $jobinfo); + #pre_var_dump($jobinfo); + $smarty->assign('jobid', $_GET['jobid']); + break; +} + +$smarty->assign('get', $_GET); +$smarty->assign('leftbar_menu', $leftbar_menu); +$smarty->assign('Action', $_GET['Action']); +$smarty->assign('status', $status); +$smarty->display('job.tpl'); +#pre_var_dump($_POST); +?> diff --git a/scire/jobs.php b/scire/jobs.php new file mode 100755 index 0000000..d54f674 --- /dev/null +++ b/scire/jobs.php @@ -0,0 +1,77 @@ +<?php +include('.lib/common.php'); + +$smarty->assign('leftbar', "on"); +$leftbar_menu = array(); +$leftbar_submenu = array(); +$template = "jobs.tpl"; +$error_msg = ""; + +check_action_access("View Jobs"); +############################################ +## Deal with submitted forms first. + +#Set information about the fields (display name, sortable) +$f_attr = get_jobs_fields(); +$smarty->assign('f_attr', $f_attr); + +if (!$_GET['sorton']) { + $_GET['sorton'] = 'jobid'; +} +if (!$_GET['sortdir']) { + $_GET['sortdir'] = 'asc'; +} +$smarty->assign('sorton', $_GET['sorton']); +$smarty->assign('sortdir', $_GET['sortdir']); + +#Grab the field list. +if ($_SESSION['settings']['jobs_page_fields']) { + $fields = explode(',', $_SESSION['settings']['jobs_page_fields']); +} else { + $fields = explode(',', get_default_jobs_fields()); +} +#$fields = array("hostname", "ip", "mac", "digest", "status", "installtime"); +$smarty->assign('fields',$fields); + +$jobs = get_scire_jobs($_GET['sorton'], $_GET['sortdir'], 'All'); +$smarty->assign('jobs', $jobs); + + +#$jobs = $db->select(array("c.hostname", "j.*"), #FROM +# "clients c, jobs j, jobs_clients jc", #WHERE +# "j.jobid = jc.jobid AND jc.clientid = c.clientid"); +#print "<pre>"; +#pre_var_dump($jobs); #For debugging. +#$client_groups = array(); +foreach( $jobs as $key => $job) { + $id = $acl->get_object_id("clients",$job['hostname'],'AXO'); + $groups = $acl->get_object_groups($id,'AXO'); + $group_string = ""; + if ($groups) { + foreach ($groups as $group) { + $group_data = $acl->get_group_data($group, 'AXO'); + $group_string .= $group_data[3]. " | "; + $client_groups["$group"] = $group_data[3]; + } + } + $jobs[$key]['groups'] = $group_string; +} +#print "</pre>"; + +$smarty->assign('jobs', $jobs); + +if ($_POST['searchfield']) { + $error_msg .= "Um, yeah... not done yet."; +} + +#Gather groups of clients. it's a phpgacl command. +$smarty->assign('leftbar_submenu_title', "Actions"); +if ( check_access("Add Job") ) { + add_leftbar($leftbar_submenu, "Add Job", "add_job.php"); +} +$smarty->assign('client_groups', $client_groups); +$smarty->assign('leftbar_menu', $leftbar_menu); +$smarty->assign('leftbar_submenu', $leftbar_submenu); + +$smarty->display('jobs.tpl'); +?> diff --git a/scire/light_blue.css b/scire/light_blue.css new file mode 100644 index 0000000..5995f3b --- /dev/null +++ b/scire/light_blue.css @@ -0,0 +1,126 @@ + html { + margin: 0px; + } + body { + margin: 0px; + font-family: Bitstream Vera Sans, Helvetica, Sans; + font-size: 10pt; + } + form { + margin: 0px; + padding: 0px; + } + p { + margin: 5px; + } + h1 { + margin: 5px; + margin-bottom: 0px; + font-size: 1.2em; + font-weight: bold; + } + h2 { + margin: 5px; + font-size: 1.1em; + font-weight: normal; + } + #logobar { + background: url("images/lightning.png") no-repeat; + } + #topbar { + border-top: 1px solid #000000; + background-color: #1E1E74; + } + #topbar table tr td a { + text-decoration: none; + } + #topbar table tr td a:hover { + color: #ffffff; + text-decoration: underline; + font-weight: bold; + } + #leftbar { + background-color: #ffffff; + border-top: 1px solid #000000; + } + #header { + border-top: 1px solid #000000; + } + #content { + padding: 7px 5px 5px; + } + #menu,#submenu { + width: 150px; + margin: 0px; + margin-bottom: 10px; + padding: 0px; + border-right: 1px solid #ffffff; + list-style: none; + } + #menu li { + width: 150px; + border-bottom: 1px solid #ffffff; + } + #submenu li { + width: 140px; + margin-left: 10px; + border-bottom: 1px solid #ffffff; + } + a.menuitem { + display: block; + position: relative; + margin: 0px; + padding: 1px; + padding-left: 4px; + background-color: #36D3F0; + color: #000000; + text-decoration: none; + } + a.menuitem:hover { + color: #ffffff; + font-weight: bold; + } + .box { + border: 1px solid #000000; + font-size: 0.8em; + } + .box td { + border: none; + } + td.boxtitle { + padding: 5px; + border-top: 1px solid #d1ddf5; + border-right: 1px solid #7a818f; + border-bottom: 1px solid #7a818f; + border-left: 1px solid #d1ddf5; + background-color: #36D3F0; + font-size: 1.2em; + font-weight: bold; + } + .table { + border: none; + border-spacing: 5px; + } + .table th { + padding: 2px 5px 0px; + border: none; + text-align: left; + } + .table td { + padding: 5px 5px 0px; + border: none; + border-top: 1px dotted #7a818f; + } + .optiongroup td { + padding-top: 5px; + border: none; + } + .optiongroup td:first-child { + padding-left: 5px; + } + .optiongroup td:last-child { + padding-right: 5px; + } + .optiongroup tr:last-child td { + padding-bottom: 5px; + } diff --git a/scire/login.php b/scire/login.php new file mode 100644 index 0000000..264fbdc --- /dev/null +++ b/scire/login.php @@ -0,0 +1,66 @@ +<?php +# Configuration +$CONFIG_DIR='/etc/scire'; +require_once($CONFIG_DIR.'/config.php'); + +# Functions +require_once('.lib/functions.php'); + +# Clean config +$basedir = normalize_path($basedir); +$baseurl = normalize_path($baseurl); +$smarty_dir = normalize_path($smarty_dir); + +# Smarty +require_once('.lib/smarty.php'); + +# Database class +require_once('.lib/DB.php'); +$db = new DB($db_host, $db_username, $db_password, $db_name, $db_type); +if (isset($db->error)) { + header('Content-type: text/html; charset=UTF-8'); + $smarty->assign('title', 'Database Error'); + $smarty->assign('message', $db->error); + $smarty->display('message.tpl'); + exit(0); +} + +# Database functions +require_once('.lib/DB_functions.php'); + +# Session class +require_once('.lib/Session.php'); +$session = new Session($db, $db_sessions_table); +if (isset($session->error)) { + header('Content-type: text/html; charset=UTF-8'); + $smarty->assign('title', 'Session Error'); + $smarty->assign('message', $session->error); + $smarty->display('message.tpl'); + exit(0); +} + +if ($_GET['logout']) { + unset($_SESSION['userid']); + unset($_SESSION['username']); +} +if ($_POST['username']) { + $user = $db->select(array('userid', 'username','password','email'), "users", "username='".$_POST['username']."'"); + if($user[0]['username']) { + if ($_POST['passwd'] and (crypt($_POST['passwd'],447470567) == $user[0]['password'])) { + $_SESSION['userid'] = $user[0]['userid']; + $_SESSION['username'] = $user[0]['username']; + $_SESSION['useremail'] = $user[0]['email']; + $_SESSION['settings'] = get_scire_settings($_SESSION['userid']); + header("Location: " . ($_GET['afterlogin'] ? $_GET['afterlogin'] : "index.php")); + exit; + } else { + print "<h1>Invalid password supplied!</h1>"; + } + } else { + print "<h1>Invalid user supplied!</h1>"; + } +} + +$smarty->display('login.tpl'); + +?> diff --git a/scire/main_checklogin.php b/scire/main_checklogin.php new file mode 100644 index 0000000..f386b07 --- /dev/null +++ b/scire/main_checklogin.php @@ -0,0 +1,10 @@ +<?php +session_start(); +if(!isset($_SESSION['userid'])) { + #print "<h1>NO MATCH</h1>"; + header("Location: login.php?afterlogin=" . url_encode($_SERVER['REQUEST_URI'])); +} +else { + print "Welcome $_SESSION[userid]<br>"; +} +?> diff --git a/scire/main_smarty.php b/scire/main_smarty.php new file mode 100644 index 0000000..3ac86c4 --- /dev/null +++ b/scire/main_smarty.php @@ -0,0 +1,25 @@ +<?php + #This is the code to set up the SMARTY templates for the Main pages. + # it has ./ on things and sets the leftbar to show the admin list. + $smarty = new Smarty; + $smarty->template_dir = './templates'; + $smarty->compile_dir = './templates_c'; + $smarty->cache_dir = './cache'; + $smarty->config_dir = './configs'; + $smarty->assign('topbar', array( + array('name'=> 'Login', 'link' => 'login.php'), + array('name'=> 'Clients', 'link' => 'clients.php'), + array('name'=> 'Jobs/Tasks', 'link' => 'jobs.php'), + array('name'=> 'Modules', 'link' => 'modules.php'), + array('name'=> 'Admin', 'link' => 'admin.php'))); + $smarty->assign('left_section_header',"Module List"); + + $module_list = array(); + $module_list = get_scire_module_list(); + #print_r($module_list); + $smarty->assign('leftnav', $module_list); + + if($status) { + $smarty->assign('error', $status); + } +?> diff --git a/scire/mockups/mockup.html b/scire/mockups/mockup.html new file mode 100644 index 0000000..e2de62a --- /dev/null +++ b/scire/mockups/mockup.html @@ -0,0 +1,511 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> + <head> + <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"/> + <title>Scire</title> + <link rel="icon" href="favicon.ico" type="image/x-icon" /> + <link rel="shortcut icon" href="favicon.ico" type="image/x-icon" /> + <style type="text/css"> + <!-- + html { + margin: 0px; + } + body { + margin: 0px; + font-family: Bitstream Vera Sans, Helvetica, Sans; + font-size: 10pt; + } + form { + margin: 0px; + padding: 0px; + } + p { + margin: 5px; + } + h1 { + margin: 5px; + margin-bottom: 0px; + font-size: 1.2em; + font-weight: bold; + } + h2 { + margin: 5px; + font-size: 1.1em; + font-weight: normal; + } + #topbar { + border-top: 1px solid #000000; + } + #topbar table tr td a { + text-decoration: none; + } + #topbar table tr td a:hover { + color: #ffffff; + text-decoration: underline; + } + #leftbar { + background-color: #ffffff; + border-top: 1px solid #000000; + } + #header { + border-top: 1px solid #000000; + } + #content { + padding: 7px 5px 5px; + } + #menu,#submenu { + width: 150px; + margin: 0px; + margin-bottom: 10px; + padding: 0px; + border-right: 1px solid #ffffff; + list-style: none; + } + #menu li { + width: 150px; + border-bottom: 1px solid #ffffff; + } + #submenu li { + width: 140px; + margin-left: 10px; + border-bottom: 1px solid #ffffff; + } + a.menuitem { + display: block; + position: relative; + margin: 0px; + padding: 1px; + padding-left: 4px; + background-color: #a6afc2; + color: #000000; + text-decoration: none; + } + a.menuitem:hover { + color: #ffffff; + } + .box { + border: 1px solid #000000; + font-size: 0.8em; + } + .box td { + border: none; + } + td.boxtitle { + padding: 5px; + border-top: 1px solid #d1ddf5; + border-right: 1px solid #7a818f; + border-bottom: 1px solid #7a818f; + border-left: 1px solid #d1ddf5; + background-color: #a5acba; + font-size: 1.2em; + font-weight: bold; + } + .table { + border: none; + border-spacing: 5px; + } + .table th { + padding: 2px 5px 0px; + border: none; + text-align: left; + } + .table td { + padding: 5px 5px 0px; + border: none; + border-top: 1px dotted #7a818f; + } + .optiongroup td { + padding-top: 5px; + border: none; + } + .optiongroup td:first-child { + padding-left: 5px; + } + .optiongroup td:last-child { + padding-right: 5px; + } + .optiongroup tr:last-child td { + padding-bottom: 5px; + } + --> + </style> + </head> + <body link="#000000" alink="#ffffff"> + <table width="100%" bgcolor="#ffffff" border="0" cellspacing="0" cellpadding="0"> + <tr> + <td colspan="2"> + <table width="100%" border="0" cellspacing="0" cellpadding="10"> + <tr> + <td width="80"> + <a href="#"><img src="scire-logo.png" alt="Scire" border="0" width="80" height="80" /></a> + </td> + <td align="right" valign="top"> + <form action="#"> + <label for="search">Search:</label> + <input id="search" name="search" type="text" size="16" /> + <input id="submit" name="submit" type="button" value="go" /> + </form> + </td> + </tr> + </table> + </td> + </tr> + <tr> + <td id="topbar" colspan="2" height="22" bgcolor="#494949"> + <table width="100%" border="0" cellspacing="0" cellpadding="0"> + <tr> + <td><font color="#ffffff"> <a href="#"><font color="#ffffff">Overview</font></a> | <a href="mockup_jobs.html"><font color="#ffffff">Jobs</font></a> | <a href="#"><font color="#ffffff">Clients</font></a> | <a href="mockup_users.html"><font color="#ffffff">Users</font></a></font></td> + <td align="right"><font color="#ffffff"><a href="#"><font color="#ffffff">Logout</font></a> | <a href="#"><font color="#ffffff">Settings</font></a> | <a href="#"><font color="#ffffff">Help</font></a> </font></td> + </tr> + </table> + </td> + </tr> + <tr> +<!-- <td id="leftbar" valign="top" bgcolor="#a6afc2"> + <ul id="menu"> + <li><a class="menuitem" href="#">Groups</a></li> + <li><a class="menuitem" href="#">Permissions</a></li> + </ul> + <p></p> + <ul id="submenu"> + <li>Actions</li> + <li><a class="menuitem" href="#">Create User</a></li> + </ul> + </td> --> + <td width="100%" valign="top"> + <table width="100%" border="0" cellspacing="0" cellpadding="0"> + <tr> + <td id="header" bgcolor="#d8d4e2"> + <table width="100%" border="0" cellspacing="0" cellpadding="0"> + <tr> + <td> + <h1>Overview</h1> + <h2>Welcome to Scire</h2> + </td> + <td align="right" valign="top"> +<!-- <p>OK</p>--> + </td> + </tr> + </table> + </td> + </tr> + <tr> + <td id="content" height="100%" valign="top" bgcolor="#ffffff"> + <!-- begin admin + <ul> + <li><a href="admin/create_user.php">Create a User</a></li> + <li><a href="admin/edit_user.php">Edit a User</a></li> + <li><a href="admin/delete_user.php">Delete a User</a></li> + </ul> + <ul> + <li><a href="admin/create_usergroup.php">Create a UserGroup</a></li> + <li><a href="admin/edit_usergroup.php">Edit a UserGroup</a></li> + <li><a href="admin/delete_usergroup.php">Delete a UserGroup</a></li> + </ul> + <ul> + <li><a href="admin/add_permission.php">Add Permission</a></li> + <li><a href="admin/edit_permission.php">Edit Permission</a></li> + <li><a href="admin/delete_permission.php">Delete Permission</a></li> + </ul> + <ul> + <li><a href="admin/add_client.php">Add Client Manually</a></li> + <li><a href="admin/edit_client.php">Edit Clients</a></li> + <li><a href="admin/delete_client.php">Delete Client from Scire</a></li> + </ul> + <ul> + <li><a href="admin/create_clientgroup.php">Create a ClientGroup</a></li> + <li><a href="admin/edit_clientgroup.php">Edit a ClientGroup</a></li> + <li><a href="admin/delte_clientgroup.php">Delete a ClientGroup</a></li> + </ul> + <ul> + <li><a href="admin/assign_permissions.php">Assign Permissions</a></li> + </ul> end admin --> + <!-- begin add client + <form id="form1" name="form1" method="post" action=""> + <table width="100%" border="0" cellspacing="0" cellpadding="0"> + <tr> + <td> + <table border="0" cellspacing="0" cellpadding="5"> + <tr> + <td><label for="hostname">Hostname:</label></td> + <td><input type="text" id="hostname" name="hostname" /></td> + </tr> + <tr> + <td><label for="mac">MAC:</label></td> + <td><input type="text" id="mac" name="mac" maxlength="17" /></td> + </tr> + <tr> + <td><label for="ip">IP:</label></td> + <td><input type="text" id="ip" name="ip" maxlength="15" /></td> + </tr> + <tr> + <td><label for="profile">Gentoo Profile Name (optional):</label></td> + <td><input type="text" id="profile" name="profile" /></td> + </tr> + <tr> + <td><label for="distribution">Distribution (optional):</label></td> + <td><input type="text" id="distribution" name="distribution" maxlength="50" /></td> + </tr> + <tr> + <td><label for="administrator">Administrator (optional):</label></td> + <td><input type="text" id="administrator" name="administrator" maxlength="50" /></td> + </tr> + <tr> + <td><label for="status">Status:</label></td> + <td><input type="text" id="status" name="status" maxlength="100" /></td> + </tr> + </table> + </td> + <td width="25%"> + <label for="groups">Groups:</label><br /> + <select id="groups" name="groups" size="14" multiple="multiple"> + <option>{html_options values=$ids output=$groupnames selected="1"}</option> + </select> + </td> + </tr> + </table> + <input type="submit" name="submit" value="Add Client" /> + </form> end add client --> + <!-- begin permission + <form id="form1" name="form1" method="post" action=""> + <table border="0" cellspacing="0" cellpadding="5"> + <tr> + <td><label for="permname">Name:</label></td> + <td><input type="text" id="permname" name="permname" /></td> + </tr> + <tr> + <td><label for="permdesc">Description:</label></td> + <td><input type="text" id="permdesc" name="permdesc" /></td> + </tr> + <tr> + <td colspan="2"> + <table class="box" border="1" cellspacing="0" cellpadding="0"> + <tr> + <td class="boxtitle">Built-in Abilities/Scripts:</td> + </tr> + <tr> + <td> + <table class="optiongroup" border="0" cellspacing="0" cellpadding="0"> + <tr> + <td> |