diff --git a/api/api.php b/api/api.php index c68b393..371b492 100644 --- a/api/api.php +++ b/api/api.php @@ -63,17 +63,16 @@ class api { $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){ + 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]])){ + 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]; diff --git a/api/api_system.php b/api/api_system.php index 736e2e0..832ca95 100644 --- a/api/api_system.php +++ b/api/api_system.php @@ -3,39 +3,20 @@ namespace SYSTEM\API; class api_system extends 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);}*/ - - public static function call_locale($request,$lang){ + 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);} + \SYSTEM\CONFIG\config::set(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_DEFAULT_RESULT, $result);} } \ No newline at end of file diff --git a/api/autoload.inc.php b/api/autoload.inc.php new file mode 100644 index 0000000..9c5b8af --- /dev/null +++ b/api/autoload.inc.php @@ -0,0 +1,2 @@ +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'];} +} \ No newline at end of file diff --git a/cron/cron_log2sqlite.php b/cron/cron_log2sqlite.php new file mode 100644 index 0000000..76af1c4 --- /dev/null +++ b/cron/cron_log2sqlite.php @@ -0,0 +1,70 @@ + 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; + } +} \ No newline at end of file diff --git a/cron/cronjob.php b/cron/cronjob.php new file mode 100644 index 0000000..da27e93 --- /dev/null +++ b/cron/cronjob.php @@ -0,0 +1,6 @@ + 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);} +} \ No newline at end of file diff --git a/db/autoload.inc.php b/db/autoload.inc.php new file mode 100644 index 0000000..2bca5de --- /dev/null +++ b/db/autoload.inc.php @@ -0,0 +1,6 @@ +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){ + } 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');} } @@ -39,4 +41,7 @@ class Connection extends ConnectionAbstr{ //Query connected Database public function query($query){ return $this->connection->query($query);} + + public function exec($query){ + return $this->connection->exec($query);} } \ No newline at end of file diff --git a/db/connection/ConnectionAMQP.php b/db/connection/ConnectionAMQP.php index 41aef29..99d9784 100644 --- a/db/connection/ConnectionAMQP.php +++ b/db/connection/ConnectionAMQP.php @@ -28,12 +28,14 @@ class ConnectionAMQP extends ConnectionAbstr { $exchange->setFlags(AMQP_DURABLE); $exchange->setName('exchange2'); $exchange->setType('direct'); - $exchange->declare(); + //$exchange->declare(); + $exchange->declareExchange(); $queue = new \AMQPQueue($channel); $queue->setName('series'); $queue->setFlags(AMQP_DURABLE | AMQP_AUTODELETE); - $queue->declare(); + //$queue->declare(); + $queue->declareQueue(); $queue->bind('exchange2','series'); $channel->startTransaction(); diff --git a/db/connection/ConnectionMYS.php b/db/connection/ConnectionMYS.php index 2dc4bc1..8cb69af 100644 --- a/db/connection/ConnectionMYS.php +++ b/db/connection/ConnectionMYS.php @@ -11,11 +11,11 @@ class ConnectionMYS extends ConnectionAbstr { $this->connection = @mysqli_connect($dbinfo->m_host, $dbinfo->m_user, $dbinfo->m_password, $new_link, $client_flag); if(!$this->connection){ - throw new \SYSTEM\LOG\ERROR('Could not connect to Database. Check ur Database Settings');} + 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 \SYSTEM\LOG\ERROR('Could not select Database. Check ur Database Settings: '.mysqli_error($this->connection));} + throw new \Exception('Could not select Database. Check ur Database Settings: '.mysqli_error($this->connection));} } public function __destruct(){ diff --git a/db/connection/ConnectionPG.php b/db/connection/ConnectionPG.php index aaa0e73..58190f3 100644 --- a/db/connection/ConnectionPG.php +++ b/db/connection/ConnectionPG.php @@ -13,7 +13,7 @@ class ConnectionPG extends ConnectionAbstr { $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 \SYSTEM\LOG\ERROR('Could not connect to Database. Check ur Database Settings');} + throw new \Exception('Could not connect to Database. Check ur Database Settings');} } public function __destruct(){} diff --git a/db/connection/ConnectionSQLite.php b/db/connection/ConnectionSQLite.php new file mode 100644 index 0000000..1cca3a3 --- /dev/null +++ b/db/connection/ConnectionSQLite.php @@ -0,0 +1,48 @@ +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); + } +} \ No newline at end of file diff --git a/db/dbinfo/DBInfoSQLite.php b/db/dbinfo/DBInfoSQLite.php new file mode 100644 index 0000000..c89dd8e --- /dev/null +++ b/db/dbinfo/DBInfoSQLite.php @@ -0,0 +1,15 @@ +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");} + } +} \ No newline at end of file diff --git a/db/qq/QQ.php b/db/qq/QQ.php index 775623c..ab86314 100644 --- a/db/qq/QQ.php +++ b/db/qq/QQ.php @@ -26,7 +26,7 @@ class QQ { return self::QQ()->next();} public static function QI(){ $qq = self::QQ(); - return $qq->affectedRows() != (0||null);} + return $qq;} //override this protected static function query(){ throw new \SYSTEM\LOG\ERROR('query function of your QQ Class not overwritten!');} diff --git a/db/result/ResultSQLite.php b/db/result/ResultSQLite.php new file mode 100644 index 0000000..7a7996f --- /dev/null +++ b/db/result/ResultSQLite.php @@ -0,0 +1,81 @@ +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);} +} \ No newline at end of file diff --git a/dbd/autoload.inc.php b/dbd/autoload.inc.php new file mode 100644 index 0000000..3cfa7e3 --- /dev/null +++ b/dbd/autoload.inc.php @@ -0,0 +1,3 @@ +TinyMCE LogoWelcome to the TinyMCE editor demo!\n

Feel free to try out the different features that are provided, please note that the MoxieManager specific functionality is part of our commercial offering. The demo is to show the integration.

\n

Got questions or need help?

\n

If you have questions or need help, feel free to visit our community forum! We also offer Enterprise support solutions. Also do not miss out on the documentation, its a great resource wiki for understanding how TinyMCE works and integrates.

\n

Found a bug?

\n

If you think you have found a bug, you can use the Bug Tracker to report bugs to the developers.

\n

And here is a simple table for you to play with.

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
ProductCostReally?
TinyMCEFreeYES!
PluploadFreeYES!
\n

Enjoy our software and create great content!

\n

Oh, and by the way, don\'t forget to check out our other product called Plupload, your ultimate upload solution with HTML5 upload support!

', '

TinyMCE LogoWelcome to the TinyMCE editor demo!

\n

Feel free to try out the different features that are provided, please note that the MoxieManager specific functionality is part of our commercial offering. The demo is to show the integration.

\n

Got questions or need help?

\n

If you have questions or need help, feel free to visit our community forum! We also offer Enterprise support solutions. Also do not miss out on the documentation, its a great resource wiki for understanding how TinyMCE works and integrates.

\n

Found a bug?

\n

If you think you have found a bug, you can use the Bug Tracker to report bugs to the developers.

\n

And here is a simple table for you to play with.

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
ProductCostReally?
TinyMCEFreeYES!
PluploadFreeYES!
\n

Enjoy our software and create great content!

\n

Oh, and by the way, don\'t forget to check out our other product called Plupload, your ultimate upload solution with HTML5 upload support!

'); \ No newline at end of file diff --git a/dbd/sql/mysql/data/sai_api.sql b/dbd/sql/mysql/data/sai_api.sql index 801a1cb..4745657 100644 --- a/dbd/sql/mysql/data/sai_api.sql +++ b/dbd/sql/mysql/data/sai_api.sql @@ -1,49 +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, 'action', NULL); +-- INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (3, 42, 0, 0, NULL, 'page', NULL); -INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (10, 42, 2, 3, 'login', 'username', 'ALL'); -INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (11, 42, 2, 3, 'login', 'password_sha', 'ALL'); -INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (12, 42, 2, 3, 'login', 'password_md5', 'ALL'); +-- 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'); -INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (20, 42, 2, 3, 'register', 'username', 'ALL'); -INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (21, 42, 2, 3, 'register', 'password', 'ALL'); -INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (23, 42, 2, 3, 'register', 'email', 'ALL'); -INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (24, 42, 3, 3, 'register', 'locale', 'ALL'); +-- 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 (30, 42, 2, 3, 'edit', 'id', 'ALL'); -INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (31, 42, 2, 3, 'edit', 'lang', 'LANG'); -INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (32, 42, 2, 3, 'edit', 'newtext', 'ALL'); -INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (33, 42, 2, 3, 'delete', 'id', 'ALL'); -INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (34, 42, 2, 3, 'editmode', 'entry', 'ALL'); -INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (35, 42, 2, 3, 'add', 'id', 'ALL'); -INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (36, 42, 2, 3, 'add', 'category', 'INT'); -INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (40, 42, 2, 3, 'upload', 'cat', 'STRING'); -INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (41, 42, 2, 3, 'del', 'cat', 'STRING'); -INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (42, 42, 2, 3, 'del', 'id', 'STRING'); -INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (43, 42, 2, 3, 'rn', 'cat', 'STRING'); -INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (44, 42, 2, 3, 'rn', 'id', 'STRING'); -INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (45, 42, 2, 3, 'rn', 'newid', 'STRING'); -INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (200, 42, 2, 3, 'tab', 'name', 'STRING'); +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 (50, 42, 3, 3, 'filter', 'filter', 'STRING'); -INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (51, 42, 3, 3, 'error', 'error', 'INT'); -INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (52, 42, 0, 3, 'stats', 'name', null); -INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (53, 42, 3, 52, null, 'filter', 'UINT'); -INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (54, 42, 2, 3, 'user', 'username', 'STRING'); -INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (55, 42, 2, 3, 'addright', 'id', 'UINT'); -INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (56, 42, 2, 3, 'addright', 'name', 'STRING'); -INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (57, 42, 2, 3, 'addright', 'description', 'STRING'); -INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (58, 42, 2, 3, 'deleteright', 'id', 'UINT'); -INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (59, 42, 2, 3, 'deleterightconfirm', 'id', 'UINT'); -INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (60, 42, 2, 3, 'addrightuser', 'rightid', 'UINT'); -INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (61, 42, 2, 3, 'addrightuser', 'userid', 'UINT'); -INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (62, 42, 2, 3, 'deleterightuser', 'rightid', 'UINT'); -INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (63, 42, 2, 3, 'deleterightuser', 'userid', 'UINT'); -INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (120, 42, 3, 3, 'users', 'search', 'STRING'); -INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (300, 42, 4, -1, NULL, '_lang', 'LANG'); +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'); \ No newline at end of file diff --git a/dbd/sql/mysql/data/sai_error_locale_string.sql b/dbd/sql/mysql/data/sai_error_locale_string.sql new file mode 100644 index 0000000..3517ad2 --- /dev/null +++ b/dbd/sql/mysql/data/sai_error_locale_string.sql @@ -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!'); \ No newline at end of file diff --git a/dbd/sql/mysql/data/sai_locale_string.sql b/dbd/sql/mysql/data/sai_locale_string.sql new file mode 100644 index 0000000..c91637c --- /dev/null +++ b/dbd/sql/mysql/data/sai_locale_string.sql @@ -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).'); \ No newline at end of file diff --git a/dbd/sql/mysql/data/system_api.sql b/dbd/sql/mysql/data/system_api.sql index d0b5d35..8c1bf33 100644 --- a/dbd/sql/mysql/data/system_api.sql +++ b/dbd/sql/mysql/data/system_api.sql @@ -1,14 +1,25 @@ -INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (0, 0, 0, -1, NULL, 'call', NULL); +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 (60, 0, 0, 0, NULL, 'action', NULL); -INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (61, 0, 2, 60, 'login', 'username', 'STRING'); -INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (62, 0, 2, 60, 'login', 'password_sha', 'STRING'); -INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (63, 0, 2, 60, 'login', 'password_md5', 'STRING'); -INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (64, 0, 2, 60, 'check', 'rightid', 'UINT'); -INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (65, 0, 2, 60, 'create', 'username', 'STRING'); -INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (66, 0, 2, 60, 'create', 'password_sha', 'STRING'); -INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (67, 0, 2, 60, 'create', 'email', 'STRING'); -INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (68, 0, 2, 60, 'create', 'locale', 'LANG'); +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 (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'); +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'); \ No newline at end of file diff --git a/dbd/sql/mysql/data/system_cron.sql b/dbd/sql/mysql/data/system_cron.sql new file mode 100644 index 0000000..f955752 --- /dev/null +++ b/dbd/sql/mysql/data/system_cron.sql @@ -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); diff --git a/dbd/sql/mysql/data/system_rights.sql b/dbd/sql/mysql/data/system_rights.sql index 72f0b4c..f56c8bb 100644 --- a/dbd/sql/mysql/data/system_rights.sql +++ b/dbd/sql/mysql/data/system_rights.sql @@ -1,5 +1,13 @@ -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 (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 (1, 'SYS_SAI', 'SAI access right'); \ No newline at end of file + +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'); \ No newline at end of file diff --git a/dbd/sql/mysql/schema/system_cron.sql b/dbd/sql/mysql/schema/system_cron.sql new file mode 100644 index 0000000..d884858 --- /dev/null +++ b/dbd/sql/mysql/schema/system_cron.sql @@ -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; diff --git a/dbd/sql/mysql/schema/system_log.sql b/dbd/sql/mysql/schema/system_log.sql index a4a742c..37f80a8 100644 --- a/dbd/sql/mysql/schema/system_log.sql +++ b/dbd/sql/mysql/schema/system_log.sql @@ -21,5 +21,4 @@ CREATE TABLE `system_log` ( ) COLLATE='utf8_general_ci' ENGINE=MyISAM -AUTO_INCREMENT=1; - +AUTO_INCREMENT=1; \ No newline at end of file diff --git a/dbd/sql/mysql/schema/system_page.sql b/dbd/sql/mysql/schema/system_page.sql new file mode 100644 index 0000000..871cd6b --- /dev/null +++ b/dbd/sql/mysql/schema/system_page.sql @@ -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; diff --git a/dbd/sql/mysql/schema/system_todo.sql b/dbd/sql/mysql/schema/system_todo.sql index 3f88815..a833791 100644 --- a/dbd/sql/mysql/schema/system_todo.sql +++ b/dbd/sql/mysql/schema/system_todo.sql @@ -1,16 +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, - `author` INT(11) NOT NULL, - `type` INT(11) NOT NULL, - `state` INT(11) NOT NULL, - `msg_1` TEXT NOT NULL, - `msg_2` TEXT NULL, - `msg_3` TEXT NULL, - `msg_4` TEXT NULL, - `msg_5` TEXT NULL, - PRIMARY KEY (`ID`) + `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=5; \ No newline at end of file +AUTO_INCREMENT=92; \ No newline at end of file diff --git a/dbd/sql/pg/data/basic_locale_string.sql b/dbd/sql/pg/data/basic_locale_string.sql new file mode 100644 index 0000000..12bce7b --- /dev/null +++ b/dbd/sql/pg/data/basic_locale_string.sql @@ -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.'); \ No newline at end of file diff --git a/dbd/sql/pg/data/sai_api.sql b/dbd/sql/pg/data/sai_api.sql index 34c0267..30f0cc0 100644 --- a/dbd/sql/pg/data/sai_api.sql +++ b/dbd/sql/pg/data/sai_api.sql @@ -1,38 +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, 'action', NULL); +-- INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (3, 42, 0, 0, NULL, 'page', NULL); -INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (10, 42, 2, 3, 'login', 'username', 'ALL'); -INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (11, 42, 2, 3, 'login', 'password_sha', 'ALL'); -INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (12, 42, 2, 3, 'login', 'password_md5', 'ALL'); +-- 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'); -INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (20, 42, 2, 3, 'register', 'username', 'ALL'); -INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (21, 42, 2, 3, 'register', 'password_sha', 'ALL'); -INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (22, 42, 2, 3, 'register', 'password_md5', 'ALL'); -INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (23, 42, 2, 3, 'register', 'email', 'ALL'); -INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (24, 42, 2, 4, 'register', 'locale', 'ALL'); +-- 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 (30, 42, 2, 3, 'edit', 'id', 'ALL'); -INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (31, 42, 2, 3, 'edit', 'lang', 'LANG'); -INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (32, 42, 2, 3, 'edit', 'newtext', 'ALL'); -INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (33, 42, 2, 3, 'delete', 'id', 'ALL'); -INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (34, 42, 2, 3, 'editmode', 'entry', 'ALL'); -INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (35, 42, 2, 3, 'add', 'id', 'ALL'); -INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (36, 42, 2, 3, 'add', 'category', 'INT'); -INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (40, 42, 2, 3, 'upload', 'cat', 'STRING'); -INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (41, 42, 2, 3, 'del', 'cat', 'STRING'); -INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (42, 42, 2, 3, 'del', 'id', 'STRING'); -INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (43, 42, 2, 3, 'rn', 'cat', 'STRING'); -INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (44, 42, 2, 3, 'rn', 'id', 'STRING'); -INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (45, 42, 2, 3, 'rn', 'newid', 'STRING'); +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 (50, 42, 3, 3, 'filter', 'filter', 'STRING'); -INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (51, 42, 3, 3, 'error', 'error', 'INT'); -INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (52, 42, 0, 3, 'stats', 'name', null); -INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (53, 42, 3, 52, null, 'filter', 'UINT'); -INSERT INTO system.api ("ID", "group", type, "parentID", "parentValue", name, verify) VALUES (300, 42, 4, -1, NULL, '_lang', 'LANG'); \ No newline at end of file +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'); \ No newline at end of file diff --git a/dbd/sql/pg/data/sai_error_locale_string.sql b/dbd/sql/pg/data/sai_error_locale_string.sql new file mode 100644 index 0000000..98e4c3c --- /dev/null +++ b/dbd/sql/pg/data/sai_error_locale_string.sql @@ -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!'); \ No newline at end of file diff --git a/dbd/sql/pg/data/sai_locale_string.sql b/dbd/sql/pg/data/sai_locale_string.sql new file mode 100644 index 0000000..7ed052c --- /dev/null +++ b/dbd/sql/pg/data/sai_locale_string.sql @@ -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).'); \ No newline at end of file diff --git a/dbd/sql/pg/data/system_api.sql b/dbd/sql/pg/data/system_api.sql new file mode 100644 index 0000000..e555ee5 --- /dev/null +++ b/dbd/sql/pg/data/system_api.sql @@ -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'); \ No newline at end of file diff --git a/dbd/sql/pg/data/system_rights.sql b/dbd/sql/pg/data/system_rights.sql new file mode 100644 index 0000000..5fb019b --- /dev/null +++ b/dbd/sql/pg/data/system_rights.sql @@ -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'); \ No newline at end of file diff --git a/dbd/sql/pg/schema/system_cron.sql b/dbd/sql/pg/schema/system_cron.sql new file mode 100644 index 0000000..650af2a --- /dev/null +++ b/dbd/sql/pg/schema/system_cron.sql @@ -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; \ No newline at end of file diff --git a/dbd/sql/pg/schema/system_log.sql b/dbd/sql/pg/schema/system_log.sql new file mode 100644 index 0000000..3693664 --- /dev/null +++ b/dbd/sql/pg/schema/system_log.sql @@ -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; \ No newline at end of file diff --git a/dbd/sql/pg/schema/system_sys_log.sql b/dbd/sql/pg/schema/system_sys_log.sql deleted file mode 100644 index d76711b..0000000 --- a/dbd/sql/pg/schema/system_sys_log.sql +++ /dev/null @@ -1,19 +0,0 @@ -CREATE TABLE system.sys_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() -) -WITH ( - OIDS=FALSE -); -ALTER TABLE system.sys_log - OWNER TO username; - diff --git a/dbd/sql/pg/schema/system_todo.sql b/dbd/sql/pg/schema/system_todo.sql index b7f08cb..41c5972 100644 --- a/dbd/sql/pg/schema/system_todo.sql +++ b/dbd/sql/pg/schema/system_todo.sql @@ -1,19 +1,34 @@ CREATE TABLE system.todo ( "ID" integer NOT NULL, - "time" timestamp with time zone NOT NULL, - author integer NOT NULL, - type integer NOT NULL, - state integer NOT NULL, - msg_1 text NOT NULL, - msg_2 text, - msg_3 text, - msg_4 text, - msg_5 text, - CONSTRAINT system_todo_pk_id PRIMARY KEY ("ID") + "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 username; + OWNER TO dasense; \ No newline at end of file diff --git a/dbd/tbl/system_cron.php b/dbd/tbl/system_cron.php new file mode 100644 index 0000000..9bde395 --- /dev/null +++ b/dbd/tbl/system_cron.php @@ -0,0 +1,18 @@ + + +SYSTEM provides several management techiques and general purpose funcionality +for a PHP Environment. All features of system are optional for using, altho +might be dependent on other features or standarts SYSTEM provides. + +Following funcionality is provided by SYSTEM: + + * api - php post/get input validation and handling + * cache - cache using the database as storage for images/other data + * config - configuration of a SYSTEM environment, can be extended for project purposes + * db - database connection, query and prepare functionality, supporting MYSQL and POSTGRESQL, QQ + * docu - register documentation right were it is - show it in the backend + * files - file management & external access api + * log - exceptionhandling - including dbwrite options + * page - html page generation scheme + * sai - Admininterface + * security - Userlogin, register, rights, (email), session management + * system - autoload, database texts, path generation, systemconfig, time \ No newline at end of file diff --git a/docu/system/2.license.md b/docu/system/2.license.md index 8cccd96..a67cf9a 100644 --- a/docu/system/2.license.md +++ b/docu/system/2.license.md @@ -1,6 +1,6 @@ License ======= -Copyright (c) 2013 TU-Darmstadt, Ulf Gebhardt +Copyright (c) 2014 Ulf Gebhardt Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/docu/system/3.getting started.md b/docu/system/3.getting started.md index 5a1b331..15f31f9 100644 --- a/docu/system/3.getting started.md +++ b/docu/system/3.getting started.md @@ -1,27 +1,6 @@ ##Getting started -SYSTEM is a PHP Lightweight Framework. - -You can obtain a copy from https://github.com/gebhardtdasense/system/ - -SYSTEM provides several management techiques and general purpose funcionality -for a PHP Environment. All features of system are optional for using, altho -might be dependent on other features or standarts SYSTEM provides. - -Following funcionality is provided by SYSTEM: - - * api - php post/get input validation and handling - * cache - cache using the database as storage for images/other data - * config - configuration of a SYSTEM environment, can be extended for - project purposes - * db - database connection, query and prepare functionality, - supporting MYSQL and POSTGRESQL - * docu - register documentation right were it is - show it in the backend - * log - exceptionhandling - including dbwrite options - * page - html page generation scheme - * sai - Admininterface - * security - Userlogin, register, rights, (email), session management - * system - autoload, database texts, path generation, systemconfig, time +This is an introduction how to setup a webpage with system ##Setup diff --git a/docu/system/system.api.md b/docu/system/system.api.md index e69de29..b1a46aa 100644 --- a/docu/system/system.api.md +++ b/docu/system/system.api.md @@ -0,0 +1,69 @@ +SYSTEM API +---------- + +The SYSTEM-Api allows you to validate post/get/jsonpost parameters to function-calls. +This allows you to direct calls to your website to a class which can process those +calls in a typesave maner. + +WARNING: This Method breaks inheritance in some use-cases! + +How it Works +------------ + +Mapping of URLs to Functions -> thats it basicly + +The URL + + http://mypage.net/api.php?call=test&action=bla¶m1=1¶m2=abc + +maps to + + public static function call_test_action_bla($param1,$param2){} + +if you set your database properly: + + INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (1, 0, 0, -1, NULL, 'call', NULL); + INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (2, 0, 0, 1, 'test', 'action', NULL); + INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (3, 0, 2, 2, 'bla', 'param1', 'UINT'); + INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (4, 0, 2, 2, 'bla', 'param2', 'STRING'); + +(note that the params are on the same level of the tree) +now you just need a php class with your function + + look there + echo \SYSTEM\API\api::run('my_verify', 'api_dasense',$json, 25); + +note the use of api group 25 - this allows you to construct several apis. \ No newline at end of file diff --git a/docu/system/system.cache.md b/docu/system/system.cache.md index e69de29..463d5d1 100644 --- a/docu/system/system.cache.md +++ b/docu/system/system.cache.md @@ -0,0 +1,2 @@ +cache +----- \ No newline at end of file diff --git a/docu/system/system.config.md b/docu/system/system.config.md index e69de29..7fd5b2d 100644 --- a/docu/system/system.config.md +++ b/docu/system/system.config.md @@ -0,0 +1,2 @@ +config +------ \ No newline at end of file diff --git a/docu/system/system.db.md b/docu/system/system.db.md index e69de29..3f9a814 100644 --- a/docu/system/system.db.md +++ b/docu/system/system.db.md @@ -0,0 +1,2 @@ +db +-- \ No newline at end of file diff --git a/docu/system/system.db.qq.md b/docu/system/system.db.qq.md new file mode 100644 index 0000000..d98b5a4 --- /dev/null +++ b/docu/system/system.db.qq.md @@ -0,0 +1,76 @@ +QQ Objects +---------- + +Referenz: + +QQ-Objekte können von zwei verschiedenen Klassen erben: + + - QQ (quick query) + - QP (quick prepare) + +Class Definitions: + + class MY_QUERY_QQ extends \SYSTEM\DB\QQ {} + class MY_QUERY_QP extends \SYSTEM\DB\QP {} + + +Je nachdem was du benutzt kannst du in deinem SQL String $1,$2,$3... +benutzen oder nicht (prepare hat $1..., query hat das nicht). +Folglich mache alle Querys ohne Paramter als QQ, alle mit als QP Klasse! + +Der Unterschied der Klassen ist einfach, dass bei allen Funktionen von QP +ein array mit den Parametern übergeben werden muss. + +Es gibt 4 Funktionen + + - QQ (selber über die daten loopen) + - Q1 (geb mir genau eine zeile) + - QA (geb mir alle Zeilen) + - QI (Insert/Delete... -> returns true) + +Q1 +-- + + MY_QUERY_QQ::Q1() + -> array(feld1 => value, feld2 => value...) + + MY_QUERY_QP::Q1(array(param1,param2,...)) + -> array(feld1 => value, feld2 => value...) + +QA +-- + + MY_QUERY_QQ::QA() + -> array(array(feld1 => value, feld2 => value...), array(feld1 => ...)) + MY_QUERY_QP::QA(array(param1,param2,...)) + -> array(array(feld1 => value, feld2 => value...), array(feld1 => ...)) + +QI +-- + + MY_QUERY_QQ::QI() + -> true/false + MY_QUERY_QP::QI(array(param1,param2,...)) + -> true/false + +QQ +-- + + $result = array(); + $rows = MY_QUERY_QQ::QQ(); + while($row = $rows->next()){ //1. über alle loopen + $row[field1] = 5; + $result[] = $row; + } + + -> QQ Benutzen, um das Datenbank Ergebnis auszuschmücken ohne zweimal über + das ergebniss zu loopen: + +Wrong +----- + $result = array(); + $rows = MY_QUERY_QQ::QA(); // 1. über alle loppen + foreach($rows as $row){ // 2. über alle loopen + $row[field1] = 5; + $result[] = $row; + } \ No newline at end of file diff --git a/docu/system/system.system.md b/docu/system/system.system.md index e69de29..8210b3a 100644 --- a/docu/system/system.system.md +++ b/docu/system/system.system.md @@ -0,0 +1,188 @@ +####autoload + + Komuniktationsprobleme der Neuzeit ;-) + + * E: Entwickler + * A: Admin + + * ##### Lösung + + * ##### * Lösung Ignorieren + +----- + + * E: 23:36:01: Hi A + * E: 23:36:13: ich habe noch mal eine Frage an dich wegen Project21 + * E: 23:36:32: ich habe es ja soweit hinbekommen die Visualisierung auf unser Handy zu bekommen + * E: 23:36:58: ich dachte mir nun, das ich jetzt am Besten einen bestehenden Algorithmus kopiere - in umbenenne und dann daran unsere Modifikationen vornehme + * E: 23:37:20: aber leider scheint das mit dem kopieren und hinzufügen in der api.php nicht getan zu sein + * E: 23:37:33: muss ich dabei sonst noch etwas beachten ? + * E: 23:37:52: weil derzeit bekomme ich in der autoload.php unter system/system + + - A: 23:37:54: in der tabelle system.api müssen zeilen hinzugefügt werden + + * E: 23:38:01: den fehler class not found + + - A: 23:38:09: dann fehlt wohl ne klasse^^ + + * E: 23:38:48: mmh ich will keine neuen parameter einfügen wenn du das meinst + * E: 23:38:54: leidiglich z.b. statt heatmapRect + * E: 23:39:02: heatMapRectCoverage callen z.B. + + - ##### A: 23:39:17: die klasse muss so heißen wie die datei + - A: 23:39:23: und geautoloaded werden + + * E: 23:40:22: mmh ich habe jetzt im ordner preprocessing in die autload.inc.php eine zeile hinzugefügt gehabt + * E: 23:40:28: das scheint dann aber wohl nicht die richtige zu sein + * E: 23:40:35: für die visualisierungs algorithmen + * ##### * E: 23:40:42: weil Datei und Ordner heißen schon gleich + + * ##### * E: 23:40:45: das habe ich berücksichtigt + + - A: 23:41:01: dann ist der ordner in der die klasse liegt wohl nicht registriert + + * E: 23:42:28: mmh das stimmt + * E: 23:42:39: aber in welcher autload.inc.php mache ich das bekannt ? + + - A: 23:42:48: in der nächsten^^ + - A: 23:42:55: die die am nächsten dran liegt + - A: 23:42:59: aber prinzipiell egal + + * ##### * E: 23:43:20: mmh dann hätte ich das aber richtig gemacht + + - A: 23:43:39: kp er sagt dir ja class not found + - A: 23:43:47: sprich er kann die klasse nicht laden + + * E: 23:43:52: korrekt + * E: 23:43:59: den ordner scheint er aber zu finden + + - A: 23:44:26: sonst schmiert der autoload mit nem fehler ab, ja + - A: 23:44:47: kp -> vll ist es einfach nicht hochgeladen, großkleinschreibeung... + + * E: 23:45:05: mmh + * E: 23:45:07: ich schau mal + * E: 23:45:10: vielleicht mal alles klein schreiben + * E: 23:47:02: mmh nein + * E: 23:47:06: auch das hat nichts gebracht + + - A: 23:52:23: kp + - A: 23:52:29: sonst fällt mir nix ein + + * E: 23:52:50: aber in der Datenbank muss dafür nichts geändert werden oder ? + + - A: 23:52:58: nö + + * E: 23:52:58: die Parameter die ich übergebe sollen ja die selben bleiben + * E: 23:53:01: kk + + - A: 23:53:06: hats n namespace? + + * E: 23:53:09: das ist schon mal gut zu wissen + + - A: 23:53:13: den musst du beim autloaden angeben + + * E: 23:53:20: mmh wie meinst du das ? + + - A: 23:53:27: namespace SYSTEM/LOG + - A: 23:53:41: dann musste beim autoload SYSTEM/LOG mit angeben + + * E: 23:54:20: in der algorithmen klasse selbst nicht nein + + - A: 23:54:31: dann müsste es passen + + * E: 23:54:59: mmh seltsam seltsam + * E: 23:55:06: ich stelle ich wahrscheinlich nur zu blöd an ^^ + + - A: 23:55:16: xD ich hab keinen plan was du da schaffst + - ##### A: 23:55:27: aber prüfe nochmal genau groß und kleinschreibung + + * E: 23:55:30: eigentlich sollte es doch nicht so kompliziert sein + + - ##### A: 23:55:31: KlassenName.php + + * E: 23:55:40: den ordner kopiern umbenennen + * E: 23:55:41: ne is eientlich ziemlich simpel + + - A: 23:56:00: der pfad im autoload haste angepasst?!^^ + + * E: 23:56:23: ja da hab ich noch einen hinzugefügt + + - A: 23:56:36: ajo + - A: 23:56:46: wenn er den ordner net findet schreit er auch + + * E: 23:56:54: genau + * E: 23:56:59: das hab ich ja auch ausprobiert + * E: 23:57:02: durch umbennenn vom ordner + * E: 23:57:07: den findet er also scheints + + - A: 23:57:12: vll ist es beim aufruf falsch geschrieben? + + * E: 23:59:06: /home/mona-srv/da-sense/test2/system/system/autoload.php + * E: 23:59:11: in der datei schmiert das system dann ab + * E: 23:59:30: aber das hilft mir auch nicht so richtig weiter + + - A: 23:59:32: joa mit der message class not found? + + * E: 23:59:37: exakt + + - A: 23:59:41: geb dir mal den klassennamen aus + - A: 23:59:50: und schau obs der gleiche ist + + * E: 00:00:41: public static function autoload($class){ + $classns = self::getClassNamespaceFromClass($class); + + if(!self::autoload_($classns[0],$classns[1]) || (!class_exists($class) && !interface_exists($class))){ + throw new \SYSTEM\LOG\ERROR("Class not found: ".$class);} + + return true; + } + * E: 00:00:48: mmh was davon ist der klassenname ? :D + * E: 00:00:55: classns[0] ? + + - A: 00:00:57: throw new \SYSTEM\LOG\ERROR("Class not found: ".$class);} + - A: 00:01:05: sollte dir den klassennamen schon sagen + + * E: 00:01:17: Class not found: s_algo + + - A: 00:01:22: ajo + + * E: 00:01:23: habs mal auf 1 buchstaben reduziert + + - ##### A: 00:01:26: da haste dein problem + + * E: 00:01:31: um schreibfehler auszuschließen + * E: 00:01:33: mmh ? + + - ##### A: 00:01:38: s_algo + + - ##### A: 00:01:45: so soll die klasse heißen + + - ##### A: 00:01:56: s_algo.php + + * ##### * E: 00:01:58: ja so heißt sie + * E: 00:02:03: und der ornder heißt auch s_algo + + - ##### A: 00:02:11: und die klasse heißt auch s_algo? + + * E: 00:02:41: oh man - ja ich bin echt zu blöd :( + + - A: 00:03:00: das war das erste, zweite und dritte was ich dich gefragt hab + + * E: 00:03:05: zu viele namen :/ + + - ##### A: 00:03:07: ob die klasse wie die datei heißt + + * E: 00:03:12: tut mir leid + + - A: 00:03:15: np + + * E: 00:03:30: ich habe dateinamen als ordnernamen fehl interpretiert + + - A: 00:03:46: kk^^ + + * E: 00:03:50: jetzt gehts - besten Dank. + * E: 00:04:04: bin mit blödheit geschlagen echt + * E: 00:04:53: danke - dann kann ich nämlich jetzt so nach herzenslust modifizieren + * E: 00:04:57: ohne das es was macht + + - A: 00:06:47: super, wenns läuft ;-) \ No newline at end of file diff --git a/files/autoload.inc.php b/files/autoload.inc.php new file mode 100644 index 0000000..038ae6d --- /dev/null +++ b/files/autoload.inc.php @@ -0,0 +1,3 @@ +next()){ + $row['url'] = \SYSTEM\PAGE\replace::replace($row['url'], $vars); + $row['css'] = $row['js'] = array(); + if(/*\is_callable($row['php_class']) &&*/ \class_exists($row['php_class']) && \method_exists($row['php_class'], 'css') && \is_callable($row['php_class'].'::css')){ + $row['css'] = array_merge($row['css'], call_user_func($row['php_class'].'::css'));} + if(/*\is_callable($row['php_class']) &&*/ \class_exists($row['php_class']) && \method_exists($row['php_class'], 'js') && \is_callable($row['php_class'].'::js')){ + $row['js'] = array_merge($row['js'], call_user_func($row['php_class'].'::js'));} + $result[] = $row;} + return \SYSTEM\LOG\JsonResult::toString($result);} +} \ No newline at end of file diff --git a/page/autoload.inc.php b/page/autoload.inc.php new file mode 100644 index 0000000..33a05ec --- /dev/null +++ b/page/autoload.inc.php @@ -0,0 +1,2 @@ +$value){ + if(!is_array($value)){ + $search[] = '/\${'.$key.'}/'; + $replace[] = $value;} } - - foreach($vars as $var){ - $replace[] = $var; - } - return @preg_replace($search, $replace, $text); } - public static function replaceFile($path, $vars){ - $buffer = file_get_contents($path); - - return self::replace($buffer, $vars); - - } - + return self::replace($buffer, $vars);} } \ No newline at end of file diff --git a/sai/autoload.inc.php b/sai/autoload.inc.php index e82a68f..b7e18c5 100644 --- a/sai/autoload.inc.php +++ b/sai/autoload.inc.php @@ -1,7 +1,5 @@ - ${ID} - ${group} - ${type} - ${parentID} - ${parentValue} - ${name} - ${verify} - \ No newline at end of file diff --git a/sai/modules/saimod_sys_api/qq/SYS_SAIMOD_API_ADD.php b/sai/modules/saimod_sys_api/qq/SYS_SAIMOD_API_ADD.php new file mode 100644 index 0000000..c858c26 --- /dev/null +++ b/sai/modules/saimod_sys_api/qq/SYS_SAIMOD_API_ADD.php @@ -0,0 +1,11 @@ +span { + cursor:pointer +} +.tree>ul>li::before, .tree>ul>li::after { + border:0 +} +.tree li:last-child::before { + height:30px +} +.tree li.parent_li>span:hover, .tree li.parent_li>span:hover+ul li span { + background:#eee; + border:1px solid #94a0b4; + color:#000 +} \ No newline at end of file diff --git a/sai/modules/saimod_sys_api/saimod_sys_api.js b/sai/modules/saimod_sys_api/saimod_sys_api.js index 7231266..c80b5a1 100644 --- a/sai/modules/saimod_sys_api/saimod_sys_api.js +++ b/sai/modules/saimod_sys_api/saimod_sys_api.js @@ -1,3 +1,98 @@ -function init__SYSTEM_SAI_saimod_sys_api() { +var currentID = ''; + +function init__SYSTEM_SAI_saimod_sys_api() { + saimod_sys_api_tree(); + saimod_sys_api_register_clickevents(); + +} + +function saimod_sys_api_loadcontent(){ + $('#api_wrapper').load(SAI_ENDPOINT+'sai_mod=.SYSTEM.SAI.saimod_sys_api', function(){ + console.log('api module loaded'); + saimod_sys_api_register_clickevents(); + }); + +} + +function saimod_sys_api_register_clickevents(){ + $('tr.api_entries').click(function() { + console.log("ahsf"); + currentID = $(this).attr("id"); + $.ajax({ + url: SAI_ENDPOINT, + data: { sai_mod: '.SYSTEM.SAI.saimod_sys_api', + action: 'deletedialog', + ID: currentID}, + type: 'GET', + success: function(data) { + console.log("works"); + $('#api_content').html(data); + $('#del_api_close').click(function() { + console.log("olenski"); + $('#del_api_description').hide(); + $('#del_api_del').show(); + saimod_sys_api_loadcontent(); + }); + $('#del_api_del').click(function() { + $.ajax({ + url: SAI_ENDPOINT, + data: { sai_mod: '.SYSTEM.SAI.saimod_sys_api', + action: 'deletecall', + ID: currentID}, + type: 'GET', + success: function(data) { + console.log("api call deleted"); + $('#api_deletedialog').html('

Api call deleted!

'); + $('#del_api_del').hide(); + }});});}});}); + + $('#addcall').click(function() { + var id = $('#new_call_id').val(); + var group = $('#new_call_group').val(); + var type = $('#new_call_type').val(); + var parentid = $('#new_call_parentid').val(); + var parentvalue = $('#new_call_parentvalue').val(); + var name = $('#new_call_name').val(); + var verify = $('#new_call_verify').val(); + $.ajax({ + url: SAI_ENDPOINT, + data: { sai_mod: '.SYSTEM.SAI.saimod_sys_api', + action: 'addcall', + ID: id, + group: group, + type: type, + parentID: parentid, + parentValue : parentvalue, + name: name, + verify: verify}, + type: 'GET', + success: function(data) { + console.log("new api call added"); + saimod_sys_api_loadcontent(); + } + }); + + }); + $('#del_api_close').click(function() { + console.log("olenski"); + $('#del_api_description').hide(); + $('#del_api_del').show(); + saimod_sys_api_loadcontent(); + }); $('#localetab a').click(function (e) {e.preventDefault(); $(this).tab('show');}); +} + +function saimod_sys_api_tree(){ + $('.tree li:has(ul)').addClass('parent_li').find(' > span').attr('title', 'Collapse this branch'); + $('.tree li.parent_li > span').on('click', function (e) { + var children = $(this).parent('li.parent_li').find(' > ul > li'); + if (children.is(":visible")) { + children.hide('fast'); + $(this).attr('title', 'Expand this branch').find(' > i').addClass('icon-plus-sign').removeClass('icon-minus-sign'); + } else { + children.show('fast'); + $(this).attr('title', 'Collapse this branch').find(' > i').addClass('icon-minus-sign').removeClass('icon-plus-sign'); + } + e.stopPropagation(); + }); } \ No newline at end of file diff --git a/sai/modules/saimod_sys_api/saimod_sys_api.php b/sai/modules/saimod_sys_api/saimod_sys_api.php index ed9eaa4..7af02aa 100644 --- a/sai/modules/saimod_sys_api/saimod_sys_api.php +++ b/sai/modules/saimod_sys_api/saimod_sys_api.php @@ -19,7 +19,7 @@ class saimod_sys_api extends \SYSTEM\SAI\SaiModule { $vars2 = array( 'active' => ($first ? 'active' : ''), 'tab_id' => $r['group']); $first = false; - $vars['tabopts'] .= \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_api/tabopt.tpl'), $vars2); + $vars['tabopts'] .= \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_api/tpl/tabopt.tpl'), $vars2); } if(\SYSTEM\system::isSystemDbInfoPG()){ @@ -33,7 +33,7 @@ class saimod_sys_api extends \SYSTEM\SAI\SaiModule { $tabs[$r['group']]['content'] = isset($tabs[$r['group']]['content']) ? $tabs[$r['group']]['content'] : ''; $r['tr_class'] = self::tablerow_class($r['type']); $r['type'] = self::type_names($r['type']); - $tabs[$r['group']]['content'] .= \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_api/list_entry.tpl'), $r); + $tabs[$r['group']]['content'] .= \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_api/tpl/list_entry.tpl'), $r); } $vars['tabs'] = ''; @@ -41,15 +41,36 @@ class saimod_sys_api extends \SYSTEM\SAI\SaiModule { foreach($tabs as $tab){ $tab['active'] = ($first ? 'active' : ''); $first = false; - $vars['tabs'] .= \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_api/tab.tpl'), $tab);} + $vars['tabs'] .= \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_api/tpl/tab.tpl'), $tab);} - return \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_api/tabs.tpl'), $vars); + return \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_api/tpl/tabs.tpl'), $vars); /* $result = ""; $result .= ''.''.$r['ID'].''.''.$r['group'].''.''.$r['type'].''.''.$r['parentID'].''.''.$r['parentValue'].''.''.$r['name'].''.''.$r['verify'].''.''; return $result;*/ } + public static function sai_mod__system_sai_saimod_sys_api_action_deletedialog($ID){ + $res = \SYSTEM\DBD\SYS_SAIMOD_API_SINGLE_SELECT::Q1(array($ID)); + return \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_api/tpl/delete_dialog.tpl'), $res); + } + + public static function sai_mod__system_sai_saimod_sys_api_action_addcall($ID,$group,$type,$parentID,$parentValue,$name,$verify){ + if(!\SYSTEM\SECURITY\Security::check(\SYSTEM\SECURITY\RIGHTS::SYS_SAI_API)){ + throw new \SYSTEM\LOG\ERROR("You dont have edit Rights - Cant proceeed");} + if($parentValue == ''){ $parentValue = NULL;} + if($verify == ''){ $verify = NULL;} + \SYSTEM\DBD\SYS_SAIMOD_API_ADD::QI(array($ID,$group,$type,$parentID,$parentValue,$name,$verify)); + return \SYSTEM\LOG\JsonResult::ok(); + } + + public static function sai_mod__system_sai_saimod_sys_api_action_deletecall($ID){ + if(!\SYSTEM\SECURITY\Security::check(\SYSTEM\SECURITY\RIGHTS::SYS_SAI_API)){ + throw new \SYSTEM\LOG\ERROR("You dont have edit Rights - Cant proceeed");} + \SYSTEM\DBD\SYS_SAIMOD_API_DEL::QI(array($ID)); + return \SYSTEM\LOG\JsonResult::ok(); + } + private static function type_names($type){ switch($type){ case 0: return 'COMMAND'; @@ -72,9 +93,11 @@ class saimod_sys_api extends \SYSTEM\SAI\SaiModule { public static function html_li_menu(){return '
  • API
  • ';} public static function right_public(){return false;} - public static function right_right(){return \SYSTEM\SECURITY\Security::check(\SYSTEM\SECURITY\RIGHTS::SYS_SAI);} + public static function right_right(){return \SYSTEM\SECURITY\Security::check(\SYSTEM\SECURITY\RIGHTS::SYS_SAI) && \SYSTEM\SECURITY\Security::check(\SYSTEM\SECURITY\RIGHTS::SYS_SAI_API);} - public static function sai_mod__SYSTEM_SAI_saimod_sys_api_flag_css(){} + public static function sai_mod__SYSTEM_SAI_saimod_sys_api_flag_css(){ + return \SYSTEM\LOG\JsonResult::toString( + array( \SYSTEM\WEBPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_api/saimod_sys_api.css')));} public static function sai_mod__SYSTEM_SAI_saimod_sys_api_flag_js(){ return \SYSTEM\LOG\JsonResult::toString( array( \SYSTEM\WEBPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_api/saimod_sys_api.js')));} diff --git a/sai/modules/saimod_sys_api/tabs.tpl b/sai/modules/saimod_sys_api/tabs.tpl deleted file mode 100644 index a042195..0000000 --- a/sai/modules/saimod_sys_api/tabs.tpl +++ /dev/null @@ -1,10 +0,0 @@ -

    System API

    -
    -
    - -
    - ${tabs} -
    -
    \ No newline at end of file diff --git a/sai/modules/saimod_sys_api/tpl/delete_dialog.tpl b/sai/modules/saimod_sys_api/tpl/delete_dialog.tpl new file mode 100644 index 0000000..54505c1 --- /dev/null +++ b/sai/modules/saimod_sys_api/tpl/delete_dialog.tpl @@ -0,0 +1,26 @@ +
    +
    Api Call: ${ID}
    +
    + + + + + + + + + + + + + + + + + + + +
    IDGroupTypeParentIDParentValueNameVerify
    ${ID}${group}${type}${parentID}${parentValue}${name}${verify}
    +
    + + diff --git a/sai/modules/saimod_sys_api/tpl/list_entry.tpl b/sai/modules/saimod_sys_api/tpl/list_entry.tpl new file mode 100644 index 0000000..b7d9845 --- /dev/null +++ b/sai/modules/saimod_sys_api/tpl/list_entry.tpl @@ -0,0 +1,9 @@ + + ${ID} + ${group} + ${type} + ${parentID} + ${parentValue} + ${name} + ${verify} + \ No newline at end of file diff --git a/sai/modules/saimod_sys_api/tab.tpl b/sai/modules/saimod_sys_api/tpl/tab.tpl similarity index 95% rename from sai/modules/saimod_sys_api/tab.tpl rename to sai/modules/saimod_sys_api/tpl/tab.tpl index 7b52a39..7e43161 100644 --- a/sai/modules/saimod_sys_api/tab.tpl +++ b/sai/modules/saimod_sys_api/tpl/tab.tpl @@ -10,5 +10,5 @@ Verify ${content} - + \ No newline at end of file diff --git a/sai/modules/saimod_sys_api/tabopt.tpl b/sai/modules/saimod_sys_api/tpl/tabopt.tpl similarity index 100% rename from sai/modules/saimod_sys_api/tabopt.tpl rename to sai/modules/saimod_sys_api/tpl/tabopt.tpl diff --git a/sai/modules/saimod_sys_api/tpl/tabs.tpl b/sai/modules/saimod_sys_api/tpl/tabs.tpl new file mode 100644 index 0000000..aa9102c --- /dev/null +++ b/sai/modules/saimod_sys_api/tpl/tabs.tpl @@ -0,0 +1,36 @@ +
    +

    System API

    +
    +
    +
    + +
    + ${tabs} +
    +
    + + + + + + + + + + + + + + + + + + + + +
    IDGroupTypeParentIDParentValueNameVerify
    + +
    +
    diff --git a/sai/modules/saimod_sys_cache/autoload.inc b/sai/modules/saimod_sys_cache/autoload.inc new file mode 100644 index 0000000..12c20b3 --- /dev/null +++ b/sai/modules/saimod_sys_cache/autoload.inc @@ -0,0 +1,5 @@ +next(); - $result = '

    Cache

    '. + $result = '

    Cache


    '. 'Entries: '.$r['count'].' showing 100'. - ''. + '
    '. ''.''.''.''.''.''; diff --git a/sai/modules/saimod_sys_config/autoload.inc b/sai/modules/saimod_sys_config/autoload.inc new file mode 100644 index 0000000..0182131 --- /dev/null +++ b/sai/modules/saimod_sys_config/autoload.inc @@ -0,0 +1,5 @@ +span { + cursor:pointer +} +.tree>ul>li::before, .tree>ul>li::after { + border:0 +} +.tree li:last-child::before { + height:30px +} +.tree li.parent_li>span:hover, .tree li.parent_li>span:hover+ul li span { + background:#eee; + border:1px solid #94a0b4; + color:#000 +} \ No newline at end of file diff --git a/sai/modules/saimod_sys_cron/js/saimod_sys_cron.js b/sai/modules/saimod_sys_cron/js/saimod_sys_cron.js new file mode 100644 index 0000000..48adf2f --- /dev/null +++ b/sai/modules/saimod_sys_cron/js/saimod_sys_cron.js @@ -0,0 +1,83 @@ +function init__SYSTEM_SAI_saimod_sys_cron() { + register_cron_add(); + register_cron_del(); + register_cron_edit(); + register_cron_change(); +} + +function register_cron_change(){ + $('.btn_cron_status').click(function(){ + $.ajax({ type :'GET', + url : SAI_ENDPOINT+'sai_mod=.SYSTEM.SAI.saimod_sys_cron&action=change'+ + '&cls='+$(this).attr('_class')+ + '&status='+$('#select_status_'+$(this).attr('_i')).val(), + success : function(data) { + if(data.status){ + $('#content-wrapper').load(SAI_ENDPOINT + 'sai_mod=.SYSTEM.SAI.saimod_sys_cron',function(){ + init__SYSTEM_SAI_saimod_sys_cron(); + }); + }else{ + alert('Problem: '+data);} + } + }); + }); +} + +function register_cron_del(){ + $('.btn_cron_del').click(function(){ + $.ajax({ type :'GET', + url : SAI_ENDPOINT+'sai_mod=.SYSTEM.SAI.saimod_sys_cron&action=del'+ + '&cls='+$(this).attr('_class'), + success : function(data) { + if(data.status){ + $('#content-wrapper').load(SAI_ENDPOINT + 'sai_mod=.SYSTEM.SAI.saimod_sys_cron',function(){ + init__SYSTEM_SAI_saimod_sys_cron(); + }); + }else{ + alert('Problem: '+data);} + } + }); + }); +} + +function register_cron_edit(){ + $('.btn_cron_edit').click(function(){ + $('#input_cron_class').val($(this).attr('_class')); + $('#input_cron_min').val($(this).attr('_min')); + $('#input_cron_hour').val($(this).attr('_hour')); + $('#input_cron_day').val($(this).attr('_day')); + $('#input_cron_day_week').val($(this).attr('_day_week')); + $('#input_cron_month').val($(this).attr('_month')); + $("#btn_cron_add").focus(); + }); +} + +function register_cron_add(){ + $('#btn_cron_add').click(function() { + var cls = $('#input_cron_class').val(); + var min = $('#input_cron_min').val(); + var hour = $('#input_cron_hour').val(); + var day = $('#input_cron_day').val(); + var day_week = $('#input_cron_day_week').val(); + var month = $('#input_cron_month').val(); + $.ajax({url: SAI_ENDPOINT, + data: { sai_mod: '.SYSTEM.SAI.saimod_sys_cron', + action: 'add', + cls: cls, + min: min, + hour: hour, + day: day, + day_week: day_week, + month: month}, + type: 'GET', + success: function(data) { + if(data.status){ + $('#content-wrapper').load(SAI_ENDPOINT + 'sai_mod=.SYSTEM.SAI.saimod_sys_cron',function(){ + init__SYSTEM_SAI_saimod_sys_cron(); + }); + }else{ + alert('Problem: '+data);} + } + }); + }); +} \ No newline at end of file diff --git a/sai/modules/saimod_sys_cron/qq/SYS_SAIMOD_CRON.php b/sai/modules/saimod_sys_cron/qq/SYS_SAIMOD_CRON.php new file mode 100644 index 0000000..5fa8721 --- /dev/null +++ b/sai/modules/saimod_sys_cron/qq/SYS_SAIMOD_CRON.php @@ -0,0 +1,11 @@ +next()){ + $r['selected_0'] = $r['selected_1'] = $r['selected_2'] = $r['selected_3'] = ''; + $r['next'] = date('Y-m-d H:i:s',\SYSTEM\CRON\cron::next($r['class'])); + $r['selected_'.$r['status']] = 'selected'; + $r['i'] = $i++; + $vars['content'] .= \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_cron/tpl/list_entry.tpl'), $r);} + return \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_cron/tpl/tabs.tpl'), $vars); + } + + public static function sai_mod__system_sai_saimod_sys_cron_action_change($cls,$status){ + if(!\SYSTEM\SECURITY\Security::check(\SYSTEM\SECURITY\RIGHTS::SYS_SAI_CRON)){ + throw new \SYSTEM\LOG\ERROR("You dont have edit Rights - Cant proceeed");} + \SYSTEM\DBD\SYS_SAIMOD_CRON_CHANGE::QI(array($status,$cls)); + return \SYSTEM\LOG\JsonResult::ok(); + } + + public static function sai_mod__system_sai_saimod_sys_cron_action_add($cls,$min,$hour,$day,$day_week,$month){ + if(!\SYSTEM\SECURITY\Security::check(\SYSTEM\SECURITY\RIGHTS::SYS_SAI_CRON)){ + throw new \SYSTEM\LOG\ERROR("You dont have edit Rights - Cant proceeed");} + if(!\SYSTEM\CRON\cron::check($cls)){ + throw new \SYSTEM\LOG\ERROR("Given Class is not a CronJob");} + \SYSTEM\DBD\SYS_SAIMOD_CRON_ADD::QI(array($cls,$min,$hour,$day,$day_week,$month)); + return \SYSTEM\LOG\JsonResult::ok(); + } + + public static function sai_mod__system_sai_saimod_sys_cron_action_del($cls){ + if(!\SYSTEM\SECURITY\Security::check(\SYSTEM\SECURITY\RIGHTS::SYS_SAI_CRON)){ + throw new \SYSTEM\LOG\ERROR("You dont have edit Rights - Cant proceeed");} + \SYSTEM\DBD\SYS_SAIMOD_CRON_DEL::QI(array($cls)); + return \SYSTEM\LOG\JsonResult::ok();} + + public static function html_li_menu(){return '
  • Cron
  • ';} + public static function right_public(){return false;} + public static function right_right(){return \SYSTEM\SECURITY\Security::check(\SYSTEM\SECURITY\RIGHTS::SYS_SAI_CRON);} + + public static function sai_mod__SYSTEM_SAI_saimod_sys_cron_flag_css(){ + return \SYSTEM\LOG\JsonResult::toString( + array( \SYSTEM\WEBPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_cron/css/saimod_sys_cron.css')));} + public static function sai_mod__SYSTEM_SAI_saimod_sys_cron_flag_js(){ + return \SYSTEM\LOG\JsonResult::toString( + array( \SYSTEM\WEBPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_cron/js/saimod_sys_cron.js')));} +} \ No newline at end of file diff --git a/sai/modules/saimod_sys_cron/tpl/list_entry.tpl b/sai/modules/saimod_sys_cron/tpl/list_entry.tpl new file mode 100644 index 0000000..4b131e4 --- /dev/null +++ b/sai/modules/saimod_sys_cron/tpl/list_entry.tpl @@ -0,0 +1,23 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/sai/modules/saimod_sys_cron/tpl/tabs.tpl b/sai/modules/saimod_sys_cron/tpl/tabs.tpl new file mode 100644 index 0000000..e79d3fb --- /dev/null +++ b/sai/modules/saimod_sys_cron/tpl/tabs.tpl @@ -0,0 +1,35 @@ +
    +

    System Cron

    +
    + Last Visit: ${last_visit}
    + Start Cron +
    +
    '.'ID'.''.'CacheID'.''.'Ident'.''.'Data'.'
    ${class}${min}${hour}${day}${day_week}${month}${last_run}${next} + + + + + +
    + + + + + + + + + + + + + ${content} + + + + + + + + + + + + +
    classminhourdayday_weekmonthlast_runnext_runstatusaction
    + + diff --git a/sai/modules/saimod_sys_docu/autoload.inc b/sai/modules/saimod_sys_docu/autoload.inc new file mode 100644 index 0000000..9159a3d --- /dev/null +++ b/sai/modules/saimod_sys_docu/autoload.inc @@ -0,0 +1,5 @@ + str_replace(' ', '_', $cat), 'tab_id_pretty' => $cat); $first = false; - $vars['tabopts'] .= \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_docu/tabopt.tpl'), $vars2); + $vars['tabopts'] .= \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_docu/tpl/tabopt.tpl'), $vars2); $first2 = true; foreach($docs as $doc){ @@ -23,11 +23,11 @@ class saimod_sys_docu extends \SYSTEM\SAI\SaiModule { $vars3 = array( 'active' => ($first2 ? 'active' : ''), 'content' => \Michelf\MarkdownExtra::defaultTransform(file_get_contents($doc)), 'tab_id' => str_replace(array('.',' ','\\','/'), '_', $doc)); - $tabs[$cat]['content'] .= \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_docu/tab2.tpl'), $vars3); + $tabs[$cat]['content'] .= \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_docu/tpl/tab2.tpl'), $vars3); $vars3 = array( 'active' => ($first2 ? 'active' : ''), 'tab_id' => str_replace(array('.',' ','\\','/'), '_', $doc), 'tab_id_pretty' => basename($doc)); - $tabs[$cat]['menu'] .= \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_docu/tabopt.tpl'), $vars3); + $tabs[$cat]['menu'] .= \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_docu/tpl/tabopt.tpl'), $vars3); $first2 = false; } @@ -36,9 +36,9 @@ class saimod_sys_docu extends \SYSTEM\SAI\SaiModule { foreach($tabs as $tab){ $tab['active'] = ($first ? 'active' : ''); $first = false; - $vars['tabs'] .= \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_docu/tab.tpl'), $tab);} + $vars['tabs'] .= \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_docu/tpl/tab.tpl'), $tab);} } - return \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_docu/tabs.tpl'), $vars); + return \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_docu/tpl/tabs.tpl'), $vars); } public static function html_li_menu(){return '
  • Docu
  • ';} diff --git a/sai/modules/saimod_sys_docu/tab.tpl b/sai/modules/saimod_sys_docu/tpl/tab.tpl similarity index 100% rename from sai/modules/saimod_sys_docu/tab.tpl rename to sai/modules/saimod_sys_docu/tpl/tab.tpl diff --git a/sai/modules/saimod_sys_docu/tab2.tpl b/sai/modules/saimod_sys_docu/tpl/tab2.tpl similarity index 100% rename from sai/modules/saimod_sys_docu/tab2.tpl rename to sai/modules/saimod_sys_docu/tpl/tab2.tpl diff --git a/sai/modules/saimod_sys_docu/tabopt.tpl b/sai/modules/saimod_sys_docu/tpl/tabopt.tpl similarity index 100% rename from sai/modules/saimod_sys_docu/tabopt.tpl rename to sai/modules/saimod_sys_docu/tpl/tabopt.tpl diff --git a/sai/modules/saimod_sys_docu/tabs.tpl b/sai/modules/saimod_sys_docu/tpl/tabs.tpl similarity index 100% rename from sai/modules/saimod_sys_docu/tabs.tpl rename to sai/modules/saimod_sys_docu/tpl/tabs.tpl diff --git a/sai/modules/saimod_sys_files/autoload.inc b/sai/modules/saimod_sys_files/autoload.inc new file mode 100644 index 0000000..f688fac --- /dev/null +++ b/sai/modules/saimod_sys_files/autoload.inc @@ -0,0 +1,5 @@ +$folder){ - $result['tabopts'] .= \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_files/saimod_sys_files_tabopt.tpl'),array('name' => $name, 'active' => $first ? 'active' : '')); - $result['tabs'] .= \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_files/saimod_sys_files_tab.tpl'),array('name' => $name, 'active' => $first ? 'active' : '', 'content' => $first ? self::sai_mod__SYSTEM_SAI_saimod_sys_files_action_tab($name) : '')); + $result['tabopts'] .= \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_files/tpl/saimod_sys_files_tabopt.tpl'),array('name' => $name, 'active' => $first ? 'active' : '')); + $result['tabs'] .= \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_files/tpl/saimod_sys_files_tab.tpl'),array('name' => $name, 'active' => $first ? 'active' : '', 'content' => $first ? self::sai_mod__SYSTEM_SAI_saimod_sys_files_action_tab($name) : '')); $first = false; } - return \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_files/saimod_sys_files.tpl'),$result); + return \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_files/tpl/saimod_sys_files.tpl'),$result); } public static function sai_mod__SYSTEM_SAI_saimod_sys_files_action_tab($name){ @@ -40,8 +40,8 @@ class saimod_sys_files extends \SYSTEM\SAI\SaiModule { $cat = \SYSTEM\FILES\files::get($name); $i = 0; foreach($cat as $file){ - $result .= \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_files/saimod_sys_files_tableentry.tpl'), array('i' => $i++, 'cat' => $name, 'name' => $file, 'extension' => substr($file,-3,3), 'url' => 'api.php?call=files&cat='.$name.'&id='.$file));} - return \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_files/saimod_sys_files_tabfull.tpl'), array('cat' => $name, 'content' => $result));} + $result .= \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_files/tpl/saimod_sys_files_tableentry.tpl'), array('i' => $i++, 'cat' => $name, 'name' => $file, 'extension' => substr($file,-3,3), 'url' => 'api.php?call=files&cat='.$name.'&id='.$file));} + return \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_files/tpl/saimod_sys_files_tabfull.tpl'), array('cat' => $name, 'content' => $result));} public static function html_li_menu(){return '
  • Files
  • ';} public static function right_public(){return false;} diff --git a/sai/modules/saimod_sys_files/saimod_sys_files.tpl b/sai/modules/saimod_sys_files/tpl/saimod_sys_files.tpl similarity index 86% rename from sai/modules/saimod_sys_files/saimod_sys_files.tpl rename to sai/modules/saimod_sys_files/tpl/saimod_sys_files.tpl index 0a3fb2b..9c8842f 100644 --- a/sai/modules/saimod_sys_files/saimod_sys_files.tpl +++ b/sai/modules/saimod_sys_files/tpl/saimod_sys_files.tpl @@ -1,3 +1,5 @@ +

    User Files

    +
    -Register an Account
    -Can't really remember your Password? \ No newline at end of file +${basic_text_register}
    +${basic_text_password_miss} \ No newline at end of file diff --git a/sai/modules/saimod_sys_login/logout.tpl b/sai/modules/saimod_sys_login/tpl/logout.tpl similarity index 77% rename from sai/modules/saimod_sys_login/logout.tpl rename to sai/modules/saimod_sys_login/tpl/logout.tpl index 4c7ad22..2529c8d 100644 --- a/sai/modules/saimod_sys_login/logout.tpl +++ b/sai/modules/saimod_sys_login/tpl/logout.tpl @@ -1,16 +1,16 @@
    -

    Logout

    -

    You are logged in.

    +

    ${basic_logout}

    +

    ${basic_state_login}

    - - + + - + - + - + - + - + - + @@ -96,7 +96,7 @@
    - +
    diff --git a/sai/modules/saimod_sys_login/register.tpl b/sai/modules/saimod_sys_login/tpl/register.tpl similarity index 77% rename from sai/modules/saimod_sys_login/register.tpl rename to sai/modules/saimod_sys_login/tpl/register.tpl index 6807cd9..1b6240d 100644 --- a/sai/modules/saimod_sys_login/register.tpl +++ b/sai/modules/saimod_sys_login/tpl/register.tpl @@ -1,4 +1,4 @@ -

    ${register}

    +

    ${basic_register}



    @@ -6,16 +6,16 @@
    ${sai_mod_login_username}${basic_username}
    ${sai_mod_login_email}${basic_email}
    ${sai_mod_login_password}${basic_password} ****
    @@ -47,8 +47,8 @@ style="margin-bottom: 15px; float: left;" id="user_new_password1" name="user_new_password1" - placeholder="${ua_new_password_first}" - minlength="5" data-validation-minlength-message="${login_password_too_short}"/> + placeholder="${basic_placeholder_password}" + minlength="5" data-validation-minlength-message="${sai_error_password_short}"/>
    @@ -57,24 +57,24 @@ style="margin-bottom: 15px; float: left;" id="user_new_password2" name="user_new_password2" - placeholder="${ua_new_password_second}" + placeholder="${basic_placeholder_password}" data-validation-matches-match="user_new_password1" - data-validation-matches-message="${register_password_dont_math}"/> + data-validation-matches-message="${sai_error_password_match}"/>
    ${sai_mod_login_last_active}${basic_last_active}
    ${sai_mod_login_join_date}${basic_join_date}
    ${sai_mod_login_locale}${basic_locale}
    ${sai_mod_login_admin_rights}${basic_admin_rights} ${isadmin}
    - + - + - +
    ${loginUsername}${basic_username}
    + placeholder="${basic_placeholder_username}" + minlength="3" data-validation-minlength-message="${sai_error_username_short}" + required data-validation-required-message="${sai_error_username_miss}"/>
    @@ -29,16 +29,16 @@ size="30" style="margin-bottom: 15px; float: left;" id="register_email" - placeholder="${enter_email}" - data-validation-email-message="${check_mail_format}" - required data-validation-required-message="${email_required}"/> + placeholder="${basic_placeholder_email}" + data-validation-email-message="${sai_error_email_wrong}" + required data-validation-required-message="${sai_error_email_miss}"/>
    ${loginPassword}${basic_password}
    @@ -47,9 +47,9 @@ style="margin-bottom: 15px; float: left;" id="user_register_password1" name="user_register_password1" - placeholder="${enter_password}" - minlength="5" data-validation-minlength-message="${login_password_too_short}" - required data-validation-required-message="${login_password_required}"/> + placeholder="${basic_placeholder_password}" + minlength="5" data-validation-minlength-message="${sai_error_password_short}" + required data-validation-required-message="${sai_error_password_miss}"/>
    @@ -59,9 +59,9 @@ style="margin-bottom: 15px; float: left;" id="user_register_password2" name="user_register_password2" - placeholder="${retype_password}" + placeholder="${basic_placeholder_password}" data-validation-matches-match="user_register_password1" - data-validation-matches-message="${register_password_dont_math}"/> + data-validation-matches-message="${sai_error_password_match}"/>
    @@ -69,7 +69,7 @@
    ${locale}${basic_locale}
    - - + +
    \ No newline at end of file diff --git a/sai/modules/saimod_sys_mod/autoload.inc b/sai/modules/saimod_sys_mod/autoload.inc new file mode 100644 index 0000000..75df4e4 --- /dev/null +++ b/sai/modules/saimod_sys_mod/autoload.inc @@ -0,0 +1,5 @@ + ' : 'Missing rights.'; - $rows .= \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_security/saimod_sys_security_right.tpl'),$r);} + $rows .= \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_security/tpl/saimod_sys_security_right.tpl'),$r);} $vars['rows'] = $rows; $vars['addright_btn'] = \SYSTEM\SECURITY\Security::check(\SYSTEM\SECURITY\RIGHTS::SYS_SAI_SECURITY_RIGHTS_EDIT) ? '' : 'You are missing the required rights for adding or removing rights.'; - return \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_security/saimod_sys_security_rights.tpl'),$vars); + return \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_security/tpl/saimod_sys_security_rights.tpl'),$vars); } public static function sai_mod__SYSTEM_SAI_saimod_sys_security_action_deleterightuser($rightid,$userid){ @@ -50,7 +50,7 @@ class saimod_sys_security extends \SYSTEM\SAI\SaiModule { if(!\SYSTEM\SECURITY\Security::check(\SYSTEM\SECURITY\RIGHTS::SYS_SAI_SECURITY_RIGHTS_EDIT)){ return false;} $vars = \SYSTEM\DBD\SYS_SAIMOD_SECURITY_RIGHT_CHECK::Q1(array($id)); - return \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_security/saimod_sys_security_deleteright.tpl'),$vars);} + return \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_security/tpl/saimod_sys_security_deleteright.tpl'),$vars);} public static function sai_mod__SYSTEM_SAI_saimod_sys_security_action_deleteright($id){ if(!\SYSTEM\SECURITY\Security::check(\SYSTEM\SECURITY\RIGHTS::SYS_SAI_SECURITY_RIGHTS_EDIT)){ @@ -65,12 +65,12 @@ class saimod_sys_security extends \SYSTEM\SAI\SaiModule { $r['class_row'] = \SYSTEM\SAI\saimod_sys_log::tablerow_class($r['class']); $r['time'] = self::time_elapsed_string(strtotime($r['time'])); $r['message'] = substr($r['message'],0,255); - $table .= \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_log/saimod_sys_log_table_row.tpl'),$r); + $table .= \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_log/tpl/saimod_sys_log_table_row.tpl'),$r); } $vars = array(); $vars['count'] = $count['count']; $vars['table'] = $table; - return \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_log/saimod_sys_log_table.tpl'), $vars); + return \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_log/tpl/saimod_sys_log_table.tpl'), $vars); } private static function user_rights($userid){ @@ -83,7 +83,7 @@ class saimod_sys_security extends \SYSTEM\SAI\SaiModule { $r['remove_btn'] = \SYSTEM\SECURITY\Security::check(\SYSTEM\SECURITY\RIGHTS::SYS_SAI_SECURITY_RIGHTS_EDIT) ? '' : 'Missing Rights'; - $vars['user_rights_table'] .= \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_security/saimod_sys_security_user_right.tpl'), $r);} + $vars['user_rights_table'] .= \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_security/tpl/saimod_sys_security_user_right.tpl'), $r);} $vars['user_rights_add'] = 'You are missing the required rights for adding or removing the rights of an user.'; if(\SYSTEM\SECURITY\Security::check(\SYSTEM\SECURITY\RIGHTS::SYS_SAI_SECURITY_RIGHTS_EDIT)){ @@ -93,18 +93,18 @@ class saimod_sys_security extends \SYSTEM\SAI\SaiModule { while($r = $res->next()){ $r['selected'] = $b ? 'selected="selected"' : ''; $b = false; - $opts .= \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_security/saimod_sys_security_user_right_add.tpl'), $r);} + $opts .= \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_security/tpl/saimod_sys_security_user_right_add.tpl'), $r);} $v = array(); $v['user_id'] = $userid; $v['right_options'] = $opts; - $vars['user_rights_add'] = \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_security/saimod_sys_security_user_rights_add.tpl'), $v); + $vars['user_rights_add'] = \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_security/tpl/saimod_sys_security_user_rights_add.tpl'), $v); } - return \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_security/saimod_sys_security_user_rights.tpl'), $vars);} + return \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_security/tpl/saimod_sys_security_user_rights.tpl'), $vars);} public static function sai_mod__SYSTEM_SAI_saimod_sys_security_action_stats(){ - return \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_security/saimod_sys_security_stats.tpl'),array()); + return \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_security/tpl/saimod_sys_security_stats.tpl'),array()); } public static function sai_mod__SYSTEM_SAI_saimod_sys_security_action_user($username){ @@ -112,7 +112,7 @@ class saimod_sys_security extends \SYSTEM\SAI\SaiModule { $vars['time_elapsed'] = self::time_elapsed_string($vars['last_active']); $vars['user_rights'] = array_key_exists('id', $vars) ? self::user_rights($vars['id']) : ''; $vars['user_actions'] = array_key_exists('id', $vars) ? self::user_actions($vars['id']) : ''; - return \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_security/saimod_sys_security_user_view.tpl'),$vars); + return \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_security/tpl/saimod_sys_security_user_view.tpl'),$vars); } public static function sai_mod__SYSTEM_SAI_saimod_sys_security_action_users($search = null){ @@ -123,15 +123,15 @@ class saimod_sys_security extends \SYSTEM\SAI\SaiModule { while($r = $res->next()){ $r['class'] = self::tablerow_class($r['last_active']); $r['time_elapsed'] = self::time_elapsed_string($r['last_active']); - $rows .= \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_security/saimod_sys_security_user.tpl'),$r); + $rows .= \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_security/tpl/saimod_sys_security_user.tpl'),$r); } - return \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_security/saimod_sys_security_users.tpl'),array('rows' => $rows, 'count' => $count['count'])); + return \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_security/tpl/saimod_sys_security_users.tpl'),array('rows' => $rows, 'count' => $count['count'])); } public static function sai_mod__SYSTEM_SAI_saimod_sys_security(){ $vars = array(); $vars['PICPATH'] = \SYSTEM\WEBPATH(new \SYSTEM\PSAI(), 'modules/saimod_sys_log/img/'); - return \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_security/saimod_sys_security.tpl'), $vars);} + return \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_security/tpl/saimod_sys_security.tpl'), $vars);} private static function tablerow_class($last_active){ $time = time() - $last_active; diff --git a/sai/modules/saimod_sys_security/saimod_sys_security.tpl b/sai/modules/saimod_sys_security/tpl/saimod_sys_security.tpl similarity index 100% rename from sai/modules/saimod_sys_security/saimod_sys_security.tpl rename to sai/modules/saimod_sys_security/tpl/saimod_sys_security.tpl diff --git a/sai/modules/saimod_sys_security/saimod_sys_security_deleteright.tpl b/sai/modules/saimod_sys_security/tpl/saimod_sys_security_deleteright.tpl similarity index 100% rename from sai/modules/saimod_sys_security/saimod_sys_security_deleteright.tpl rename to sai/modules/saimod_sys_security/tpl/saimod_sys_security_deleteright.tpl diff --git a/sai/modules/saimod_sys_security/saimod_sys_security_groups.tpl b/sai/modules/saimod_sys_security/tpl/saimod_sys_security_groups.tpl similarity index 100% rename from sai/modules/saimod_sys_security/saimod_sys_security_groups.tpl rename to sai/modules/saimod_sys_security/tpl/saimod_sys_security_groups.tpl diff --git a/sai/modules/saimod_sys_security/saimod_sys_security_newright.tpl b/sai/modules/saimod_sys_security/tpl/saimod_sys_security_newright.tpl similarity index 100% rename from sai/modules/saimod_sys_security/saimod_sys_security_newright.tpl rename to sai/modules/saimod_sys_security/tpl/saimod_sys_security_newright.tpl diff --git a/sai/modules/saimod_sys_security/saimod_sys_security_right.tpl b/sai/modules/saimod_sys_security/tpl/saimod_sys_security_right.tpl similarity index 100% rename from sai/modules/saimod_sys_security/saimod_sys_security_right.tpl rename to sai/modules/saimod_sys_security/tpl/saimod_sys_security_right.tpl diff --git a/sai/modules/saimod_sys_security/saimod_sys_security_rights.tpl b/sai/modules/saimod_sys_security/tpl/saimod_sys_security_rights.tpl similarity index 100% rename from sai/modules/saimod_sys_security/saimod_sys_security_rights.tpl rename to sai/modules/saimod_sys_security/tpl/saimod_sys_security_rights.tpl diff --git a/sai/modules/saimod_sys_security/saimod_sys_security_stats.tpl b/sai/modules/saimod_sys_security/tpl/saimod_sys_security_stats.tpl similarity index 100% rename from sai/modules/saimod_sys_security/saimod_sys_security_stats.tpl rename to sai/modules/saimod_sys_security/tpl/saimod_sys_security_stats.tpl diff --git a/sai/modules/saimod_sys_security/saimod_sys_security_user.tpl b/sai/modules/saimod_sys_security/tpl/saimod_sys_security_user.tpl similarity index 100% rename from sai/modules/saimod_sys_security/saimod_sys_security_user.tpl rename to sai/modules/saimod_sys_security/tpl/saimod_sys_security_user.tpl diff --git a/sai/modules/saimod_sys_security/saimod_sys_security_user_right.tpl b/sai/modules/saimod_sys_security/tpl/saimod_sys_security_user_right.tpl similarity index 100% rename from sai/modules/saimod_sys_security/saimod_sys_security_user_right.tpl rename to sai/modules/saimod_sys_security/tpl/saimod_sys_security_user_right.tpl diff --git a/sai/modules/saimod_sys_security/saimod_sys_security_user_right_add.tpl b/sai/modules/saimod_sys_security/tpl/saimod_sys_security_user_right_add.tpl similarity index 100% rename from sai/modules/saimod_sys_security/saimod_sys_security_user_right_add.tpl rename to sai/modules/saimod_sys_security/tpl/saimod_sys_security_user_right_add.tpl diff --git a/sai/modules/saimod_sys_security/saimod_sys_security_user_rights.tpl b/sai/modules/saimod_sys_security/tpl/saimod_sys_security_user_rights.tpl similarity index 100% rename from sai/modules/saimod_sys_security/saimod_sys_security_user_rights.tpl rename to sai/modules/saimod_sys_security/tpl/saimod_sys_security_user_rights.tpl diff --git a/sai/modules/saimod_sys_security/saimod_sys_security_user_rights_add.tpl b/sai/modules/saimod_sys_security/tpl/saimod_sys_security_user_rights_add.tpl similarity index 100% rename from sai/modules/saimod_sys_security/saimod_sys_security_user_rights_add.tpl rename to sai/modules/saimod_sys_security/tpl/saimod_sys_security_user_rights_add.tpl diff --git a/sai/modules/saimod_sys_security/saimod_sys_security_user_view.tpl b/sai/modules/saimod_sys_security/tpl/saimod_sys_security_user_view.tpl similarity index 100% rename from sai/modules/saimod_sys_security/saimod_sys_security_user_view.tpl rename to sai/modules/saimod_sys_security/tpl/saimod_sys_security_user_view.tpl diff --git a/sai/modules/saimod_sys_security/saimod_sys_security_users.tpl b/sai/modules/saimod_sys_security/tpl/saimod_sys_security_users.tpl similarity index 100% rename from sai/modules/saimod_sys_security/saimod_sys_security_users.tpl rename to sai/modules/saimod_sys_security/tpl/saimod_sys_security_users.tpl diff --git a/sai/modules/saimod_sys_todo/autoload.inc b/sai/modules/saimod_sys_todo/autoload.inc new file mode 100644 index 0000000..033c876 --- /dev/null +++ b/sai/modules/saimod_sys_todo/autoload.inc @@ -0,0 +1,8 @@ +query('SELECT * FROM system.todo LEFT JOIN system.user ON system.todo.author = system.user.ID ORDER BY state, time DESC;'); - } else { - $res = $con->query('SELECT * FROM system_todo LEFT JOIN system_user ON system_todo.author = system_user.ID ORDER BY state, time DESC;'); - } - $result = '
    '. - ''.''.''.''.''.''.''.''.''.''; + $vars = array(); + $vars['PICPATH'] = \SYSTEM\WEBPATH(new \SYSTEM\PSAI(), 'modules/saimod_sys_log/img/'); + return \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_todo/tpl/saimod_sys_todo.tpl'), $vars); + } + + public static function sai_mod__SYSTEM_SAI_saimod_sys_todo_action_new(){ + $vars = array(); + return \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_todo/tpl/saimod_sys_todo_new.tpl'), $vars); + } + + public static function sai_mod__SYSTEM_SAI_saimod_sys_todo_action_todolist(){ + $result = $result_user = ''; + $res = \SYSTEM\DBD\SYS_SAIMOD_TODO_TODO_LIST::QQ(); + $count = \SYSTEM\DBD\SYS_SAIMOD_TODO_TODO_COUNT::Q1()['count']; while($row = $res->next()){ - $result .= ''. - ''.''. - ''. - ''. - ''. - ''. - ''. - ''.''; - } - $result .= '
    '.'Time ago'.''.'Time'.''.'Reporttype'.''.'Message'.''.'Author'.''.'Volunteers'.''.'State'.''.'Action'.'
    '.self::time_elapsed_string(strtotime($row['time'])).''.$row['time'].''.self::reporttype($row['type']).''.$row['msg_1'].''.$row['username'].''.'I_S and many more'.''.self::state($row['state']).''. self::statebtn($row['state']). - ''. - ''. - ''.'
    '; + $row['class_row'] = self::trclass($row['type'],$row['class']); + $row['time_elapsed'] = self::time_elapsed_string(strtotime($row['time'])); + //$row['report_type'] = self::reporttype($row['type']); + $row['state_string'] = self::state($row['count']); + $row['state_btn'] = self::statebtn($row['count']); + if($row['type'] == \SYSTEM\DBD\system_todo::FIELD_TYPE_USER){ + $row['message'] = str_replace("\r", '
    ', $row['message']); + $result_user .= \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_todo/tpl/todo_user_list_element.tpl'), $row); + } else { + $result .= \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_todo/tpl/todo_list_element.tpl'), $row); + }} + return \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_todo/tpl/todo_list.tpl'), array('todo_user_list_elements' => $result_user,'todo_list_elements' => $result, 'count' => $count)); + } + + public static function sai_mod__SYSTEM_SAI_saimod_sys_todo_action_dotolist(){ + $result = $result_user = ''; + $res = \SYSTEM\DBD\SYS_SAIMOD_TODO_DOTO_LIST::QQ(); + $count = \SYSTEM\DBD\SYS_SAIMOD_TODO_DOTO_COUNT::Q1()['count']; + while($row = $res->next()){ + $row['class_row'] = self::trclass($row['type'],$row['class']); + $row['time_elapsed'] = self::time_elapsed_string(strtotime($row['time'])); + $row['state_string'] = self::state($row['count']); + $row['state_btn'] = self::statebtn($row['count']); + if($row['type'] == \SYSTEM\DBD\system_todo::FIELD_TYPE_USER){ + $row['message'] = str_replace("\r", '
    ', $row['message']); + $result_user .= \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_todo/tpl/todo_user_list_element.tpl'), $row); + } else { + $result .= \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_todo/tpl/todo_list_element.tpl'), $row); + } + } + return \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_todo/tpl/todo_list.tpl'), array('todo_user_list_elements' => $result_user,'todo_list_elements' => $result, 'count' => $count)); + } + + public static function statistics(){ + $result = array(); + $result['project'] = 0; + $result['project_count'] = 0; + $result['project_all'] = 0; + $result['data'] = array(); + foreach(self::$stats as $stat){ + $data = \call_user_func(array($stat, 'stats')); + $result['data'][] = $data; + $result['project'] += $data->perc; + $result['project_count'] += $data->part; + $result['project_all'] += $data->whole; + } + $result['project'] = round($result['project'] / (count($result['data'])),2); return $result; - } + } + + public static function sai_mod__SYSTEM_SAI_saimod_sys_todo_action_stats(){ + $vars = self::statistics(); + $vars['entries'] = ''; + foreach($vars['data'] as $stat){ + $vars['entries'] .= \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_todo/tpl/todo_stats_entry.tpl'), $stat); + } + return \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_todo/tpl/todo_stats.tpl'), $vars);} private static function time_elapsed_string($ptime) { @@ -66,29 +138,82 @@ class saimod_sys_todo extends \SYSTEM\SAI\SaiModule { return '';} return '';} - private static function reporttype($type){ - switch($type){ - case 0: return 'Feature Request'; - case 1: return 'Error Report'; - case 2: return 'Unasigned Category'; - default: return 'Note'; + private static function trclass($type,$class){ + if($type == \SYSTEM\DBD\system_todo::FIELD_TYPE_USER){ + return 'success';} + switch($class){ + case 'SYSTEM\LOG\INFO': case 'INFO': case 'SYSTEM\LOG\COUNTER': + return 'success'; + case 'SYSTEM\LOG\DEPRECATED': case 'DEPRECATED': + return 'info'; + case 'SYSTEM\LOG\ERROR': case 'ERROR': case 'Exception': case 'SYSTEM\LOG\ERROR_EXCEPTION': + case 'ErrorException': case 'SYSTEM\LOG\SHUTDOWN_EXCEPTION': + return 'error'; + case 'SYSTEM\LOG\WARNING': case 'WARNING': + return 'warning'; + default: + return ''; } } - private static function trclassbytype($type){ - switch($type){ - case 0: return 'info'; - case 1: return 'error'; - case 2: return 'warning'; - case 3: return 'success'; - default: return ''; - } - } + public static function sai_mod__SYSTEM_SAI_saimod_sys_todo_action_close_all(){ + \SYSTEM\DBD\SYS_SAIMOD_TODO_CLOSE_ALL::QI(); + return \SYSTEM\LOG\JsonResult::ok();} + + public static function sai_mod__SYSTEM_SAI_saimod_sys_todo_action_edit($todo, $message){ + \SYSTEM\DBD\SYS_SAIMOD_TODO_EDIT::QI(array($message,$message,$todo)); + return \SYSTEM\LOG\JsonResult::ok();} + + public static function sai_mod__SYSTEM_SAI_saimod_sys_todo_action_todo($todo){ + $vars = \SYSTEM\DBD\SYS_SAIMOD_TODO_TODO::Q1(array($todo)); + $vars['trace'] = implode('
    ', array_slice(explode('#', $vars['trace']), 1, -1)); + return $vars[\SYSTEM\DBD\system_todo::FIELD_TYPE] == \SYSTEM\DBD\system_todo::FIELD_TYPE_USER ? + \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_todo/tpl/saimod_sys_todo_todo_user.tpl'), $vars) : + \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_todo/tpl/saimod_sys_todo_todo.tpl'), $vars);} public static function html_li_menu(){return '
  • ToDo
  • ';} public static function right_public(){return false;} public static function right_right(){return \SYSTEM\SECURITY\Security::check(\SYSTEM\SECURITY\RIGHTS::SYS_SAI);} public static function sai_mod__SYSTEM_SAI_saimod_sys_todo_flag_css(){} - public static function sai_mod__SYSTEM_SAI_saimod_sys_todo_flag_js(){} + public static function sai_mod__SYSTEM_SAI_saimod_sys_todo_flag_js(){return \SYSTEM\LOG\JsonResult::toString( + array(\SYSTEM\WEBPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_todo/js/saimod_sys_todo.js')));} + + public static function exception(\Exception $E, $thrown, $user = false){ + try{ + if(\property_exists(get_class($E), 'todo_logged') && $E->todo_logged){ + return false;} //alrdy logged(this prevents proper thrown value for every system exception) + if($user){ + \SYSTEM\DBD\SYS_SAIMOD_TODO_USER_EXCEPTION_INSERT::Q1( array( get_class($E), $E->getMessage(), $E->getCode(), $E->getFile(), $E->getLine(), $E->getTraceAsString(), + getenv('REMOTE_ADDR'),round(microtime(true) - \SYSTEM\time::getStartTime(),5), + $_SERVER["SERVER_NAME"],$_SERVER["SERVER_PORT"],$_SERVER['REQUEST_URI'], serialize($_POST), + array_key_exists('HTTP_REFERER', $_SERVER) ? $_SERVER['HTTP_REFERER'] : null, + array_key_exists('HTTP_USER_AGENT',$_SERVER) ? $_SERVER['HTTP_USER_AGENT'] : null, + ($user = \SYSTEM\SECURITY\Security::getUser()) ? $user->id : null, $thrown ? 1 : 0, sha1($E->getMessage())), + array( get_class($E), $E->getMessage(), $E->getCode(), $E->getFile(), $E->getLine(), $E->getTraceAsString(), + getenv('REMOTE_ADDR'),round(microtime(true) - \SYSTEM\time::getStartTime(),5),date('Y-m-d H:i:s', microtime(true)), + $_SERVER["SERVER_NAME"],$_SERVER["SERVER_PORT"],$_SERVER['REQUEST_URI'], serialize($_POST), + array_key_exists('HTTP_REFERER', $_SERVER) ? $_SERVER['HTTP_REFERER'] : null, + array_key_exists('HTTP_USER_AGENT',$_SERVER) ? $_SERVER['HTTP_USER_AGENT'] : null, + ($user = \SYSTEM\SECURITY\Security::getUser()) ? $user->id : null,$thrown,$E->getMessage())); + } else { + \SYSTEM\DBD\SYS_SAIMOD_TODO_EXCEPTION_INSERT::Q1( array( get_class($E), $E->getMessage(), $E->getCode(), $E->getFile(), $E->getLine(), $E->getTraceAsString(), + getenv('REMOTE_ADDR'),round(microtime(true) - \SYSTEM\time::getStartTime(),5), + $_SERVER["SERVER_NAME"],$_SERVER["SERVER_PORT"],$_SERVER['REQUEST_URI'], serialize($_POST), + array_key_exists('HTTP_REFERER', $_SERVER) ? $_SERVER['HTTP_REFERER'] : null, + array_key_exists('HTTP_USER_AGENT',$_SERVER) ? $_SERVER['HTTP_USER_AGENT'] : null, + ($user = \SYSTEM\SECURITY\Security::getUser()) ? $user->id : null, $thrown ? 1 : 0, sha1($E->getMessage())), + array( get_class($E), $E->getMessage(), $E->getCode(), $E->getFile(), $E->getLine(), $E->getTraceAsString(), + getenv('REMOTE_ADDR'),round(microtime(true) - \SYSTEM\time::getStartTime(),5),date('Y-m-d H:i:s', microtime(true)), + $_SERVER["SERVER_NAME"],$_SERVER["SERVER_PORT"],$_SERVER['REQUEST_URI'], serialize($_POST), + array_key_exists('HTTP_REFERER', $_SERVER) ? $_SERVER['HTTP_REFERER'] : null, + array_key_exists('HTTP_USER_AGENT',$_SERVER) ? $_SERVER['HTTP_USER_AGENT'] : null, + ($user = \SYSTEM\SECURITY\Security::getUser()) ? $user->id : null,$thrown,$E->getMessage())); + } + if(\property_exists(get_class($E), 'logged')){ + $E->todo_logged = true;} //we just did log + } catch (\Exception $E){return false;} //Error -> Ignore + + return false; //We just log and do not handle the error! + } } \ No newline at end of file diff --git a/sai/modules/saimod_sys_todo/stats/todo_stats_gen.php b/sai/modules/saimod_sys_todo/stats/todo_stats_gen.php new file mode 100644 index 0000000..453150d --- /dev/null +++ b/sai/modules/saimod_sys_todo/stats/todo_stats_gen.php @@ -0,0 +1,12 @@ +name = $name; + $this->part = $part; + $this->whole = $whole; + $this->perc = round($this->part / $this->whole * 100,2); + } +} diff --git a/sai/modules/saimod_sys_todo/tpl/saimod_sys_todo.tpl b/sai/modules/saimod_sys_todo/tpl/saimod_sys_todo.tpl new file mode 100644 index 0000000..f2d4bae --- /dev/null +++ b/sai/modules/saimod_sys_todo/tpl/saimod_sys_todo.tpl @@ -0,0 +1,16 @@ +

    System ToDo

    +
    +
    + +
    +
    +
    +
    \ No newline at end of file diff --git a/sai/modules/saimod_sys_todo/tpl/saimod_sys_todo_new.tpl b/sai/modules/saimod_sys_todo/tpl/saimod_sys_todo_new.tpl new file mode 100644 index 0000000..f122f54 --- /dev/null +++ b/sai/modules/saimod_sys_todo/tpl/saimod_sys_todo_new.tpl @@ -0,0 +1,5 @@ + + +
    Message
    + + \ No newline at end of file diff --git a/sai/modules/saimod_sys_todo/tpl/saimod_sys_todo_todo.tpl b/sai/modules/saimod_sys_todo/tpl/saimod_sys_todo_todo.tpl new file mode 100644 index 0000000..f688d84 --- /dev/null +++ b/sai/modules/saimod_sys_todo/tpl/saimod_sys_todo_todo.tpl @@ -0,0 +1,26 @@ +

    ToDo ${ID}

    + + + + + + + + + + + + + + + + + + + + + +
    PropertyValue
    ID${ID}
    class${class}
    code${code}
    file${file}
    line${line}
    trace${trace}
    ip${ip}
    querytime${querytime}
    time${time}
    server_name${server_name}
    server_port${server_port}
    request_uri${request_uri}
    url${server_name}:${server_port}${request_uri}
    post${post}
    http_referer${http_referer}
    http_user_agent${http_user_agent}
    user${username}
    thrown${thrown}
    message${message}
    + + + \ No newline at end of file diff --git a/sai/modules/saimod_sys_todo/tpl/saimod_sys_todo_todo_user.tpl b/sai/modules/saimod_sys_todo/tpl/saimod_sys_todo_todo_user.tpl new file mode 100644 index 0000000..44d4286 --- /dev/null +++ b/sai/modules/saimod_sys_todo/tpl/saimod_sys_todo_todo_user.tpl @@ -0,0 +1,16 @@ +

    ToDo ${ID}

    + + + + + + + + + + +
    PropertyValue
    ID${ID}
    ip${ip}
    querytime${querytime}
    time${time}
    http_referer${http_referer}
    http_user_agent${http_user_agent}
    user${username}
    message
    + + + + \ No newline at end of file diff --git a/sai/modules/saimod_sys_todo/tpl/todo_list.tpl b/sai/modules/saimod_sys_todo/tpl/todo_list.tpl new file mode 100644 index 0000000..e2c195d --- /dev/null +++ b/sai/modules/saimod_sys_todo/tpl/todo_list.tpl @@ -0,0 +1,29 @@ +
    + Rows: ${count} +
    User ToDo's
    + + + + + + + ${todo_user_list_elements} +
    time agomessageuser
    +
    +
    Generated ToDo's
    + + + + + + + + + + + + + + ${todo_list_elements} +
    time agoclassmessagefilelineipurluserquerytimecount
    +
    \ No newline at end of file diff --git a/sai/modules/saimod_sys_todo/tpl/todo_list_element.tpl b/sai/modules/saimod_sys_todo/tpl/todo_list_element.tpl new file mode 100644 index 0000000..ee9c842 --- /dev/null +++ b/sai/modules/saimod_sys_todo/tpl/todo_list_element.tpl @@ -0,0 +1,12 @@ + + ${time_elapsed} + ${class} + ${message} + ${file} + ${line} + ${ip} + ${server_name}:${server_port}${request_uri} + ${username} + ${querytime} + ${count} + \ No newline at end of file diff --git a/sai/modules/saimod_sys_todo/tpl/todo_stats.tpl b/sai/modules/saimod_sys_todo/tpl/todo_stats.tpl new file mode 100644 index 0000000..7845abb --- /dev/null +++ b/sai/modules/saimod_sys_todo/tpl/todo_stats.tpl @@ -0,0 +1,15 @@ + + + + + + + + ${entries} + + + + + + +
    NameCountAllDone
    Project${project_count}${project_all}${project}%
    \ No newline at end of file diff --git a/sai/modules/saimod_sys_todo/tpl/todo_stats_entry.tpl b/sai/modules/saimod_sys_todo/tpl/todo_stats_entry.tpl new file mode 100644 index 0000000..aa258bc --- /dev/null +++ b/sai/modules/saimod_sys_todo/tpl/todo_stats_entry.tpl @@ -0,0 +1,6 @@ + + ${name} + ${part} + ${whole} + ${perc}% + \ No newline at end of file diff --git a/sai/modules/saimod_sys_todo/tpl/todo_user_list_element.tpl b/sai/modules/saimod_sys_todo/tpl/todo_user_list_element.tpl new file mode 100644 index 0000000..e37d0b7 --- /dev/null +++ b/sai/modules/saimod_sys_todo/tpl/todo_user_list_element.tpl @@ -0,0 +1,5 @@ + + ${time_elapsed} + ${message} + ${username} + \ No newline at end of file diff --git a/sai/modules/saistart_sys_sai/autoload.inc b/sai/modules/saistart_sys_sai/autoload.inc new file mode 100644 index 0000000..e5dbfae --- /dev/null +++ b/sai/modules/saistart_sys_sai/autoload.inc @@ -0,0 +1,3 @@ +Logout -
    -
    -
    - - -
    -
    \ No newline at end of file diff --git a/sai/modules/saistart_sys_sai/qq/dummy b/sai/modules/saistart_sys_sai/qq/dummy new file mode 100644 index 0000000..e69de29 diff --git a/sai/modules/saistart_sys_sai/saistart_sys_sai.php b/sai/modules/saistart_sys_sai/saistart_sys_sai.php index 0459ba7..6c8ebfc 100644 --- a/sai/modules/saistart_sys_sai/saistart_sys_sai.php +++ b/sai/modules/saistart_sys_sai/saistart_sys_sai.php @@ -3,8 +3,11 @@ namespace SYSTEM\SAI; class saistart_sys_sai extends \SYSTEM\SAI\SaiModule { public static function sai_mod__SYSTEM_SAI_saistart_sys_sai(){ - return \SYSTEM\PAGE\replace::replaceFile( \SYSTEM\WEBPATH(new \SYSTEM\PSAI(),'modules/saistart_sys_sai/saistart.tpl'), - array('content' => self::html_content(), 'login' => self::html_login()));} + $vars = array('content' => self::html_content(), 'login' => self::html_login()); + $vars = array_merge($vars, \SYSTEM\locale::getStrings(\SYSTEM\DBD\system_locale_string::VALUE_CATEGORY_BASIC), + \SYSTEM\locale::getStrings(\SYSTEM\DBD\system_locale_string::VALUE_CATEGORY_SYSTEM_SAI), + \SYSTEM\locale::getStrings(\SYSTEM\DBD\system_locale_string::VALUE_CATEGORY_SYSTEM_SAI_ERROR)); + return \SYSTEM\PAGE\replace::replaceFile( \SYSTEM\WEBPATH(new \SYSTEM\PSAI(),'modules/saistart_sys_sai/tpl/saistart.tpl'),$vars);} public static function html_li_menu(){return '
  • '.\SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_SAI_CONFIG_TITLE).'
  • ';} public static function right_public(){return true;} public static function right_right(){return true;} @@ -19,8 +22,8 @@ class saistart_sys_sai extends \SYSTEM\SAI\SaiModule { ));} protected static function html_content(){ - return \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\WEBPATH(new \SYSTEM\PSAI(),'modules/saistart_sys_sai/content.tpl'), array());} + return \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\WEBPATH(new \SYSTEM\PSAI(),'modules/saistart_sys_sai/tpl/content.tpl'), array());} protected static function html_login(){ - return \SYSTEM\SECURITY\Security::isLoggedIn() ? \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\WEBPATH(new \SYSTEM\PSAI(),'modules/saistart_sys_sai/logout.tpl'), array()) : \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\WEBPATH(new \SYSTEM\PSAI(),'modules/saistart_sys_sai/login.tpl'), array());} + return \SYSTEM\SECURITY\Security::isLoggedIn() ? \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\WEBPATH(new \SYSTEM\PSAI(),'modules/saistart_sys_sai/tpl/logout.tpl'), array()) : \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\WEBPATH(new \SYSTEM\PSAI(),'modules/saistart_sys_sai/tpl/login.tpl'), array());} } \ No newline at end of file diff --git a/sai/modules/saistart_sys_sai/carousel.tpl b/sai/modules/saistart_sys_sai/tpl/carousel.tpl similarity index 100% rename from sai/modules/saistart_sys_sai/carousel.tpl rename to sai/modules/saistart_sys_sai/tpl/carousel.tpl diff --git a/sai/modules/saistart_sys_sai/content.tpl b/sai/modules/saistart_sys_sai/tpl/content.tpl similarity index 90% rename from sai/modules/saistart_sys_sai/content.tpl rename to sai/modules/saistart_sys_sai/tpl/content.tpl index 6d95414..30df80a 100644 --- a/sai/modules/saistart_sys_sai/content.tpl +++ b/sai/modules/saistart_sys_sai/tpl/content.tpl @@ -4,7 +4,7 @@ From here you can control and manage your Website.