readded submodules for slingit
This commit is contained in:
parent
b45552aabe
commit
86d8ae81ec
3
system/.gitignore
vendored
Normal file
3
system/.gitignore
vendored
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
/nbproject/private/
|
||||||
|
/nbproject/
|
||||||
|
/sai/modules/saimod_sys_img/nbproject/private/
|
||||||
219
system/api/api.php
Normal file
219
system/api/api.php
Normal file
@ -0,0 +1,219 @@
|
|||||||
|
<?php
|
||||||
|
namespace SYSTEM\API;
|
||||||
|
|
||||||
|
class api {
|
||||||
|
const ROOT_PARENTID = -1;
|
||||||
|
const DEFAULT_GROUP = 0;
|
||||||
|
const DEFAULT_STRICT = true;
|
||||||
|
const DEFAULT_DEFAULT = false;
|
||||||
|
|
||||||
|
public static function run( $verifyclassname,$apiclassname,
|
||||||
|
$params,$group = self::DEFAULT_GROUP,
|
||||||
|
$strict = self::DEFAULT_STRICT,$default = self::DEFAULT_DEFAULT){
|
||||||
|
//Verify Class
|
||||||
|
if(!\class_exists($verifyclassname)){
|
||||||
|
throw new \SYSTEM\LOG\ERROR("Verify Class given to the api does not exist: '".$verifyclassname."'");}
|
||||||
|
|
||||||
|
//API Class
|
||||||
|
if(!\class_exists($apiclassname)){
|
||||||
|
throw new \SYSTEM\LOG\ERROR("API Class given to the api does not exist: '".$apiclassname."'");}
|
||||||
|
|
||||||
|
//check parameters
|
||||||
|
if( !isset($params) || !is_array($params) || count($params) <= 0){
|
||||||
|
return self::do_default($default, $apiclassname);} //throws
|
||||||
|
|
||||||
|
//Get the Databasetree
|
||||||
|
$tree = self::getApiTree($group); //throws
|
||||||
|
|
||||||
|
$statics = self::do_statics($params, $tree, $apiclassname, $verifyclassname, $default); //throws
|
||||||
|
|
||||||
|
//Commands
|
||||||
|
$commands = self::do_commands($params, $tree);
|
||||||
|
if(count($commands) <= 0){
|
||||||
|
return self::do_default($default, $apiclassname);} //throws
|
||||||
|
|
||||||
|
//Parameters
|
||||||
|
$parentid = $commands[count($commands)-1][0];
|
||||||
|
$parentid = $parentid[\SYSTEM\DBD\system_api::FIELD_ID];
|
||||||
|
$parameters = self::do_parameters($params, $tree, $parentid, $commands[count($commands)-1][1],$verifyclassname); //throws
|
||||||
|
|
||||||
|
//Opt Parameters
|
||||||
|
$parentid = $commands[count($commands)-1][0];
|
||||||
|
$parentid = $parentid[\SYSTEM\DBD\system_api::FIELD_ID];
|
||||||
|
$parameters_opt = self::do_parameters_opt($params, $tree, $parentid, $commands[count($commands)-1][1],$verifyclassname); //throws
|
||||||
|
|
||||||
|
//strict check
|
||||||
|
self::do_strict($strict, $params, $statics, $commands, $parameters, $parameters_opt); //throws
|
||||||
|
|
||||||
|
//Function Name
|
||||||
|
$call_funcname = self::do_func_name($commands); //throws
|
||||||
|
|
||||||
|
//Function Parameters
|
||||||
|
$call_funcparam = self::do_func_params($parameters, $parameters_opt);
|
||||||
|
|
||||||
|
//Does function exist?
|
||||||
|
if(!\method_exists($apiclassname, $call_funcname)){
|
||||||
|
return self::do_default($default, $apiclassname, $call_funcname);} //throws
|
||||||
|
|
||||||
|
//Call Function
|
||||||
|
return \call_user_func_array(array($apiclassname,$call_funcname),$call_funcparam);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static function getApiTree($group){
|
||||||
|
$result = \SYSTEM\DBD\SYS_API_TREE::QA(array($group));
|
||||||
|
if(!isset($result) || !is_array($result) || count($result) <= 0){
|
||||||
|
throw new \SYSTEM\LOG\ERROR("Database Tree for Api empty - cannot proced! GROUP: ".$group);}
|
||||||
|
return $result;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static function do_statics($params,$tree,$apiclassname,$verifyclassname,$default){
|
||||||
|
$statics = array();
|
||||||
|
$parentid = self::ROOT_PARENTID;
|
||||||
|
foreach($tree as $item){
|
||||||
|
if( intval($item[\SYSTEM\DBD\system_api::FIELD_TYPE]) == \SYSTEM\DBD\system_api::VALUE_TYPE_STATIC &&
|
||||||
|
intval($item[\SYSTEM\DBD\system_api::FIELD_PARENTID]) == $parentid &&
|
||||||
|
isset($params[$item[\SYSTEM\DBD\system_api::FIELD_NAME]])){
|
||||||
|
|
||||||
|
$statics[] = array($item,$params[$item[\SYSTEM\DBD\system_api::FIELD_NAME]]);
|
||||||
|
$call_funcname = 'static_'.$item[\SYSTEM\DBD\system_api::FIELD_NAME];
|
||||||
|
|
||||||
|
//verify func
|
||||||
|
if(!\method_exists($apiclassname, $call_funcname)){
|
||||||
|
return self::do_default($default, $apiclassname, $call_funcname);} //throws
|
||||||
|
|
||||||
|
//verify parameter
|
||||||
|
if( !method_exists($verifyclassname, $item[\SYSTEM\DBD\system_api::FIELD_VERIFY]) ||
|
||||||
|
!call_user_func(array($verifyclassname,$item[\SYSTEM\DBD\system_api::FIELD_VERIFY]),$params[$item[\SYSTEM\DBD\system_api::FIELD_NAME]])){
|
||||||
|
throw new \SYSTEM\LOG\ERROR('Parameter type missmacht or Missing Verifier. Param: '.$item[\SYSTEM\DBD\system_api::FIELD_NAME].' Verifier: '.$item[\SYSTEM\DBD\system_api::FIELD_VERIFY]);}
|
||||||
|
//throw new \SYSTEM\LOG\ERROR("yo ".$call_funcname.' '.$apiclassname);
|
||||||
|
\call_user_func_array(array($apiclassname,$call_funcname),array($params[$item[\SYSTEM\DBD\system_api::FIELD_NAME]]));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return $statics;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static function do_default($default, $apiclassname, $call_funcname = null){
|
||||||
|
if($default){ //should we call the default function or throw an error?
|
||||||
|
return \call_user_func(array($apiclassname,'default_page'));}
|
||||||
|
if($call_funcname == null){
|
||||||
|
throw new \SYSTEM\LOG\ERROR("No call given for the api");}
|
||||||
|
throw new \SYSTEM\LOG\ERROR("API call is not implemented in API: ".$call_funcname);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static function do_strict($strict, $params, $statics, $commands, $parameters, $parameters_opt){
|
||||||
|
if( $strict &&
|
||||||
|
count($params) != (count($statics) + count($parameters) + count($commands) + count($parameters_opt))){
|
||||||
|
throw new \SYSTEM\LOG\ERROR( 'Unhandled or misshandled parameters - api query is invalid'.
|
||||||
|
'; given: '.count($params).
|
||||||
|
'; statics: '.count($statics).
|
||||||
|
'; req_command: '.count($commands).
|
||||||
|
'; req_param: '.count($parameters).
|
||||||
|
'; opt_param: '.count($parameters_opt).
|
||||||
|
'; url: ' .$_SERVER["REQUEST_URI"]);}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static function do_commands($params,$tree){
|
||||||
|
$commands = array();
|
||||||
|
$parentid = self::ROOT_PARENTID;
|
||||||
|
foreach($tree as $item){
|
||||||
|
if( (intval($item[\SYSTEM\DBD\system_api::FIELD_TYPE]) == \SYSTEM\DBD\system_api::VALUE_TYPE_COMMAND ||
|
||||||
|
intval($item[\SYSTEM\DBD\system_api::FIELD_TYPE]) == \SYSTEM\DBD\system_api::VALUE_TYPE_COMMAND_FLAG) &&
|
||||||
|
intval($item[\SYSTEM\DBD\system_api::FIELD_PARENTID]) == $parentid &&
|
||||||
|
isset($params[$item[\SYSTEM\DBD\system_api::FIELD_NAME]])){
|
||||||
|
|
||||||
|
//check parent value
|
||||||
|
if( isset($item[\SYSTEM\DBD\system_api::FIELD_PARENTVALUE]) &&
|
||||||
|
$commands[count($commands)-1][1] != $item[\SYSTEM\DBD\system_api::FIELD_PARENTVALUE]){
|
||||||
|
continue;}
|
||||||
|
|
||||||
|
$commands[] = array($item,$params[$item[\SYSTEM\DBD\system_api::FIELD_NAME]]);
|
||||||
|
$parentid = intval($item[\SYSTEM\DBD\system_api::FIELD_ID]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return $commands;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static function do_parameters($params,$tree,$parentid,$lastcommandvalue,$verifyclassname){
|
||||||
|
$parameters = array();
|
||||||
|
foreach($tree as $item){
|
||||||
|
if( intval($item[\SYSTEM\DBD\system_api::FIELD_TYPE]) == \SYSTEM\DBD\system_api::VALUE_TYPE_PARAM &&
|
||||||
|
intval($item[\SYSTEM\DBD\system_api::FIELD_PARENTID]) == $parentid){
|
||||||
|
|
||||||
|
//check parent value
|
||||||
|
if( isset($item[\SYSTEM\DBD\system_api::FIELD_PARENTVALUE]) &&
|
||||||
|
$lastcommandvalue != $item[\SYSTEM\DBD\system_api::FIELD_PARENTVALUE]){
|
||||||
|
continue;}
|
||||||
|
|
||||||
|
//all parameters are required
|
||||||
|
if(!isset($params[$item[\SYSTEM\DBD\system_api::FIELD_NAME]])){
|
||||||
|
throw new \SYSTEM\LOG\ERROR('Parameter missing: '.$item[\SYSTEM\DBD\system_api::FIELD_NAME]);}
|
||||||
|
|
||||||
|
//verify parameter
|
||||||
|
if( !method_exists($verifyclassname, $item[\SYSTEM\DBD\system_api::FIELD_VERIFY]) ||
|
||||||
|
!call_user_func(array($verifyclassname,$item[\SYSTEM\DBD\system_api::FIELD_VERIFY]),$params[$item[\SYSTEM\DBD\system_api::FIELD_NAME]])){
|
||||||
|
throw new \SYSTEM\LOG\ERROR('Parameter type missmacht or Missing Verifier. Param: '.$item[\SYSTEM\DBD\system_api::FIELD_NAME].' Verifier: '.$item[\SYSTEM\DBD\system_api::FIELD_VERIFY]);}
|
||||||
|
|
||||||
|
$parameters[] = array($item, $params[$item[\SYSTEM\DBD\system_api::FIELD_NAME]]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return $parameters;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static function do_parameters_opt($params,$tree,$parentid,$lastcommandvalue,$verifyclassname){
|
||||||
|
$parameters_opt = array();
|
||||||
|
foreach($tree as $item){
|
||||||
|
if( intval($item[\SYSTEM\DBD\system_api::FIELD_TYPE]) == \SYSTEM\DBD\system_api::VALUE_TYPE_PARAM_OPT &&
|
||||||
|
intval($item[\SYSTEM\DBD\system_api::FIELD_PARENTID]) == $parentid){
|
||||||
|
|
||||||
|
//check parent value
|
||||||
|
if( isset($item[\SYSTEM\DBD\system_api::FIELD_PARENTVALUE]) &&
|
||||||
|
$lastcommandvalue != $item[\SYSTEM\DBD\system_api::FIELD_PARENTVALUE]){
|
||||||
|
continue;}
|
||||||
|
|
||||||
|
//all parameters are NOT required - just continue
|
||||||
|
if(!isset($params[$item[\SYSTEM\DBD\system_api::FIELD_NAME]])){
|
||||||
|
continue;}
|
||||||
|
|
||||||
|
//verify parameter
|
||||||
|
if( !method_exists($verifyclassname, $item[\SYSTEM\DBD\system_api::FIELD_VERIFY]) ||
|
||||||
|
!call_user_func(array($verifyclassname,$item[\SYSTEM\DBD\system_api::FIELD_VERIFY]),$params[$item[\SYSTEM\DBD\system_api::FIELD_NAME]])){
|
||||||
|
throw new \SYSTEM\LOG\ERROR('Parameter type missmacht or Missing Verifier. Param: '.$item[\SYSTEM\DBD\system_api::FIELD_NAME].' Verifier: '.$item[\SYSTEM\DBD\system_api::FIELD_VERIFY]);}
|
||||||
|
|
||||||
|
$parameters_opt[] = array($item, $params[$item[\SYSTEM\DBD\system_api::FIELD_NAME]]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return $parameters_opt;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static function do_func_name($commands){
|
||||||
|
$call_funcname = '';
|
||||||
|
foreach($commands as $com){
|
||||||
|
if(!\preg_match('^[0-9A-Za-z_]+$^', $com[1])){
|
||||||
|
throw new \SYSTEM\LOG\ERROR('Call Command can only have letters! command: '.$com[0]['name'].'; value: '.$com[1]);}
|
||||||
|
|
||||||
|
if($com[0][\SYSTEM\DBD\system_api::FIELD_TYPE] == \SYSTEM\DBD\system_api::VALUE_TYPE_COMMAND_FLAG){
|
||||||
|
$call_funcname .= '_flag_'.$com[0][\SYSTEM\DBD\system_api::FIELD_NAME];
|
||||||
|
} else {
|
||||||
|
$call_funcname .= '_'.$com[0][\SYSTEM\DBD\system_api::FIELD_NAME].'_'.\strtolower($com[1]);}
|
||||||
|
}
|
||||||
|
$call_funcname = substr($call_funcname, 1); //strip leading _
|
||||||
|
|
||||||
|
return $call_funcname;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static function do_func_params($parameters,$parameters_opt){
|
||||||
|
$call_funcparam = array();
|
||||||
|
foreach($parameters as $param){
|
||||||
|
$call_funcparam[] = $param[1];}
|
||||||
|
|
||||||
|
//Optional Function Parameters
|
||||||
|
foreach($parameters_opt as $param){
|
||||||
|
$call_funcparam[] = $param[1];}
|
||||||
|
|
||||||
|
return $call_funcparam;
|
||||||
|
}
|
||||||
|
}
|
||||||
24
system/api/api_default.php
Normal file
24
system/api/api_default.php
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace SYSTEM\API;
|
||||||
|
|
||||||
|
abstract class api_default {
|
||||||
|
//https://developers.google.com/webmasters/ajax-crawling/docs/getting-started
|
||||||
|
//mojotrollz.eu:80/web/flingit/?_escaped_fragment_=start%3Bhash.ce5504f67533ab3d881a32e1dcdd330aaeb27f19
|
||||||
|
public static function static__escaped_fragment_($_escaped_fragment_){
|
||||||
|
$state = \SYSTEM\PAGE\State::get(1, $_escaped_fragment_,false);
|
||||||
|
$result = '';
|
||||||
|
foreach($state as $row){
|
||||||
|
parse_str(\parse_url($row['url'],PHP_URL_QUERY), $params);
|
||||||
|
$result .= \SYSTEM\API\api::run('\SYSTEM\API\verify', static::get_class(), $params, 1, true, true)->html();
|
||||||
|
}
|
||||||
|
echo $result;//echo (new \default_page())->html();
|
||||||
|
die();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function get_class(){
|
||||||
|
return self::class;}
|
||||||
|
|
||||||
|
public static function default_page(){
|
||||||
|
throw new \RuntimeException("Unimplemented");}
|
||||||
|
}
|
||||||
30
system/api/api_login.php
Normal file
30
system/api/api_login.php
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace SYSTEM\API;
|
||||||
|
|
||||||
|
class api_login {
|
||||||
|
/*
|
||||||
|
INSERT INTO `system_api_calls` (`ID`, `Flag`, `ParentID`, `ParentValue`, `Name`, `AllowedValues`) VALUES (0, 0, -1, NULL, 'call', NULL);
|
||||||
|
INSERT INTO `system_api_calls` (`ID`, `Flag`, `ParentID`, `ParentValue`, `Name`, `AllowedValues`) VALUES (60, 0, 0, 'account', 'action', NULL);
|
||||||
|
|
||||||
|
INSERT INTO `system_api_calls` (`ID`, `Flag`, `ParentID`, `ParentValue`, `Name`, `AllowedValues`) VALUES (61,1,60,'login','username','USERNAME');
|
||||||
|
INSERT INTO `system_api_calls` (`ID`, `Flag`, `ParentID`, `ParentValue`, `Name`, `AllowedValues`) VALUES (62,1,60,'login','password_sha','PASSHASH');
|
||||||
|
INSERT INTO `system_api_calls` (`ID`, `Flag`, `ParentID`, `ParentValue`, `Name`, `AllowedValues`) VALUES (63,1,60,'login','password_md5','PASSHASH');
|
||||||
|
INSERT INTO `system_api_calls` (`ID`, `Flag`, `ParentID`, `ParentValue`, `Name`, `AllowedValues`) VALUES (64,1,60,'check','rightid','UINT');
|
||||||
|
INSERT INTO `system_api_calls` (`ID`, `Flag`, `ParentID`, `ParentValue`, `Name`, `AllowedValues`) VALUES (65,1,60,'create','username','USERNAME');
|
||||||
|
INSERT INTO `system_api_calls` (`ID`, `Flag`, `ParentID`, `ParentValue`, `Name`, `AllowedValues`) VALUES (66,1,60,'create','password_sha','PASSHASH');
|
||||||
|
INSERT INTO `system_api_calls` (`ID`, `Flag`, `ParentID`, `ParentValue`, `Name`, `AllowedValues`) VALUES (67,1,60,'create','email','EMAIL');
|
||||||
|
INSERT INTO `system_api_calls` (`ID`, `Flag`, `ParentID`, `ParentValue`, `Name`, `AllowedValues`) VALUES (68,1,60,'create','locale','LANG');
|
||||||
|
*/
|
||||||
|
|
||||||
|
public static function call_account_action_login($username, $password_sha, $password_md5){
|
||||||
|
return \SYSTEM\SECURITY\Security::login($username, $password_sha, $password_md5);}
|
||||||
|
public static function call_account_action_logout(){
|
||||||
|
return \SYSTEM\SECURITY\Security::logout();}
|
||||||
|
public static function call_account_action_isloggedin(){
|
||||||
|
return \SYSTEM\SECURITY\Security::isLoggedIn();}
|
||||||
|
public static function call_account_action_check($rightid){
|
||||||
|
return \SYSTEM\SECURITY\Security::check($rightid);}
|
||||||
|
public static function call_account_action_create($username, $password_sha, $email, $locale){
|
||||||
|
return \SYSTEM\SECURITY\Security::create($username, $password_sha, $email, $locale);}
|
||||||
|
}
|
||||||
22
system/api/api_system.php
Normal file
22
system/api/api_system.php
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace SYSTEM\API;
|
||||||
|
|
||||||
|
class api_system extends api_login{
|
||||||
|
public static function call_cron(){
|
||||||
|
return \SYSTEM\CRON\cron::run();}
|
||||||
|
|
||||||
|
public static function call_text($request,$lang){
|
||||||
|
return \SYSTEM\LOG\JsonResult::toString(\SYSTEM\locale::getStrings($request, $lang));}
|
||||||
|
|
||||||
|
public static function call_files($cat,$id = null){
|
||||||
|
return \SYSTEM\FILES\files::get($cat, $id, true);}
|
||||||
|
|
||||||
|
public static function call_pages($group,$state){
|
||||||
|
return \SYSTEM\PAGE\State::get($group,$state);}
|
||||||
|
|
||||||
|
public static function static__lang($lang){
|
||||||
|
\SYSTEM\locale::set($lang);}
|
||||||
|
public static function static__result($result){
|
||||||
|
\SYSTEM\CONFIG\config::set(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_DEFAULT_RESULT, $result);}
|
||||||
|
}
|
||||||
2
system/api/autoload.inc.php
Normal file
2
system/api/autoload.inc.php
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
<?php
|
||||||
|
\SYSTEM\autoload::registerFolder(dirname(__FILE__),'SYSTEM\API');
|
||||||
20
system/api/verify.php
Normal file
20
system/api/verify.php
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace SYSTEM\API;
|
||||||
|
|
||||||
|
class verify {
|
||||||
|
public static function ALL ($param) {return true;}
|
||||||
|
public static function UINT ($param) {return \is_numeric($param) ? ((int)$param > 0 ? true : false) : false;}
|
||||||
|
public static function UINT0 ($param) {return \is_numeric($param) ? ((int)$param >= 0 ? true : false) : false;}
|
||||||
|
public static function INT ($param) {return \is_numeric($param);}
|
||||||
|
public static function TIMEUNIX ($param) {return \is_numeric($param) ? ((int)$param > 0 ? true : false) : false;}
|
||||||
|
public static function DATE ($param) {return \strtotime($param);}
|
||||||
|
public static function STRING ($param) {return \is_string($param);}
|
||||||
|
public static function BOOL ($param) {return \is_bool($param) || $param == '0' || $param == '1';}
|
||||||
|
public static function FLOAT ($param) {return \is_float(\floatval($param));}
|
||||||
|
public static function JSON ($param) {return (self::ARY($param) || \json_decode(\stripslashes($param))) ? true : false;} //ary cuz when sent via direct json, all json is alrdy converted to an array.
|
||||||
|
public static function ARY ($param) {return \is_array($param);}
|
||||||
|
public static function LANG ($param) {return \SYSTEM\locale::isLang($param);}
|
||||||
|
public static function RESULT ($param) {return ($param == 'json' || $param == 'msgpack');}
|
||||||
|
|
||||||
|
};
|
||||||
23
system/autoload.inc.php
Normal file
23
system/autoload.inc.php
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
<?php
|
||||||
|
//include autoload class
|
||||||
|
require_once dirname(__FILE__).'/system/path.php';
|
||||||
|
require_once dirname(__FILE__).'/system/autoload.php';
|
||||||
|
|
||||||
|
//Register autoload
|
||||||
|
\SYSTEM\autoload::register_autoload();
|
||||||
|
|
||||||
|
//Autoload submodules
|
||||||
|
require_once dirname(__FILE__).'/system/autoload.inc.php';
|
||||||
|
require_once dirname(__FILE__).'/log/autoload.inc.php';
|
||||||
|
require_once dirname(__FILE__).'/api/autoload.inc.php';
|
||||||
|
require_once dirname(__FILE__).'/page/autoload.inc.php';
|
||||||
|
require_once dirname(__FILE__).'/dbd/autoload.inc.php';
|
||||||
|
require_once dirname(__FILE__).'/db/autoload.inc.php';
|
||||||
|
require_once dirname(__FILE__).'/security/autoload.inc.php';
|
||||||
|
require_once dirname(__FILE__).'/config/autoload.inc.php';
|
||||||
|
require_once dirname(__FILE__).'/cache/autoload.inc.php';
|
||||||
|
require_once dirname(__FILE__).'/docu/autoload.inc.php';
|
||||||
|
require_once dirname(__FILE__).'/files/autoload.inc.php';
|
||||||
|
require_once dirname(__FILE__).'/cron/autoload.inc.php';
|
||||||
|
require_once dirname(__FILE__).'/sai/autoload.inc.php';
|
||||||
|
require_once dirname(__FILE__).'/lib/autoload.inc.php';
|
||||||
2
system/cache/autoload.inc.php
vendored
Normal file
2
system/cache/autoload.inc.php
vendored
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
<?php
|
||||||
|
\SYSTEM\autoload::registerFolder(dirname(__FILE__),'SYSTEM\CACHE');
|
||||||
30
system/cache/cache.php
vendored
Normal file
30
system/cache/cache.php
vendored
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace SYSTEM\CACHE;
|
||||||
|
|
||||||
|
class cache {
|
||||||
|
|
||||||
|
public static function get($cache_id, $ident){
|
||||||
|
$result = \SYSTEM\DBD\SYS_CACHE_CHECK::Q1(array($cache_id,$ident));
|
||||||
|
if(!$result){
|
||||||
|
return NULL;}
|
||||||
|
|
||||||
|
return pg_unescape_bytea($result['data']);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function put($cache_id, $ident, $data, $fail_on_exist = false){
|
||||||
|
if((self::get($cache_id,$ident) != NULL)){
|
||||||
|
if($fail_on_exist){
|
||||||
|
return false;}
|
||||||
|
self::del($cache_id, $ident);
|
||||||
|
}
|
||||||
|
|
||||||
|
$result = \SYSTEM\DBD\SYS_CACHE_PUT::Q1(array($cache_id,$ident, pg_escape_bytea($data)));
|
||||||
|
return $result ? $data : NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function del($cache_id, $ident){
|
||||||
|
$result = \SYSTEM\DBD\SYS_CACHE_DELETE::Q1(array($cache_id,$ident));
|
||||||
|
return $result ? true : false;
|
||||||
|
}
|
||||||
|
}
|
||||||
2
system/config/autoload.inc.php
Normal file
2
system/config/autoload.inc.php
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
<?php
|
||||||
|
\SYSTEM\autoload::registerFolder(dirname(__FILE__),'SYSTEM\CONFIG');
|
||||||
28
system/config/config.php
Normal file
28
system/config/config.php
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace SYSTEM\CONFIG;
|
||||||
|
|
||||||
|
class config {
|
||||||
|
private static $config;
|
||||||
|
|
||||||
|
public static function get($config_id){
|
||||||
|
if( !isset(self::$config) ||
|
||||||
|
!is_array(self::$config) ||
|
||||||
|
!array_key_exists($config_id, self::$config)){
|
||||||
|
return NULL;}
|
||||||
|
return self::$config[$config_id];
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function set($config_id, $value){
|
||||||
|
if( !isset(self::$config) ||
|
||||||
|
!is_array(self::$config)){
|
||||||
|
self::$config = array();}
|
||||||
|
|
||||||
|
self::$config[$config_id] = $value;
|
||||||
|
}
|
||||||
|
|
||||||
|
//array( array(ID, VALUE), array(ID, VALUE))
|
||||||
|
public static function setArray($id_value_array){
|
||||||
|
foreach($id_value_array as $v){
|
||||||
|
self::set($v[0], $v[1]);}}
|
||||||
|
}
|
||||||
33
system/config/config_ids.php
Normal file
33
system/config/config_ids.php
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace SYSTEM\CONFIG;
|
||||||
|
|
||||||
|
class config_ids {
|
||||||
|
|
||||||
|
const SYS_CONFIG_ERRORREPORTING = 1;
|
||||||
|
const SYS_CONFIG_PATH_BASEURL = 2;
|
||||||
|
const SYS_CONFIG_PATH_BASEPATH = 3;
|
||||||
|
const SYS_CONFIG_PATH_SYSTEMPATHREL = 4;
|
||||||
|
const SYS_CONFIG_DEFAULT_RESULT = 5;
|
||||||
|
const SYS_CONFIG_DEFAULT_RESULT_JSON = 'json';
|
||||||
|
const SYS_CONFIG_DEFAULT_RESULT_MSGPACK = 'msgpack';
|
||||||
|
|
||||||
|
const SYS_CONFIG_DB_TYPE = 11;
|
||||||
|
const SYS_CONFIG_DB_TYPE_MYS = 'mysql';
|
||||||
|
const SYS_CONFIG_DB_TYPE_PG = 'postgresql';
|
||||||
|
const SYS_CONFIG_DB_HOST = 12;
|
||||||
|
const SYS_CONFIG_DB_PORT = 13;
|
||||||
|
const SYS_CONFIG_DB_USER = 14;
|
||||||
|
const SYS_CONFIG_DB_PASSWORD = 15;
|
||||||
|
const SYS_CONFIG_DB_DBNAME = 16;
|
||||||
|
|
||||||
|
const SYS_CONFIG_LANGS = 21;
|
||||||
|
const SYS_CONFIG_DEFAULT_LANG = 22;
|
||||||
|
|
||||||
|
const SYS_CRON_LOG2SQLITE_PATH = 30;
|
||||||
|
|
||||||
|
const SYS_SAI_CONFIG_BASEURL = 50;
|
||||||
|
const SYS_SAI_CONFIG_NAVIMG = 51;
|
||||||
|
const SYS_SAI_CONFIG_TITLE = 52;
|
||||||
|
const SYS_SAI_CONFIG_COPYRIGHT = 53;
|
||||||
|
}
|
||||||
2
system/cron/autoload.inc.php
Normal file
2
system/cron/autoload.inc.php
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
<?php
|
||||||
|
\SYSTEM\autoload::registerFolder(dirname(__FILE__),'SYSTEM\CRON');
|
||||||
58
system/cron/cron.php
Normal file
58
system/cron/cron.php
Normal file
@ -0,0 +1,58 @@
|
|||||||
|
<?php
|
||||||
|
namespace SYSTEM\CRON;
|
||||||
|
|
||||||
|
class cron {
|
||||||
|
public static function check($class){
|
||||||
|
if( !\class_exists($class) ||
|
||||||
|
!\is_array($parents = \class_parents($class)) ||
|
||||||
|
!\array_search('SYSTEM\CRON\cronjob', $parents)){
|
||||||
|
return false;}
|
||||||
|
return true;}
|
||||||
|
|
||||||
|
public static function run(){
|
||||||
|
$crons = \SYSTEM\DBD\SYS_CRON_LIST::QQ();
|
||||||
|
while($cron = $crons->next()){
|
||||||
|
//check module
|
||||||
|
if(!self::check($cron[\SYSTEM\DBD\system_cron::FIELD_CLASS])){
|
||||||
|
self::status($cron[\SYSTEM\DBD\system_cron::FIELD_CLASS], \SYSTEM\CRON\cronstatus::CRON_STATUS_FAIL_CLASS);
|
||||||
|
continue;}
|
||||||
|
//time to execute?
|
||||||
|
if(!\SYSTEM\CRON\crontime::check_now( strtotime($cron[\SYSTEM\DBD\system_cron::FIELD_LAST_RUN]),
|
||||||
|
$cron[\SYSTEM\DBD\system_cron::FIELD_MIN],
|
||||||
|
$cron[\SYSTEM\DBD\system_cron::FIELD_HOUR],
|
||||||
|
$cron[\SYSTEM\DBD\system_cron::FIELD_DAY],
|
||||||
|
$cron[\SYSTEM\DBD\system_cron::FIELD_DAY_WEEK],
|
||||||
|
$cron[\SYSTEM\DBD\system_cron::FIELD_MONTH])){
|
||||||
|
continue;}
|
||||||
|
//Status is ok?
|
||||||
|
if($cron[\SYSTEM\DBD\system_cron::FIELD_STATUS] != \SYSTEM\CRON\cronstatus::CRON_STATUS_SUCCESFULLY){
|
||||||
|
new \SYSTEM\LOG\CRON('Cron for Class '.$cron[\SYSTEM\DBD\system_cron::FIELD_CLASS].' could not execute cuz Status aint good: '. \SYSTEM\CRON\cronstatus::text($cron[\SYSTEM\DBD\system_cron::FIELD_STATUS]));
|
||||||
|
continue;}
|
||||||
|
//set running
|
||||||
|
self::status($cron[\SYSTEM\DBD\system_cron::FIELD_CLASS], \SYSTEM\CRON\cronstatus::CRON_STATUS_RUNNING);
|
||||||
|
self::status($cron[\SYSTEM\DBD\system_cron::FIELD_CLASS], call_user_func(array($cron[\SYSTEM\DBD\system_cron::FIELD_CLASS],'run')));
|
||||||
|
}
|
||||||
|
return \SYSTEM\LOG\JsonResult::ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function next($class){
|
||||||
|
$cron = \SYSTEM\DBD\SYS_CRON_GET::Q1(array($class));
|
||||||
|
//check module
|
||||||
|
if(!self::check($cron[\SYSTEM\DBD\system_cron::FIELD_CLASS])){
|
||||||
|
throw new \SYSTEM\LOG\ERROR("Given class is not a cronjob");}
|
||||||
|
//time
|
||||||
|
return \SYSTEM\CRON\crontime::next( strtotime($cron[\SYSTEM\DBD\system_cron::FIELD_LAST_RUN]),
|
||||||
|
$cron[\SYSTEM\DBD\system_cron::FIELD_MIN],
|
||||||
|
$cron[\SYSTEM\DBD\system_cron::FIELD_HOUR],
|
||||||
|
$cron[\SYSTEM\DBD\system_cron::FIELD_DAY],
|
||||||
|
$cron[\SYSTEM\DBD\system_cron::FIELD_DAY_WEEK],
|
||||||
|
$cron[\SYSTEM\DBD\system_cron::FIELD_MONTH]);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static function status($class, $status){
|
||||||
|
new \SYSTEM\LOG\CRON('Cron Status for Class '.$class.' updated to: '. \SYSTEM\CRON\cronstatus::text($status));
|
||||||
|
return \SYSTEM\DBD\SYS_CRON_UPD::QI(array($status,time(),$class));}
|
||||||
|
|
||||||
|
public static function last_visit(){
|
||||||
|
return \SYSTEM\DBD\SYS_CRON_LAST_VISIT::Q1()['time'];}
|
||||||
|
}
|
||||||
70
system/cron/cron_log2sqlite.php
Normal file
70
system/cron/cron_log2sqlite.php
Normal file
@ -0,0 +1,70 @@
|
|||||||
|
<?php
|
||||||
|
namespace SYSTEM\CRON;
|
||||||
|
class cron_log2sqlite extends \SYSTEM\CRON\cronjob{
|
||||||
|
public static function run(){
|
||||||
|
//find oldest value
|
||||||
|
$oldest = \SYSTEM\DBD\SYS_LOG_OLDEST::Q1();
|
||||||
|
list( $now_month, $now_year ) = preg_split( "/ /", date("m Y"));
|
||||||
|
//All fine -> abort
|
||||||
|
if( $oldest['year'] >= $now_year &&
|
||||||
|
$oldest['month'] >= $now_month){
|
||||||
|
return cronstatus::CRON_STATUS_SUCCESFULLY;}
|
||||||
|
|
||||||
|
$filename = \SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_CRON_LOG2SQLITE_PATH).$oldest['year'].'.'.$oldest['month'].'.db';
|
||||||
|
//extract whole month to file
|
||||||
|
$con = new \SYSTEM\DB\Connection(new \SYSTEM\DB\DBInfoSQLite($filename));
|
||||||
|
|
||||||
|
//create table
|
||||||
|
$con->query('CREATE TABLE IF NOT EXISTS `system_log` ('.
|
||||||
|
' `ID` INT(10) NOT NULL,'.
|
||||||
|
' `class` TEXT NOT NULL,'.
|
||||||
|
' `message` TEXT NOT NULL,'.
|
||||||
|
' `code` INT(11) NOT NULL,'.
|
||||||
|
' `file` TEXT NOT NULL,'.
|
||||||
|
' `line` INT(11) NOT NULL,'.
|
||||||
|
' `trace` TEXT NOT NULL,'.
|
||||||
|
' `ip` TEXT NOT NULL,'.
|
||||||
|
' `querytime` DOUBLE NOT NULL,'.
|
||||||
|
' `time` DATETIME NOT NULL,'.
|
||||||
|
' `server_name` CHAR(255) NOT NULL,'.
|
||||||
|
' `server_port` INT(10) NOT NULL,'.
|
||||||
|
' `request_uri` CHAR(255) NOT NULL,'.
|
||||||
|
' `post` TEXT NOT NULL,'.
|
||||||
|
' `http_referer` CHAR(255) NULL DEFAULT NULL,'.
|
||||||
|
' `http_user_agent` TEXT NOT NULL,'.
|
||||||
|
' `user` INT(11) NULL DEFAULT NULL,'.
|
||||||
|
' `thrown` BIT(1) NOT NULL,'.
|
||||||
|
' PRIMARY KEY (`ID`)'.');');
|
||||||
|
|
||||||
|
//write data as trasaction
|
||||||
|
$con->exec('begin transaction');
|
||||||
|
$res = \SYSTEM\DBD\SYS_LOG_MONTH::QQ(array($oldest['month'],$oldest['year']));
|
||||||
|
$i = 0;
|
||||||
|
while($row = $res->next()){
|
||||||
|
set_time_limit(30);
|
||||||
|
$i++;
|
||||||
|
if(!$con->exec('INSERT OR IGNORE INTO '.\SYSTEM\DBD\system_log::NAME_MYS.
|
||||||
|
'(`ID`, `class`, `message`, `code`, `file`, `line`, `trace`, `ip`, `querytime`, `time`,'.
|
||||||
|
' `server_name`, `server_port`, `request_uri`, `post`,'.
|
||||||
|
' `http_referer`, `http_user_agent`, `user`, `thrown`)'.
|
||||||
|
'VALUES ('.$row['ID'].', \''.\SQLite3::escapeString($row['class']).'\', \''.\SQLite3::escapeString($row['message']).'\', '.
|
||||||
|
$row['code'].', \''.\SQLite3::escapeString($row['file']).'\', '.$row['line'].', \''.\SQLite3::escapeString($row['trace']).'\', \''.
|
||||||
|
$row['ip'].'\', '.$row['querytime'].', \''.$row['time'].'\', \''.
|
||||||
|
\SQLite3::escapeString($row['server_name']).'\', '.$row['server_port'].', \''.\SQLite3::escapeString($row['request_uri']).'\', \''.\SQLite3::escapeString($row['post']).'\', \''.
|
||||||
|
\SQLite3::escapeString($row['http_referer']).'\', \''.\SQLite3::escapeString($row['http_user_agent']).'\', '.$row['user'].','.true.');')){
|
||||||
|
new \SYSTEM\LOG\ERROR('failed to insert into log archiev');
|
||||||
|
return cronstatus::CRON_STATUS_FAIL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(!$con->exec('end transaction')){
|
||||||
|
new \SYSTEM\LOG\ERROR('failed to insert into log archiev');
|
||||||
|
return cronstatus::CRON_STATUS_FAIL;};
|
||||||
|
|
||||||
|
//delete from database
|
||||||
|
if(!\SYSTEM\DBD\SYS_LOG_MONTH_DEL::QI(array($oldest['month'],$oldest['year']))){
|
||||||
|
new \SYSTEM\LOG\ERROR('failed to delete log entries');
|
||||||
|
return cronstatus::CRON_STATUS_FAIL;}
|
||||||
|
|
||||||
|
return cronstatus::CRON_STATUS_SUCCESFULLY;
|
||||||
|
}
|
||||||
|
}
|
||||||
6
system/cron/cronjob.php
Normal file
6
system/cron/cronjob.php
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
<?php
|
||||||
|
namespace SYSTEM\CRON;
|
||||||
|
class cronjob{
|
||||||
|
public static function run(){
|
||||||
|
new \RuntimeException("Unimplemented!");}
|
||||||
|
}
|
||||||
29
system/cron/cronstatus.php
Normal file
29
system/cron/cronstatus.php
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
<?php
|
||||||
|
namespace SYSTEM\CRON;
|
||||||
|
|
||||||
|
class cronstatus {
|
||||||
|
const CRON_STATUS_SUCCESFULLY = 0;
|
||||||
|
const CRON_STATUS_RUNNING = 1;
|
||||||
|
const CRON_STATUS_FAIL = 2;
|
||||||
|
const CRON_STATUS_FAIL_CLASS = 3;
|
||||||
|
|
||||||
|
const CRON_STATUS_USER_STATES = 99;
|
||||||
|
|
||||||
|
public static function text($status){
|
||||||
|
switch($status){
|
||||||
|
case self::CRON_STATUS_SUCCESFULLY:
|
||||||
|
$status = 'SUCCESFULLY';
|
||||||
|
break;
|
||||||
|
case self::CRON_STATUS_RUNNING:
|
||||||
|
$status = 'RUNNING';
|
||||||
|
break;
|
||||||
|
case self::CRON_STATUS_FAIL:
|
||||||
|
$status = 'FAIL';
|
||||||
|
break;
|
||||||
|
case self::CRON_STATUS_FAIL_CLASS:
|
||||||
|
$status = 'FAIL_CLASS';
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return $status;
|
||||||
|
}
|
||||||
|
}
|
||||||
58
system/cron/crontime.php
Normal file
58
system/cron/crontime.php
Normal file
@ -0,0 +1,58 @@
|
|||||||
|
<?php
|
||||||
|
namespace SYSTEM\CRON;
|
||||||
|
class crontime {
|
||||||
|
public static function next($base_time,$min,$hour,$day,$day_week,$month){
|
||||||
|
list( $now_min, $now_hour, $now_day, $now_month, $now_day_week ) = preg_split( "/ /", date("i H d n N", $base_time ) );
|
||||||
|
list( $next_min, $next_hour, $next_day, $next_month, $next_year) = preg_split( "/ /", date("i H d n Y", $base_time ) );
|
||||||
|
if($month){
|
||||||
|
if(($month + $now_month)> 12){ $next_year += 1;}
|
||||||
|
$next_month = ($now_month+$month)%12;}
|
||||||
|
if($day){
|
||||||
|
if($day + $now_day> 31){ $next_month += 1;}
|
||||||
|
$next_day = ($now_day+$day)%31;}
|
||||||
|
if($hour){
|
||||||
|
if(($hour + $now_hour)>= 24){ $next_day += 1;}
|
||||||
|
$next_hour = ($now_hour+$hour)%24;}
|
||||||
|
if($min){
|
||||||
|
if(($min + $now_min)> 60){ $next_hour += 1;}
|
||||||
|
$next_min = ($now_min+$min)%60;}
|
||||||
|
if($day_week){
|
||||||
|
$day_week = $day_week % 6; // 7 and 0 both mean Sunday
|
||||||
|
$now_day_week = $now_day_week % 6; // 7 and 0 both mean Sunday
|
||||||
|
$next_day += abs($day_week - $now_day_week);}
|
||||||
|
//new \SYSTEM\LOG\INFO(print_r(array($base_time,$min,$hour,$day,$day_week,$month),true));
|
||||||
|
//new \SYSTEM\LOG\INFO(print_r(array($now_min, $now_hour, $now_day, $now_month, $now_day_week),true));
|
||||||
|
//new \SYSTEM\LOG\INFO(print_r(array($next_hour, $next_min, 0, $next_month, $next_day, $next_year),true));
|
||||||
|
return mktime($next_hour, $next_min, 0, $next_month, $next_day, $next_year);
|
||||||
|
}
|
||||||
|
public static function last($base_time,$min,$hour,$day,$day_week,$month){
|
||||||
|
list( $now_min, $now_hour, $now_day, $now_month, $now_day_week ) = preg_split( "/ /", date("i H d n N", $base_time ) );
|
||||||
|
list( $last_min, $last_hour, $last_day, $last_month, $last_year) = preg_split( "/ /", date("i H d n Y", $base_time ) );
|
||||||
|
if($month){
|
||||||
|
if(($now_month - $month)< 12){ $last_year -= 1;}
|
||||||
|
$last_month = ($now_month-$month)%12;}
|
||||||
|
if($day){
|
||||||
|
if(($now_day - $day)> 31){ $last_month -= 1;}
|
||||||
|
$last_day = ($now_day-$day)%31;}
|
||||||
|
if($hour){
|
||||||
|
if(($now_hour - $hour)> 24){ $last_day -= 1;}
|
||||||
|
$last_hour = ($now_hour-$hour)%24;}
|
||||||
|
if($min){
|
||||||
|
if(($now_min - $min)> 60){ $last_hour -= 1;}
|
||||||
|
$last_min = ($now_min-$min)%60;}
|
||||||
|
if($day_week){
|
||||||
|
$day_week = $day_week % 6; // 7 and 0 both mean Sunday
|
||||||
|
$now_day_week = $now_day_week % 6; // 7 and 0 both mean Sunday
|
||||||
|
$last_day -= abs($day_week - $now_day_week);}
|
||||||
|
return mktime($last_hour, $last_min, 0, $last_month, $last_day, $last_year);
|
||||||
|
}
|
||||||
|
public static function check($base_time,$last_run,$min,$hour,$day,$day_week,$month){
|
||||||
|
//new \SYSTEM\LOG\INFO('next:'.self::next($last_run, $min, $hour, $day, $day_week, $month).' bt:'.$base_time.' last:'.$last_run.' dif:'.(self::next($last_run, $min, $hour, $day, $day_week, $month) - time($base_time)).' run:'.(self::next($last_run, $min, $hour, $day, $day_week, $month) <= time($base_time) ? 'run' : 'not run'));
|
||||||
|
return self::next($last_run, $min, $hour, $day, $day_week, $month) <= $base_time ? true : false;}
|
||||||
|
public static function next_now($min,$hour,$day,$day_week,$month){
|
||||||
|
return self::next(time(),$min,$hour,$day,$day_week,$month);}
|
||||||
|
public static function last_now($min,$hour,$day,$day_week,$month){
|
||||||
|
return self::last(time(),$min,$hour,$day,$day_week,$month);}
|
||||||
|
public static function check_now($last_run,$min,$hour,$day,$day_week,$month){
|
||||||
|
return self::check(time(),$last_run,$min,$hour,$day,$day_week,$month);}
|
||||||
|
}
|
||||||
6
system/db/autoload.inc.php
Normal file
6
system/db/autoload.inc.php
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
<?php
|
||||||
|
\SYSTEM\autoload::registerFolder(dirname(__FILE__),'SYSTEM\DB');
|
||||||
|
\SYSTEM\autoload::registerFolder(dirname(__FILE__).'/dbinfo','SYSTEM\DB');
|
||||||
|
\SYSTEM\autoload::registerFolder(dirname(__FILE__).'/connection','SYSTEM\DB');
|
||||||
|
\SYSTEM\autoload::registerFolder(dirname(__FILE__).'/result','SYSTEM\DB');
|
||||||
|
\SYSTEM\autoload::registerFolder(dirname(__FILE__).'/qq','SYSTEM\DB');
|
||||||
47
system/db/connection/Connection.php
Normal file
47
system/db/connection/Connection.php
Normal file
@ -0,0 +1,47 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace SYSTEM\DB;
|
||||||
|
|
||||||
|
class Connection extends ConnectionAbstr{
|
||||||
|
|
||||||
|
//The open Connection, either ConnectionPG or ConnectionMYS
|
||||||
|
private $connection = NULL;
|
||||||
|
//private $dbinfo = NULL;
|
||||||
|
|
||||||
|
//Connects to DB, dependent on DBInfo a connection to a PG or MYS will be established
|
||||||
|
public function __construct(DBInfo $dbinfo = null){
|
||||||
|
//$this->dbinfo = $dbinfo;
|
||||||
|
if(!$dbinfo){
|
||||||
|
$dbinfo = \SYSTEM\system::getSystemDBInfo();}
|
||||||
|
|
||||||
|
if($dbinfo instanceof \SYSTEM\DB\DBInfoPG){
|
||||||
|
$this->connection = new \SYSTEM\DB\ConnectionPG($dbinfo);
|
||||||
|
} else if ($dbinfo instanceof \SYSTEM\DB\DBInfoMYS){
|
||||||
|
$this->connection = new \SYSTEM\DB\ConnectionMYS($dbinfo);
|
||||||
|
} else if ($dbinfo instanceof \SYSTEM\DB\DBInfoAMQP){
|
||||||
|
$this->connection = new \SYSTEM\DB\ConnectionAMQP($dbinfo);
|
||||||
|
} else if ($dbinfo instanceof \SYSTEM\DB\DBInfoSQLite){
|
||||||
|
$this->connection = new \SYSTEM\DB\ConnectionSQLite($dbinfo);
|
||||||
|
} else {
|
||||||
|
throw new \Exception('Could not understand Database Settings. Check ur Database Settings');}
|
||||||
|
}
|
||||||
|
|
||||||
|
//Destruct connection object.
|
||||||
|
public function __destruct(){
|
||||||
|
unset($this->connection);}
|
||||||
|
|
||||||
|
//Query connected Database with prepared statements, $stmt = sql string with ?; $values = array of values
|
||||||
|
public function prepare($stmtName, $stmt, $values){
|
||||||
|
return $this->connection->prepare($stmtName, $stmt, $values);}
|
||||||
|
|
||||||
|
//Close Connection
|
||||||
|
public function close(){
|
||||||
|
return $this->connection->close();}
|
||||||
|
|
||||||
|
//Query connected Database
|
||||||
|
public function query($query){
|
||||||
|
return $this->connection->query($query);}
|
||||||
|
|
||||||
|
public function exec($query){
|
||||||
|
return $this->connection->exec($query);}
|
||||||
|
}
|
||||||
66
system/db/connection/ConnectionAMQP.php
Normal file
66
system/db/connection/ConnectionAMQP.php
Normal file
@ -0,0 +1,66 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace SYSTEM\DB;
|
||||||
|
|
||||||
|
class ConnectionAMQP extends ConnectionAbstr {
|
||||||
|
|
||||||
|
private $connection = NULL;
|
||||||
|
|
||||||
|
public function __construct(DBInfo $dbinfo){
|
||||||
|
$this->connection = new \AMQPConnection(
|
||||||
|
array(
|
||||||
|
'host' => $dbinfo->m_host,
|
||||||
|
'vhost' => $dbinfo->m_database,
|
||||||
|
'port' => $dbinfo->m_port,
|
||||||
|
'login' => $dbinfo->m_user,
|
||||||
|
'password' => $dbinfo->m_password
|
||||||
|
));
|
||||||
|
|
||||||
|
$this->connection->connect();
|
||||||
|
|
||||||
|
if(!$this->connection || !$this->connection->isConnected()){
|
||||||
|
throw new \SYSTEM\LOG\ERROR('Cannot connect to the amqp queue!');}
|
||||||
|
}
|
||||||
|
|
||||||
|
public function send($msg){
|
||||||
|
$channel = new \AMQPChannel($this->connection);
|
||||||
|
$exchange = new \AMQPExchange($channel);
|
||||||
|
$exchange->setFlags(AMQP_DURABLE);
|
||||||
|
$exchange->setName('exchange2');
|
||||||
|
$exchange->setType('direct');
|
||||||
|
//$exchange->declare();
|
||||||
|
$exchange->declareExchange();
|
||||||
|
|
||||||
|
$queue = new \AMQPQueue($channel);
|
||||||
|
$queue->setName('series');
|
||||||
|
$queue->setFlags(AMQP_DURABLE | AMQP_AUTODELETE);
|
||||||
|
//$queue->declare();
|
||||||
|
$queue->declareQueue();
|
||||||
|
$queue->bind('exchange2','series');
|
||||||
|
|
||||||
|
$channel->startTransaction();
|
||||||
|
$message = $exchange->publish(json_encode($msg), 'series', AMQP_MANDATORY,
|
||||||
|
array('content_type' => 'application/json',
|
||||||
|
'delivery_mode' => 2));
|
||||||
|
$channel->commitTransaction();
|
||||||
|
|
||||||
|
if(!$message) {
|
||||||
|
throw new \SYSTEM\LOG\ERROR("Error: Message '".$message."' was not sent to queue.!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public function __destruct(){
|
||||||
|
$this->close();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function close(){
|
||||||
|
if (!$this->connection->disconnect()) {
|
||||||
|
throw new Exception("Could not disconnect !");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public function query($query){ }
|
||||||
|
|
||||||
|
public function prepare($stmtName, $stmt, $values){}
|
||||||
|
|
||||||
|
}
|
||||||
28
system/db/connection/ConnectionAbstr.php
Normal file
28
system/db/connection/ConnectionAbstr.php
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace SYSTEM\DB;
|
||||||
|
|
||||||
|
abstract class ConnectionAbstr {
|
||||||
|
//Connects to Database with given DBInfos
|
||||||
|
abstract public function __construct(DBInfo $dbinfo);
|
||||||
|
//Close Connection to Database
|
||||||
|
abstract public function __destruct();
|
||||||
|
//Close Connection to Database
|
||||||
|
abstract public function close();
|
||||||
|
//Query Database with prepared Statement with $stmtName = name of the stament(pg only) $stmt = string and $values = array()
|
||||||
|
abstract public function prepare($stmtName, $stmt, $values);
|
||||||
|
//Query Database with normal Statement with $query = SQLString
|
||||||
|
abstract public function query($query);
|
||||||
|
|
||||||
|
//Convert Prepared Values to SQL Type identifiers
|
||||||
|
protected static function getPrepareValueType($value){
|
||||||
|
if(is_double($value)){
|
||||||
|
return 'd';}
|
||||||
|
if(is_integer($value)){
|
||||||
|
return 'i';}
|
||||||
|
if(is_string($value)){
|
||||||
|
return 's';}
|
||||||
|
//blob
|
||||||
|
return 'b';
|
||||||
|
}
|
||||||
|
}
|
||||||
56
system/db/connection/ConnectionMYS.php
Normal file
56
system/db/connection/ConnectionMYS.php
Normal file
@ -0,0 +1,56 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace SYSTEM\DB;
|
||||||
|
|
||||||
|
class ConnectionMYS extends ConnectionAbstr {
|
||||||
|
private $connection = NULL;
|
||||||
|
//private $dbinfo = NULL;
|
||||||
|
|
||||||
|
public function __construct(DBInfo $dbinfo, $new_link = false, $client_flag = 0){
|
||||||
|
//$this->dbinfo = $dbinfo;
|
||||||
|
|
||||||
|
$this->connection = @mysqli_connect($dbinfo->m_host, $dbinfo->m_user, $dbinfo->m_password, $new_link, $client_flag);
|
||||||
|
if(!$this->connection){
|
||||||
|
throw new \Exception('Could not connect to Database. Check ur Database Settings');}
|
||||||
|
|
||||||
|
if(!mysqli_select_db($this->connection, $dbinfo->m_database)){
|
||||||
|
mysqli_close($this->connection);
|
||||||
|
throw new \Exception('Could not select Database. Check ur Database Settings: '.mysqli_error($this->connection));}
|
||||||
|
}
|
||||||
|
|
||||||
|
public function __destruct(){
|
||||||
|
$this->close();}
|
||||||
|
|
||||||
|
public function prepare($stmtName, $stmt, $values){
|
||||||
|
$prepStmt = \mysqli_prepare($this->connection, $stmt);
|
||||||
|
if(!$prepStmt){
|
||||||
|
throw new \SYSTEM\LOG\ERROR('Prepared Statement prepare fail: '. \mysqli_error($this->connection));}
|
||||||
|
|
||||||
|
$types = '';
|
||||||
|
$binds = array($prepStmt,null);
|
||||||
|
for($i =0; $i < \count($values);$i++){
|
||||||
|
$types .= self::getPrepareValueType($values[$i]);
|
||||||
|
$binds[] = &$values[$i];}
|
||||||
|
$binds[1] = $types;
|
||||||
|
\call_user_func_array('mysqli_stmt_bind_param', $binds); //you need 2 append the parameters - thats the right way to do that.
|
||||||
|
|
||||||
|
if(!mysqli_stmt_execute($prepStmt)){
|
||||||
|
throw new \SYSTEM\LOG\ERROR("Could not execute prepare statement: ". \mysqli_stmt_error($prepStmt));}
|
||||||
|
|
||||||
|
return new ResultMysqliPrepare($prepStmt,$this);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function close(){
|
||||||
|
return mysqli_close($this->connection);}
|
||||||
|
|
||||||
|
public function query($query){
|
||||||
|
$result = mysqli_query($this->connection, $query);
|
||||||
|
if(!$result){
|
||||||
|
throw new \SYSTEM\LOG\ERROR('Could not query Database. Check ur Query Syntax or required Rights: '.mysqli_error($this->connection));}
|
||||||
|
|
||||||
|
if($result === TRUE){
|
||||||
|
return TRUE;}
|
||||||
|
|
||||||
|
return new ResultMysqli($result);
|
||||||
|
}
|
||||||
|
}
|
||||||
61
system/db/connection/ConnectionPG.php
Normal file
61
system/db/connection/ConnectionPG.php
Normal file
@ -0,0 +1,61 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace SYSTEM\DB;
|
||||||
|
|
||||||
|
class ConnectionPG extends ConnectionAbstr {
|
||||||
|
|
||||||
|
private $connection = NULL;
|
||||||
|
//private $dbinfo = NULL;
|
||||||
|
|
||||||
|
public function __construct(DBInfo $dbinfo){
|
||||||
|
//$this->dbinfo = $dbinfo;
|
||||||
|
|
||||||
|
$this->connection = pg_connect("host=".$dbinfo->m_host." port=".$dbinfo->m_port." dbname=".$dbinfo->m_database."
|
||||||
|
user=".$dbinfo->m_user." password=".$dbinfo->m_password."");
|
||||||
|
if(!$this->connection){
|
||||||
|
throw new \Exception('Could not connect to Database. Check ur Database Settings');}
|
||||||
|
}
|
||||||
|
|
||||||
|
public function __destruct(){}
|
||||||
|
|
||||||
|
public function prepare($stmtName, $stmt, $values){
|
||||||
|
$result = pg_query_params($this->connection, 'SELECT name FROM pg_prepared_statements WHERE name = $1', array($stmtName));
|
||||||
|
//var_dump($stmt);
|
||||||
|
//var_dump($values);
|
||||||
|
if (pg_num_rows($result) == 0) {
|
||||||
|
$result = \pg_prepare($this->connection, $stmtName, $stmt);
|
||||||
|
if(($info = \pg_last_notice($this->connection)) != ''){
|
||||||
|
new \SYSTEM\LOG\INFO($info);}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!$result)
|
||||||
|
throw new \SYSTEM\LOG\ERROR('Prepared Statement prepare fail: '. \pg_last_error($this->connection));
|
||||||
|
|
||||||
|
$result = \pg_execute($this->connection, $stmtName, $values);
|
||||||
|
if(($info = \pg_last_notice($this->connection)) != ''){
|
||||||
|
new \SYSTEM\LOG\INFO($info);}
|
||||||
|
|
||||||
|
if(!$result)
|
||||||
|
throw new \SYSTEM\LOG\ERROR("Could not execute prepare statement: ". \pg_last_error($this->connection));
|
||||||
|
|
||||||
|
return new ResultPostgres($result,$this);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function close(){
|
||||||
|
return pg_close($this->connection);}
|
||||||
|
|
||||||
|
public function query($query){
|
||||||
|
$result = \pg_query($this->connection, $query);
|
||||||
|
if(($info = \pg_last_notice($this->connection)) != ''){
|
||||||
|
new \SYSTEM\LOG\INFO($info);}
|
||||||
|
|
||||||
|
if(!$result){
|
||||||
|
throw new \SYSTEM\LOG\ERROR('Could not query Database. Check ur Query Syntax or required Rights: '.pg_last_error($this->connection));}
|
||||||
|
|
||||||
|
if($result === TRUE){
|
||||||
|
return TRUE;}
|
||||||
|
|
||||||
|
return new ResultPostgres($result,$this);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
48
system/db/connection/ConnectionSQLite.php
Normal file
48
system/db/connection/ConnectionSQLite.php
Normal file
@ -0,0 +1,48 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace SYSTEM\DB;
|
||||||
|
|
||||||
|
class ConnectionSQLite extends ConnectionAbstr {
|
||||||
|
private $connection = NULL;
|
||||||
|
|
||||||
|
public function __construct(DBInfo $dbinfo, $new_link = false, $client_flag = 0){
|
||||||
|
$error = null;
|
||||||
|
$this->connection = new \SQLite3($dbinfo->m_database);
|
||||||
|
if(!$this->connection){
|
||||||
|
throw new \Exception('Could not connect to Database. Check ur Database Settings: '.$error);}
|
||||||
|
}
|
||||||
|
|
||||||
|
public function __destruct(){
|
||||||
|
$this->close();}
|
||||||
|
|
||||||
|
public function prepare($stmtName, $stmt, $values){
|
||||||
|
$prepStmt = $this->connection->prepare($stmt);
|
||||||
|
if(!$prepStmt){
|
||||||
|
throw new \SYSTEM\LOG\ERROR('Prepared Statement prepare fail: '. $error);}
|
||||||
|
|
||||||
|
foreach($values as $key=>$val){
|
||||||
|
$prepStmt->bindParam($key,$val);}
|
||||||
|
|
||||||
|
if(!($result = $prepStmt->execute())){
|
||||||
|
throw new \SYSTEM\LOG\ERROR("Could not execute prepare statement: ". $error);}
|
||||||
|
|
||||||
|
return new ResultSQLite($result,$prepStmt);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function close(){
|
||||||
|
return $this->connection->close();}
|
||||||
|
|
||||||
|
public function query($query){
|
||||||
|
$result = $this->connection->query($query);
|
||||||
|
if(!$result){
|
||||||
|
throw new \SYSTEM\LOG\ERROR('Could not query Database. Check ur Query Syntax or required Rights: '.$this->connection->lastErrorMsg());}
|
||||||
|
if($result === TRUE){
|
||||||
|
return TRUE;}
|
||||||
|
|
||||||
|
return new ResultSQLite($result,null);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function exec($query){
|
||||||
|
return $this->connection->exec($query);
|
||||||
|
}
|
||||||
|
}
|
||||||
13
system/db/dbinfo/DBInfo.php
Normal file
13
system/db/dbinfo/DBInfo.php
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace SYSTEM\DB;
|
||||||
|
|
||||||
|
abstract class DBInfo {
|
||||||
|
public $m_database = null;
|
||||||
|
public $m_user = null;
|
||||||
|
public $m_password = null;
|
||||||
|
public $m_host = null;
|
||||||
|
public $m_port = null;
|
||||||
|
|
||||||
|
abstract public function __construct($database , $user , $password, $host, $port = null);
|
||||||
|
}
|
||||||
19
system/db/dbinfo/DBInfoAMQP.php
Normal file
19
system/db/dbinfo/DBInfoAMQP.php
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
<?php
|
||||||
|
namespace SYSTEM\DB;
|
||||||
|
|
||||||
|
class DBInfoAMQP extends \SYSTEM\DB\DBInfo {
|
||||||
|
|
||||||
|
public function __construct($vhost , $user , $password, $host, $port = null){
|
||||||
|
$this->m_database = $vhost;
|
||||||
|
$this->m_user = $user;
|
||||||
|
$this->m_password = $password;
|
||||||
|
$this->m_host = $host;
|
||||||
|
$this->m_port = $port;
|
||||||
|
|
||||||
|
if( $this->m_database == null ||
|
||||||
|
$this->m_user == null ||
|
||||||
|
$this->m_password == null ||
|
||||||
|
$this->m_host == null){
|
||||||
|
throw new \Exception("AMQP Connection Info not correct, vhost, user, password or host are null");}
|
||||||
|
}
|
||||||
|
}
|
||||||
19
system/db/dbinfo/DBInfoMYS.php
Normal file
19
system/db/dbinfo/DBInfoMYS.php
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
<?php
|
||||||
|
namespace SYSTEM\DB;
|
||||||
|
|
||||||
|
class DBInfoMYS extends \SYSTEM\DB\DBInfo {
|
||||||
|
|
||||||
|
public function __construct($database , $user , $password, $host, $port = null){
|
||||||
|
$this->m_database = $database;
|
||||||
|
$this->m_user = $user;
|
||||||
|
$this->m_password = $password;
|
||||||
|
$this->m_host = $host;
|
||||||
|
$this->m_port = $port;
|
||||||
|
|
||||||
|
if( $this->m_database == null ||
|
||||||
|
$this->m_user == null ||
|
||||||
|
$this->m_password == null ||
|
||||||
|
$this->m_host == null){
|
||||||
|
throw new \Exception("DBInfo not correct, database, user, password or host are null");}
|
||||||
|
}
|
||||||
|
}
|
||||||
19
system/db/dbinfo/DBInfoPG.php
Normal file
19
system/db/dbinfo/DBInfoPG.php
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
<?php
|
||||||
|
namespace SYSTEM\DB;
|
||||||
|
|
||||||
|
class DBInfoPG extends \SYSTEM\DB\DBInfo {
|
||||||
|
|
||||||
|
public function __construct($database , $user , $password, $host, $port = null){
|
||||||
|
$this->m_database = $database;
|
||||||
|
$this->m_user = $user;
|
||||||
|
$this->m_password = $password;
|
||||||
|
$this->m_host = $host;
|
||||||
|
$this->m_port = $port;
|
||||||
|
|
||||||
|
if( $this->m_database == null ||
|
||||||
|
$this->m_user == null ||
|
||||||
|
$this->m_password == null ||
|
||||||
|
$this->m_host == null){
|
||||||
|
throw new \Exception("DBInfo not correct, database, user, password or host are null");}
|
||||||
|
}
|
||||||
|
}
|
||||||
15
system/db/dbinfo/DBInfoSQLite.php
Normal file
15
system/db/dbinfo/DBInfoSQLite.php
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
<?php
|
||||||
|
namespace SYSTEM\DB;
|
||||||
|
|
||||||
|
class DBInfoSQLite extends \SYSTEM\DB\DBInfo {
|
||||||
|
public function __construct($database , $user = null , $password = null, $host = null, $port = null){
|
||||||
|
$this->m_database = $database;
|
||||||
|
$this->m_user = $user;
|
||||||
|
$this->m_password = $password;
|
||||||
|
$this->m_host = $host;
|
||||||
|
$this->m_port = $port;
|
||||||
|
|
||||||
|
if( $this->m_database == null){
|
||||||
|
throw new \Exception("DBInfo not correct, database, permissions are null");}
|
||||||
|
}
|
||||||
|
}
|
||||||
35
system/db/qq/QP.php
Normal file
35
system/db/qq/QP.php
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
<?php
|
||||||
|
namespace SYSTEM\DB;
|
||||||
|
|
||||||
|
class QP {
|
||||||
|
public static function QQ($params,$params_mys = null){
|
||||||
|
$query = static::query();
|
||||||
|
$con = new \SYSTEM\DB\Connection($query->dbinfo);
|
||||||
|
$is_pg = \SYSTEM\system::isSystemDbInfoPG();
|
||||||
|
if($query->dbinfo){
|
||||||
|
$is_pg = $query->dbinfo instanceof \SYSTEM\DB\DBInfoPG;}
|
||||||
|
if($is_pg){
|
||||||
|
return $con->prepare($query->name,$query->sql_pg,$params);
|
||||||
|
} else {
|
||||||
|
return $con->prepare($query->name,$query->sql_mys,$params_mys ? $params_mys : $params);}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function QA($params,$params_mys = null){
|
||||||
|
$res = self::QQ($params,$params_mys);
|
||||||
|
$result = array();
|
||||||
|
while($row = $res->next()){
|
||||||
|
$result[] = $row;}
|
||||||
|
return $result;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function Q1($params,$params_mys = null){
|
||||||
|
return self::QQ($params,$params_mys)->next();}
|
||||||
|
|
||||||
|
public static function QI($params,$params_mys = null){
|
||||||
|
$qq = self::QQ($params,$params_mys);
|
||||||
|
return $qq->affectedRows() != (0||null);}
|
||||||
|
//override this
|
||||||
|
protected static function query(){
|
||||||
|
throw new \SYSTEM\LOG\ERROR('query function of your QP Class not overwritten!');}
|
||||||
|
//return new QQuery();}
|
||||||
|
}
|
||||||
34
system/db/qq/QQ.php
Normal file
34
system/db/qq/QQ.php
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
<?php
|
||||||
|
namespace SYSTEM\DB;
|
||||||
|
|
||||||
|
class QQ {
|
||||||
|
public static function QQ(){
|
||||||
|
$query = static::query();
|
||||||
|
$con = new \SYSTEM\DB\Connection($query->dbinfo);
|
||||||
|
$is_pg = \SYSTEM\system::isSystemDbInfoPG();
|
||||||
|
if($query->dbinfo){
|
||||||
|
$is_pg = $query->dbinfo instanceof \SYSTEM\DB\DBInfoPG;}
|
||||||
|
if($is_pg){
|
||||||
|
return $con->query($query->sql_pg);
|
||||||
|
} else {
|
||||||
|
return $con->query($query->sql_mys);}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function QA(){
|
||||||
|
$res = self::QQ();
|
||||||
|
$result = array();
|
||||||
|
while($row = $res->next()){
|
||||||
|
$result[] = $row;}
|
||||||
|
return $result;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function Q1(){
|
||||||
|
return self::QQ()->next();}
|
||||||
|
public static function QI(){
|
||||||
|
$qq = self::QQ();
|
||||||
|
return $qq;}
|
||||||
|
//override this
|
||||||
|
protected static function query(){
|
||||||
|
throw new \SYSTEM\LOG\ERROR('query function of your QQ Class not overwritten!');}
|
||||||
|
//return new QQuery();}
|
||||||
|
}
|
||||||
16
system/db/qq/QQuery.php
Normal file
16
system/db/qq/QQuery.php
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
<?php
|
||||||
|
namespace SYSTEM\DB;
|
||||||
|
|
||||||
|
class QQuery{
|
||||||
|
public $name = null;
|
||||||
|
public $sql_pg = null;
|
||||||
|
public $sql_mys = null;
|
||||||
|
public $dbinfo = null;
|
||||||
|
|
||||||
|
public function __construct($name,$sql_pg=null,$sql_mys=null,$dbinfo = null){
|
||||||
|
$this->name = $name;
|
||||||
|
$this->sql_pg = $sql_pg;
|
||||||
|
$this->sql_mys = $sql_mys;
|
||||||
|
$this->dbinfo = $dbinfo;
|
||||||
|
}
|
||||||
|
}
|
||||||
16
system/db/result/Result.php
Normal file
16
system/db/result/Result.php
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace SYSTEM\DB;
|
||||||
|
|
||||||
|
abstract class Result {
|
||||||
|
|
||||||
|
public abstract function count();
|
||||||
|
|
||||||
|
public abstract function affectedRows();
|
||||||
|
|
||||||
|
public abstract function next($object = false, $result_type = MYSQL_BOTH);
|
||||||
|
|
||||||
|
public abstract function seek($row_number);
|
||||||
|
|
||||||
|
public abstract function close();
|
||||||
|
}
|
||||||
37
system/db/result/ResultAMQP.php
Normal file
37
system/db/result/ResultAMQP.php
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace SYSTEM\DB;
|
||||||
|
|
||||||
|
class ResultAMQP extends \SYSTEM\DB\Result{ // < maybe not ? check if amqpchannel is compatible with dbresult.
|
||||||
|
|
||||||
|
private $res = NULL;
|
||||||
|
private $current = NULL;
|
||||||
|
|
||||||
|
//Result from mysql_query
|
||||||
|
public function __construct($res){
|
||||||
|
$this->res = $res;}
|
||||||
|
|
||||||
|
public function __destruct(){
|
||||||
|
$this->close();}
|
||||||
|
|
||||||
|
public function close(){
|
||||||
|
pg_free_result($this->res);}
|
||||||
|
|
||||||
|
public function count(){
|
||||||
|
return pg_num_rows($this->res);}
|
||||||
|
|
||||||
|
public function affectedRows(){
|
||||||
|
throw new \SYSTEM\LOG\ERROR("Not Supported!");}
|
||||||
|
|
||||||
|
public function next($object = false, $result_type = MYSQL_BOTH){
|
||||||
|
if($object){
|
||||||
|
$this->current = pg_fetch_object($this->res);
|
||||||
|
} else {
|
||||||
|
$this->current = pg_fetch_assoc($this->res);
|
||||||
|
}
|
||||||
|
return $this->current;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function seek($row_number){
|
||||||
|
return pg_data_seek($this->res,$row_number);}
|
||||||
|
}
|
||||||
37
system/db/result/ResultMysqli.php
Normal file
37
system/db/result/ResultMysqli.php
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace SYSTEM\DB;
|
||||||
|
|
||||||
|
class ResultMysqli extends \SYSTEM\DB\Result{
|
||||||
|
|
||||||
|
private $res = NULL;
|
||||||
|
private $current = NULL;
|
||||||
|
|
||||||
|
//Result from mysql_query
|
||||||
|
public function __construct($res){
|
||||||
|
$this->res = $res;}
|
||||||
|
|
||||||
|
public function __destruct(){
|
||||||
|
$this->close();}
|
||||||
|
|
||||||
|
public function close(){
|
||||||
|
mysqli_free_result($this->res);}
|
||||||
|
|
||||||
|
public function count(){
|
||||||
|
return mysqli_num_rows($this->res);}
|
||||||
|
|
||||||
|
public function affectedRows(){
|
||||||
|
return mysqli_affected_rows($this->res);}
|
||||||
|
|
||||||
|
public function next($object = false, $result_type = MYSQL_BOTH){
|
||||||
|
if($object){
|
||||||
|
$this->current = mysqli_fetch_object($this->res);
|
||||||
|
} else {
|
||||||
|
$this->current = mysqli_fetch_assoc($this->res);
|
||||||
|
}
|
||||||
|
return $this->current;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function seek($row_number){
|
||||||
|
return mysqli_data_seek($this->res,$row_number);}
|
||||||
|
}
|
||||||
58
system/db/result/ResultMysqliPrepare.php
Normal file
58
system/db/result/ResultMysqliPrepare.php
Normal file
@ -0,0 +1,58 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace SYSTEM\DB;
|
||||||
|
|
||||||
|
class ResultMysqliPrepare extends \SYSTEM\DB\Result{
|
||||||
|
|
||||||
|
private $res = NULL;
|
||||||
|
private $meta = NULL;
|
||||||
|
private $binds = array();
|
||||||
|
private $connection = NULL;
|
||||||
|
|
||||||
|
//Result from mysql_query
|
||||||
|
public function __construct($res,$connection){
|
||||||
|
$this->res = $res;
|
||||||
|
$this->connection = $connection;
|
||||||
|
|
||||||
|
$this->meta = \mysqli_stmt_result_metadata($this->res);
|
||||||
|
|
||||||
|
if(!$this->meta){
|
||||||
|
//occurs on insert
|
||||||
|
//throw new \Exception("Could not retrieve meta for prepare statement");}
|
||||||
|
return;}
|
||||||
|
|
||||||
|
while ($field = $this->meta->fetch_field() ) {
|
||||||
|
$this->binds[$field->table.'.'.$field->name] = &$this->binds[$field->table.'.'.$field->name];} //fix for ambiguous fieldnames
|
||||||
|
|
||||||
|
\mysqli_free_result($this->meta);
|
||||||
|
|
||||||
|
call_user_func_array(array($this->res, 'bind_result'), $this->binds); //you need 2 append the parameters - thats the right way to do that.
|
||||||
|
}
|
||||||
|
|
||||||
|
public function __destruct() {
|
||||||
|
$this->close();}
|
||||||
|
|
||||||
|
public function close(){
|
||||||
|
mysqli_stmt_free_result($this->res);
|
||||||
|
mysqli_stmt_close($this->res);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function count(){
|
||||||
|
return \mysqli_stmt_num_rows($this->res);}
|
||||||
|
|
||||||
|
public function affectedRows(){
|
||||||
|
return \mysqli_stmt_affected_rows($this->res);}
|
||||||
|
|
||||||
|
//$object not used
|
||||||
|
//$result_type not used!
|
||||||
|
public function next($object = false, $result_type = MYSQL_BOTH){
|
||||||
|
if(\mysqli_stmt_fetch($this->res)){
|
||||||
|
foreach( $this->binds as $key=>$value ){
|
||||||
|
$row[substr($key, strpos($key, '.')+1)] = $value;} //fix for ambiguous fieldnames
|
||||||
|
return $row;}
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function seek($row_number){
|
||||||
|
return \mysqli_stmt_data_seek($this->res,$row_number);}
|
||||||
|
}
|
||||||
39
system/db/result/ResultPostgres.php
Normal file
39
system/db/result/ResultPostgres.php
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace SYSTEM\DB;
|
||||||
|
|
||||||
|
class ResultPostgres extends \SYSTEM\DB\Result{
|
||||||
|
|
||||||
|
private $res = NULL;
|
||||||
|
private $current = NULL;
|
||||||
|
private $connection = NULL;
|
||||||
|
|
||||||
|
//Result from mysql_query
|
||||||
|
public function __construct($res,$connection){
|
||||||
|
$this->res = $res;
|
||||||
|
$this->connection = $connection;}
|
||||||
|
|
||||||
|
public function __destruct(){
|
||||||
|
$this->close();}
|
||||||
|
|
||||||
|
public function close(){
|
||||||
|
pg_free_result($this->res);}
|
||||||
|
|
||||||
|
public function count(){
|
||||||
|
return pg_num_rows($this->res);}
|
||||||
|
|
||||||
|
public function affectedRows(){
|
||||||
|
return pg_affected_rows($this->res);}
|
||||||
|
|
||||||
|
public function next($object = false, $result_type = MYSQL_BOTH){
|
||||||
|
if($object){
|
||||||
|
$this->current = pg_fetch_object($this->res);
|
||||||
|
} else {
|
||||||
|
$this->current = pg_fetch_assoc($this->res);
|
||||||
|
}
|
||||||
|
return $this->current;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function seek($row_number){
|
||||||
|
return pg_data_seek($this->res,$row_number);}
|
||||||
|
}
|
||||||
81
system/db/result/ResultSQLite.php
Normal file
81
system/db/result/ResultSQLite.php
Normal file
@ -0,0 +1,81 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace SYSTEM\DB;
|
||||||
|
|
||||||
|
class ResultSQLite extends \SYSTEM\DB\Result{
|
||||||
|
|
||||||
|
private $res = NULL;
|
||||||
|
private $stmt = NULL;
|
||||||
|
private $current = NULL;
|
||||||
|
|
||||||
|
//Result from mysql_query
|
||||||
|
public function __construct($res,$stmt){
|
||||||
|
$this->res = $res;
|
||||||
|
$this->stmt = $stmt;}
|
||||||
|
|
||||||
|
public function __destruct(){
|
||||||
|
$this->close();}
|
||||||
|
|
||||||
|
public function close(){
|
||||||
|
if($this->stmt){
|
||||||
|
$this->stmt->close();}
|
||||||
|
}
|
||||||
|
|
||||||
|
public function count(){
|
||||||
|
throw new Exception("Problem SQLite");
|
||||||
|
return mysqli_num_rows($this->res);}
|
||||||
|
/*
|
||||||
|
* if ($res->numColumns() && $res->columnType(0) != SQLITE3_NULL) {
|
||||||
|
// have rows
|
||||||
|
} else {
|
||||||
|
// zero rows
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
|
public function affectedRows(){
|
||||||
|
throw new Exception("Problem SQLite");
|
||||||
|
return mysqli_affected_rows($this->res);}
|
||||||
|
|
||||||
|
public function next($object = false, $result_type = SQLITE3_ASSOC){
|
||||||
|
if($object){
|
||||||
|
throw new Exception("Problem SQLite");
|
||||||
|
} else {
|
||||||
|
$this->current = $this->res->fetchArray($result_type);
|
||||||
|
}
|
||||||
|
return $this->current;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* function fetchObject($sqlite3result, $objectType = NULL) {
|
||||||
|
$array = $sqlite3result->fetchArray();
|
||||||
|
|
||||||
|
if(is_null($objectType)) {
|
||||||
|
$object = new stdClass();
|
||||||
|
} else {
|
||||||
|
// does not call this class' constructor
|
||||||
|
$object = unserialize(sprintf('O:%d:"%s":0:{}', strlen($objectType), $objectType));
|
||||||
|
}
|
||||||
|
|
||||||
|
$reflector = new ReflectionObject($object);
|
||||||
|
for($i = 0; $i < $sqlite3result->numColumns(); $i++) {
|
||||||
|
$name = $sqlite3result->columnName($i);
|
||||||
|
$value = $array[$name];
|
||||||
|
|
||||||
|
try {
|
||||||
|
$attribute = $reflector->getProperty($name);
|
||||||
|
|
||||||
|
$attribute->setAccessible(TRUE);
|
||||||
|
$attribute->setValue($object, $value);
|
||||||
|
} catch (ReflectionException $e) {
|
||||||
|
$object->$name = $value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return $object;
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
|
public function seek($row_number){
|
||||||
|
throw new Exception("Problem SQLite");
|
||||||
|
return mysqli_data_seek($this->res,$row_number);}
|
||||||
|
}
|
||||||
3
system/dbd/autoload.inc.php
Normal file
3
system/dbd/autoload.inc.php
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
<?php
|
||||||
|
\SYSTEM\autoload::registerFolder(dirname(__FILE__).'/tbl','SYSTEM\DBD');
|
||||||
|
\SYSTEM\autoload::registerFolder(dirname(__FILE__).'/qq','SYSTEM\DBD');
|
||||||
15
system/dbd/qq/SYS_API_TREE.php
Normal file
15
system/dbd/qq/SYS_API_TREE.php
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
<?php
|
||||||
|
namespace SYSTEM\DBD;
|
||||||
|
|
||||||
|
class SYS_API_TREE extends \SYSTEM\DB\QP {
|
||||||
|
protected static function query(){
|
||||||
|
return new \SYSTEM\DB\QQuery(get_class(),
|
||||||
|
//pg
|
||||||
|
'SELECT * FROM '.\SYSTEM\DBD\system_api::NAME_PG
|
||||||
|
.' WHERE "'.\SYSTEM\DBD\system_api::FIELD_GROUP.'" = $1'
|
||||||
|
.' ORDER BY "'.\SYSTEM\DBD\system_api::FIELD_ID.'"',
|
||||||
|
//mys
|
||||||
|
'SELECT * FROM '.\SYSTEM\DBD\system_api::NAME_MYS
|
||||||
|
.' WHERE `'.\SYSTEM\DBD\system_api::FIELD_GROUP.'` = ?'
|
||||||
|
.' ORDER BY '.\SYSTEM\DBD\system_api::FIELD_ID
|
||||||
|
);}}
|
||||||
12
system/dbd/qq/SYS_CACHE_CHECK.php
Normal file
12
system/dbd/qq/SYS_CACHE_CHECK.php
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
<?php
|
||||||
|
namespace SYSTEM\DBD;
|
||||||
|
|
||||||
|
class SYS_CACHE_CHECK extends \SYSTEM\DB\QP {
|
||||||
|
protected static function query(){
|
||||||
|
return new \SYSTEM\DB\QQuery(get_class(),
|
||||||
|
//pg
|
||||||
|
'SELECT "data" FROM system.cache'.
|
||||||
|
' WHERE "CacheID" = $1 AND'.
|
||||||
|
' "Ident" = $2;'
|
||||||
|
//mys
|
||||||
|
);}}
|
||||||
12
system/dbd/qq/SYS_CACHE_DELETE.php
Normal file
12
system/dbd/qq/SYS_CACHE_DELETE.php
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
<?php
|
||||||
|
namespace SYSTEM\DBD;
|
||||||
|
|
||||||
|
class SYS_CACHE_DELETE extends \SYSTEM\DB\QP {
|
||||||
|
protected static function query(){
|
||||||
|
return new \SYSTEM\DB\QQuery(get_class(),
|
||||||
|
//pg
|
||||||
|
'DELETE FROM system.cache'.
|
||||||
|
' WHERE "CacheID" = $1 AND'.
|
||||||
|
' "Ident" = $2;'
|
||||||
|
//mys
|
||||||
|
);}}
|
||||||
11
system/dbd/qq/SYS_CACHE_PUT.php
Normal file
11
system/dbd/qq/SYS_CACHE_PUT.php
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
<?php
|
||||||
|
namespace SYSTEM\DBD;
|
||||||
|
|
||||||
|
class SYS_CACHE_PUT extends \SYSTEM\DB\QP {
|
||||||
|
protected static function query(){
|
||||||
|
return new \SYSTEM\DB\QQuery(get_class(),
|
||||||
|
//pg
|
||||||
|
'INSERT INTO system.cache ("CacheID", "Ident", "data")'.
|
||||||
|
' VALUES ($1,$2,$3);'
|
||||||
|
//mys
|
||||||
|
);}}
|
||||||
11
system/dbd/qq/SYS_CRON_GET.php
Normal file
11
system/dbd/qq/SYS_CRON_GET.php
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
<?php
|
||||||
|
namespace SYSTEM\DBD;
|
||||||
|
|
||||||
|
class SYS_CRON_GET extends \SYSTEM\DB\QP {
|
||||||
|
protected static function query(){
|
||||||
|
return new \SYSTEM\DB\QQuery(get_class(),
|
||||||
|
//pg
|
||||||
|
'SELECT * FROM '.\SYSTEM\DBD\system_cron::NAME_PG.' WHERE class = $1;',
|
||||||
|
//mys
|
||||||
|
'SELECT * FROM '.\SYSTEM\DBD\system_cron::NAME_MYS.' WHERE class = ?;'
|
||||||
|
);}}
|
||||||
11
system/dbd/qq/SYS_CRON_LAST_VISIT.php
Normal file
11
system/dbd/qq/SYS_CRON_LAST_VISIT.php
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
<?php
|
||||||
|
namespace SYSTEM\DBD;
|
||||||
|
|
||||||
|
class SYS_CRON_LAST_VISIT extends \SYSTEM\DB\QQ {
|
||||||
|
protected static function query(){
|
||||||
|
return new \SYSTEM\DB\QQuery(get_class(),
|
||||||
|
//pg
|
||||||
|
'SELECT time FROM '.\SYSTEM\DBD\system_log::NAME_PG.' WHERE class = \'SYSTEM\LOG\WARNING\' ORDER BY time DESC LIMIT 1;',
|
||||||
|
//mys
|
||||||
|
'SELECT time FROM '.\SYSTEM\DBD\system_log::NAME_MYS.' WHERE class = "SYSTEM\\\\LOG\\\\CRON" ORDER BY time DESC LIMIT 1'
|
||||||
|
);}}
|
||||||
11
system/dbd/qq/SYS_CRON_LIST.php
Normal file
11
system/dbd/qq/SYS_CRON_LIST.php
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
<?php
|
||||||
|
namespace SYSTEM\DBD;
|
||||||
|
|
||||||
|
class SYS_CRON_LIST extends \SYSTEM\DB\QQ {
|
||||||
|
protected static function query(){
|
||||||
|
return new \SYSTEM\DB\QQuery(get_class(),
|
||||||
|
//pg
|
||||||
|
'SELECT * FROM '.\SYSTEM\DBD\system_cron::NAME_PG.';',
|
||||||
|
//mys
|
||||||
|
'SELECT * FROM '.\SYSTEM\DBD\system_cron::NAME_MYS.';'
|
||||||
|
);}}
|
||||||
11
system/dbd/qq/SYS_CRON_UPD.php
Normal file
11
system/dbd/qq/SYS_CRON_UPD.php
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
<?php
|
||||||
|
namespace SYSTEM\DBD;
|
||||||
|
|
||||||
|
class SYS_CRON_UPD extends \SYSTEM\DB\QP {
|
||||||
|
protected static function query(){
|
||||||
|
return new \SYSTEM\DB\QQuery(get_class(),
|
||||||
|
//pg
|
||||||
|
'UPDATE '.\SYSTEM\DBD\system_cron::NAME_PG.' SET '.\SYSTEM\DBD\system_cron::FIELD_STATUS.' = $1,'.\SYSTEM\DBD\system_cron::FIELD_LAST_RUN.' = to_timestamp($2) WHERE '.\SYSTEM\DBD\system_cron::FIELD_CLASS.' = $3;',
|
||||||
|
//mys
|
||||||
|
'UPDATE '.\SYSTEM\DBD\system_cron::NAME_MYS.' SET '.\SYSTEM\DBD\system_cron::FIELD_STATUS.' = ?,'.\SYSTEM\DBD\system_cron::FIELD_LAST_RUN.' = FROM_UNIXTIME(?) WHERE '.\SYSTEM\DBD\system_cron::FIELD_CLASS.' = ?;'
|
||||||
|
);}}
|
||||||
15
system/dbd/qq/SYS_LOCALE_SET_LOCALE.php
Normal file
15
system/dbd/qq/SYS_LOCALE_SET_LOCALE.php
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
<?php
|
||||||
|
namespace SYSTEM\DBD;
|
||||||
|
|
||||||
|
class SYS_LOCALE_SET_LOCALE extends \SYSTEM\DB\QP {
|
||||||
|
protected static function query(){
|
||||||
|
return new \SYSTEM\DB\QQuery(get_class(),
|
||||||
|
//pg
|
||||||
|
'UPDATE '.\SYSTEM\DBD\system_user::NAME_PG.
|
||||||
|
' SET '.\SYSTEM\DBD\system_user::FIELD_LOCALE.' = $1'.
|
||||||
|
' WHERE '.\SYSTEM\DBD\system_user::FIELD_ID.' = $2;',
|
||||||
|
//mys
|
||||||
|
'UPDATE '.\SYSTEM\DBD\system_user::NAME_MYS.
|
||||||
|
' SET '.\SYSTEM\DBD\system_user::FIELD_LOCALE.' = ? '.
|
||||||
|
'WHERE '.\SYSTEM\DBD\system_user::FIELD_ID.' = ?;'
|
||||||
|
);}}
|
||||||
30
system/dbd/qq/SYS_LOG_INSERT.php
Normal file
30
system/dbd/qq/SYS_LOG_INSERT.php
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
<?php
|
||||||
|
namespace SYSTEM\DBD;
|
||||||
|
|
||||||
|
class SYS_LOG_INSERT extends \SYSTEM\DB\QP {
|
||||||
|
protected static function query(){
|
||||||
|
return new \SYSTEM\DB\QQuery(get_class(),
|
||||||
|
//pg
|
||||||
|
'INSERT INTO '.\SYSTEM\DBD\system_log::NAME_PG.
|
||||||
|
'("'.\SYSTEM\DBD\system_log::FIELD_CLASS.'","'.\SYSTEM\DBD\system_log::FIELD_MESSAGE.'","'.
|
||||||
|
\SYSTEM\DBD\system_log::FIELD_CODE.'","'.\SYSTEM\DBD\system_log::FIELD_FILE.'","'.
|
||||||
|
\SYSTEM\DBD\system_log::FIELD_LINE.'","'.\SYSTEM\DBD\system_log::FIELD_TRACE.'","'.
|
||||||
|
\SYSTEM\DBD\system_log::FIELD_IP.'","'.\SYSTEM\DBD\system_log::FIELD_QUERYTIME.'","'.
|
||||||
|
\SYSTEM\DBD\system_log::FIELD_SERVER_NAME.'","'.\SYSTEM\DBD\system_log::FIELD_SERVER_PORT.'","'.
|
||||||
|
\SYSTEM\DBD\system_log::FIELD_REQUEST_URI.'","'.\SYSTEM\DBD\system_log::FIELD_POST.'","'.
|
||||||
|
\SYSTEM\DBD\system_log::FIELD_HTTP_REFERER.'","'.\SYSTEM\DBD\system_log::FIELD_HTTP_USER_AGENT.'","'.
|
||||||
|
\SYSTEM\DBD\system_log::FIELD_USER.'","'.\SYSTEM\DBD\system_log::FIELD_THROWN.'")'.
|
||||||
|
'VALUES($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16);',
|
||||||
|
//mys
|
||||||
|
'INSERT INTO '.\SYSTEM\DBD\system_log::NAME_MYS.
|
||||||
|
'('.\SYSTEM\DBD\system_log::FIELD_CLASS.','.\SYSTEM\DBD\system_log::FIELD_MESSAGE.','.
|
||||||
|
\SYSTEM\DBD\system_log::FIELD_CODE.','.\SYSTEM\DBD\system_log::FIELD_FILE.','.
|
||||||
|
\SYSTEM\DBD\system_log::FIELD_LINE.','.\SYSTEM\DBD\system_log::FIELD_TRACE.','.
|
||||||
|
\SYSTEM\DBD\system_log::FIELD_IP.','.\SYSTEM\DBD\system_log::FIELD_QUERYTIME.','.
|
||||||
|
\SYSTEM\DBD\system_log::FIELD_TIME.','.\SYSTEM\DBD\system_log::FIELD_SERVER_NAME.','.
|
||||||
|
\SYSTEM\DBD\system_log::FIELD_SERVER_PORT.','.\SYSTEM\DBD\system_log::FIELD_REQUEST_URI.','.
|
||||||
|
\SYSTEM\DBD\system_log::FIELD_POST.','.\SYSTEM\DBD\system_log::FIELD_HTTP_REFERER.','.
|
||||||
|
\SYSTEM\DBD\system_log::FIELD_HTTP_USER_AGENT.','.\SYSTEM\DBD\system_log::FIELD_USER.','.
|
||||||
|
\SYSTEM\DBD\system_log::FIELD_THROWN.')'.
|
||||||
|
'VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?);'
|
||||||
|
);}}
|
||||||
11
system/dbd/qq/SYS_LOG_MONTH.php
Normal file
11
system/dbd/qq/SYS_LOG_MONTH.php
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
<?php
|
||||||
|
namespace SYSTEM\DBD;
|
||||||
|
|
||||||
|
class SYS_LOG_MONTH extends \SYSTEM\DB\QP {
|
||||||
|
protected static function query(){
|
||||||
|
return new \SYSTEM\DB\QQuery(get_class(),
|
||||||
|
//pg
|
||||||
|
'SELECT * FROM '.\SYSTEM\DBD\system_log::NAME_PG.' WHERE MONTH(time) = $1 AND YEAR(time) = $2 ORDER BY time ASC',
|
||||||
|
//mys
|
||||||
|
'SELECT * FROM '.\SYSTEM\DBD\system_log::NAME_MYS.' WHERE MONTH(time) = ? AND YEAR(time) = ? ORDER BY time ASC'
|
||||||
|
);}}
|
||||||
11
system/dbd/qq/SYS_LOG_MONTH_DEL.php
Normal file
11
system/dbd/qq/SYS_LOG_MONTH_DEL.php
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
<?php
|
||||||
|
namespace SYSTEM\DBD;
|
||||||
|
|
||||||
|
class SYS_LOG_MONTH_DEL extends \SYSTEM\DB\QP {
|
||||||
|
protected static function query(){
|
||||||
|
return new \SYSTEM\DB\QQuery(get_class(),
|
||||||
|
//pg
|
||||||
|
'DELETE FROM '.\SYSTEM\DBD\system_log::NAME_PG.' WHERE MONTH(time) = $1 AND YEAR(time) = $2;',
|
||||||
|
//mys
|
||||||
|
'DELETE FROM '.\SYSTEM\DBD\system_log::NAME_MYS.' WHERE MONTH(time) = ? AND YEAR(time) = ?;'
|
||||||
|
);}}
|
||||||
11
system/dbd/qq/SYS_LOG_OLDEST.php
Normal file
11
system/dbd/qq/SYS_LOG_OLDEST.php
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
<?php
|
||||||
|
namespace SYSTEM\DBD;
|
||||||
|
|
||||||
|
class SYS_LOG_OLDEST extends \SYSTEM\DB\QQ {
|
||||||
|
protected static function query(){
|
||||||
|
return new \SYSTEM\DB\QQuery(get_class(),
|
||||||
|
//pg
|
||||||
|
'SELECT MONTH(time) as month, YEAR(time) as year FROM '.\SYSTEM\DBD\system_log::NAME_PG.' ORDER BY time ASC LIMIT 1',
|
||||||
|
//mys
|
||||||
|
'SELECT MONTH(time) as month, YEAR(time) as year FROM '.\SYSTEM\DBD\system_log::NAME_MYS.' ORDER BY time ASC LIMIT 1'
|
||||||
|
);}}
|
||||||
17
system/dbd/qq/SYS_PAGE_GROUP.php
Normal file
17
system/dbd/qq/SYS_PAGE_GROUP.php
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
<?php
|
||||||
|
namespace SYSTEM\DBD;
|
||||||
|
|
||||||
|
class SYS_PAGE_GROUP extends \SYSTEM\DB\QP {
|
||||||
|
protected static function query(){
|
||||||
|
return new \SYSTEM\DB\QQuery(get_class(),
|
||||||
|
//pg
|
||||||
|
'SELECT * FROM '.\SYSTEM\DBD\system_page::NAME_PG
|
||||||
|
.' WHERE "'.\SYSTEM\DBD\system_page::FIELD_GROUP.'" = $1'
|
||||||
|
.' AND "'.\SYSTEM\DBD\system_page::FIELD_ID.'" = $2'
|
||||||
|
.' ORDER BY "'.\SYSTEM\DBD\system_page::FIELD_ID.'"',
|
||||||
|
//mys
|
||||||
|
'SELECT * FROM '.\SYSTEM\DBD\system_page::NAME_MYS
|
||||||
|
.' WHERE `'.\SYSTEM\DBD\system_page::FIELD_GROUP.'` = ?'
|
||||||
|
.' AND `'.\SYSTEM\DBD\system_page::FIELD_ID.'` = ?'
|
||||||
|
.' ORDER BY '.\SYSTEM\DBD\system_page::FIELD_ID
|
||||||
|
);}}
|
||||||
13
system/dbd/qq/SYS_SECURITY_AVAILABLE.php
Normal file
13
system/dbd/qq/SYS_SECURITY_AVAILABLE.php
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
<?php
|
||||||
|
namespace SYSTEM\DBD;
|
||||||
|
|
||||||
|
class SYS_SECURITY_AVAILABLE extends \SYSTEM\DB\QP {
|
||||||
|
protected static function query(){
|
||||||
|
return new \SYSTEM\DB\QQuery(get_class(),
|
||||||
|
//pg
|
||||||
|
'SELECT COUNT(*) as count FROM '.\SYSTEM\DBD\system_user::NAME_PG.
|
||||||
|
' WHERE lower('.\SYSTEM\DBD\system_user::FIELD_USERNAME.') like lower($1) ;',
|
||||||
|
//mys
|
||||||
|
'SELECT COUNT(*) as count FROM '.\SYSTEM\DBD\system_user::NAME_MYS.
|
||||||
|
' WHERE lower('.\SYSTEM\DBD\system_user::FIELD_USERNAME.') like lower(?) ;'
|
||||||
|
);}}
|
||||||
15
system/dbd/qq/SYS_SECURITY_CHECK.php
Normal file
15
system/dbd/qq/SYS_SECURITY_CHECK.php
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
<?php
|
||||||
|
namespace SYSTEM\DBD;
|
||||||
|
|
||||||
|
class SYS_SECURITY_CHECK extends \SYSTEM\DB\QP {
|
||||||
|
protected static function query(){
|
||||||
|
return new \SYSTEM\DB\QQuery(get_class(),
|
||||||
|
//pg
|
||||||
|
'SELECT COUNT(*) as count FROM '.\SYSTEM\DBD\UserRightsTable::NAME_PG.
|
||||||
|
' WHERE "'.\SYSTEM\DBD\UserRightsTable::FIELD_USERID.'" = $1'.
|
||||||
|
' AND "'.\SYSTEM\DBD\UserRightsTable::FIELD_RIGHTID.'" = $2;',
|
||||||
|
//mys
|
||||||
|
'SELECT COUNT(*) as count FROM '.\SYSTEM\DBD\UserRightsTable::NAME_MYS.
|
||||||
|
' WHERE '.\SYSTEM\DBD\UserRightsTable::FIELD_USERID.' = ?'.
|
||||||
|
' AND '.\SYSTEM\DBD\UserRightsTable::FIELD_RIGHTID.' = ?;'
|
||||||
|
);}}
|
||||||
17
system/dbd/qq/SYS_SECURITY_CREATE.php
Normal file
17
system/dbd/qq/SYS_SECURITY_CREATE.php
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
<?php
|
||||||
|
namespace SYSTEM\DBD;
|
||||||
|
|
||||||
|
class SYS_SECURITY_CREATE extends \SYSTEM\DB\QP {
|
||||||
|
protected static function query(){
|
||||||
|
return new \SYSTEM\DB\QQuery(get_class(),
|
||||||
|
//pg
|
||||||
|
'INSERT INTO '.\SYSTEM\DBD\system_user::NAME_PG.
|
||||||
|
' ('.\SYSTEM\DBD\system_user::FIELD_USERNAME.','.\SYSTEM\DBD\system_user::FIELD_PASSWORD_SHA.','
|
||||||
|
.\SYSTEM\DBD\system_user::FIELD_EMAIL.','.\SYSTEM\DBD\system_user::FIELD_LOCALE.','.\SYSTEM\DBD\system_user::FIELD_ACCOUNT_FLAG.')'.
|
||||||
|
' VALUES ($1, $2, $3, $4, $5);',
|
||||||
|
//mys
|
||||||
|
'INSERT INTO '.\SYSTEM\DBD\system_user::NAME_MYS.
|
||||||
|
' ('.\SYSTEM\DBD\system_user::FIELD_USERNAME.','.\SYSTEM\DBD\system_user::FIELD_PASSWORD_SHA.','
|
||||||
|
.\SYSTEM\DBD\system_user::FIELD_EMAIL.','.\SYSTEM\DBD\system_user::FIELD_LOCALE.','.\SYSTEM\DBD\system_user::FIELD_ACCOUNT_FLAG.')'.
|
||||||
|
' VALUES (?, ?, ?, ?, ?);'
|
||||||
|
);}}
|
||||||
15
system/dbd/qq/SYS_SECURITY_LOGIN_MD5.php
Normal file
15
system/dbd/qq/SYS_SECURITY_LOGIN_MD5.php
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
<?php
|
||||||
|
namespace SYSTEM\DBD;
|
||||||
|
|
||||||
|
class SYS_SECURITY_LOGIN_MD5 extends \SYSTEM\DB\QP {
|
||||||
|
protected static function query(){
|
||||||
|
return new \SYSTEM\DB\QQuery(get_class(),
|
||||||
|
//pg
|
||||||
|
'SELECT * FROM '.\SYSTEM\DBD\system_user::NAME_PG.
|
||||||
|
' WHERE (lower('.\SYSTEM\DBD\system_user::FIELD_USERNAME.') LIKE lower($1) OR lower('.\SYSTEM\DBD\system_user::FIELD_EMAIL.') LIKE lower($1))'.
|
||||||
|
' AND ('.\SYSTEM\DBD\system_user::FIELD_PASSWORD_SHA.' = $2 OR '.\SYSTEM\DBD\system_user::FIELD_PASSWORD_MD5.' = $3 );',
|
||||||
|
//mys
|
||||||
|
'SELECT * FROM '.\SYSTEM\DBD\system_user::NAME_MYS.
|
||||||
|
' WHERE (lower('.\SYSTEM\DBD\system_user::FIELD_USERNAME.') LIKE lower(?) OR lower('.\SYSTEM\DBD\system_user::FIELD_EMAIL.') LIKE lower(?))'.
|
||||||
|
' AND ('.\SYSTEM\DBD\system_user::FIELD_PASSWORD_SHA.' = ? OR '.\SYSTEM\DBD\system_user::FIELD_PASSWORD_MD5.' = ? );'
|
||||||
|
);}}
|
||||||
15
system/dbd/qq/SYS_SECURITY_LOGIN_SHA1.php
Normal file
15
system/dbd/qq/SYS_SECURITY_LOGIN_SHA1.php
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
<?php
|
||||||
|
namespace SYSTEM\DBD;
|
||||||
|
|
||||||
|
class SYS_SECURITY_LOGIN_SHA1 extends \SYSTEM\DB\QP {
|
||||||
|
protected static function query(){
|
||||||
|
return new \SYSTEM\DB\QQuery(get_class(),
|
||||||
|
//pg
|
||||||
|
'SELECT * FROM '.\SYSTEM\DBD\system_user::NAME_PG.
|
||||||
|
' WHERE (lower('.\SYSTEM\DBD\system_user::FIELD_USERNAME.') LIKE lower($1) OR lower('.\SYSTEM\DBD\system_user::FIELD_EMAIL.') LIKE lower($1))'.
|
||||||
|
' AND '.\SYSTEM\DBD\system_user::FIELD_PASSWORD_SHA.' = $2;',
|
||||||
|
//mys
|
||||||
|
'SELECT * FROM '.\SYSTEM\DBD\system_user::NAME_MYS.
|
||||||
|
' WHERE (lower('.\SYSTEM\DBD\system_user::FIELD_USERNAME.') LIKE lower(?) OR lower('.\SYSTEM\DBD\system_user::FIELD_EMAIL.') LIKE lower(?))'.
|
||||||
|
' AND '.\SYSTEM\DBD\system_user::FIELD_PASSWORD_SHA.' = ?;'
|
||||||
|
);}}
|
||||||
19
system/dbd/qq/SYS_SECURITY_UPDATE_LASTACTIVE.php
Normal file
19
system/dbd/qq/SYS_SECURITY_UPDATE_LASTACTIVE.php
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
<?php
|
||||||
|
namespace SYSTEM\DBD;
|
||||||
|
|
||||||
|
//using QI:
|
||||||
|
//this does not return true nessecary,
|
||||||
|
//since if called in a very short time twice
|
||||||
|
//the affected row count could be zero and therefore return false!
|
||||||
|
class SYS_SECURITY_UPDATE_LASTACTIVE extends \SYSTEM\DB\QP {
|
||||||
|
protected static function query(){
|
||||||
|
return new \SYSTEM\DB\QQuery(get_class(),
|
||||||
|
//pg
|
||||||
|
'UPDATE '.\SYSTEM\DBD\system_user::NAME_PG.
|
||||||
|
' SET '.\SYSTEM\DBD\system_user::FIELD_LAST_ACTIVE.' = NOW()'.
|
||||||
|
' WHERE '.\SYSTEM\DBD\system_user::FIELD_ID.' = $1;',
|
||||||
|
//mys
|
||||||
|
'UPDATE '.\SYSTEM\DBD\system_user::NAME_MYS.
|
||||||
|
' SET '.\SYSTEM\DBD\system_user::FIELD_LAST_ACTIVE.' = NOW()'.
|
||||||
|
' WHERE '.\SYSTEM\DBD\system_user::FIELD_ID.' = ?;'
|
||||||
|
);}}
|
||||||
15
system/dbd/qq/SYS_SECURITY_UPDATE_PW.php
Normal file
15
system/dbd/qq/SYS_SECURITY_UPDATE_PW.php
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
<?php
|
||||||
|
namespace SYSTEM\DBD;
|
||||||
|
|
||||||
|
class SYS_SECURITY_UPDATE_PW extends \SYSTEM\DB\QP {
|
||||||
|
protected static function query(){
|
||||||
|
return new \SYSTEM\DB\QQuery(get_class(),
|
||||||
|
//pg
|
||||||
|
'UPDATE '.\SYSTEM\DBD\system_user::NAME_PG.
|
||||||
|
' SET '.\SYSTEM\DBD\system_user::FIELD_PASSWORD_SHA.' = $1'.
|
||||||
|
' WHERE '.\SYSTEM\DBD\system_user::FIELD_ID.' = $2;',
|
||||||
|
//mys
|
||||||
|
'UPDATE '.\SYSTEM\DBD\system_user::NAME_MYS.
|
||||||
|
' SET '.\SYSTEM\DBD\system_user::FIELD_PASSWORD_SHA.' = ?'.
|
||||||
|
' WHERE '.\SYSTEM\DBD\system_user::FIELD_ID.' = ?;'
|
||||||
|
);}}
|
||||||
26
system/dbd/sql/mysql/data/basic_locale_string.sql
Normal file
26
system/dbd/sql/mysql/data/basic_locale_string.sql
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
DELETE FROM system_locale_string WHERE category = 1;
|
||||||
|
INSERT INTO `system_locale_string` (`id`, `category`, `enUS`, `deDE`) VALUES ('basic_logout', 1, 'Logout', 'Ausloggen');
|
||||||
|
INSERT INTO `system_locale_string` (`id`, `category`, `enUS`, `deDE`) VALUES ('basic_login', 1, 'Login', 'Einloggen');
|
||||||
|
INSERT INTO `system_locale_string` (`id`, `category`, `enUS`, `deDE`) VALUES ('basic_register', 1, 'Register', 'Registrieren');
|
||||||
|
INSERT INTO `system_locale_string` (`id`, `category`, `enUS`, `deDE`) VALUES ('basic_username', 1, 'Username', 'Username');
|
||||||
|
INSERT INTO `system_locale_string` (`id`, `category`, `enUS`, `deDE`) VALUES ('basic_password', 1, 'Password', 'Passwort');
|
||||||
|
INSERT INTO `system_locale_string` (`id`, `category`, `enUS`, `deDE`) VALUES ('basic_email', 1, 'EMail', 'E-Mail2');
|
||||||
|
INSERT INTO `system_locale_string` (`id`, `category`, `enUS`, `deDE`) VALUES ('basic_last_active', 1, 'Last active', 'Zuletzt aktiv');
|
||||||
|
INSERT INTO `system_locale_string` (`id`, `category`, `enUS`, `deDE`) VALUES ('basic_join_date', 1, 'Joindate', 'Beitrittsdatum');
|
||||||
|
INSERT INTO `system_locale_string` (`id`, `category`, `enUS`, `deDE`) VALUES ('basic_locale', 1, 'Locale', 'Sprache');
|
||||||
|
INSERT INTO `system_locale_string` (`id`, `category`, `enUS`, `deDE`) VALUES ('basic_admin_rights', 1, 'Admin Rights', 'Admin Rechte');
|
||||||
|
INSERT INTO `system_locale_string` (`id`, `category`, `enUS`, `deDE`) VALUES ('basic_cancel', 1, 'Cancel', 'Abbrechen');
|
||||||
|
INSERT INTO `system_locale_string` (`id`, `category`, `enUS`, `deDE`) VALUES ('basic_close', 1, 'Close', 'Schließen');
|
||||||
|
|
||||||
|
INSERT INTO `system_locale_string` (`id`, `category`, `enUS`, `deDE`) VALUES ('basic_text_logout', 1, 'Logout before you leave!', 'Loggen Sie sie sich aus bevor Sie gehen!');
|
||||||
|
INSERT INTO `system_locale_string` (`id`, `category`, `enUS`, `deDE`) VALUES ('basic_text_login', 1, 'Login to your Website.', 'Loggen Sie sich in ihre Website ein.');
|
||||||
|
INSERT INTO `system_locale_string` (`id`, `category`, `enUS`, `deDE`) VALUES ('basic_text_register', 1, 'Register an Account', 'Register an Account');
|
||||||
|
INSERT INTO `system_locale_string` (`id`, `category`, `enUS`, `deDE`) VALUES ('basic_text_password_miss', 1, 'Can\'t really remember your Password?', 'Can\'t really remember your Password?');
|
||||||
|
|
||||||
|
INSERT INTO `system_locale_string` (`id`, `category`, `enUS`, `deDE`) VALUES ('basic_placeholder_username', 1, 'peter / peter@world.org', 'peter / peter@world.org');
|
||||||
|
INSERT INTO `system_locale_string` (`id`, `category`, `enUS`, `deDE`) VALUES ('basic_placeholder_password', 1, 'my secret123', 'geheim567');
|
||||||
|
INSERT INTO `system_locale_string` (`id`, `category`, `enUS`, `deDE`) VALUES ('basic_placeholder_email', 1, 'peter@world.org', 'peter@world.org');
|
||||||
|
|
||||||
|
INSERT INTO `system_locale_string` (`id`, `category`, `enUS`, `deDE`) VALUES ('basic_state_login', 1, 'You are logged in.', 'You are logged in.');
|
||||||
|
|
||||||
|
INSERT INTO `system_locale_string` (`id`, `category`, `enUS`, `deDE`) VALUES ('basic_example', 1, '<h1><img style="float: right;" title="TinyMCE Logo" src="http://www.tinymce.com/tryit/img/tlogo.png" alt="TinyMCE Logo" width="92" height="80" />Welcome to the TinyMCE editor demo!</h1>\n<p>Feel free to try out the different features that are provided, please note that the <strong>MoxieManager</strong> specific functionality is part of our commercial offering. The demo is to show the integration.</p>\n<h2>Got questions or need help?</h2>\n<p>If you have questions or need help, feel free to visit our <a href="forum/index.php">community forum</a>! We also offer Enterprise <a href="enterprise/support.php">support</a> solutions. Also do not miss out on the <a href="wiki.php">documentation</a>, its a great resource wiki for understanding how TinyMCE works and integrates.</p>\n<h2>Found a bug?</h2>\n<p>If you think you have found a bug, you can use the <a href="develop/bugtracker.php">Bug Tracker</a> to report bugs to the developers.</p>\n<p>And here is a simple table for you to play with.</p>\n<table border="0">\n<tbody>\n<tr>\n<td><strong>Product</strong></td>\n<td><strong>Cost</strong></td>\n<td><strong>Really?</strong></td>\n</tr>\n<tr>\n<td>TinyMCE</td>\n<td>Free</td>\n<td>YES!</td>\n</tr>\n<tr>\n<td>Plupload</td>\n<td>Free</td>\n<td>YES!</td>\n</tr>\n</tbody>\n</table>\n<p>Enjoy our software and create great content!</p>\n<p>Oh, and by the way, don\'t forget to check out our other product called <a href="http://www.plupload.com" target="_blank">Plupload</a>, your ultimate upload solution with HTML5 upload support!</p>', '<h1><img style="float: right;" title="TinyMCE Logo" src="http://www.tinymce.com/tryit/img/tlogo.png" alt="TinyMCE Logo" width="92" height="80" />Welcome to the TinyMCE editor demo!</h1>\n<p>Feel free to try out the different features that are provided, please note that the <strong>MoxieManager</strong> specific functionality is part of our commercial offering. The demo is to show the integration.</p>\n<h2>Got questions or need help?</h2>\n<p>If you have questions or need help, feel free to visit our <a href="forum/index.php">community forum</a>! We also offer Enterprise <a href="enterprise/support.php">support</a> solutions. Also do not miss out on the <a href="wiki.php">documentation</a>, its a great resource wiki for understanding how TinyMCE works and integrates.</p>\n<h2>Found a bug?</h2>\n<p>If you think you have found a bug, you can use the <a href="develop/bugtracker.php">Bug Tracker</a> to report bugs to the developers.</p>\n<p>And here is a simple table for you to play with.</p>\n<table border="0">\n<tbody>\n<tr>\n<td><strong>Product</strong></td>\n<td><strong>Cost</strong></td>\n<td><strong>Really?</strong></td>\n</tr>\n<tr>\n<td>TinyMCE</td>\n<td>Free</td>\n<td>YES!</td>\n</tr>\n<tr>\n<td>Plupload</td>\n<td>Free</td>\n<td>YES!</td>\n</tr>\n</tbody>\n</table>\n<p>Enjoy our software and create great content!</p>\n<p>Oh, and by the way, don\'t forget to check out our other product called <a href="http://www.plupload.com" target="_blank">Plupload</a>, your ultimate upload solution with HTML5 upload support!</p>');
|
||||||
151
system/dbd/sql/mysql/data/sai_api.sql
Normal file
151
system/dbd/sql/mysql/data/sai_api.sql
Normal file
@ -0,0 +1,151 @@
|
|||||||
|
DELETE FROM `system_api` WHERE `group` = 42;
|
||||||
|
|
||||||
|
-- basic
|
||||||
|
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (0, 42, 0, -1, NULL, 'sai_mod', NULL);
|
||||||
|
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (1, 42, 1, 0, NULL, 'js', NULL);
|
||||||
|
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (2, 42, 1, 0, NULL, 'css', NULL);
|
||||||
|
-- INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (3, 42, 0, 0, NULL, 'page', NULL);
|
||||||
|
|
||||||
|
-- system_api
|
||||||
|
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (10, 42, 0, -1, NULL, 'call', NULL);
|
||||||
|
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (11, 42, 0, 10, NULL, 'action', NULL);
|
||||||
|
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (20, 42, 2, 11, 'login', 'username', 'STRING');
|
||||||
|
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (21, 42, 2, 11, 'login', 'password_sha', 'STRING');
|
||||||
|
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (22, 42, 2, 11, 'login', 'password_md5', 'STRING');
|
||||||
|
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (23, 42, 2, 11, 'check', 'rightid', 'UINT');
|
||||||
|
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (24, 42, 2, 11, 'create', 'username', 'STRING');
|
||||||
|
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (25, 42, 2, 11, 'create', 'password_sha', 'STRING');
|
||||||
|
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (26, 42, 2, 11, 'create', 'email', 'STRING');
|
||||||
|
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (27, 42, 2, 11, 'create', 'locale', 'LANG');
|
||||||
|
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (30, 42, 2, 10, 'files', 'cat', 'STRING');
|
||||||
|
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (31, 42, 3, 30, 'files', 'id', 'STRING');
|
||||||
|
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (40, 42, 2, 10, 'text', 'request', 'STRING');
|
||||||
|
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (41, 42, 2, 40, 'text', 'lang', 'LANG');
|
||||||
|
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (50, 42, 2, 10, 'pages', 'group', 'UINT');
|
||||||
|
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (51, 42, 2, 10, 'pages', 'state', 'STRING');
|
||||||
|
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (52, 42, 1, 50, NULL, 'js', NULL);
|
||||||
|
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (53, 42, 2, 51, NULL, 'group', 'UINT');
|
||||||
|
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (55, 42, 1, 50, NULL, 'css', NULL);
|
||||||
|
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (56, 42, 2, 55, NULL, 'group', 'UINT');
|
||||||
|
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (90, 42, 4, -1, NULL, '_lang', 'LANG');
|
||||||
|
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (91, 42, 4, -1, NULL, '_result', 'RESULT');
|
||||||
|
|
||||||
|
-- specific stuff for mods
|
||||||
|
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (100, 42, 0, 0, '_SYSTEM_SAI_saimod_sys_login', 'action', NULL);
|
||||||
|
--
|
||||||
|
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (101, 42, 2, 100, 'login', 'username', 'ALL');
|
||||||
|
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (102, 42, 2, 100, 'login', 'password_sha', 'ALL');
|
||||||
|
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (103, 42, 2, 100, 'login', 'password_md5', 'ALL');
|
||||||
|
--
|
||||||
|
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (110, 42, 2, 100, 'register', 'username', 'ALL');
|
||||||
|
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (111, 42, 2, 100, 'register', 'password', 'ALL');
|
||||||
|
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (112, 42, 2, 100, 'register', 'email', 'ALL');
|
||||||
|
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (113, 42, 3, 100, 'register', 'locale', 'ALL');
|
||||||
|
|
||||||
|
|
||||||
|
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (200, 42, 0, 0, '_SYSTEM_SAI_saimod_sys_log', 'action', NULL);
|
||||||
|
--
|
||||||
|
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (201, 42, 3, 200, 'filter', 'filter', 'STRING');
|
||||||
|
--
|
||||||
|
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (210, 42, 3, 200, 'error', 'error', 'INT');
|
||||||
|
--
|
||||||
|
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (220, 42, 0, 200, 'stats', 'name', null);
|
||||||
|
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (221, 42, 3, 220, null, 'filter', 'UINT');
|
||||||
|
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (222, 42, 3, 220, null, 'db', 'STRING');
|
||||||
|
|
||||||
|
|
||||||
|
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (300, 42, 0, 0, '_SYSTEM_SAI_saimod_sys_security', 'action', NULL);
|
||||||
|
--
|
||||||
|
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (301, 42, 2, 300, 'user', 'username', 'STRING');
|
||||||
|
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (302, 42, 3, 300, 'users', 'search', 'STRING');
|
||||||
|
--
|
||||||
|
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (310, 42, 2, 300, 'addright', 'id', 'UINT');
|
||||||
|
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (311, 42, 2, 300, 'addright', 'name', 'STRING');
|
||||||
|
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (312, 42, 2, 300, 'addright', 'description', 'STRING');
|
||||||
|
--
|
||||||
|
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (320, 42, 2, 300, 'deleteright', 'id', 'UINT');
|
||||||
|
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (321, 42, 2, 300, 'deleterightconfirm', 'id', 'UINT');
|
||||||
|
--
|
||||||
|
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (330, 42, 2, 300, 'addrightuser', 'rightid', 'UINT');
|
||||||
|
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (331, 42, 2, 300, 'addrightuser', 'userid', 'UINT');
|
||||||
|
--
|
||||||
|
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (340, 42, 2, 300, 'deleterightuser', 'rightid', 'UINT');
|
||||||
|
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (341, 42, 2, 300, 'deleterightuser', 'userid', 'UINT');
|
||||||
|
|
||||||
|
|
||||||
|
-- INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (400, 42, 0, 0, '_SYSTEM_SAI_saimod_sys_sai_mods', 'action', NULL);
|
||||||
|
|
||||||
|
|
||||||
|
-- INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (500, 42, 0, 0, '_SYSTEM_SAI_saimod_sys_config', 'action', NULL);
|
||||||
|
|
||||||
|
|
||||||
|
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (600, 42, 0, 0, '_SYSTEM_SAI_saimod_sys_api', 'action', NULL);
|
||||||
|
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (601, 42, 2, 600, 'addcall', 'ID', 'INT');
|
||||||
|
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (602, 42, 2, 600, 'addcall', 'group', 'INT');
|
||||||
|
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (603, 42, 2, 600, 'addcall', 'type', 'INT');
|
||||||
|
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (604, 42, 2, 600, 'addcall', 'parentID', 'INT');
|
||||||
|
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (605, 42, 2, 600, 'addcall', 'parentValue', 'STRING');
|
||||||
|
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (606, 42, 2, 600, 'addcall', 'name', 'STRING');
|
||||||
|
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (607, 42, 2, 600, 'addcall', 'verify', 'ALL');
|
||||||
|
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (608, 42, 2, 600, 'deletecall', 'ID', 'INT');
|
||||||
|
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (609, 42, 2, 600, 'deletedialog', 'ID', 'INT');
|
||||||
|
|
||||||
|
|
||||||
|
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (700, 42, 0, 0, '_SYSTEM_SAI_saimod_sys_locale', 'action', NULL);
|
||||||
|
--
|
||||||
|
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (701, 42, 2, 700, 'load', 'id', 'LANG');
|
||||||
|
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (702, 42, 2, 700, 'load', 'group', 'INT');
|
||||||
|
--
|
||||||
|
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (710, 42, 2, 700, 'singleload', 'id', 'ALL');
|
||||||
|
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (711, 42, 2, 700, 'singleload', 'lang', 'ALL');
|
||||||
|
--
|
||||||
|
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (720, 42, 2, 700, 'delete', 'id', 'ALL');
|
||||||
|
--
|
||||||
|
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (730, 42, 2, 700, 'add', 'id', 'ALL');
|
||||||
|
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (731, 42, 2, 700, 'add', 'category', 'INT');
|
||||||
|
--
|
||||||
|
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (740, 42, 2, 700, 'edit', 'id', 'ALL');
|
||||||
|
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (741, 42, 2, 700, 'edit', 'lang', 'LANG');
|
||||||
|
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (742, 42, 2, 700, 'edit', 'category', 'ALL');
|
||||||
|
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (743, 42, 2, 700, 'edit', 'newtext', 'ALL');
|
||||||
|
|
||||||
|
|
||||||
|
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (800, 42, 0, 0, '_SYSTEM_SAI_saimod_sys_files', 'action', NULL);
|
||||||
|
--
|
||||||
|
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (801, 42, 2, 800, 'upload', 'cat', 'STRING');
|
||||||
|
--
|
||||||
|
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (810, 42, 2, 800, 'del', 'cat', 'STRING');
|
||||||
|
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (811, 42, 2, 800, 'del', 'id', 'STRING');
|
||||||
|
--
|
||||||
|
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (820, 42, 2, 800, 'rn', 'cat', 'STRING');
|
||||||
|
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (821, 42, 2, 800, 'rn', 'id', 'STRING');
|
||||||
|
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (822, 42, 2, 800, 'rn', 'newid', 'STRING');
|
||||||
|
--
|
||||||
|
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (830, 42, 2, 800, 'tab', 'name', 'STRING');
|
||||||
|
|
||||||
|
|
||||||
|
-- INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (900, 42, 0, 0, '_SYSTEM_SAI_saimod_sys_cache', 'action', NULL);
|
||||||
|
|
||||||
|
|
||||||
|
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (1000, 42, 0, 0, '_SYSTEM_SAI_saimod_sys_todo', 'action', NULL);
|
||||||
|
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (1001, 42, 2, 1000, 'todo', 'todo', 'INT');
|
||||||
|
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (1002, 42, 2, 1000, 'open', 'todo', 'INT');
|
||||||
|
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (1003, 42, 2, 1000, 'close', 'todo', 'INT');
|
||||||
|
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (1004, 42, 2, 1000, 'add', 'todo', 'STRING');
|
||||||
|
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (1010, 42, 2, 1000, 'edit', 'todo', 'INT');
|
||||||
|
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (1011, 42, 2, 1000, 'edit', 'message', 'STRING');
|
||||||
|
|
||||||
|
|
||||||
|
-- INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (1100, 42, 0, 0, '_SYSTEM_SAI_saimod_sys_docu', 'action', NULL);
|
||||||
|
|
||||||
|
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (1200, 42, 0, 0, '_SYSTEM_SAI_saimod_sys_cron', 'action', NULL);
|
||||||
|
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (1201, 42, 2, 1200, 'add', 'cls', 'STRING');
|
||||||
|
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (1202, 42, 2, 1200, 'add', 'min', 'INT');
|
||||||
|
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (1203, 42, 2, 1200, 'add', 'hour', 'INT');
|
||||||
|
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (1204, 42, 2, 1200, 'add', 'day', 'INT');
|
||||||
|
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (1205, 42, 2, 1200, 'add', 'day_week', 'INT');
|
||||||
|
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (1206, 42, 2, 1200, 'add', 'month', 'INT');
|
||||||
|
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (1208, 42, 2, 1200, 'del', 'cls', 'STRING');
|
||||||
|
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (1209, 42, 2, 1200, 'deldialog', 'cls', 'STRING');
|
||||||
|
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (1210, 42, 2, 1200, 'change', 'cls', 'STRING');
|
||||||
|
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (1211, 42, 2, 1200, 'change', 'status', 'INT');
|
||||||
9
system/dbd/sql/mysql/data/sai_error_locale_string.sql
Normal file
9
system/dbd/sql/mysql/data/sai_error_locale_string.sql
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
DELETE FROM system_locale_string WHERE category = 43;
|
||||||
|
INSERT INTO `system_locale_string` (`id`, `category`, `enUS`, `deDE`) VALUES ('sai_error_username_short', 43, 'Username is too short', 'Nutzername ist zu kurz');
|
||||||
|
INSERT INTO `system_locale_string` (`id`, `category`, `enUS`, `deDE`) VALUES ('sai_error_username_long', 43, 'Username is too long', 'Nutzername ist zu lang');
|
||||||
|
INSERT INTO `system_locale_string` (`id`, `category`, `enUS`, `deDE`) VALUES ('sai_error_username_miss', 43, 'Username required', 'Nutzername erfoderlich');
|
||||||
|
INSERT INTO `system_locale_string` (`id`, `category`, `enUS`, `deDE`) VALUES ('sai_error_password_miss', 43, 'Password required', 'Passwort erforderlich');
|
||||||
|
INSERT INTO `system_locale_string` (`id`, `category`, `enUS`, `deDE`) VALUES ('sai_error_password_long', 43, 'Password too long', 'Passwort zu lang');
|
||||||
|
INSERT INTO `system_locale_string` (`id`, `category`, `enUS`, `deDE`) VALUES ('sai_error_password_short', 43, 'Password too short', 'Passwort zu kurz');
|
||||||
|
INSERT INTO `system_locale_string` (`id`, `category`, `enUS`, `deDE`) VALUES ('sai_error_password_match', 43, 'Passwords do not match!', 'Passwords do not match!');
|
||||||
|
INSERT INTO `system_locale_string` (`id`, `category`, `enUS`, `deDE`) VALUES ('sai_error_email_wrong', 43, 'Invalid EMail!', 'Invalid EMail!');
|
||||||
2
system/dbd/sql/mysql/data/sai_locale_string.sql
Normal file
2
system/dbd/sql/mysql/data/sai_locale_string.sql
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
DELETE FROM system_locale_string WHERE category = 42;
|
||||||
|
INSERT INTO `system_locale_string` (`id`, `category`, `enUS`, `deDE`) VALUES ('sai_mod_login_text', 42, 'Please login for developer access (if you are a developer).', 'Please login for developer access (if you are a developer).');
|
||||||
25
system/dbd/sql/mysql/data/system_api.sql
Normal file
25
system/dbd/sql/mysql/data/system_api.sql
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (10, 0, 0, -1, NULL, 'call', NULL);
|
||||||
|
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (11, 0, 0, 10, NULL, 'action', NULL);
|
||||||
|
|
||||||
|
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (20, 0, 2, 11, 'login', 'username', 'STRING');
|
||||||
|
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (21, 0, 2, 11, 'login', 'password_sha', 'STRING');
|
||||||
|
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (22, 0, 2, 11, 'login', 'password_md5', 'STRING');
|
||||||
|
|
||||||
|
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (23, 0, 2, 11, 'check', 'rightid', 'UINT');
|
||||||
|
|
||||||
|
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (24, 0, 2, 11, 'create', 'username', 'STRING');
|
||||||
|
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (25, 0, 2, 11, 'create', 'password_sha', 'STRING');
|
||||||
|
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (26, 0, 2, 11, 'create', 'email', 'STRING');
|
||||||
|
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (27, 0, 2, 11, 'create', 'locale', 'LANG');
|
||||||
|
|
||||||
|
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (30, 0, 2, 10, 'files', 'cat', 'STRING');
|
||||||
|
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (31, 0, 3, 30, 'files', 'id', 'STRING');
|
||||||
|
|
||||||
|
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (40, 0, 2, 10, 'text', 'request', 'STRING');
|
||||||
|
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (41, 0, 2, 10, 'text', 'lang', 'LANG');
|
||||||
|
|
||||||
|
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (50, 0, 2, 10, 'pages', 'group', 'UINT');
|
||||||
|
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (51, 0, 2, 10, 'pages', 'state', 'STRING');
|
||||||
|
|
||||||
|
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (90, 0, 4, -1, NULL, '_lang', 'LANG');
|
||||||
|
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (91, 0, 4, -1, NULL, '_result', 'RESULT');
|
||||||
2
system/dbd/sql/mysql/data/system_api_default.sql
Normal file
2
system/dbd/sql/mysql/data/system_api_default.sql
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (0, 1, 4, -1, NULL, '_escaped_fragment_', 'STRING');
|
||||||
|
INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (1, 1, 0, -1, NULL, 'page', NULL);
|
||||||
1
system/dbd/sql/mysql/data/system_cron.sql
Normal file
1
system/dbd/sql/mysql/data/system_cron.sql
Normal file
@ -0,0 +1 @@
|
|||||||
|
INSERT INTO `system_cron` (`class`, `min`, `hour`, `day`, `day_week`, `month`, `last_run`, `status`) VALUES ('\\SYSTEM\\CRON\\cron_log2sqlite', 0, 0, 0, 0, 0, '2015-01-01 01:00:00', 0);
|
||||||
13
system/dbd/sql/mysql/data/system_rights.sql
Normal file
13
system/dbd/sql/mysql/data/system_rights.sql
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
INSERT INTO `system_rights` (`ID`, `name`, `description`) VALUES (1, 'SYS_SAI', 'SAI access right');
|
||||||
|
|
||||||
|
INSERT INTO `system_rights` (`ID`, `name`, `description`) VALUES (5, 'SYS_SAI_SECURITY', 'Allows access to the Security Module in SAI');
|
||||||
|
INSERT INTO `system_rights` (`ID`, `name`, `description`) VALUES (6, 'SYS_SAI_SECURITY_RIGHTS_EDIT', 'Allows deleting, editing and adding of Right in the SAI module Security');
|
||||||
|
|
||||||
|
INSERT INTO `system_rights` (`ID`, `name`, `description`) VALUES (10, 'SYS_SAI_LOCALE', 'Allows access to the Locale Module in SAI to edit or add Multilanguage Text');
|
||||||
|
|
||||||
|
INSERT INTO `system_rights` (`ID`, `name`, `description`) VALUES (15, 'SYS_SAI_IMG', 'Allows access to the Image Module in SAI to delete or add Pictures');
|
||||||
|
|
||||||
|
INSERT INTO `system_rights` (`ID`, `name`, `description`) VALUES (20, 'SYS_SAI_API', 'SAI API Access right');
|
||||||
|
INSERT INTO `system_rights` (`ID`, `name`, `description`) VALUES (21, 'SYS_SAI_API_EDIT', 'SAI API Edit right');
|
||||||
|
|
||||||
|
INSERT INTO `system_rights` (`ID`, `name`, `description`) VALUES (25, 'SYS_SAI_CRON', 'SAI Cron Access right');
|
||||||
12
system/dbd/sql/mysql/schema/system_api.sql
Normal file
12
system/dbd/sql/mysql/schema/system_api.sql
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
CREATE TABLE `system_api` (
|
||||||
|
`ID` INT(10) UNSIGNED NOT NULL,
|
||||||
|
`group` INT(10) UNSIGNED NOT NULL,
|
||||||
|
`type` TINYINT(3) UNSIGNED NOT NULL,
|
||||||
|
`parentID` INT(11) NOT NULL,
|
||||||
|
`parentValue` CHAR(50) NULL DEFAULT NULL,
|
||||||
|
`name` CHAR(50) NOT NULL,
|
||||||
|
`verify` CHAR(50) NULL DEFAULT NULL,
|
||||||
|
PRIMARY KEY (`ID`, `group`)
|
||||||
|
)
|
||||||
|
COLLATE='utf8_general_ci'
|
||||||
|
ENGINE=MyISAM;
|
||||||
9
system/dbd/sql/mysql/schema/system_cache.sql
Normal file
9
system/dbd/sql/mysql/schema/system_cache.sql
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
CREATE TABLE `system_cache` (
|
||||||
|
`ID` INT(10) NOT NULL AUTO_INCREMENT,
|
||||||
|
`CacheID` INT(10) NOT NULL,
|
||||||
|
`Ident` CHAR(255) NOT NULL,
|
||||||
|
`data` BINARY(255) NOT NULL,
|
||||||
|
PRIMARY KEY (`ID`)
|
||||||
|
)
|
||||||
|
COLLATE='utf8_general_ci'
|
||||||
|
ENGINE=MyISAM;
|
||||||
13
system/dbd/sql/mysql/schema/system_cron.sql
Normal file
13
system/dbd/sql/mysql/schema/system_cron.sql
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
CREATE TABLE `system_cron` (
|
||||||
|
`class` CHAR(255) NOT NULL,
|
||||||
|
`min` INT(10) NULL DEFAULT NULL,
|
||||||
|
`hour` INT(10) NULL DEFAULT NULL,
|
||||||
|
`day` INT(10) NULL DEFAULT NULL,
|
||||||
|
`day_week` INT(10) NULL DEFAULT NULL,
|
||||||
|
`month` INT(10) NULL DEFAULT NULL,
|
||||||
|
`last_run` TIMESTAMP NULL DEFAULT NULL,
|
||||||
|
`status` INT(11) NOT NULL DEFAULT '0',
|
||||||
|
PRIMARY KEY (`class`)
|
||||||
|
)
|
||||||
|
COLLATE='utf8_general_ci'
|
||||||
|
ENGINE=InnoDB;
|
||||||
10
system/dbd/sql/mysql/schema/system_locale_string.sql
Normal file
10
system/dbd/sql/mysql/schema/system_locale_string.sql
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
CREATE TABLE `system_locale_string` (
|
||||||
|
`id` CHAR(35) NOT NULL,
|
||||||
|
`category` INT(10) UNSIGNED NOT NULL,
|
||||||
|
`enUS` TEXT NOT NULL,
|
||||||
|
`deDE` TEXT NOT NULL,
|
||||||
|
PRIMARY KEY (`id`)
|
||||||
|
)
|
||||||
|
COMMENT='Shall hold strings and its translation'
|
||||||
|
COLLATE='utf8_general_ci'
|
||||||
|
ENGINE=MyISAM;
|
||||||
24
system/dbd/sql/mysql/schema/system_log.sql
Normal file
24
system/dbd/sql/mysql/schema/system_log.sql
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
CREATE TABLE `system_log` (
|
||||||
|
`ID` INT(10) NOT NULL AUTO_INCREMENT,
|
||||||
|
`class` TEXT NOT NULL,
|
||||||
|
`message` TEXT NOT NULL,
|
||||||
|
`code` INT(11) NOT NULL,
|
||||||
|
`file` TEXT NOT NULL,
|
||||||
|
`line` INT(11) NOT NULL,
|
||||||
|
`trace` TEXT NOT NULL,
|
||||||
|
`ip` TEXT NOT NULL,
|
||||||
|
`querytime` DOUBLE NOT NULL,
|
||||||
|
`time` DATETIME NOT NULL,
|
||||||
|
`server_name` CHAR(255) NOT NULL,
|
||||||
|
`server_port` INT(10) UNSIGNED NOT NULL,
|
||||||
|
`request_uri` CHAR(255) NOT NULL,
|
||||||
|
`post` TEXT NOT NULL,
|
||||||
|
`http_referer` CHAR(255) NULL DEFAULT NULL,
|
||||||
|
`http_user_agent` TEXT NOT NULL,
|
||||||
|
`user` INT(11) NULL DEFAULT NULL,
|
||||||
|
`thrown` BIT(1) NOT NULL,
|
||||||
|
PRIMARY KEY (`ID`)
|
||||||
|
)
|
||||||
|
COLLATE='utf8_general_ci'
|
||||||
|
ENGINE=MyISAM
|
||||||
|
AUTO_INCREMENT=1;
|
||||||
11
system/dbd/sql/mysql/schema/system_page.sql
Normal file
11
system/dbd/sql/mysql/schema/system_page.sql
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
CREATE TABLE `system_page` (
|
||||||
|
`group` INT(10) UNSIGNED NOT NULL,
|
||||||
|
`id` CHAR(50) NOT NULL,
|
||||||
|
`div` CHAR(50) NOT NULL,
|
||||||
|
`url` TEXT NOT NULL,
|
||||||
|
`func` CHAR(50) NOT NULL,
|
||||||
|
`php_class` CHAR(50) NOT NULL,
|
||||||
|
PRIMARY KEY (`id`, `div`, `group`)
|
||||||
|
)
|
||||||
|
COLLATE='utf8_unicode_ci'
|
||||||
|
ENGINE=InnoDB;
|
||||||
9
system/dbd/sql/mysql/schema/system_rights.sql
Normal file
9
system/dbd/sql/mysql/schema/system_rights.sql
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
CREATE TABLE `system_rights` (
|
||||||
|
`ID` INT(10) NOT NULL AUTO_INCREMENT,
|
||||||
|
`name` CHAR(50) NOT NULL,
|
||||||
|
`description` CHAR(255) NOT NULL,
|
||||||
|
PRIMARY KEY (`ID`)
|
||||||
|
)
|
||||||
|
COLLATE='utf8_general_ci'
|
||||||
|
ENGINE=MyISAM
|
||||||
|
AUTO_INCREMENT=16;
|
||||||
29
system/dbd/sql/mysql/schema/system_todo.sql
Normal file
29
system/dbd/sql/mysql/schema/system_todo.sql
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
CREATE TABLE `system_todo` (
|
||||||
|
`ID` INT(10) NOT NULL AUTO_INCREMENT,
|
||||||
|
`class` TEXT NOT NULL,
|
||||||
|
`message` TEXT NOT NULL,
|
||||||
|
`message_hash` CHAR(40) NOT NULL,
|
||||||
|
`code` INT(10) UNSIGNED NOT NULL,
|
||||||
|
`file` CHAR(255) NOT NULL,
|
||||||
|
`line` INT(11) NOT NULL,
|
||||||
|
`trace` TEXT NOT NULL,
|
||||||
|
`ip` TEXT NOT NULL,
|
||||||
|
`querytime` DOUBLE NOT NULL,
|
||||||
|
`time` DATETIME NOT NULL,
|
||||||
|
`server_name` CHAR(255) NOT NULL,
|
||||||
|
`server_port` INT(10) UNSIGNED NOT NULL,
|
||||||
|
`request_uri` CHAR(255) NOT NULL,
|
||||||
|
`post` TEXT NOT NULL,
|
||||||
|
`http_referer` CHAR(255) NOT NULL,
|
||||||
|
`http_user_agent` TEXT NOT NULL,
|
||||||
|
`user` INT(10) UNSIGNED NOT NULL,
|
||||||
|
`thrown` BIT(1) NOT NULL,
|
||||||
|
`type` INT(11) NOT NULL DEFAULT '0',
|
||||||
|
`count` INT(11) NOT NULL DEFAULT '1',
|
||||||
|
`state` INT(11) NOT NULL DEFAULT '0',
|
||||||
|
PRIMARY KEY (`ID`),
|
||||||
|
UNIQUE INDEX `file_line_message` (`file`, `line`, `message_hash`)
|
||||||
|
)
|
||||||
|
COLLATE='utf8_general_ci'
|
||||||
|
ENGINE=MyISAM
|
||||||
|
AUTO_INCREMENT=92;
|
||||||
15
system/dbd/sql/mysql/schema/system_user.sql
Normal file
15
system/dbd/sql/mysql/schema/system_user.sql
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
CREATE TABLE `system_user` (
|
||||||
|
`id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||||
|
`username` CHAR(32) NOT NULL,
|
||||||
|
`password_sha` CHAR(255) NULL DEFAULT NULL,
|
||||||
|
`password_md5` CHAR(255) NULL DEFAULT NULL,
|
||||||
|
`email` CHAR(255) NOT NULL,
|
||||||
|
`joindate` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||||
|
`locale` CHAR(6) NOT NULL DEFAULT 'enUS',
|
||||||
|
`last_active` TIMESTAMP NOT NULL DEFAULT '0000-00-00 00:00:00',
|
||||||
|
`account_flag` INT(10) NULL DEFAULT NULL,
|
||||||
|
PRIMARY KEY (`id`)
|
||||||
|
)
|
||||||
|
COLLATE='utf8_general_ci'
|
||||||
|
ENGINE=InnoDB
|
||||||
|
AUTO_INCREMENT=1;
|
||||||
7
system/dbd/sql/mysql/schema/system_user_to_rights.sql
Normal file
7
system/dbd/sql/mysql/schema/system_user_to_rights.sql
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
CREATE TABLE `system_user_to_rights` (
|
||||||
|
`rightID` INT(10) NOT NULL DEFAULT '0',
|
||||||
|
`userID` INT(10) UNSIGNED NOT NULL DEFAULT '0',
|
||||||
|
PRIMARY KEY (`rightID`, `userID`)
|
||||||
|
)
|
||||||
|
COLLATE='utf8_general_ci'
|
||||||
|
ENGINE=InnoDB;
|
||||||
23
system/dbd/sql/pg/data/basic_locale_string.sql
Normal file
23
system/dbd/sql/pg/data/basic_locale_string.sql
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
DELETE FROM system.locale_string WHERE category = 1;
|
||||||
|
INSERT INTO system.locale_string ("id", "category", "enUS", "deDE") VALUES ('basic_logout', 1, 'Logout', 'Ausloggen');
|
||||||
|
INSERT INTO system.locale_string ("id", "category", "enUS", "deDE") VALUES ('basic_login', 1, 'Login', 'Einloggen');
|
||||||
|
INSERT INTO system.locale_string ("id", "category", "enUS", "deDE") VALUES ('basic_register', 1, 'Register', 'Registrieren');
|
||||||
|
INSERT INTO system.locale_string ("id", "category", "enUS", "deDE") VALUES ('basic_username', 1, 'Username', 'Username');
|
||||||
|
INSERT INTO system.locale_string ("id", "category", "enUS", "deDE") VALUES ('basic_password', 1, 'Password', 'Passwort');
|
||||||
|
INSERT INTO system.locale_string ("id", "category", "enUS", "deDE") VALUES ('basic_email', 1, 'EMail', 'E-Mail2');
|
||||||
|
INSERT INTO system.locale_string ("id", "category", "enUS", "deDE") VALUES ('basic_last_active', 1, 'Last active', 'Zuletzt aktiv');
|
||||||
|
INSERT INTO system.locale_string ("id", "category", "enUS", "deDE") VALUES ('basic_join_date', 1, 'Joindate', 'Beitrittsdatum');
|
||||||
|
INSERT INTO system.locale_string ("id", "category", "enUS", "deDE") VALUES ('basic_locale', 1, 'Locale', 'Sprache');
|
||||||
|
INSERT INTO system.locale_string ("id", "category", "enUS", "deDE") VALUES ('basic_admin_rights', 1, 'Admin Rights', 'Admin Rechte');
|
||||||
|
INSERT INTO system.locale_string ("id", "category", "enUS", "deDE") VALUES ('basic_cancel', 1, 'Cancel', 'Abbrechen');
|
||||||
|
|
||||||
|
INSERT INTO system.locale_string ("id", "category", "enUS", "deDE") VALUES ('basic_text_logout', 1, 'Logout before you leave!', 'Loggen Sie sie sich aus bevor Sie gehen!');
|
||||||
|
INSERT INTO system.locale_string ("id", "category", "enUS", "deDE") VALUES ('basic_text_login', 1, 'Login to your Website.', 'Loggen Sie sich in ihre Website ein.');
|
||||||
|
INSERT INTO system.locale_string ("id", "category", "enUS", "deDE") VALUES ('basic_text_register', 1, 'Register an Account', 'Register an Account');
|
||||||
|
INSERT INTO system.locale_string ("id", "category", "enUS", "deDE") VALUES ('basic_text_password_miss', 1, 'Cannot really remember your Password?', 'Cannot really remember your Password?');
|
||||||
|
|
||||||
|
INSERT INTO system.locale_string ("id", "category", "enUS", "deDE") VALUES ('basic_placeholder_username', 1, 'peter / peter@world.org', 'peter / peter@world.org');
|
||||||
|
INSERT INTO system.locale_string ("id", "category", "enUS", "deDE") VALUES ('basic_placeholder_password', 1, 'my secret123', 'geheim567');
|
||||||
|
INSERT INTO system.locale_string ("id", "category", "enUS", "deDE") VALUES ('basic_placeholder_email', 1, 'peter@world.org', 'peter@world.org');
|
||||||
|
|
||||||
|
INSERT INTO system.locale_string ("id", "category", "enUS", "deDE") VALUES ('basic_state_login', 1, 'You are logged in.', 'You are logged in.');
|
||||||
129
system/dbd/sql/pg/data/sai_api.sql
Normal file
129
system/dbd/sql/pg/data/sai_api.sql
Normal file
@ -0,0 +1,129 @@
|
|||||||
|
DELETE FROM system.api WHERE "group" = 42;
|
||||||
|
|
||||||
|
-- basic
|
||||||
|
INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (0, 42, 0, -1, NULL, 'sai_mod', NULL);
|
||||||
|
INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (1, 42, 1, 0, NULL, 'js', NULL);
|
||||||
|
INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (2, 42, 1, 0, NULL, 'css', NULL);
|
||||||
|
-- INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (3, 42, 0, 0, NULL, 'page', NULL);
|
||||||
|
|
||||||
|
-- system_api
|
||||||
|
INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (10, 42, 0, -1, NULL, 'call', NULL);
|
||||||
|
INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (11, 42, 0, 10, NULL, 'action', NULL);
|
||||||
|
INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (20, 42, 2, 11, 'login', 'username', 'STRING');
|
||||||
|
INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (21, 42, 2, 11, 'login', 'password_sha', 'STRING');
|
||||||
|
INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (22, 42, 2, 11, 'login', 'password_md5', 'STRING');
|
||||||
|
INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (23, 42, 2, 11, 'check', 'rightid', 'UINT');
|
||||||
|
INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (24, 42, 2, 11, 'create', 'username', 'STRING');
|
||||||
|
INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (25, 42, 2, 11, 'create', 'password_sha', 'STRING');
|
||||||
|
INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (26, 42, 2, 11, 'create', 'email', 'STRING');
|
||||||
|
INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (27, 42, 2, 11, 'create', 'locale', 'LANG');
|
||||||
|
INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (30, 42, 2, 10, 'files', 'cat', 'STRING');
|
||||||
|
INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (31, 42, 3, 30, 'files', 'id', 'STRING');
|
||||||
|
INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (40, 42, 4, -1, NULL, '_lang', 'LANG');
|
||||||
|
INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (41, 42, 4, -1, NULL, '_result', 'RESULT');
|
||||||
|
|
||||||
|
-- specific stuff for mods
|
||||||
|
INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (100, 42, 0, 0, '_SYSTEM_SAI_saimod_sys_login', 'action', NULL);
|
||||||
|
--
|
||||||
|
INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (101, 42, 2, 100, 'login', 'username', 'ALL');
|
||||||
|
INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (102, 42, 2, 100, 'login', 'password_sha', 'ALL');
|
||||||
|
INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (103, 42, 2, 100, 'login', 'password_md5', 'ALL');
|
||||||
|
--
|
||||||
|
INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (110, 42, 2, 100, 'register', 'username', 'ALL');
|
||||||
|
INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (111, 42, 2, 100, 'register', 'password', 'ALL');
|
||||||
|
INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (112, 42, 2, 100, 'register', 'email', 'ALL');
|
||||||
|
INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (113, 42, 3, 100, 'register', 'locale', 'ALL');
|
||||||
|
|
||||||
|
|
||||||
|
INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (200, 42, 0, 0, '_SYSTEM_SAI_saimod_sys_log', 'action', NULL);
|
||||||
|
--
|
||||||
|
INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (201, 42, 3, 200, 'filter', 'filter', 'STRING');
|
||||||
|
--
|
||||||
|
INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (210, 42, 3, 200, 'error', 'error', 'INT');
|
||||||
|
--
|
||||||
|
INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (220, 42, 0, 200, 'stats', 'name', null);
|
||||||
|
INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (221, 42, 3, 220, null, 'filter', 'UINT');
|
||||||
|
|
||||||
|
|
||||||
|
INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (300, 42, 0, 0, '_SYSTEM_SAI_saimod_sys_security', 'action', NULL);
|
||||||
|
--
|
||||||
|
INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (301, 42, 2, 300, 'user', 'username', 'STRING');
|
||||||
|
INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (302, 42, 3, 300, 'users', 'search', 'STRING');
|
||||||
|
--
|
||||||
|
INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (310, 42, 2, 300, 'addright', 'id', 'UINT');
|
||||||
|
INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (311, 42, 2, 300, 'addright', 'name', 'STRING');
|
||||||
|
INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (312, 42, 2, 300, 'addright', 'description', 'STRING');
|
||||||
|
--
|
||||||
|
INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (320, 42, 2, 300, 'deleteright', 'id', 'UINT');
|
||||||
|
INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (321, 42, 2, 300, 'deleterightconfirm', 'id', 'UINT');
|
||||||
|
--
|
||||||
|
INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (330, 42, 2, 300, 'addrightuser', 'rightid', 'UINT');
|
||||||
|
INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (331, 42, 2, 300, 'addrightuser', 'userid', 'UINT');
|
||||||
|
--
|
||||||
|
INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (340, 42, 2, 300, 'deleterightuser', 'rightid', 'UINT');
|
||||||
|
INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (341, 42, 2, 300, 'deleterightuser', 'userid', 'UINT');
|
||||||
|
|
||||||
|
|
||||||
|
-- INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (400, 42, 0, 0, '_SYSTEM_SAI_saimod_sys_sai_mods', 'action', NULL);
|
||||||
|
|
||||||
|
|
||||||
|
-- INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (500, 42, 0, 0, '_SYSTEM_SAI_saimod_sys_config', 'action', NULL);
|
||||||
|
|
||||||
|
|
||||||
|
-- INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (600, 42, 0, 0, '_SYSTEM_SAI_saimod_sys_api', 'action', NULL);
|
||||||
|
|
||||||
|
|
||||||
|
INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (700, 42, 0, 0, '_SYSTEM_SAI_saimod_sys_locale', 'action', NULL);
|
||||||
|
--
|
||||||
|
INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (701, 42, 2, 700, 'load', 'id', 'LANG');
|
||||||
|
INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (702, 42, 2, 700, 'load', 'group', 'INT');
|
||||||
|
--
|
||||||
|
INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (710, 42, 2, 700, 'singleload', 'id', 'ALL');
|
||||||
|
INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (711, 42, 2, 700, 'singleload', 'lang', 'ALL');
|
||||||
|
--
|
||||||
|
INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (720, 42, 2, 700, 'delete', 'id', 'ALL');
|
||||||
|
--
|
||||||
|
INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (730, 42, 2, 700, 'add', 'id', 'ALL');
|
||||||
|
INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (731, 42, 2, 700, 'add', 'category', 'INT');
|
||||||
|
--
|
||||||
|
INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (740, 42, 2, 700, 'edit', 'id', 'ALL');
|
||||||
|
INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (741, 42, 2, 700, 'edit', 'lang', 'LANG');
|
||||||
|
INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (742, 42, 2, 700, 'edit', 'category', 'ALL');
|
||||||
|
INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (743, 42, 2, 700, 'edit', 'newtext', 'ALL');
|
||||||
|
|
||||||
|
|
||||||
|
INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (800, 42, 0, 0, '_SYSTEM_SAI_saimod_sys_files', 'action', NULL);
|
||||||
|
--
|
||||||
|
INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (801, 42, 2, 800, 'upload', 'cat', 'STRING');
|
||||||
|
--
|
||||||
|
INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (810, 42, 2, 800, 'del', 'cat', 'STRING');
|
||||||
|
INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (811, 42, 2, 800, 'del', 'id', 'STRING');
|
||||||
|
--
|
||||||
|
INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (820, 42, 2, 800, 'rn', 'cat', 'STRING');
|
||||||
|
INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (821, 42, 2, 800, 'rn', 'id', 'STRING');
|
||||||
|
INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (822, 42, 2, 800, 'rn', 'newid', 'STRING');
|
||||||
|
--
|
||||||
|
INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (830, 42, 2, 800, 'tab', 'name', 'STRING');
|
||||||
|
|
||||||
|
|
||||||
|
-- INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (900, 42, 0, 0, '_SYSTEM_SAI_saimod_sys_cache', 'action', NULL);
|
||||||
|
|
||||||
|
|
||||||
|
INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (1000, 42, 0, 0, '_SYSTEM_SAI_saimod_sys_todo', 'action', NULL);
|
||||||
|
INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (1001, 42, 2, 1000, 'todo', 'todo', 'INT');
|
||||||
|
INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (1002, 42, 2, 1000, 'open', 'todo', 'INT');
|
||||||
|
INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (1003, 42, 2, 1000, 'close', 'todo', 'INT');
|
||||||
|
INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (1004, 42, 2, 1000, 'add', 'todo', 'STRING');
|
||||||
|
|
||||||
|
|
||||||
|
-- INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (1100, 42, 0, 0, '_SYSTEM_SAI_saimod_sys_docu', 'action', NULL);
|
||||||
|
|
||||||
|
INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (1200, 42, 0, 0, '_SYSTEM_SAI_saimod_sys_cron', 'action', NULL);
|
||||||
|
INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (1201, 42, 2, 1200, 'add', 'cls', 'STRING');
|
||||||
|
INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (1202, 42, 2, 1200, 'add', 'min', 'INT');
|
||||||
|
INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (1203, 42, 2, 1200, 'add', 'hour', 'INT');
|
||||||
|
INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (1204, 42, 2, 1200, 'add', 'day', 'INT');
|
||||||
|
INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (1205, 42, 2, 1200, 'add', 'day_week', 'INT');
|
||||||
|
INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (1206, 42, 2, 1200, 'add', 'month', 'INT');
|
||||||
|
INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (1208, 42, 2, 1200, 'del', 'cls', 'STRING');
|
||||||
|
INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (1209, 42, 2, 1200, 'deldialog', 'cls', 'STRING');
|
||||||
9
system/dbd/sql/pg/data/sai_error_locale_string.sql
Normal file
9
system/dbd/sql/pg/data/sai_error_locale_string.sql
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
DELETE FROM system.locale_string WHERE category = 43;
|
||||||
|
INSERT INTO system.locale_string ("id", "category", "enUS", "deDE") VALUES ('sai_error_username_short', 43, 'Username is too short', 'Nutzername ist zu kurz');
|
||||||
|
INSERT INTO system.locale_string ("id", "category", "enUS", "deDE") VALUES ('sai_error_username_long', 43, 'Username is too long', 'Nutzername ist zu lang');
|
||||||
|
INSERT INTO system.locale_string ("id", "category", "enUS", "deDE") VALUES ('sai_error_username_miss', 43, 'Username required', 'Nutzername erfoderlich');
|
||||||
|
INSERT INTO system.locale_string ("id", "category", "enUS", "deDE") VALUES ('sai_error_password_miss', 43, 'Password required', 'Passwort erforderlich');
|
||||||
|
INSERT INTO system.locale_string ("id", "category", "enUS", "deDE") VALUES ('sai_error_password_long', 43, 'Password too long', 'Passwort zu lang');
|
||||||
|
INSERT INTO system.locale_string ("id", "category", "enUS", "deDE") VALUES ('sai_error_password_short', 43, 'Password too short', 'Passwort zu kurz');
|
||||||
|
INSERT INTO system.locale_string ("id", "category", "enUS", "deDE") VALUES ('sai_error_password_match', 43, 'Passwords do not match!', 'Passwords do not match!');
|
||||||
|
INSERT INTO system.locale_string ("id", "category", "enUS", "deDE") VALUES ('sai_error_email_wrong', 43, 'Invalid EMail!', 'Invalid EMail!');
|
||||||
2
system/dbd/sql/pg/data/sai_locale_string.sql
Normal file
2
system/dbd/sql/pg/data/sai_locale_string.sql
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
DELETE FROM system.locale_string WHERE category = 42;
|
||||||
|
INSERT INTO system.locale_string ("id", "category", "enUS", "deDE") VALUES ('sai_mod_login_text', 42, 'Please login for developer access (if you are a developer).', 'Please login for developer access (if you are a developer).');
|
||||||
19
system/dbd/sql/pg/data/system_api.sql
Normal file
19
system/dbd/sql/pg/data/system_api.sql
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (10, 42, 0, -1, NULL, 'call', NULL);
|
||||||
|
INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (11, 42, 0, 10, NULL, 'action', NULL);
|
||||||
|
|
||||||
|
INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (20, 42, 2, 11, 'login', 'username', 'STRING');
|
||||||
|
INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (21, 42, 2, 11, 'login', 'password_sha', 'STRING');
|
||||||
|
INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (22, 42, 2, 11, 'login', 'password_md5', 'STRING');
|
||||||
|
|
||||||
|
INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (23, 42, 2, 11, 'check', 'rightid', 'UINT');
|
||||||
|
|
||||||
|
INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (24, 42, 2, 11, 'create', 'username', 'STRING');
|
||||||
|
INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (25, 42, 2, 11, 'create', 'password_sha', 'STRING');
|
||||||
|
INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (26, 42, 2, 11, 'create', 'email', 'STRING');
|
||||||
|
INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (27, 42, 2, 11, 'create', 'locale', 'LANG');
|
||||||
|
|
||||||
|
INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (30, 42, 2, 10, 'files', 'cat', 'STRING');
|
||||||
|
INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (31, 42, 3, 30, 'files', 'id', 'STRING');
|
||||||
|
|
||||||
|
-- INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (100, 0, 2, 0, 'files', 'cat', 'STRING');
|
||||||
|
-- INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (101, 0, 3, 0, 'files', 'id', 'STRING');
|
||||||
13
system/dbd/sql/pg/data/system_rights.sql
Normal file
13
system/dbd/sql/pg/data/system_rights.sql
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
INSERT INTO system.rights (`ID`, `name`, `description`) VALUES (1, 'SYS_SAI', 'SAI access right');
|
||||||
|
|
||||||
|
INSERT INTO system.rights (`ID`, `name`, `description`) VALUES (5, 'SYS_SAI_SECURITY', 'Allows access to the Security Module in SAI');
|
||||||
|
INSERT INTO system.rights (`ID`, `name`, `description`) VALUES (6, 'SYS_SAI_SECURITY_RIGHTS_EDIT', 'Allows deleting, editing and adding of Right in the SAI module Security');
|
||||||
|
|
||||||
|
INSERT INTO system.rights (`ID`, `name`, `description`) VALUES (10, 'SYS_SAI_LOCALE', 'Allows access to the Locale Module in SAI to edit or add Multilanguage Text');
|
||||||
|
|
||||||
|
INSERT INTO system.rights (`ID`, `name`, `description`) VALUES (15, 'SYS_SAI_IMG', 'Allows access to the Image Module in SAI to delete or add Pictures');
|
||||||
|
|
||||||
|
INSERT INTO system.rights (`ID`, `name`, `description`) VALUES (20, 'SYS_SAI_API', 'SAI API Access right');
|
||||||
|
INSERT INTO system.rights (`ID`, `name`, `description`) VALUES (21, 'SYS_SAI_API_EDIT', 'SAI API Edit right');
|
||||||
|
|
||||||
|
INSERT INTO system.rights (`ID`, `name`, `description`) VALUES (25, 'SYS_SAI_CRON', 'SAI Cron Access right');
|
||||||
2
system/dbd/sql/pg/schema/schema.sql
Normal file
2
system/dbd/sql/pg/schema/schema.sql
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
CREATE SCHEMA system
|
||||||
|
AUTHORIZATION username;
|
||||||
16
system/dbd/sql/pg/schema/system_api.sql
Normal file
16
system/dbd/sql/pg/schema/system_api.sql
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
CREATE TABLE system.api
|
||||||
|
(
|
||||||
|
"ID" integer NOT NULL,
|
||||||
|
"group" integer NOT NULL,
|
||||||
|
type integer NOT NULL,
|
||||||
|
"parentID" integer NOT NULL,
|
||||||
|
"parentValue" character varying(50),
|
||||||
|
name character varying(50) NOT NULL,
|
||||||
|
verify character varying(50),
|
||||||
|
CONSTRAINT system_api_pk PRIMARY KEY ("ID", "group")
|
||||||
|
)
|
||||||
|
WITH (
|
||||||
|
OIDS=FALSE
|
||||||
|
);
|
||||||
|
ALTER TABLE system.api
|
||||||
|
OWNER TO username;
|
||||||
32
system/dbd/sql/pg/schema/system_cache.sql
Normal file
32
system/dbd/sql/pg/schema/system_cache.sql
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
CREATE TABLE system.cache
|
||||||
|
(
|
||||||
|
"ID" integer NOT NULL DEFAULT nextval('system."cache_ID_seq"'::regclass),
|
||||||
|
"CacheID" integer NOT NULL,
|
||||||
|
"Ident" character varying NOT NULL,
|
||||||
|
data bytea,
|
||||||
|
CONSTRAINT pk_system_cache_id PRIMARY KEY ("ID"),
|
||||||
|
CONSTRAINT unique_system_cache_cid_ident UNIQUE ("CacheID", "Ident")
|
||||||
|
)
|
||||||
|
WITH (
|
||||||
|
OIDS=FALSE
|
||||||
|
);
|
||||||
|
ALTER TABLE system.cache
|
||||||
|
OWNER TO username;
|
||||||
|
|
||||||
|
-- Index: system."cache_CacheID_Ident_idx"
|
||||||
|
|
||||||
|
-- DROP INDEX system."cache_CacheID_Ident_idx";
|
||||||
|
|
||||||
|
CREATE INDEX "cache_CacheID_Ident_idx"
|
||||||
|
ON system.cache
|
||||||
|
USING btree
|
||||||
|
("CacheID", "Ident" COLLATE pg_catalog."default");
|
||||||
|
|
||||||
|
-- Index: system."cache_Ident_idx"
|
||||||
|
|
||||||
|
-- DROP INDEX system."cache_Ident_idx";
|
||||||
|
|
||||||
|
CREATE INDEX "cache_Ident_idx"
|
||||||
|
ON system.cache
|
||||||
|
USING btree
|
||||||
|
("Ident" COLLATE pg_catalog."default");
|
||||||
17
system/dbd/sql/pg/schema/system_cron.sql
Normal file
17
system/dbd/sql/pg/schema/system_cron.sql
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
CREATE TABLE system.cron
|
||||||
|
(
|
||||||
|
"class" character varying(255) NOT NULL,
|
||||||
|
"min" integer DEFAULT NULL,
|
||||||
|
"hour" integer DEFAULT NULL,
|
||||||
|
"day" integer DEFAULT NULL,
|
||||||
|
"day_week" integer DEFAULT NULL,
|
||||||
|
"month" integer DEFAULT NULL,
|
||||||
|
"last_run" timestamp with time zone DEFAULT NULL,
|
||||||
|
"status" integer NOT NULL DEFAULT 0,
|
||||||
|
PRIMARY KEY ("class")
|
||||||
|
)
|
||||||
|
WITH (
|
||||||
|
OIDS=FALSE
|
||||||
|
);
|
||||||
|
ALTER TABLE system.log
|
||||||
|
OWNER TO dasense;
|
||||||
13
system/dbd/sql/pg/schema/system_locale_string.sql
Normal file
13
system/dbd/sql/pg/schema/system_locale_string.sql
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
CREATE TABLE system.locale_string
|
||||||
|
(
|
||||||
|
id character varying(50) NOT NULL,
|
||||||
|
category integer NOT NULL DEFAULT 0,
|
||||||
|
"enUS" text,
|
||||||
|
"deDE" text,
|
||||||
|
CONSTRAINT system_locale_string_pk_id PRIMARY KEY (id)
|
||||||
|
)
|
||||||
|
WITH (
|
||||||
|
OIDS=FALSE
|
||||||
|
);
|
||||||
|
ALTER TABLE system.locale_string
|
||||||
|
OWNER TO username;
|
||||||
30
system/dbd/sql/pg/schema/system_log.sql
Normal file
30
system/dbd/sql/pg/schema/system_log.sql
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
CREATE TABLE system.log
|
||||||
|
(
|
||||||
|
"ID" integer NOT NULL DEFAULT nextval('system."sys_log_ID_seq"'::regclass),
|
||||||
|
class text NOT NULL,
|
||||||
|
message text NOT NULL,
|
||||||
|
code integer NOT NULL,
|
||||||
|
file text NOT NULL,
|
||||||
|
line integer NOT NULL,
|
||||||
|
trace text NOT NULL,
|
||||||
|
ip text NOT NULL,
|
||||||
|
querytime double precision NOT NULL,
|
||||||
|
"time" timestamp with time zone NOT NULL DEFAULT now(),
|
||||||
|
server_name character varying(255),
|
||||||
|
server_port integer,
|
||||||
|
request_uri character varying(512),
|
||||||
|
post text,
|
||||||
|
http_referer character varying(255),
|
||||||
|
http_user_agent text,
|
||||||
|
"user" integer,
|
||||||
|
thrown integer,
|
||||||
|
CONSTRAINT system_log_pk_id PRIMARY KEY ("ID"),
|
||||||
|
CONSTRAINT system_log_fk_user FOREIGN KEY ("user")
|
||||||
|
REFERENCES system."user" (id) MATCH SIMPLE
|
||||||
|
ON UPDATE NO ACTION ON DELETE NO ACTION
|
||||||
|
)
|
||||||
|
WITH (
|
||||||
|
OIDS=FALSE
|
||||||
|
);
|
||||||
|
ALTER TABLE system.log
|
||||||
|
OWNER TO dasense;
|
||||||
12
system/dbd/sql/pg/schema/system_rights.sql
Normal file
12
system/dbd/sql/pg/schema/system_rights.sql
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
CREATE TABLE system.rights
|
||||||
|
(
|
||||||
|
"ID" integer NOT NULL DEFAULT nextval('system."user_rights_ID_seq"'::regclass),
|
||||||
|
name character varying(55) NOT NULL,
|
||||||
|
description character varying(255) NOT NULL,
|
||||||
|
CONSTRAINT system_rights_pk PRIMARY KEY ("ID")
|
||||||
|
)
|
||||||
|
WITH (
|
||||||
|
OIDS=FALSE
|
||||||
|
);
|
||||||
|
ALTER TABLE system.rights
|
||||||
|
OWNER TO username;
|
||||||
34
system/dbd/sql/pg/schema/system_todo.sql
Normal file
34
system/dbd/sql/pg/schema/system_todo.sql
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
CREATE TABLE system.todo
|
||||||
|
(
|
||||||
|
"ID" integer NOT NULL,
|
||||||
|
"class" text NOT NULL,
|
||||||
|
"message" text NOT NULL,
|
||||||
|
"message_hash" character varying(40) NOT NULL,
|
||||||
|
"code" integer NOT NULL,
|
||||||
|
"file" text NOT NULL,
|
||||||
|
"line" integer NOT NULL,
|
||||||
|
"trace" text NOT NULL,
|
||||||
|
"ip" text NOT NULL,
|
||||||
|
"querytime" double precision NOT NULL,
|
||||||
|
"time" timestamp with time zone NOT NULL DEFAULT now(),
|
||||||
|
server_name character varying(255),
|
||||||
|
server_port integer,
|
||||||
|
request_uri character varying(512),
|
||||||
|
post text,
|
||||||
|
http_referer character varying(255),
|
||||||
|
http_user_agent text,
|
||||||
|
"user" integer,
|
||||||
|
thrown integer,
|
||||||
|
"type" integer NOT NULL DEFAULT 0,
|
||||||
|
"count" integer NOT NULL DEFAULT 1,
|
||||||
|
"state" integer NOT NULL DEFAULT 0,
|
||||||
|
CONSTRAINT system_todo_pk_id PRIMARY KEY ("ID"),
|
||||||
|
CONSTRAINT system_todo_fk_user FOREIGN KEY ("user")
|
||||||
|
REFERENCES system."user" (id) MATCH SIMPLE
|
||||||
|
ON UPDATE NO ACTION ON DELETE NO ACTION
|
||||||
|
)
|
||||||
|
WITH (
|
||||||
|
OIDS=FALSE
|
||||||
|
);
|
||||||
|
ALTER TABLE system.todo
|
||||||
|
OWNER TO dasense;
|
||||||
18
system/dbd/sql/pg/schema/system_user.sql
Normal file
18
system/dbd/sql/pg/schema/system_user.sql
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
CREATE TABLE system."user"
|
||||||
|
(
|
||||||
|
id serial NOT NULL,
|
||||||
|
username character varying(32) NOT NULL,
|
||||||
|
password_sha character varying(255),
|
||||||
|
password_md5 character varying(255),
|
||||||
|
email character varying(255) NOT NULL,
|
||||||
|
joindate timestamp with time zone NOT NULL DEFAULT now(),
|
||||||
|
locale character varying(6) NOT NULL DEFAULT 'enUS'::character varying,
|
||||||
|
last_active timestamp with time zone NOT NULL DEFAULT now(),
|
||||||
|
account_flag integer,
|
||||||
|
CONSTRAINT system_user_pk_id PRIMARY KEY (id)
|
||||||
|
)
|
||||||
|
WITH (
|
||||||
|
OIDS=FALSE
|
||||||
|
);
|
||||||
|
ALTER TABLE system."user"
|
||||||
|
OWNER TO username;
|
||||||
16
system/dbd/sql/pg/schema/system_user_to_rights.sql
Normal file
16
system/dbd/sql/pg/schema/system_user_to_rights.sql
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
CREATE TABLE system.user_to_rights
|
||||||
|
(
|
||||||
|
"rightID" integer NOT NULL,
|
||||||
|
"userID" integer NOT NULL,
|
||||||
|
CONSTRAINT "system_user_to_rights_fk_userID" FOREIGN KEY ("userID")
|
||||||
|
REFERENCES system."user" (id) MATCH SIMPLE
|
||||||
|
ON UPDATE NO ACTION ON DELETE NO ACTION,
|
||||||
|
CONSTRAINT "system_user_to_rights_rightID" FOREIGN KEY ("rightID")
|
||||||
|
REFERENCES system.rights ("ID") MATCH SIMPLE
|
||||||
|
ON UPDATE NO ACTION ON DELETE NO ACTION
|
||||||
|
)
|
||||||
|
WITH (
|
||||||
|
OIDS=FALSE
|
||||||
|
);
|
||||||
|
ALTER TABLE system.user_to_rights
|
||||||
|
OWNER TO username;
|
||||||
13
system/dbd/sql/pg/util_copy_api_table_by_groupa.sql
Normal file
13
system/dbd/sql/pg/util_copy_api_table_by_groupa.sql
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
-- delete old entries of group
|
||||||
|
DELETE FROM system.api where "group" = 101;
|
||||||
|
-- get data from group 0 and write it in your group
|
||||||
|
INSERT INTO system.api ( "ID", "group","type","parentID","parentValue","name","verify" )
|
||||||
|
SELECT "ID",
|
||||||
|
'101' as "group", -- target group
|
||||||
|
"type",
|
||||||
|
"parentID",
|
||||||
|
"parentValue",
|
||||||
|
"name",
|
||||||
|
"verify"
|
||||||
|
FROM system.api
|
||||||
|
WHERE "group" = 0; -- pattern group
|
||||||
14
system/dbd/tbl/UserLoginsTable.php
Normal file
14
system/dbd/tbl/UserLoginsTable.php
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace SYSTEM\DBD;
|
||||||
|
|
||||||
|
class UserLoginsTable {
|
||||||
|
|
||||||
|
const NAME = 'system.user_logins';
|
||||||
|
|
||||||
|
const FIELD_ID = 'id';
|
||||||
|
const FIELD_USERID = 'userID';
|
||||||
|
const FIELD_IP = 'IP';
|
||||||
|
const FIELD_SUCC = 'succ';
|
||||||
|
const FIELD_TIMESTAMP = 'timestamp';
|
||||||
|
}
|
||||||
12
system/dbd/tbl/UserRightsTable.php
Normal file
12
system/dbd/tbl/UserRightsTable.php
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace SYSTEM\DBD;
|
||||||
|
|
||||||
|
class UserRightsTable {
|
||||||
|
|
||||||
|
const NAME_PG = 'system.user_to_rights';
|
||||||
|
const NAME_MYS = 'system_user_to_rights';
|
||||||
|
|
||||||
|
const FIELD_USERID = 'userID';
|
||||||
|
const FIELD_RIGHTID = 'rightID';
|
||||||
|
}
|
||||||
22
system/dbd/tbl/system_api.php
Normal file
22
system/dbd/tbl/system_api.php
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace SYSTEM\DBD;
|
||||||
|
|
||||||
|
class system_api {
|
||||||
|
const NAME_PG = 'system.api';
|
||||||
|
const NAME_MYS = 'system_api';
|
||||||
|
|
||||||
|
const FIELD_ID = 'ID';
|
||||||
|
const FIELD_GROUP = 'group';
|
||||||
|
const FIELD_TYPE = 'type';
|
||||||
|
const FIELD_PARENTID = 'parentID';
|
||||||
|
const FIELD_PARENTVALUE = 'parentValue';
|
||||||
|
const FIELD_NAME = 'name';
|
||||||
|
const FIELD_VERIFY = 'verify';
|
||||||
|
|
||||||
|
const VALUE_TYPE_COMMAND = 0;
|
||||||
|
const VALUE_TYPE_COMMAND_FLAG = 1;
|
||||||
|
const VALUE_TYPE_PARAM = 2;
|
||||||
|
const VALUE_TYPE_PARAM_OPT = 3;
|
||||||
|
const VALUE_TYPE_STATIC = 4;
|
||||||
|
}
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user