From 81d1eb66e29bea907434b6c5586f4c3363270010 Mon Sep 17 00:00:00 2001 From: paulr Date: Sat, 23 Jul 2011 07:33:26 +1000 Subject: [PATCH] Moving the old code aside into the archive as i begin a new code-from-scratch effort with a more focused approach --- agent/agent.php | 11 -- archive/v1/agent/agent.php | 11 ++ archive/v1/doc/README | 4 + archive/v1/doc/flow.dia | Bin 0 -> 1530 bytes archive/v1/doc/globals.txt | 12 ++ archive/v1/lib/config.php | 26 +++++ archive/v1/lib/datastore.php | 180 +++++++++++++++++++++++++++++++ archive/v1/lib/db.php | 123 +++++++++++++++++++++ archive/v1/lib/lib.php | 62 +++++++++++ archive/v1/lib/messages.php | 73 +++++++++++++ archive/v1/lib/plugins/aptproxy.php | 32 ++++++ archive/v1/lib/plugins/db_mysql.php | 2 + archive/v1/lib/plugins/db_sqlite.php | 3 + archive/v1/lib/plugins/install.php | 29 +++++ archive/v1/lib/plugins/packages.php | 3 + archive/v1/lib/plugins/yumproxy.php | 43 ++++++++ archive/v1/lib/updates.php | 52 +++++++++ archive/v1/lib/wsdl.php | 196 ++++++++++++++++++++++++++++++++++ archive/v1/lib/www.php | 169 +++++++++++++++++++++++++++++ archive/v1/unittests/datastores.php | 62 +++++++++++ archive/v1/unittests/dbtest.php | 76 +++++++++++++ archive/v1/unittests/libload.php | 5 + archive/v1/unittests/msgtest.php | 41 +++++++ archive/v1/unittests/soaptest.php | 17 +++ archive/v1/var/config.php | 9 ++ archive/v1/var/sqlite3.sql | 2 + archive/v1/www/.htaccess | 8 ++ archive/v1/www/index.php | 17 +++ archive/v1/www/soap.php | 59 ++++++++++ doc/README | 4 - doc/flow.dia | Bin 1530 -> 0 bytes doc/globals.txt | 12 -- lib/config.php | 26 ----- lib/datastore.php | 180 ------------------------------- lib/db.php | 123 --------------------- lib/lib.php | 62 ----------- lib/messages.php | 73 ------------- lib/plugins/aptproxy.php | 32 ------ lib/plugins/db_mysql.php | 2 - lib/plugins/db_sqlite.php | 3 - lib/plugins/install.php | 29 ----- lib/plugins/packages.php | 3 - lib/plugins/yumproxy.php | 43 -------- lib/updates.php | 52 --------- lib/wsdl.php | 196 ---------------------------------- lib/www.php | 169 ----------------------------- unittests/datastores.php | 62 ----------- unittests/dbtest.php | 76 ------------- unittests/libload.php | 5 - unittests/msgtest.php | 41 ------- unittests/soaptest.php | 17 --- var/config.php | 9 -- var/sqlite3.sql | 2 - www/.htaccess | 8 -- www/index.php | 17 --- www/soap.php | 59 ---------- 56 files changed, 1316 insertions(+), 1316 deletions(-) delete mode 100644 agent/agent.php create mode 100644 archive/v1/agent/agent.php create mode 100644 archive/v1/doc/README create mode 100644 archive/v1/doc/flow.dia create mode 100644 archive/v1/doc/globals.txt create mode 100644 archive/v1/lib/config.php create mode 100644 archive/v1/lib/datastore.php create mode 100644 archive/v1/lib/db.php create mode 100644 archive/v1/lib/lib.php create mode 100644 archive/v1/lib/messages.php create mode 100644 archive/v1/lib/plugins/aptproxy.php create mode 100644 archive/v1/lib/plugins/db_mysql.php create mode 100644 archive/v1/lib/plugins/db_sqlite.php create mode 100644 archive/v1/lib/plugins/install.php create mode 100644 archive/v1/lib/plugins/packages.php create mode 100644 archive/v1/lib/plugins/yumproxy.php create mode 100644 archive/v1/lib/updates.php create mode 100644 archive/v1/lib/wsdl.php create mode 100644 archive/v1/lib/www.php create mode 100644 archive/v1/unittests/datastores.php create mode 100644 archive/v1/unittests/dbtest.php create mode 100644 archive/v1/unittests/libload.php create mode 100644 archive/v1/unittests/msgtest.php create mode 100644 archive/v1/unittests/soaptest.php create mode 100644 archive/v1/var/config.php create mode 100644 archive/v1/var/mysql.sql create mode 100644 archive/v1/var/sqlite3.sql create mode 100644 archive/v1/www/.htaccess create mode 100644 archive/v1/www/index.php create mode 100644 archive/v1/www/soap.php delete mode 100644 doc/README delete mode 100644 doc/flow.dia delete mode 100644 doc/globals.txt delete mode 100644 lib/config.php delete mode 100644 lib/datastore.php delete mode 100644 lib/db.php delete mode 100644 lib/lib.php delete mode 100644 lib/messages.php delete mode 100644 lib/plugins/aptproxy.php delete mode 100644 lib/plugins/db_mysql.php delete mode 100644 lib/plugins/db_sqlite.php delete mode 100644 lib/plugins/install.php delete mode 100644 lib/plugins/packages.php delete mode 100644 lib/plugins/yumproxy.php delete mode 100644 lib/updates.php delete mode 100644 lib/wsdl.php delete mode 100644 lib/www.php delete mode 100644 unittests/datastores.php delete mode 100644 unittests/dbtest.php delete mode 100644 unittests/libload.php delete mode 100644 unittests/msgtest.php delete mode 100644 unittests/soaptest.php delete mode 100644 var/config.php delete mode 100644 var/mysql.sql delete mode 100644 var/sqlite3.sql delete mode 100644 www/.htaccess delete mode 100644 www/index.php delete mode 100644 www/soap.php diff --git a/agent/agent.php b/agent/agent.php deleted file mode 100644 index f9aa584..0000000 --- a/agent/agent.php +++ /dev/null @@ -1,11 +0,0 @@ -status(); - -echo "l was $k\n"; -?> \ No newline at end of file diff --git a/archive/v1/agent/agent.php b/archive/v1/agent/agent.php new file mode 100644 index 0000000..f9aa584 --- /dev/null +++ b/archive/v1/agent/agent.php @@ -0,0 +1,11 @@ +status(); + +echo "l was $k\n"; +?> \ No newline at end of file diff --git a/archive/v1/doc/README b/archive/v1/doc/README new file mode 100644 index 0000000..f4eb95f --- /dev/null +++ b/archive/v1/doc/README @@ -0,0 +1,4 @@ +GLCAS +===== + +Generic Linux Central Administration System diff --git a/archive/v1/doc/flow.dia b/archive/v1/doc/flow.dia new file mode 100644 index 0000000000000000000000000000000000000000..028ecb954961d3609a699a5a57db64505ad83d73 GIT binary patch literal 1530 zcmVz$CqVbJj*!oqi|wEV3~#t=aK7& z-o*Ul_b>05`SJ1YgX@d;`p=8S($H6gN&0DGE|glmACEVi4G6Z0P*Ds5e+?2j{zn9X z7;B-i`FLj-hYDPwM0##_Rwxzwv$c{&D3)?!&cyti7f0*RHFK$*+&l`R*mxGf#JqpX z4s*OyGcM>kqI)GgIg6$E)~wpn2j^{6uVh?SyIe(yuSL{$RS{{>lm0)D*-0f@DD)oh ze<1hyE$vS1b=BQyBZyjx*z?0Gj`mHEI|2cQ5Yo<|oN>z`4t({=<#4mx!Uea5i*F0( zC(~6Ft62D|3OS3SK#DL&Rqej{5S`$+GwU@{X$^*Vaf6 zE|XN!%jv;e`>sq*EVH6agQmq!Y<$Y=Ww~=5lbC>T(TsI@;(2dstky@hH9gMeFwqoo6rMYNgL)R3nM@)DGlaNQy~mdvq0 z%Lk+6OT|m&L{XAy@4gq8&6{C2U~qxB1}vp zQQI_O=vdD${YeJTQu%XnnAa}9gUTwaeKf4N(k#*qw3vnJ;uTo{(GdlR({4~jb~@6+ zSXMV6UHf_AQr16D8LpQ#w0(@Y>$s}vA(>W8w1Jz!V%$e&s3 zI6jX$IADw+jY8;y2DBkelRB~?Ylk|I!f+}>H?!kH>zahxlZ;*_^HupK>Po(g*d%nP zB95a?S@C{VBGgg!G?1Zpj2c@ni#@~%@;w_NedKyo>BXN^Xyf%8W1+((&9~4rRFu_L z#{OIFuxgc9QhH8M9+q@J`eGSnwP86hQRlLb0*LHj!|@-Wq2!Zbmq5dpVZRbx^sAi0D|)20VLdlkn)=h4{|WOC5g?V*p>0=(hL^S zAR1;Bebd&Ta`tnWC=mn$Y4uH77z3V>79#^`U7fU=TO)FX*2uOP96=7OwzcTFoe`xw zAjH$gh!V(02m|WCp8KNC7M|A@F@_J@qF%cq-4pSHu80m@(XHtv-RII-K8oet&>7vZ zGeQtpLuYiWp*X$5P&{pCt)6#OdD(g~_dge}8rUe-WjHqs$KTp; z+}aJtS#dZHab+bOnXIGY#nx3O>!%~zzEWh{fZAxOm;gK!3e92-7h2pG)=;GFkQ-nB*^ znShekqt+q1zmw=Dmqa%%Uh7T=@gG`NN>;r*4x>%jN3EMP$a(9BC+)TjKP_2tR@bM|YR$GgJMZ65Fb1zi}ETar5f041{qqyPW_ literal 0 HcmV?d00001 diff --git a/archive/v1/doc/globals.txt b/archive/v1/doc/globals.txt new file mode 100644 index 0000000..49b5a27 --- /dev/null +++ b/archive/v1/doc/globals.txt @@ -0,0 +1,12 @@ +$BASE_URLS["ypc"]["base"] = "ypc"; // ap for apt-proxy +$BASE_URLS["ypc"]["function"] = "yp_contentUrlsCtl"; + +$MENU_ITEMS["yp"]["title"] = "YUM Proxy"; +$MENU_ITEMS["yp"]["link"] = "/ypc/proxycontrol"; + +$VERSION["item"]["major"] +$VERSION["item"]["minor"] +$VERSION["item"]["release"] + +$GLOBAL_BASE_URL="/src/eclipse-workspace/glcas/www/"; +$DB_URL="sqlite:$BASE_DIR/var/ds_store.db"; diff --git a/archive/v1/lib/config.php b/archive/v1/lib/config.php new file mode 100644 index 0000000..272e641 --- /dev/null +++ b/archive/v1/lib/config.php @@ -0,0 +1,26 @@ + \ No newline at end of file diff --git a/archive/v1/lib/datastore.php b/archive/v1/lib/datastore.php new file mode 100644 index 0000000..a074cc3 --- /dev/null +++ b/archive/v1/lib/datastore.php @@ -0,0 +1,180 @@ +Browsing, $dsbr
"; + break; + case "createds": + ds_createDS($_REQUEST["dsname"], $_REQUEST["dsloc"]); + echo "DS Created, return"; + break; + case "control": + default: + ds_controlPane(); + // go thru the db and list the components + } + } +} + +function ds_controlPane() +{ + global $GLOBAL_BASE_URL; + echo "

DataStores

"; + $dss = ds_listDS(); + + if($dss != false) { + echo ""; + echo ""; + foreach($dss as $dsl) { + $dsname = $dsl["dsname"]; + $dspath = $dsl["dslocation"]; + echo ""; + } + echo "
DataStore NameDataStore PathSizeUsageControl
$dsname$dspath
"; + } + echo "

Create DataStore

"; + echo "
"; + echo "DataStore Name:
"; + echo "DataStore Location:
"; + echo ""; + echo "
"; + +} + +function ds_leftMenu() +{ + global $GLOBAL_BASE_URL; + echo "

Browse

"; + $dss = ds_listDS(); + //echo "
";
+	//print_r($dss);
+	//echo "
"; + foreach ($dss as $dsl) { + $dsname = $dsl["dsname"]; + echo "$dsname
"; + } +} + +function ds_contentUrls() +{ + $calls["needs_base_page"] = true; + $calls["content_pane_function"] = "ds_contentPane"; + $calls["left_menu_function"] = "ds_leftMenu"; + + return $calls; +} + +function ds_createDS($ds_name, $store_location) +{ + db_createTable("datastores", "dsname", "dslocation"); + db_createTable("datastores_files", "dsname", "fileowner", "filename", "dsfname"); + + $data = db_selectData("datastores", "dsname", "$ds_name"); + if(isset($data[0]["dsname"])) return false; + + db_insertData("datastores", "$ds_name", "$store_location"); +} + +function ds_listDS() +{ + return db_selectData("datastores"); +} + +function ds_deleteFile($ds_name, $file_name, $file_tag) +{ + $dlk = db_selectData("datastores_files", "filename", $file_name); + $afname = ""; + foreach($dlk as $kmm) { + if($kmm["fileowner"] == $file_tag) { + // we got ya + $afname = $kmm["dsfname"]; + if(file_exists($afname)) unlink($afname); + //echo "name was: $afname\n"; + } + } + //echo "now delete name was: $afname\n"; + if($afname != "") db_deleteData("datastores_files", "dsfname", $afname); +} + +// returns a file name to the location a file can be created +function ds_fileds($ds_name, $file_name, $file_tag) +{ + + $data = db_selectData("datastores", "dsname", "$ds_name"); + + $dtime = time(); + $made_file_name = "$dtime-".md5($file_name)."-".basename($file_name); + + $act_fname = $data[0]["dslocation"]."/".basename($made_file_name); + + db_insertData("datastores_files", "$ds_name", "$file_tag", "$file_name", "$act_fname"); + + return $act_fname; +} + +function ds_getFileList($ds_name, $file_tag) +{ + $list = db_selectData("datastores_files", "fileowner", "$file_tag"); + + return $list; +} + + +function ds_deleteDS($ds_name) +{ + db_deleteData("datastores", "dsname", "$ds_name"); + db_deleteData("datastores_files", "dsname", $ds_name); +} + +function ds_downloadAndStore($ds_name, $file_id, $file_name, $file_url) +{ + +} + +?> \ No newline at end of file diff --git a/archive/v1/lib/db.php b/archive/v1/lib/db.php new file mode 100644 index 0000000..f24917f --- /dev/null +++ b/archive/v1/lib/db.php @@ -0,0 +1,123 @@ +query($sql); +} + +function db_insertData($tablename) +{ + + $db = db_getDB(); + + $sql = "insert into \"$tablename\" values (NULL"; + for($i=1; $i < func_num_args(); $i++) { + $sql .= ",'".func_get_arg($i)."'"; + } + $sql .=")"; + + $db->query($sql); +} + +function db_selectData($tablename, $column="", $value="") +{ + $db = db_getDB(); + + if($column != "") $extra = " where $column like '%$value%'"; + else $extra = ""; + $sql = "select * from \"$tablename\"$extra"; + $res = $db->query($sql); + if(!$res) return false; + $data = $res->fetchAll(); + + return $data; +} + +function db_deleteData($tablename, $column, $value) +{ + $db = db_getDB(); + + $sql = "delete from \"$tablename\" where $column like '%$value%'"; + //echo "Sql is $sql\n"; + return $db->query($sql); + +} + +function db_updateData($tablename, $column, $newdata, $wherecol, $wheredata, $exact=true) +{ + $db = db_getDB(); + + if($exact) $sql = "update \"$tablename\" set $column='$newdata' where $wherecol='$wheredata'"; + else $sql = "update \"$tablename\" set $column='$newdata' where $wherecol like '$wheredata'"; + return $db->query($sql); +} + +function db_deleteTable($tablename) +{ + $db = db_getDB(); + + $sql = "drop table $tablename"; + + return $db->query($sql); +} + +function db_tableExists($tablename) +{ + $db = db_getDB(); + + $sql = "select count(*) from sqlite_master where type='table' and name='$tablename'"; + $res = $db->query($sql); + + $value = $res->fetchColumn(); + + if($value == 1) return true; + else return false; +} + +function db_getTables() +{ + $db = db_getDB(); + + $sql = "select name from sqlite_master where type='table' and name not like 'sqlite_%'"; + $res = $db->query($sql); + + return $res->fetchAll(); +} +?> \ No newline at end of file diff --git a/archive/v1/lib/lib.php b/archive/v1/lib/lib.php new file mode 100644 index 0000000..6c48c4c --- /dev/null +++ b/archive/v1/lib/lib.php @@ -0,0 +1,62 @@ + 0) { + require_once("$basedir/plugins/$file"); + //echo "required $basedir/plugins/$file\n"; + } + } + } +} else { + echo "No plugins dir ($basedir/plugins), continuing without\n"; +} + +function urlInterpretter() +{ + global $BASE_URLS; + global $URL_COMPONENTS; + + if(isset($_REQUEST["q"])) $qry = $_REQUEST["q"]; + else $qry = ""; + + $urlcomps = preg_split("/[,\/]/", $qry); + $URL_COMPONENTS = $urlcomps; + + foreach($BASE_URLS as $bases_cd => $bases) { + //echo "
checking $bases_cd for ".$bases["base"]." against \"".$urlcomps[0]."\"
"; + if(strtolower($urlcomps[0]) == strtolower($bases["base"])) { + //echo "match
"; + $func = $bases["function"]; + return $func(); + } + } +} + +$db = db_getDB(); +db_createTable("options", "option_name", "option_value"); +?> \ No newline at end of file diff --git a/archive/v1/lib/messages.php b/archive/v1/lib/messages.php new file mode 100644 index 0000000..e735e90 --- /dev/null +++ b/archive/v1/lib/messages.php @@ -0,0 +1,73 @@ + \ No newline at end of file diff --git a/archive/v1/lib/plugins/aptproxy.php b/archive/v1/lib/plugins/aptproxy.php new file mode 100644 index 0000000..161ade2 --- /dev/null +++ b/archive/v1/lib/plugins/aptproxy.php @@ -0,0 +1,32 @@ +"; +} + +function ap_leftMenu() +{ + echo "i am a ap leftmenu"; +} + + +?> \ No newline at end of file diff --git a/archive/v1/lib/plugins/db_mysql.php b/archive/v1/lib/plugins/db_mysql.php new file mode 100644 index 0000000..67c94a5 --- /dev/null +++ b/archive/v1/lib/plugins/db_mysql.php @@ -0,0 +1,2 @@ + \ No newline at end of file diff --git a/archive/v1/lib/plugins/db_sqlite.php b/archive/v1/lib/plugins/db_sqlite.php new file mode 100644 index 0000000..15c5adc --- /dev/null +++ b/archive/v1/lib/plugins/db_sqlite.php @@ -0,0 +1,3 @@ + \ No newline at end of file diff --git a/archive/v1/lib/plugins/install.php b/archive/v1/lib/plugins/install.php new file mode 100644 index 0000000..865d1e9 --- /dev/null +++ b/archive/v1/lib/plugins/install.php @@ -0,0 +1,29 @@ +install"; + echo "
";
+	echo "servers\n";
+	print_r($_SERVER);
+	echo "request\n";
+	print_r($_REQUEST);
+	echo "
"; + echo ""; + exit(0); +} + +*/ +?> \ No newline at end of file diff --git a/archive/v1/lib/plugins/packages.php b/archive/v1/lib/plugins/packages.php new file mode 100644 index 0000000..15c5adc --- /dev/null +++ b/archive/v1/lib/plugins/packages.php @@ -0,0 +1,3 @@ + \ No newline at end of file diff --git a/archive/v1/lib/plugins/yumproxy.php b/archive/v1/lib/plugins/yumproxy.php new file mode 100644 index 0000000..68c8768 --- /dev/null +++ b/archive/v1/lib/plugins/yumproxy.php @@ -0,0 +1,43 @@ +"; +} + +function yp_leftMenu() +{ + echo "i am a yp leftmenu"; +} + +function yp_contentUrlsCtl() +{ + $calls["needs_base_page"] = true; + $calls["content_pane_function"] = "yp_contentPane"; + $calls["left_menu_function"] = "yp_leftMenu"; + + return $calls; +} + +function yp_contentUrlsPrx() +{ + $calls["needs_base_page"] = false; + $calls["page_builder"] = "yp_proxyPageBuilder"; + + return $calls; +} + +function yp_proxyPageBuilder() +{ + echo "I write the songs that make the whole world sing"; +} +?> \ No newline at end of file diff --git a/archive/v1/lib/updates.php b/archive/v1/lib/updates.php new file mode 100644 index 0000000..95cc892 --- /dev/null +++ b/archive/v1/lib/updates.php @@ -0,0 +1,52 @@ + $timerval) { + up_doUpdateCheck(); + } +} +//echo "timerval: $timerval\n"; + +function up_doUpdateCheck() +{ + echo "do update check and reset interval\n"; + + // db_updateData($tablename, $column, $newdata, $wherecol, $wheredata, $exact=true) + $ctime = time(); + + db_updateData("options", "option_value", "$ctime", "option_name", "update.check.last"); + + // next go thru the $VERSION set info, and download the lastest version list from the + // main site. +} +?> \ No newline at end of file diff --git a/archive/v1/lib/wsdl.php b/archive/v1/lib/wsdl.php new file mode 100644 index 0000000..6b0e4b4 --- /dev/null +++ b/archive/v1/lib/wsdl.php @@ -0,0 +1,196 @@ +stringpass[0] = "something"; + * $object->stringpass[1] = "something"; + * + * And you need to pass out the same way, i.e.: + * $mypassout = new dataContainer(); + * $mypassout->stringpass[0] = "something"; + * etc... + * return $mypassout; + * + * I was planning on implementing a way for functions to define "real" schemas and have + * the above as a default, but for now, this will do. Technically its not a "kind" thing + * to do because the only person who knows what the funtions expects and what the function + * returns is the person coding the function. But this will change, and later this will be the + * default, but you'll be expected to define a schema for your function, unless your function + * really is just returning a list of strings. This becomes important later on when + * the web comes into play because in order for the website to be able to accept input for + * foreign data, it'll need to know how to format a form (for example) + * + * I expect this will take the form of something like + * function myFunction(); + * function myFunctionInSchema(); + * function myFunctionOutSchema(); + * or maybe these will take the form of some functional array.. It requires some + * thought, but you'll still just define the one thing in the wsdlFunctions array. + * + * + * $mfapi_exportedFunctions has the following format + * + * $mfapi_exportedFunctions[funcname] = "name"; + * + * format simplified at commit 694 in home repo + */ + + // this the class used to pass around data between soap connections + // Im really not a fan of OO in php... + class dataContainer { + public $stringpass; + }; + +// function for generation of XSD +function sp_generateXSD($location, $soapFunctions) +{ + + + $return = ""; + + $return .=''."\n"; + $return .=''."\n"; + foreach($soapFunctions as $key => $val) { + + // check the function exists first + if(function_exists($val)) { + // request type for function + //$return .=''."\n"; + $return .=''."\n"; + $return .=''."\n"; + $return .=''."\n"; + $return .=''."\n"; + //$return .=''."\n"; + $return .=''."\n"; + $return .=''."\n"; + //$return .=''."\n"; + + // response type for function + //$return .=''."\n"; + $return .=''."\n"; + $return .=''."\n"; + $return .=''."\n"; + $return .=''."\n"; + //$return .=''."\n"; + $return .=''."\n"; + $return .=''."\n"; + //$return .=''."\n"; + } + } + $return .=''."\n"; + + return $return; +} + +// This function was greatly simplified at commit 694. +// I need to generate as xsd as well +function sp_generateWSDL($location, $soapFunctions) +{ + + $retarray = ""; + + // first the header + $retarray .= ''."\n"; + $retarray .= ''."\n"; + //$retarray .= mfapi_generateXSD("none"); + $retarray .= ''."\n"; + $retarray .= ''."\n"; + + // now the message types + foreach($soapFunctions as $key => $val) { + + // check the function exists first + if(function_exists($val)) { + $retarray .= ''."\n"; + $retarray .= "\t".''."\n"; + $retarray .= ''."\n"; + $retarray .= ''."\n"; + $retarray .= "\t".''."\n"; + $retarray .= ''."\n"; + } + + } + + $retarray .= "\n"; + + // now the port types + $retarray .= ''."\n"; + foreach($soapFunctions as $key => $val) { + // check the function exists first + if(function_exists($val)) { + // foreach operation + $retarray .= "\t".''."\n"; + $retarray .= "\t\t".''."\n"; + $retarray .= "\t\t".''."\n"; + $retarray .= "\t".''."\n"; + } + } + $retarray .= ''."\n"; + + $retarray .= "\n"; + + // now the binding + $retarray .= ''."\n"; + $retarray .= "\t".''."\n"; + foreach($soapFunctions as $key => $val) { + if(function_exists($val)) { + // foreach operation + $retarray .= "\t".''."\n"; + $retarray .= "\t\t".''."\n"; + $retarray .= "\t\t".''."\n"; + $retarray .= "\t\t\t".''."\n"; + $retarray .= "\t\t".''."\n"; + $retarray .= "\t\t".''."\n"; + $retarray .= "\t\t\t".''."\n"; + $retarray .= "\t\t".''."\n"; + + $retarray .= "\t".''."\n"; + } + } + + $retarray .= ''."\n"; + + $retarray .= "\n"; + + // and the end bit + $retarray .= ''."\n"; + $retarray .= "\t".''."\n"; + $retarray .= "\t\t".''."\n"; + $retarray .= "\t".''."\n"; + $retarray .= ''."\n"; + $retarray .= ''."\n"; + + + // and return the array + return $retarray; +} + +?> diff --git a/archive/v1/lib/www.php b/archive/v1/lib/www.php new file mode 100644 index 0000000..f356ca0 --- /dev/null +++ b/archive/v1/lib/www.php @@ -0,0 +1,169 @@ +"; + + // top + if(isset($calls["top_function"])) { + $func = $calls["top_function"]; + $func(); + } else { + www_top(); + } + + echo ""; + + // left menu + if(isset($calls["left_menu_function"])) { + $func = $calls["left_menu_function"]; + $func(); + } else { + www_leftmenu(); + } + + echo ""; + + // contentpane + if(isset($calls["content_pane_function"])) { + $func = $calls["content_pane_function"]; + $func(); + } else { + www_contentpane(); + } + + echo ""; + + // footer + if(isset($calls["footer_function"])) { + $func = $calls["footer_function"]; + $func(); + } else { + www_footer(); + } + + echo ""; + + // page end + if(isset($calls["page_end_function"])) { + $func = $calls["page_end_function"]; + $func(); + } else { + www_pageend(); + } + +} + +function www_header() +{ + echo ""; + echo " "; + echo ""; +} + +function www_top() +{ + echo "

Welcome to GLCAS

"; + echo ""; + + global $MENU_ITEMS, $GLOBAL_BASE_URL; + foreach($MENU_ITEMS as $mes) { + $mtext = $mes["title"]; + $mlink = "$GLOBAL_BASE_URL/".$mes["link"]; + // remove the excess /'s + $mlink2 = preg_replace("/\/[\/]+/", "/", $mlink); + //echo "went from $mlink to $mlink2\n"; + echo ""; + } + + echo "
$mtext
"; + if(function_exists("msg_haveMessages")) if(msg_haveMessages()) { + echo ""; + $msgs = msg_getMessages(); + + foreach($msgs as $msg) { + $msgtime = msg_toDate($msg["msgdate"]); + $msgcol = $msg["msgcolour"]; + $msgtxt = $msg["msgtext"]; + $msgid = $msg["messages_id"]; + + echo ""; + echo ""; + } + echo "
$msgtime - $msgtxtAcknowledge
"; + } +} + +function www_leftmenu() +{ + echo "i be a left menu, yar"; +} + +function www_contentpane() +{ + echo "i be a content pane, yar"; +} + +function www_footer() +{ + echo "i be a footer, yar"; +} + + +function www_pageend() +{ + echo ""; +} + +function urlCreate($from) +{ + global $MENU_ITEMS, $GLOBAL_BASE_URL; + + $mlink = "$GLOBAL_BASE_URL/".$from; + $mlink = preg_replace("/\/[\/]+/", "/", $mlink); + + return $mlink; + +} + + +?> \ No newline at end of file diff --git a/archive/v1/unittests/datastores.php b/archive/v1/unittests/datastores.php new file mode 100644 index 0000000..f5313c4 --- /dev/null +++ b/archive/v1/unittests/datastores.php @@ -0,0 +1,62 @@ + \ No newline at end of file diff --git a/archive/v1/unittests/dbtest.php b/archive/v1/unittests/dbtest.php new file mode 100644 index 0000000..4310202 --- /dev/null +++ b/archive/v1/unittests/dbtest.php @@ -0,0 +1,76 @@ + \ No newline at end of file diff --git a/archive/v1/unittests/libload.php b/archive/v1/unittests/libload.php new file mode 100644 index 0000000..bf99490 --- /dev/null +++ b/archive/v1/unittests/libload.php @@ -0,0 +1,5 @@ + \ No newline at end of file diff --git a/archive/v1/unittests/msgtest.php b/archive/v1/unittests/msgtest.php new file mode 100644 index 0000000..c1db060 --- /dev/null +++ b/archive/v1/unittests/msgtest.php @@ -0,0 +1,41 @@ + \ No newline at end of file diff --git a/archive/v1/unittests/soaptest.php b/archive/v1/unittests/soaptest.php new file mode 100644 index 0000000..f72318f --- /dev/null +++ b/archive/v1/unittests/soaptest.php @@ -0,0 +1,17 @@ + 1)); + +print_r($client->__getFunctions()); + +$mk = new dataContainer(); +$mk->stringpass[0] = "mix"; +$mk->stringpass[1] = "me"; + +$lk = $client->status($mk); + +print_r($lk); +?> \ No newline at end of file diff --git a/archive/v1/var/config.php b/archive/v1/var/config.php new file mode 100644 index 0000000..48cd513 --- /dev/null +++ b/archive/v1/var/config.php @@ -0,0 +1,9 @@ + \ No newline at end of file diff --git a/archive/v1/var/mysql.sql b/archive/v1/var/mysql.sql new file mode 100644 index 0000000..e69de29 diff --git a/archive/v1/var/sqlite3.sql b/archive/v1/var/sqlite3.sql new file mode 100644 index 0000000..c4b7b9f --- /dev/null +++ b/archive/v1/var/sqlite3.sql @@ -0,0 +1,2 @@ +create table data_components ( component_id INTEGER PRIMARY KEY AUTOINCREMENT, component_name text, component_version text); +create table config_data (config_id INTEGER PRIMARY KEY AUTOINCREMENT, config_name text, config_data text); diff --git a/archive/v1/www/.htaccess b/archive/v1/www/.htaccess new file mode 100644 index 0000000..e1f7b2e --- /dev/null +++ b/archive/v1/www/.htaccess @@ -0,0 +1,8 @@ +RewriteEngine on +RewriteBase /src/eclipse-workspace/glcas/www/ +RewriteRule ^index\.php.* - [L] +RewriteRule ^soap\.php.* - [L] +RewriteCond %{REQUEST_FILENAME} !-f +RewriteCond %{REQUEST_FILENAME} !-d +RewriteRule ^(.*)$ index.php?q=$1 [L,QSA] + diff --git a/archive/v1/www/index.php b/archive/v1/www/index.php new file mode 100644 index 0000000..d42091a --- /dev/null +++ b/archive/v1/www/index.php @@ -0,0 +1,17 @@ + + + +No Web Component Installed + + diff --git a/archive/v1/www/soap.php b/archive/v1/www/soap.php new file mode 100644 index 0000000..577e359 --- /dev/null +++ b/archive/v1/www/soap.php @@ -0,0 +1,59 @@ +stringpass[0] = "yes"; + $lk->stringpass[1] = "np"; + return $lk; +} + +if(isset($_REQUEST["wsdl"])) { + $mylocation = "https://".$_SERVER["SERVER_NAME"].$_SERVER["PHP_SELF"]; + generateWSDL($mylocation, $soapFunctions); + exit(0); +} + +if(isset($_REQUEST["xsd"])) { + $mylocation = "https://".$_SERVER["SERVER_NAME"].$_SERVER["PHP_SELF"]; + generateXSD($mylocation, $soapFunctions); + exit(0); +} + +if($_SERVER["REQUEST_METHOD"] != "POST") { + $mylocation = "https://".$_SERVER["SERVER_NAME"].$_SERVER["PHP_SELF"]; + generateWSDL($mylocation, $soapFunctions); + exit(0); +} + +function generateWSDL($location, $functions) +{ + header("Content-type: text/xml"); + $wsdl = sp_generateWSDL($location, $functions); + echo $wsdl; +} + +function generateXSD($location, $functions) +{ + header("Content-type: text/xml"); + $wsdl = sp_generateXSD($location, $functions); + echo $wsdl; +} + +$mylocation = "https://".$_SERVER["SERVER_NAME"].$_SERVER["PHP_SELF"]; +$s = new SoapServer("$mylocation?wsdl"); + +foreach($soapFunctions as $function) { + $s->addFunction($function); +} + +$s->handle(); + + +?> \ No newline at end of file diff --git a/doc/README b/doc/README deleted file mode 100644 index f4eb95f..0000000 --- a/doc/README +++ /dev/null @@ -1,4 +0,0 @@ -GLCAS -===== - -Generic Linux Central Administration System diff --git a/doc/flow.dia b/doc/flow.dia deleted file mode 100644 index 028ecb954961d3609a699a5a57db64505ad83d73..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1530 zcmVz$CqVbJj*!oqi|wEV3~#t=aK7& z-o*Ul_b>05`SJ1YgX@d;`p=8S($H6gN&0DGE|glmACEVi4G6Z0P*Ds5e+?2j{zn9X z7;B-i`FLj-hYDPwM0##_Rwxzwv$c{&D3)?!&cyti7f0*RHFK$*+&l`R*mxGf#JqpX z4s*OyGcM>kqI)GgIg6$E)~wpn2j^{6uVh?SyIe(yuSL{$RS{{>lm0)D*-0f@DD)oh ze<1hyE$vS1b=BQyBZyjx*z?0Gj`mHEI|2cQ5Yo<|oN>z`4t({=<#4mx!Uea5i*F0( zC(~6Ft62D|3OS3SK#DL&Rqej{5S`$+GwU@{X$^*Vaf6 zE|XN!%jv;e`>sq*EVH6agQmq!Y<$Y=Ww~=5lbC>T(TsI@;(2dstky@hH9gMeFwqoo6rMYNgL)R3nM@)DGlaNQy~mdvq0 z%Lk+6OT|m&L{XAy@4gq8&6{C2U~qxB1}vp zQQI_O=vdD${YeJTQu%XnnAa}9gUTwaeKf4N(k#*qw3vnJ;uTo{(GdlR({4~jb~@6+ zSXMV6UHf_AQr16D8LpQ#w0(@Y>$s}vA(>W8w1Jz!V%$e&s3 zI6jX$IADw+jY8;y2DBkelRB~?Ylk|I!f+}>H?!kH>zahxlZ;*_^HupK>Po(g*d%nP zB95a?S@C{VBGgg!G?1Zpj2c@ni#@~%@;w_NedKyo>BXN^Xyf%8W1+((&9~4rRFu_L z#{OIFuxgc9QhH8M9+q@J`eGSnwP86hQRlLb0*LHj!|@-Wq2!Zbmq5dpVZRbx^sAi0D|)20VLdlkn)=h4{|WOC5g?V*p>0=(hL^S zAR1;Bebd&Ta`tnWC=mn$Y4uH77z3V>79#^`U7fU=TO)FX*2uOP96=7OwzcTFoe`xw zAjH$gh!V(02m|WCp8KNC7M|A@F@_J@qF%cq-4pSHu80m@(XHtv-RII-K8oet&>7vZ zGeQtpLuYiWp*X$5P&{pCt)6#OdD(g~_dge}8rUe-WjHqs$KTp; z+}aJtS#dZHab+bOnXIGY#nx3O>!%~zzEWh{fZAxOm;gK!3e92-7h2pG)=;GFkQ-nB*^ znShekqt+q1zmw=Dmqa%%Uh7T=@gG`NN>;r*4x>%jN3EMP$a(9BC+)TjKP_2tR@bM|YR$GgJMZ65Fb1zi}ETar5f041{qqyPW_ diff --git a/doc/globals.txt b/doc/globals.txt deleted file mode 100644 index 49b5a27..0000000 --- a/doc/globals.txt +++ /dev/null @@ -1,12 +0,0 @@ -$BASE_URLS["ypc"]["base"] = "ypc"; // ap for apt-proxy -$BASE_URLS["ypc"]["function"] = "yp_contentUrlsCtl"; - -$MENU_ITEMS["yp"]["title"] = "YUM Proxy"; -$MENU_ITEMS["yp"]["link"] = "/ypc/proxycontrol"; - -$VERSION["item"]["major"] -$VERSION["item"]["minor"] -$VERSION["item"]["release"] - -$GLOBAL_BASE_URL="/src/eclipse-workspace/glcas/www/"; -$DB_URL="sqlite:$BASE_DIR/var/ds_store.db"; diff --git a/lib/config.php b/lib/config.php deleted file mode 100644 index 272e641..0000000 --- a/lib/config.php +++ /dev/null @@ -1,26 +0,0 @@ - \ No newline at end of file diff --git a/lib/datastore.php b/lib/datastore.php deleted file mode 100644 index a074cc3..0000000 --- a/lib/datastore.php +++ /dev/null @@ -1,180 +0,0 @@ -Browsing, $dsbr
"; - break; - case "createds": - ds_createDS($_REQUEST["dsname"], $_REQUEST["dsloc"]); - echo "DS Created, return"; - break; - case "control": - default: - ds_controlPane(); - // go thru the db and list the components - } - } -} - -function ds_controlPane() -{ - global $GLOBAL_BASE_URL; - echo "

DataStores

"; - $dss = ds_listDS(); - - if($dss != false) { - echo ""; - echo ""; - foreach($dss as $dsl) { - $dsname = $dsl["dsname"]; - $dspath = $dsl["dslocation"]; - echo ""; - } - echo "
DataStore NameDataStore PathSizeUsageControl
$dsname$dspath
"; - } - echo "

Create DataStore

"; - echo "
"; - echo "DataStore Name:
"; - echo "DataStore Location:
"; - echo ""; - echo "
"; - -} - -function ds_leftMenu() -{ - global $GLOBAL_BASE_URL; - echo "

Browse

"; - $dss = ds_listDS(); - //echo "
";
-	//print_r($dss);
-	//echo "
"; - foreach ($dss as $dsl) { - $dsname = $dsl["dsname"]; - echo "$dsname
"; - } -} - -function ds_contentUrls() -{ - $calls["needs_base_page"] = true; - $calls["content_pane_function"] = "ds_contentPane"; - $calls["left_menu_function"] = "ds_leftMenu"; - - return $calls; -} - -function ds_createDS($ds_name, $store_location) -{ - db_createTable("datastores", "dsname", "dslocation"); - db_createTable("datastores_files", "dsname", "fileowner", "filename", "dsfname"); - - $data = db_selectData("datastores", "dsname", "$ds_name"); - if(isset($data[0]["dsname"])) return false; - - db_insertData("datastores", "$ds_name", "$store_location"); -} - -function ds_listDS() -{ - return db_selectData("datastores"); -} - -function ds_deleteFile($ds_name, $file_name, $file_tag) -{ - $dlk = db_selectData("datastores_files", "filename", $file_name); - $afname = ""; - foreach($dlk as $kmm) { - if($kmm["fileowner"] == $file_tag) { - // we got ya - $afname = $kmm["dsfname"]; - if(file_exists($afname)) unlink($afname); - //echo "name was: $afname\n"; - } - } - //echo "now delete name was: $afname\n"; - if($afname != "") db_deleteData("datastores_files", "dsfname", $afname); -} - -// returns a file name to the location a file can be created -function ds_fileds($ds_name, $file_name, $file_tag) -{ - - $data = db_selectData("datastores", "dsname", "$ds_name"); - - $dtime = time(); - $made_file_name = "$dtime-".md5($file_name)."-".basename($file_name); - - $act_fname = $data[0]["dslocation"]."/".basename($made_file_name); - - db_insertData("datastores_files", "$ds_name", "$file_tag", "$file_name", "$act_fname"); - - return $act_fname; -} - -function ds_getFileList($ds_name, $file_tag) -{ - $list = db_selectData("datastores_files", "fileowner", "$file_tag"); - - return $list; -} - - -function ds_deleteDS($ds_name) -{ - db_deleteData("datastores", "dsname", "$ds_name"); - db_deleteData("datastores_files", "dsname", $ds_name); -} - -function ds_downloadAndStore($ds_name, $file_id, $file_name, $file_url) -{ - -} - -?> \ No newline at end of file diff --git a/lib/db.php b/lib/db.php deleted file mode 100644 index f24917f..0000000 --- a/lib/db.php +++ /dev/null @@ -1,123 +0,0 @@ -query($sql); -} - -function db_insertData($tablename) -{ - - $db = db_getDB(); - - $sql = "insert into \"$tablename\" values (NULL"; - for($i=1; $i < func_num_args(); $i++) { - $sql .= ",'".func_get_arg($i)."'"; - } - $sql .=")"; - - $db->query($sql); -} - -function db_selectData($tablename, $column="", $value="") -{ - $db = db_getDB(); - - if($column != "") $extra = " where $column like '%$value%'"; - else $extra = ""; - $sql = "select * from \"$tablename\"$extra"; - $res = $db->query($sql); - if(!$res) return false; - $data = $res->fetchAll(); - - return $data; -} - -function db_deleteData($tablename, $column, $value) -{ - $db = db_getDB(); - - $sql = "delete from \"$tablename\" where $column like '%$value%'"; - //echo "Sql is $sql\n"; - return $db->query($sql); - -} - -function db_updateData($tablename, $column, $newdata, $wherecol, $wheredata, $exact=true) -{ - $db = db_getDB(); - - if($exact) $sql = "update \"$tablename\" set $column='$newdata' where $wherecol='$wheredata'"; - else $sql = "update \"$tablename\" set $column='$newdata' where $wherecol like '$wheredata'"; - return $db->query($sql); -} - -function db_deleteTable($tablename) -{ - $db = db_getDB(); - - $sql = "drop table $tablename"; - - return $db->query($sql); -} - -function db_tableExists($tablename) -{ - $db = db_getDB(); - - $sql = "select count(*) from sqlite_master where type='table' and name='$tablename'"; - $res = $db->query($sql); - - $value = $res->fetchColumn(); - - if($value == 1) return true; - else return false; -} - -function db_getTables() -{ - $db = db_getDB(); - - $sql = "select name from sqlite_master where type='table' and name not like 'sqlite_%'"; - $res = $db->query($sql); - - return $res->fetchAll(); -} -?> \ No newline at end of file diff --git a/lib/lib.php b/lib/lib.php deleted file mode 100644 index 6c48c4c..0000000 --- a/lib/lib.php +++ /dev/null @@ -1,62 +0,0 @@ - 0) { - require_once("$basedir/plugins/$file"); - //echo "required $basedir/plugins/$file\n"; - } - } - } -} else { - echo "No plugins dir ($basedir/plugins), continuing without\n"; -} - -function urlInterpretter() -{ - global $BASE_URLS; - global $URL_COMPONENTS; - - if(isset($_REQUEST["q"])) $qry = $_REQUEST["q"]; - else $qry = ""; - - $urlcomps = preg_split("/[,\/]/", $qry); - $URL_COMPONENTS = $urlcomps; - - foreach($BASE_URLS as $bases_cd => $bases) { - //echo "
checking $bases_cd for ".$bases["base"]." against \"".$urlcomps[0]."\"
"; - if(strtolower($urlcomps[0]) == strtolower($bases["base"])) { - //echo "match
"; - $func = $bases["function"]; - return $func(); - } - } -} - -$db = db_getDB(); -db_createTable("options", "option_name", "option_value"); -?> \ No newline at end of file diff --git a/lib/messages.php b/lib/messages.php deleted file mode 100644 index e735e90..0000000 --- a/lib/messages.php +++ /dev/null @@ -1,73 +0,0 @@ - \ No newline at end of file diff --git a/lib/plugins/aptproxy.php b/lib/plugins/aptproxy.php deleted file mode 100644 index 161ade2..0000000 --- a/lib/plugins/aptproxy.php +++ /dev/null @@ -1,32 +0,0 @@ -"; -} - -function ap_leftMenu() -{ - echo "i am a ap leftmenu"; -} - - -?> \ No newline at end of file diff --git a/lib/plugins/db_mysql.php b/lib/plugins/db_mysql.php deleted file mode 100644 index 67c94a5..0000000 --- a/lib/plugins/db_mysql.php +++ /dev/null @@ -1,2 +0,0 @@ - \ No newline at end of file diff --git a/lib/plugins/db_sqlite.php b/lib/plugins/db_sqlite.php deleted file mode 100644 index 15c5adc..0000000 --- a/lib/plugins/db_sqlite.php +++ /dev/null @@ -1,3 +0,0 @@ - \ No newline at end of file diff --git a/lib/plugins/install.php b/lib/plugins/install.php deleted file mode 100644 index 865d1e9..0000000 --- a/lib/plugins/install.php +++ /dev/null @@ -1,29 +0,0 @@ -install"; - echo "
";
-	echo "servers\n";
-	print_r($_SERVER);
-	echo "request\n";
-	print_r($_REQUEST);
-	echo "
"; - echo ""; - exit(0); -} - -*/ -?> \ No newline at end of file diff --git a/lib/plugins/packages.php b/lib/plugins/packages.php deleted file mode 100644 index 15c5adc..0000000 --- a/lib/plugins/packages.php +++ /dev/null @@ -1,3 +0,0 @@ - \ No newline at end of file diff --git a/lib/plugins/yumproxy.php b/lib/plugins/yumproxy.php deleted file mode 100644 index 68c8768..0000000 --- a/lib/plugins/yumproxy.php +++ /dev/null @@ -1,43 +0,0 @@ -"; -} - -function yp_leftMenu() -{ - echo "i am a yp leftmenu"; -} - -function yp_contentUrlsCtl() -{ - $calls["needs_base_page"] = true; - $calls["content_pane_function"] = "yp_contentPane"; - $calls["left_menu_function"] = "yp_leftMenu"; - - return $calls; -} - -function yp_contentUrlsPrx() -{ - $calls["needs_base_page"] = false; - $calls["page_builder"] = "yp_proxyPageBuilder"; - - return $calls; -} - -function yp_proxyPageBuilder() -{ - echo "I write the songs that make the whole world sing"; -} -?> \ No newline at end of file diff --git a/lib/updates.php b/lib/updates.php deleted file mode 100644 index 95cc892..0000000 --- a/lib/updates.php +++ /dev/null @@ -1,52 +0,0 @@ - $timerval) { - up_doUpdateCheck(); - } -} -//echo "timerval: $timerval\n"; - -function up_doUpdateCheck() -{ - echo "do update check and reset interval\n"; - - // db_updateData($tablename, $column, $newdata, $wherecol, $wheredata, $exact=true) - $ctime = time(); - - db_updateData("options", "option_value", "$ctime", "option_name", "update.check.last"); - - // next go thru the $VERSION set info, and download the lastest version list from the - // main site. -} -?> \ No newline at end of file diff --git a/lib/wsdl.php b/lib/wsdl.php deleted file mode 100644 index 6b0e4b4..0000000 --- a/lib/wsdl.php +++ /dev/null @@ -1,196 +0,0 @@ -stringpass[0] = "something"; - * $object->stringpass[1] = "something"; - * - * And you need to pass out the same way, i.e.: - * $mypassout = new dataContainer(); - * $mypassout->stringpass[0] = "something"; - * etc... - * return $mypassout; - * - * I was planning on implementing a way for functions to define "real" schemas and have - * the above as a default, but for now, this will do. Technically its not a "kind" thing - * to do because the only person who knows what the funtions expects and what the function - * returns is the person coding the function. But this will change, and later this will be the - * default, but you'll be expected to define a schema for your function, unless your function - * really is just returning a list of strings. This becomes important later on when - * the web comes into play because in order for the website to be able to accept input for - * foreign data, it'll need to know how to format a form (for example) - * - * I expect this will take the form of something like - * function myFunction(); - * function myFunctionInSchema(); - * function myFunctionOutSchema(); - * or maybe these will take the form of some functional array.. It requires some - * thought, but you'll still just define the one thing in the wsdlFunctions array. - * - * - * $mfapi_exportedFunctions has the following format - * - * $mfapi_exportedFunctions[funcname] = "name"; - * - * format simplified at commit 694 in home repo - */ - - // this the class used to pass around data between soap connections - // Im really not a fan of OO in php... - class dataContainer { - public $stringpass; - }; - -// function for generation of XSD -function sp_generateXSD($location, $soapFunctions) -{ - - - $return = ""; - - $return .=''."\n"; - $return .=''."\n"; - foreach($soapFunctions as $key => $val) { - - // check the function exists first - if(function_exists($val)) { - // request type for function - //$return .=''."\n"; - $return .=''."\n"; - $return .=''."\n"; - $return .=''."\n"; - $return .=''."\n"; - //$return .=''."\n"; - $return .=''."\n"; - $return .=''."\n"; - //$return .=''."\n"; - - // response type for function - //$return .=''."\n"; - $return .=''."\n"; - $return .=''."\n"; - $return .=''."\n"; - $return .=''."\n"; - //$return .=''."\n"; - $return .=''."\n"; - $return .=''."\n"; - //$return .=''."\n"; - } - } - $return .=''."\n"; - - return $return; -} - -// This function was greatly simplified at commit 694. -// I need to generate as xsd as well -function sp_generateWSDL($location, $soapFunctions) -{ - - $retarray = ""; - - // first the header - $retarray .= ''."\n"; - $retarray .= ''."\n"; - //$retarray .= mfapi_generateXSD("none"); - $retarray .= ''."\n"; - $retarray .= ''."\n"; - - // now the message types - foreach($soapFunctions as $key => $val) { - - // check the function exists first - if(function_exists($val)) { - $retarray .= ''."\n"; - $retarray .= "\t".''."\n"; - $retarray .= ''."\n"; - $retarray .= ''."\n"; - $retarray .= "\t".''."\n"; - $retarray .= ''."\n"; - } - - } - - $retarray .= "\n"; - - // now the port types - $retarray .= ''."\n"; - foreach($soapFunctions as $key => $val) { - // check the function exists first - if(function_exists($val)) { - // foreach operation - $retarray .= "\t".''."\n"; - $retarray .= "\t\t".''."\n"; - $retarray .= "\t\t".''."\n"; - $retarray .= "\t".''."\n"; - } - } - $retarray .= ''."\n"; - - $retarray .= "\n"; - - // now the binding - $retarray .= ''."\n"; - $retarray .= "\t".''."\n"; - foreach($soapFunctions as $key => $val) { - if(function_exists($val)) { - // foreach operation - $retarray .= "\t".''."\n"; - $retarray .= "\t\t".''."\n"; - $retarray .= "\t\t".''."\n"; - $retarray .= "\t\t\t".''."\n"; - $retarray .= "\t\t".''."\n"; - $retarray .= "\t\t".''."\n"; - $retarray .= "\t\t\t".''."\n"; - $retarray .= "\t\t".''."\n"; - - $retarray .= "\t".''."\n"; - } - } - - $retarray .= ''."\n"; - - $retarray .= "\n"; - - // and the end bit - $retarray .= ''."\n"; - $retarray .= "\t".''."\n"; - $retarray .= "\t\t".''."\n"; - $retarray .= "\t".''."\n"; - $retarray .= ''."\n"; - $retarray .= ''."\n"; - - - // and return the array - return $retarray; -} - -?> diff --git a/lib/www.php b/lib/www.php deleted file mode 100644 index f356ca0..0000000 --- a/lib/www.php +++ /dev/null @@ -1,169 +0,0 @@ -"; - - // top - if(isset($calls["top_function"])) { - $func = $calls["top_function"]; - $func(); - } else { - www_top(); - } - - echo ""; - - // left menu - if(isset($calls["left_menu_function"])) { - $func = $calls["left_menu_function"]; - $func(); - } else { - www_leftmenu(); - } - - echo ""; - - // contentpane - if(isset($calls["content_pane_function"])) { - $func = $calls["content_pane_function"]; - $func(); - } else { - www_contentpane(); - } - - echo ""; - - // footer - if(isset($calls["footer_function"])) { - $func = $calls["footer_function"]; - $func(); - } else { - www_footer(); - } - - echo ""; - - // page end - if(isset($calls["page_end_function"])) { - $func = $calls["page_end_function"]; - $func(); - } else { - www_pageend(); - } - -} - -function www_header() -{ - echo ""; - echo " "; - echo ""; -} - -function www_top() -{ - echo "

Welcome to GLCAS

"; - echo ""; - - global $MENU_ITEMS, $GLOBAL_BASE_URL; - foreach($MENU_ITEMS as $mes) { - $mtext = $mes["title"]; - $mlink = "$GLOBAL_BASE_URL/".$mes["link"]; - // remove the excess /'s - $mlink2 = preg_replace("/\/[\/]+/", "/", $mlink); - //echo "went from $mlink to $mlink2\n"; - echo ""; - } - - echo "
$mtext
"; - if(function_exists("msg_haveMessages")) if(msg_haveMessages()) { - echo ""; - $msgs = msg_getMessages(); - - foreach($msgs as $msg) { - $msgtime = msg_toDate($msg["msgdate"]); - $msgcol = $msg["msgcolour"]; - $msgtxt = $msg["msgtext"]; - $msgid = $msg["messages_id"]; - - echo ""; - echo ""; - } - echo "
$msgtime - $msgtxtAcknowledge
"; - } -} - -function www_leftmenu() -{ - echo "i be a left menu, yar"; -} - -function www_contentpane() -{ - echo "i be a content pane, yar"; -} - -function www_footer() -{ - echo "i be a footer, yar"; -} - - -function www_pageend() -{ - echo ""; -} - -function urlCreate($from) -{ - global $MENU_ITEMS, $GLOBAL_BASE_URL; - - $mlink = "$GLOBAL_BASE_URL/".$from; - $mlink = preg_replace("/\/[\/]+/", "/", $mlink); - - return $mlink; - -} - - -?> \ No newline at end of file diff --git a/unittests/datastores.php b/unittests/datastores.php deleted file mode 100644 index f5313c4..0000000 --- a/unittests/datastores.php +++ /dev/null @@ -1,62 +0,0 @@ - \ No newline at end of file diff --git a/unittests/dbtest.php b/unittests/dbtest.php deleted file mode 100644 index 4310202..0000000 --- a/unittests/dbtest.php +++ /dev/null @@ -1,76 +0,0 @@ - \ No newline at end of file diff --git a/unittests/libload.php b/unittests/libload.php deleted file mode 100644 index bf99490..0000000 --- a/unittests/libload.php +++ /dev/null @@ -1,5 +0,0 @@ - \ No newline at end of file diff --git a/unittests/msgtest.php b/unittests/msgtest.php deleted file mode 100644 index c1db060..0000000 --- a/unittests/msgtest.php +++ /dev/null @@ -1,41 +0,0 @@ - \ No newline at end of file diff --git a/unittests/soaptest.php b/unittests/soaptest.php deleted file mode 100644 index f72318f..0000000 --- a/unittests/soaptest.php +++ /dev/null @@ -1,17 +0,0 @@ - 1)); - -print_r($client->__getFunctions()); - -$mk = new dataContainer(); -$mk->stringpass[0] = "mix"; -$mk->stringpass[1] = "me"; - -$lk = $client->status($mk); - -print_r($lk); -?> \ No newline at end of file diff --git a/var/config.php b/var/config.php deleted file mode 100644 index 48cd513..0000000 --- a/var/config.php +++ /dev/null @@ -1,9 +0,0 @@ - \ No newline at end of file diff --git a/var/mysql.sql b/var/mysql.sql deleted file mode 100644 index e69de29..0000000 diff --git a/var/sqlite3.sql b/var/sqlite3.sql deleted file mode 100644 index c4b7b9f..0000000 --- a/var/sqlite3.sql +++ /dev/null @@ -1,2 +0,0 @@ -create table data_components ( component_id INTEGER PRIMARY KEY AUTOINCREMENT, component_name text, component_version text); -create table config_data (config_id INTEGER PRIMARY KEY AUTOINCREMENT, config_name text, config_data text); diff --git a/www/.htaccess b/www/.htaccess deleted file mode 100644 index e1f7b2e..0000000 --- a/www/.htaccess +++ /dev/null @@ -1,8 +0,0 @@ -RewriteEngine on -RewriteBase /src/eclipse-workspace/glcas/www/ -RewriteRule ^index\.php.* - [L] -RewriteRule ^soap\.php.* - [L] -RewriteCond %{REQUEST_FILENAME} !-f -RewriteCond %{REQUEST_FILENAME} !-d -RewriteRule ^(.*)$ index.php?q=$1 [L,QSA] - diff --git a/www/index.php b/www/index.php deleted file mode 100644 index d42091a..0000000 --- a/www/index.php +++ /dev/null @@ -1,17 +0,0 @@ - - - -No Web Component Installed - - diff --git a/www/soap.php b/www/soap.php deleted file mode 100644 index 577e359..0000000 --- a/www/soap.php +++ /dev/null @@ -1,59 +0,0 @@ -stringpass[0] = "yes"; - $lk->stringpass[1] = "np"; - return $lk; -} - -if(isset($_REQUEST["wsdl"])) { - $mylocation = "https://".$_SERVER["SERVER_NAME"].$_SERVER["PHP_SELF"]; - generateWSDL($mylocation, $soapFunctions); - exit(0); -} - -if(isset($_REQUEST["xsd"])) { - $mylocation = "https://".$_SERVER["SERVER_NAME"].$_SERVER["PHP_SELF"]; - generateXSD($mylocation, $soapFunctions); - exit(0); -} - -if($_SERVER["REQUEST_METHOD"] != "POST") { - $mylocation = "https://".$_SERVER["SERVER_NAME"].$_SERVER["PHP_SELF"]; - generateWSDL($mylocation, $soapFunctions); - exit(0); -} - -function generateWSDL($location, $functions) -{ - header("Content-type: text/xml"); - $wsdl = sp_generateWSDL($location, $functions); - echo $wsdl; -} - -function generateXSD($location, $functions) -{ - header("Content-type: text/xml"); - $wsdl = sp_generateXSD($location, $functions); - echo $wsdl; -} - -$mylocation = "https://".$_SERVER["SERVER_NAME"].$_SERVER["PHP_SELF"]; -$s = new SoapServer("$mylocation?wsdl"); - -foreach($soapFunctions as $function) { - $s->addFunction($function); -} - -$s->handle(); - - -?> \ No newline at end of file -- 1.7.0.4