Skip to content

Commit

Permalink
release v3
Browse files Browse the repository at this point in the history
release v3
issues 8,10,14,38,27,34 are now fixed
  • Loading branch information
Kranf99 committed Dec 12, 2019
1 parent 5053e22 commit c9eebd3
Show file tree
Hide file tree
Showing 107 changed files with 437 additions and 2,842 deletions.
2 changes: 1 addition & 1 deletion JSON_SQL_Bridge/classes.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@
If you are interested in distributing, reselling, modifying, contibuting or in general creating
any derivative work from JSON_SQL_Bridge, please contact Frank Vanden Berghen at [email protected].
*/
namespace kibella; class l0 extends \sqlite3 { function __construct($O0) { try { $this->open($O0); } catch ( \exception $l1) { $l1->getmessage(); } } } class O1 extends \thread { private $l2; private $O2; private $l3; public function __construct($l2,$O2=FALSE) { $this->l2 =$l2; $this->O2 =$O2; } public function run() { $O3=l4($this->l2 ,$O2=$this->O2); $this->l3 =$O3["responseFile"]; $this->O4 =TRUE; } public function l5() { return $this->l2; } public function O5() { return $this->O2; } public function l6() { return $this->l3; } }
namespace kibella; class O8 extends \sqlite3 { function __construct($l9) { try { $this->open($l9); } catch ( \exception $O9) { echo $O9->getmessage().PHP_EOL; showmessage( __FILE__ ,"error","Connection to the SQLite database $l9 could not be established."); } } } class la { private $Oa; function __construct($lb,$Ob="/\t+/") { try { $this->Oa =$this->lc($lb,$Ob); foreach ($this->Oa as $Oc => $ld) { $Od=$this->le($ld); $this->Oa[$Oc]=array("connectionString" => $ld,"dbengine" => $Od["odbc:Driver"],"server" => $Od["Server"],"dbname" => $Od["Database"]); } } catch ( \exception $O9) { echo $O9->getmessage().PHP_EOL; showmessage( __FILE__ ,"warning","The connection to the database has NOT been set."); } } private function lc($Oe,$Ob="/\t+/") { $lf=array(); if (($Of=fopen($Oe,"r")) === FALSE) throw new \exception( __FUNCTION__."Cannot open configuration file ($Oe)."); while (($lg=fgets($Of,02000)) !== FALSE) { $lg=preg_replace("/(^\\s+)|(\\s+\$)/","",$lg); if (preg_match("/^#/",$lg) == 0) { $Og=preg_split($Ob,$lg); if (count($Og)>1) { $lf[$Og[0]]=trim($Og[1]); } } } return $lf; } private function le($ld,$lh=";") { $Oh=preg_split( "/$lh/" ,$ld,-1,PREG_SPLIT_NO_EMPTY); $Od=array(); foreach ($Oh as $Oi) { $lj=strpos($Oi,"="); if ($lj>=0) { $Oj=substr($Oi,0,$lj); $lk=strtolower(substr($Oi,$lj+1)); $lk=preg_replace("/[{}\\s]+/","",$lk); $Od[$Oj]=$lk; } else { showmessage( __FILE__ ,"warning","The currently analyzed database connection string is not properly formed:\n$ld\n"."Caught while analyzing the following part of the connection string: '$Oi'\n"."Check the specified database connections file:\n$lb\n"); } } return $Od; } public function Ok() { return $this->Oa; } public function ll($Oc) { if (array_key_exists($Oc,$this->Oa)) { return $this->Oa[$Oc]["connectionString"]; } return NULL; } public function lm($Oc) { if (array_key_exists($Oc,$this->Oa)) { return $this->Oa[$Oc]["dbengine"]; } return NULL; } public function Om($Oc) { if (array_key_exists($Oc,$this->Oa)) { return $this->Oa[$Oc]["server"]; } return NULL; } public function ln($Oc) { if (array_key_exists($Oc,$this->Oa)) { return $this->Oa[$Oc]["dbname"]; } return NULL; } } class On { public $lo; public $Oo; public $lp; private $Op; private $lq; private $Oq; private $lr=0; function __construct($ls,$lq,$Oo,$lp,$Os) { $this->lo =$ls; $this->lq =$lq; $this->Oo =$Oo; $this->lp =$lp; $this->Oq =lt; try { $this->Op =new \pdo($this->lq ,"","",$Os); } catch ( \pdoexception $O9) { echo $O9->getmessage().PHP_EOL; showmessage( __FILE__ ,"error","The connection to the database could not be established.\n\t\t\t\t\t\t\t\t\t\t\tConnection string: $this->lq"); $this->Op =FALSE; $this->lr =RC_ERROR_NOTFOUND_DB; } } function getdbhandle() { return $this->Op; } function close() { if ($this->Op) { Ot($this->Op ,$this->Oq); } } function lu() { return $this->lr; } } class Ou { private static $Op; public $lo; public $Oo; public $lp; private $lq; private $Os; private $Oq; private $lr=0; function __construct($ls,$lq,$Oo,$lp,$Os) { $this->lo =$ls; $this->lq =$lq; $this->Oo =$Oo; $this->lp =$lp; $this->Os =$Os; $this->Oq =lt; } public function getdbhandle() { if (! isset (self::$Op)) { try { self::$Op=new \pdo($this->lq ,"","",$this->Os); } catch ( \pdoexception $O9) { echo $O9->getmessage().PHP_EOL; showmessage( __FILE__ ,"error","The connection to the database could not be established.\n\t\t\t\t\t\t\t\t\t\t\t\tConnection string: $this->lq"); self::$Op=FALSE; $this->lr =RC_ERROR_NOTFOUND_DB; } } return self::$Op; } function close() { if (self::$Op) { Ot(self::$Op,$this->Oq); } } function lu() { return $this->lr; } } class lv extends \thread { public static $Ov=0; private $lw; private $Ow; private $lx; private $Ox; private $ly; public function __construct($Ow,$lx=FALSE) { self::$Ov=self::$Ov+1; $this->lw =self::$Ov; $this->Ow =$Ow; $this->lx =$lx; $this->Ox =FALSE; } public function run() { $Oy=lz($this->Ow ,$lx=$this->lx); usleep(.1E6); $this->synchronized( function ($ly) { $this->ly =$ly; } ,$Oy["responseFile"]); $this->Ox =TRUE; } public function Oz() { return $this->Ow; } public function l10() { return $this->lx; } public function O10() { return $this->ly; } public function l11() { return $this->Ox; } }
2 changes: 1 addition & 1 deletion JSON_SQL_Bridge/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@
If you are interested in distributing, reselling, modifying, contibuting or in general creating
any derivative work from JSON_SQL_Bridge, please contact Frank Vanden Berghen at [email protected].
*/
namespace kibella; error_reporting( E_ALL); const O6=01123240; ini_set("session.gc_maxlifetime",O6); ini_set("session.gc_probability",1); ini_set("session.gc_divisor",1); ini_set("session.cookie_lifetime",O6); session_set_cookie_params(O6); ini_set("time_limit",0454); if ( isset ($_COOKIE[session_name()])) setcookie(session_name(),$_COOKIE[session_name()],time()+O6,"/"); require_once "configreadinifile.php"; require_once "functionsaux.php"; require_once "constants.php"; require_once "geohash.php"; require_once "globals.php"; require_once "functionsauxkibella.php"; require_once "functionsdashaccelerate.php"; require_once "functionsdb.php"; require_once "functionsparse.php"; require_once "functionsmsg.php"; require_once "functionsquery.php"; require_once "functionsserver.php"; require_once "functionsstatic.php"; require_once "classes.php";
namespace kibella; error_reporting( E_ALL); const O11=01123240; ini_set("session.gc_maxlifetime",O11); ini_set("session.gc_probability",1); ini_set("session.gc_divisor",1); ini_set("session.cookie_lifetime",O11); session_set_cookie_params(O11); ini_set("time_limit",0454); ini_set("date.timezone","UTC"); if ( isset ($_COOKIE[session_name()])) setcookie(session_name(),$_COOKIE[session_name()],time()+O11,"/"); require_once __DIR__."/configreadinifile.php"; require_once __DIR__."/configdbconnections.php"; require_once __DIR__."/functionsaux.php"; require_once __DIR__."/constants.php"; require_once __DIR__."/geohash.php"; require_once __DIR__."/globals.php"; require_once __DIR__."/functionsauxkibella.php"; require_once __DIR__."/functionsdashaccelerate.php"; require_once __DIR__."/functionsdb.php"; require_once __DIR__."/functionsparse.php"; require_once __DIR__."/functionsmsg.php"; require_once __DIR__."/functionsquery.php"; require_once __DIR__."/functionsserver.php"; require_once __DIR__."/functionsstatic.php"; require_once __DIR__."/classes.php"; require_once __DIR__."/users/user.php";
11 changes: 11 additions & 0 deletions JSON_SQL_Bridge/configdbconnections.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?php
/*
JSON_SQL_Bridge 1.0
Copyright 2016 Frank Vanden berghen
All Right reserved.
JSON_SQL_Bridge is not a free software. The JSON_SQL_Bridge software is NOT licensed under the "Apache License".
If you are interested in distributing, reselling, modifying, contibuting or in general creating
any derivative work from JSON_SQL_Bridge, please contact Frank Vanden Berghen at [email protected].
*/
namespace kibella; require_once "classes.php"; require_once "constantscfg.php";
2 changes: 1 addition & 1 deletion JSON_SQL_Bridge/configreadinifile.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@
If you are interested in distributing, reselling, modifying, contibuting or in general creating
any derivative work from JSON_SQL_Bridge, please contact Frank Vanden Berghen at [email protected].
*/
namespace kibella; require_once "constantscfg.php"; require_once "functionscfg.php"; l7(APPCONFIG);
namespace kibella; require_once "functionscfg.php"; l12();
2 changes: 1 addition & 1 deletion JSON_SQL_Bridge/constants.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@
If you are interested in distributing, reselling, modifying, contibuting or in general creating
any derivative work from JSON_SQL_Bridge, please contact Frank Vanden Berghen at [email protected].
*/
namespace kibella; const DEBUG=FALSE; const LOG=FALSE; define(__NAMESPACE__."\\APPDIRNAME",basename(dirname( __DIR__))); define(__NAMESPACE__."\\ESDIRNAME",APPDIRNAME."/db"); define(__NAMESPACE__."\\TEMPDIR",__DIR__."/../tempdata"); define(__NAMESPACE__."\\TABLESDIR",TEMPDIR); const O7=".kibana-4"; const l8="4.1.2"; define(__NAMESPACE__."\\LOGFILE",TEMPDIR."/kibella.log"); define(__NAMESPACE__."\\CACHEDIR",TEMPDIR."/cache"); const CACHEMODE_DAY="day"; const O8=03410; const l9="LastResponse"; const O9="TimeOfLastQuery"; const la="CacheEnabledLastQuery"; const Oa=1; const lb="NOTE"; const Ob="WARNING"; const lc="ERROR"; const Oc="INTERNAL ERROR"; const ld="Contact your software provider"; const Od=-1; const le=-2; const Oe=-3; const lf=0; const Of=1; const lg="config"; const Og="dashboard"; const lh="index-pattern"; const Oh="search"; const Oi="visualization"; const lj="_index"; const Oj="_type"; const lk="_id"; const Ok="_version"; const ll="_score"; const lm="_source"; const Om="_shared"; const ln="_shards"; const On="created"; const lo="found"; const Oo=1; const lp=7; const KIBELLADB="kibella.sqlite"; const Op="dbtemp"; const lq=lk; const Oq=Ok; const lr="RegisteredTables"; const ls="tablename"; const Os="db"; const lt="dbtype"; const Ot="datefields"; const lu="geofields"; const Ou="linkfields"; const lv="enablecache"; const Ov="Objects"; const lw="tableid"; const Ow=Oj; const lx=lm; const Ox="query"; const ly="_shared"; const Oy="Queries"; const lz="md5"; const Oz="lastdate"; const l10="tableid"; const O10="query"; const l11="counter"; const O11=0; const l12="DefaultIndex"; const O12="query"; const l13="no_database.sqlite"; const O13="sqlite"; const l14="no_table"; const O14="-"; const l15=" and "; const O15="desc"; const l16="avg"; const O16="cardinality"; const l17="value_count"; const MAX="max"; const MIN="min"; const O17="percentiles"; const l18="std_dev"; const O18="sum"; const l19="aggregations"; const O19="aggs"; const l1a="AGGS_FIELD"; const O1a="AGGS_RANGE"; const l1b="date_range"; const O1b="bool"; const l1c="buckets"; const O1c="filter"; const l1d="geo_bounding_box"; const O1d="bottom_right"; const l1e="FILTER_GEOHASH_FIELD"; const O1e="top_left"; const l1f="match"; const O1f="FILTER_MATCH_FIELD"; const l1g="FILTER_RANGE"; const O1g="FILTER_RANGE_FIELD"; const l1h="filtered"; const O1h="geohash_grid"; const l1i="highlight"; const O1i="histogram"; const l1j="date_histogram"; const O1j="must"; const l1k="must_not"; const O1k="operator"; const l1l="order"; const O1l="query"; const l1m="query_string"; const O1m="range"; const l1n="ranges"; const O1n="ROOT"; const l1o="term"; const O1o="terms"; const l1p="STATISTIC"; const O1p="analyze_wildcard"; const l1q="_count"; const O1q="default_field"; const l1r="default_operator"; const O1r="field"; const l1s="fields"; const O1s="format"; const l1t="from"; const O1t="lat"; const l1u="lon"; const O1u="gt"; const l1v="gte"; const O1v="interval"; const l1w="keyed"; const O1w="lt"; const l1x="lte"; const O1x="min_doc_count"; const l1y="operator"; const O1y="precision"; const l1z="query"; const O1z="script_fields"; const l20="size"; const O20="to"; const l21="type";
namespace kibella; const DEBUG=FALSE; const LOG=FALSE; define(__NAMESPACE__."\\APPDIRNAME",basename(dirname( __DIR__))); define(__NAMESPACE__."\\ESDIRNAME",APPDIRNAME."/db"); define(__NAMESPACE__."\\TEMPDIR",__DIR__."/../tempdata"); define(__NAMESPACE__."\\TABLESDIR",TEMPDIR); const O12=".kibana-4"; const l13="4.1.2"; define(__NAMESPACE__."\\LOGFILE",TEMPDIR."/kibella.log"); define(__NAMESPACE__."\\CACHEDIR",TEMPDIR."/cache"); const CACHEMODE_DAY="day"; const O13=03410; const l14="LastResponse"; const O14="TimeOfLastQuery"; const l15="CacheEnabledLastQuery"; const O15=1; const TAG_NOTE="NOTE"; const l16="WARNING"; const TAG_ERROR="ERROR"; const TAG_ERROR_INTERNAL="INTERNAL ERROR"; const O16="Contact your software provider"; const RC_ERROR_NOTFOUND_DB=-1; const RC_ERROR_NOTFOUND_TABLE=-2; const RC_NOTE_TABLE_ADDED=0; const RC_NOTE_TABLE_UPDATED=1; const lt=1; const l17=2; const O17=1; const l18=2; const O18=1; const l19=2; const O19=1; const l1a=2; const O1a="table_prefix"; const l1b="table_suffix"; const O1b=1; const l1c=2; const O1c="\n\t"; const l1d="config"; const O4="dashboard"; const O1d="index-pattern"; const l1e="search"; const O1e="visualization"; const l1f="_index"; const O1f="_type"; const l1g="_id"; const O1g="_version"; const l1h="_score"; const O1h="_source"; const l1i="_shared"; const O1i="_shards"; const l1j="created"; const O1j="found"; const l1k=01274; const O1k=1; const l1l=7; const KIBELLADB="kibella.sqlite"; const O3=l1g; const O1l=O1g; const l1m="lastUpdate"; const O1m="RegisteredTables"; const l1n="tablename"; const O1n="db"; const l1o="dbtype"; const O1o="datefields"; const l1p="geofields"; const O1p="linkfields"; const l1q="enablecache"; const l3="Objects"; const O1q="tableid"; const l4=O1f; const l1r=O1h; const O1r="query"; const O2="_shared"; const l1s="Queries"; const O1s="md5"; const l1t="lastdate"; const O1t="tableid"; const l1u="query"; const O1u="counter"; const l1v="_rowid"; const O1v=0; const l1w="DefaultIndex"; const O1w="query"; const l1x="no_database.sqlite"; const O1x="sqlite"; const l1y="no_table"; const O1y="-"; const l1z=" and "; const O1z="desc"; const l20="avg"; const O20="cardinality"; const l21="value_count"; const MAX="max"; const MIN="min"; const O21="percentiles"; const l22="std_dev"; const O22="sum"; const l23="aggregations"; const O23="aggs"; const l24="AGGS_FIELD"; const O24="AGGS_RANGE"; const l25="date_range"; const O25="bool"; const l26="buckets"; const O26="filter"; const l27="geo_bounding_box"; const O27="bottom_right"; const l28="FILTER_GEOHASH_FIELD"; const O28="top_left"; const l29="match"; const O29="FILTER_MATCH_FIELD"; const l2a="FILTER_RANGE"; const O2a="FILTER_RANGE_FIELD"; const l2b="filtered"; const O2b="geohash_grid"; const l2c="highlight"; const O2c="histogram"; const l2d="date_histogram"; const O2d="must"; const l2e="must_not"; const O2e="operator"; const l2f="order"; const O2f="query"; const l2g="query_string"; const O2g="range"; const l2h="ranges"; const O2h="ROOT"; const l2i="term"; const O2i="terms"; const l2j="STATISTIC"; const O2j="analyze_wildcard"; const l2k="_count"; const O2k="default_field"; const l2l="default_operator"; const O2l="field"; const l2m="fields"; const O2m="format"; const l2n="from"; const O2n="lat"; const l2o="lon"; const O2o="gt"; const l2p="gte"; const O2p="interval"; const l2q="keyed"; const O2q="lt"; const l2r="lte"; const O2r="min_doc_count"; const l2s="operator"; const O2s="precision"; const l2t="query"; const O2t="script_fields"; const l2u="size"; const O2u="to"; const l2v="type";
2 changes: 1 addition & 1 deletion JSON_SQL_Bridge/constantscfg.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@
If you are interested in distributing, reselling, modifying, contibuting or in general creating
any derivative work from JSON_SQL_Bridge, please contact Frank Vanden Berghen at [email protected].
*/
namespace kibella; define(__NAMESPACE__."\\APPCONFIG",__DIR__."/../kibella.ini");
namespace kibella; define(__NAMESPACE__."\\APPCONFIG",__DIR__."/../kibella.ini"); define(__NAMESPACE__."\\DEFAULT_DATADIR",__DIR__."/../../data"); const O2v=0764; const l2w=1; const O2w=1; const l2x="day"; const O2x="04:00"; const l2y=030; const O2y=017; const l2z=024; const O2z=1; define(__NAMESPACE__."\\DEFAULT_DBCONNECTIONSFILE",__DIR__."/../config/dbconnections/dsn_databases.con");
9 changes: 1 addition & 8 deletions JSON_SQL_Bridge/dashboard/actions/changeShared.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,4 @@
If you are interested in distributing, reselling, modifying, contibuting or in general creating
any derivative work from JSON_SQL_Bridge, please contact Frank Vanden Berghen at [email protected].
*/
namespace kibella;

require_once(__DIR__ . '/../dashboard.php');

$data = json_decode(file_get_contents("php://input"));
$dashboard = new Dashboard();

echo $dashboard->changeShared($data->id, $data->sharedValue);
namespace kibella; require_once ( __DIR__."/../dashboard.php"); $O7=json_decode(file_get_contents("php://input"),TRUE); $l8=new l0(); $l5=$l8->l6($O7["id"],$O7["sharedValue"]); echo $l5;
9 changes: 1 addition & 8 deletions JSON_SQL_Bridge/dashboard/actions/isShared.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,4 @@
If you are interested in distributing, reselling, modifying, contibuting or in general creating
any derivative work from JSON_SQL_Bridge, please contact Frank Vanden Berghen at [email protected].
*/
namespace kibella;

require_once(__DIR__ . '/../dashboard.php');

$data = json_decode(file_get_contents("php://input"));
$dashboard = new Dashboard();

echo $dashboard->isShared($data->id);
namespace kibella; require_once ( __DIR__."/../dashboard.php"); $O7=json_decode(file_get_contents("php://input"),TRUE); $l8=new l0(); echo $l8->l1($O7["id"]);
54 changes: 1 addition & 53 deletions JSON_SQL_Bridge/dashboard/dashboard.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,56 +8,4 @@
If you are interested in distributing, reselling, modifying, contibuting or in general creating
any derivative work from JSON_SQL_Bridge, please contact Frank Vanden Berghen at [email protected].
*/
namespace kibella;

require_once(__DIR__ . '/../constants.php');
require_once(__DIR__ . '/../functionsdb.php');
require_once(__DIR__ . '/../classes.php');

require_once(__DIR__ . '/../users/user.php');

class Dashboard {

private $db_connection = null;

public function isShared($id) {
$id = addslashes(htmlentities($id, ENT_QUOTES));

$this->db_connection = dbDBHCreate(KIBELLADB, TABLESDIR, $mode="sqlite");

$sql = 'SELECT ' . OBJ_COLUMN_SHARED . '
FROM ' . OBJTABLE . '
WHERE ' . ALL_COLUMN_ID . ' = "' . $id . '" AND ' . OBJ_COLUMN_TYPE . ' = "' . NAME_DASHBOARD . '"
LIMIT 1';

$result = dbDBHExecuteSqlQuery($this->db_connection, $sql, $mode="sqlite");

return $result[0][OBJ_COLUMN_SHARED];
}

public function changeShared($id, $newValue) {
$tuser = new User();

if($tuser->isLoggedIn() && is_bool($newValue)) {
$id = addslashes(htmlentities($id, ENT_QUOTES));

if($newValue)
$newValue = 1;
else
$newValue = 0;

$this->db_connection = dbDBHCreate(KIBELLADB, TABLESDIR, $mode="sqlite");

$sql = 'UPDATE ' . OBJTABLE . '
SET ' . OBJ_COLUMN_SHARED . ' = "' . $newValue . '"
WHERE ' . ALL_COLUMN_ID . ' = "' . $id . '" AND ' . OBJ_COLUMN_TYPE . ' = "' . NAME_DASHBOARD . '"
LIMIT 1';

$result = dbDBHExecuteSqlQuery($this->db_connection, $sql, $mode="exec");

return $result;
}

return false;
}
}
namespace kibella; require_once __DIR__."/../config.php"; class l0 { private $O0=NULL; public function l1($O1) { $O1=addslashes(htmlentities($O1,ENT_QUOTES)); $this->O0 =dbcreatedbh(KIBELLADB); $l2="SELECT ".O2."\n FROM ".l3."\n WHERE ".O3." = \"".$O1."\" AND ".l4." = \"".O4."\""; $l5=dbdbhexecutesqlquery($this->O0->getdbhandle(),$l2,$O5="query"); if (count($l5)>1) { showmessage("dashboard.php","warning","While checking the shared property for dashboard with ID '$O1',\n \t\tit was found that there are more than one record associated to the dashboard.\n \t\tThis can cause unexpected results.\nPlease contact technical support to solve this issue.\n"); } return $l5[0][O2]; } public function l6($O1,$O6) { $l7=new user(); if ($l7->isloggedin() && is_bool($O6)) { $O1=addslashes(htmlentities($O1,ENT_QUOTES)); if ($O6) $O6=1; else $O6=0; $this->O0 =dbcreatedbh(KIBELLADB); $l2="UPDATE ".l3."\n SET ".O2." = ".$O6."\n WHERE ".O3." = \"".$O1."\" AND ".l4." = \"".O4."\""; $l5=dbdbhexecutesqlquery($this->O0->getdbhandle(),$l2,$O5="exec"); return $l5; } return FALSE; } }
Loading

0 comments on commit c9eebd3

Please sign in to comment.