diff --git a/api/api.php b/api/api.php
index b6b1368..839e1f1 100644
--- a/api/api.php
+++ b/api/api.php
@@ -7,11 +7,11 @@ class api {
public static function run($verifyclassname,$apiclassname,$params,$group = self::DEFAULT_GROUP,$strict = true,$default = false){
//Verify Class
if(!class_exists($verifyclassname)){
- throw new \SYSTEM\LOG\ERROR("Verify Class given to the api does not exist.");}
+ throw new \SYSTEM\LOG\ERROR("Verify Class given to the api does not exist: '".$verifyclassname."'");}
//API Class
if(!class_exists($apiclassname)){
- throw new \SYSTEM\LOG\ERROR("API Class given to the api does not exist.");}
+ throw new \SYSTEM\LOG\ERROR("API Class given to the api does not exist: '".$apiclassname."'");}
//check parameters
if( !isset($params) || !is_array($params) || count($params) <= 0){
@@ -84,13 +84,13 @@ class api {
$commands[count($commands)-1][1] != $item[\SYSTEM\DBD\APITable::FIELD_PARENTVALUE]){
continue;}
- //all parameters are required
+ //all parameters are NOT required - just continue
if(!isset($params[$item[\SYSTEM\DBD\APITable::FIELD_NAME]])){
- throw new \SYSTEM\LOG\ERROR('Parameter missing: '.$item[\SYSTEM\DBD\APITable::FIELD_NAME]);}
+ continue;}
//verify parameter
- if( !method_exists($verifyclassname, $item[\SYSTEM\DBD\APITable::FIELD_VERIFY]) ||
- !$verifyclassname->$item[\SYSTEM\DBD\APITable::FIELD_VERIFY]($params[$item[\SYSTEM\DBD\APITable::FIELD_NAME]])){
+ if( !method_exists($verifyclassname, $item[\SYSTEM\DBD\APITable::FIELD_VERIFY]) ||
+ !call_user_func(array($verifyclassname,$item[\SYSTEM\DBD\APITable::FIELD_VERIFY]),$params[$item[\SYSTEM\DBD\APITable::FIELD_NAME]])){
throw new \SYSTEM\LOG\ERROR('Parameter type missmacht or Missing Verifier. Param: '.$item[\SYSTEM\DBD\APITable::FIELD_NAME].' Verifier: '.$item[\SYSTEM\DBD\APITable::FIELD_VERIFY]);}
$parameters_opt[] = array($item, $params[$item[\SYSTEM\DBD\APITable::FIELD_NAME]]);
@@ -99,8 +99,8 @@ class api {
//strict check
if( $strict &&
- count($params) != (count($parameters) + count($commands)) ){
- throw new \SYSTEM\LOG\ERROR('Unhandled or misshandled parameters - api query is invalid');}
+ count($params) != (count($parameters) + count($commands) + count($parameters_opt)) ){
+ throw new \SYSTEM\LOG\ERROR('Unhandled or misshandled parameters - api query is invalid: '.$_SERVER["REQUEST_URI"]);}
//Function Name
$call_funcname = "";
@@ -137,7 +137,7 @@ class api {
private static function getApiTree($group){
$con = new \SYSTEM\DB\Connection(\SYSTEM\system::getSystemDBInfo());
if(\SYSTEM\system::isSystemDbInfoPG()){
- $res = $con->query('SELECT * FROM '.\SYSTEM\DBD\APITable::NAME_PG .' WHERE `'.\SYSTEM\DBD\APITable::FIELD_GROUP.'` = '.$group.' ORDER BY "'.\SYSTEM\DBD\APITable::FIELD_ID.'"');
+ $res = $con->query('SELECT * FROM '.\SYSTEM\DBD\APITable::NAME_PG .' WHERE "'.\SYSTEM\DBD\APITable::FIELD_GROUP.'" = '.$group.' ORDER BY "'.\SYSTEM\DBD\APITable::FIELD_ID.'"');
} else {
$res = $con->query('SELECT * FROM '.\SYSTEM\DBD\APITable::NAME_MYS.' WHERE `'.\SYSTEM\DBD\APITable::FIELD_GROUP.'` = '.$group.' ORDER BY '.\SYSTEM\DBD\APITable::FIELD_ID);
}
diff --git a/api/api_login.php b/api/api_login.php
index 14ca004..91918a3 100644
--- a/api/api_login.php
+++ b/api/api_login.php
@@ -18,13 +18,13 @@ class api_login {
*/
public static function call_account_action_login($username, $password_sha, $password_md5){
- return \SYSTEM\SECURITY\Security::login(\SYSTEM\system::getSystemDBInfo(), $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(\SYSTEM\system::getSystemDBInfo(),$rightid);}
+ return \SYSTEM\SECURITY\Security::check($rightid);}
public static function call_account_action_create($username, $password_sha, $email, $locale){
- return \SYSTEM\SECURITY\Security::create(\SYSTEM\system::getSystemDBInfo(), $username, $password_sha, $email, $locale);}
+ return \SYSTEM\SECURITY\Security::create($username, $password_sha, $email, $locale);}
}
\ No newline at end of file
diff --git a/sai/autoload.inc.php b/sai/autoload.inc.php
index 15929c5..4971b61 100644
--- a/sai/autoload.inc.php
+++ b/sai/autoload.inc.php
@@ -3,17 +3,6 @@ SYSTEM\autoload::registerFolder(dirname(__FILE__).'/sai','SYSTEM\SAI');
SYSTEM\autoload::registerFolder(dirname(__FILE__).'/page','SYSTEM\SAI');
SYSTEM\autoload::registerFolder(dirname(__FILE__).'/page/default_page','SYSTEM\SAI');
-SYSTEM\autoload::registerFolder(dirname(__FILE__).'/page/default_module','SYSTEM\SAI');
-
-SYSTEM\autoload::registerFolder(dirname(__FILE__).'/modules','SYSTEM\SAI');
-SYSTEM\autoload::registerFolder(dirname(__FILE__).'/modules/saimod_sys_sai','SYSTEM\SAI');
-SYSTEM\autoload::registerFolder(dirname(__FILE__).'/modules/saimod_sys_login','SYSTEM\SAI');
-SYSTEM\autoload::registerFolder(dirname(__FILE__).'/modules/saimod_sys_log','SYSTEM\SAI');
-SYSTEM\autoload::registerFolder(dirname(__FILE__).'/modules/saimod_sys_security','SYSTEM\SAI');
-SYSTEM\autoload::registerFolder(dirname(__FILE__).'/modules/saimod_sys_mod','SYSTEM\SAI');
-SYSTEM\autoload::registerFolder(dirname(__FILE__).'/modules/saimod_sys_config','SYSTEM\SAI');
-SYSTEM\autoload::registerFolder(dirname(__FILE__).'/modules/saimod_sys_calls','SYSTEM\SAI');
-SYSTEM\autoload::registerFolder(dirname(__FILE__).'/modules/saimod_sys_locale','SYSTEM\SAI');
-SYSTEM\autoload::registerFolder(dirname(__FILE__).'/modules/saimod_sys_cache','SYSTEM\SAI');
+require_once dirname(__FILE__).'/modules/autoload_modules.php';
require_once dirname(__FILE__).'/modules/register_modules.php';
\ No newline at end of file
diff --git a/sai/modules/autoload_modules.php b/sai/modules/autoload_modules.php
new file mode 100644
index 0000000..6e52fa7
--- /dev/null
+++ b/sai/modules/autoload_modules.php
@@ -0,0 +1,13 @@
+register_sys('\SYSTEM\SAI\saimod_sys_sai');
-\SYSTEM\SAI\sai::getInstance()->register_sys('\SYSTEM\SAI\saimod_sys_login');
-\SYSTEM\SAI\sai::getInstance()->register_sys('\SYSTEM\SAI\saimod_sys_log');
-\SYSTEM\SAI\sai::getInstance()->register_sys('\SYSTEM\SAI\saimod_sys_security');
-\SYSTEM\SAI\sai::getInstance()->register_sys('\SYSTEM\SAI\saimod_sys_mod');
-\SYSTEM\SAI\sai::getInstance()->register_sys('\SYSTEM\SAI\saimod_sys_config');
-\SYSTEM\SAI\sai::getInstance()->register_sys('\SYSTEM\SAI\saimod_sys_calls');
-\SYSTEM\SAI\sai::getInstance()->register_sys('\SYSTEM\SAI\saimod_sys_locale');
-\SYSTEM\SAI\sai::getInstance()->register_sys('\SYSTEM\SAI\saimod_sys_cache');
-//\SYSTEM\SAI\sai::getInstance()->register_sys('\SYSTEM\SAI\saimod_sys_docu');
\ No newline at end of file
+\SYSTEM\SAI\sai::register_sys('\SYSTEM\SAI\saimod_sys_sai');
+\SYSTEM\SAI\sai::register_sys('\SYSTEM\SAI\saimod_sys_login');
+\SYSTEM\SAI\sai::register_sys('\SYSTEM\SAI\saimod_sys_log');
+\SYSTEM\SAI\sai::register_sys('\SYSTEM\SAI\saimod_sys_security');
+\SYSTEM\SAI\sai::register_sys('\SYSTEM\SAI\saimod_sys_mod');
+\SYSTEM\SAI\sai::register_sys('\SYSTEM\SAI\saimod_sys_config');
+\SYSTEM\SAI\sai::register_sys('\SYSTEM\SAI\saimod_sys_calls');
+\SYSTEM\SAI\sai::register_sys('\SYSTEM\SAI\saimod_sys_locale');
+\SYSTEM\SAI\sai::register_sys('\SYSTEM\SAI\saimod_sys_cache');
+\SYSTEM\SAI\sai::register_sys('\SYSTEM\SAI\saimod_sys_todo');
+\SYSTEM\SAI\sai::register_sys('\SYSTEM\SAI\saimod_sys_docu');
\ No newline at end of file
diff --git a/sai/modules/saimod_sys_cache/saimod_sys_cache.php b/sai/modules/saimod_sys_cache/saimod_sys_cache.php
index 47daf39..cdeb845 100644
--- a/sai/modules/saimod_sys_cache/saimod_sys_cache.php
+++ b/sai/modules/saimod_sys_cache/saimod_sys_cache.php
@@ -2,7 +2,7 @@
namespace SYSTEM\SAI;
class saimod_sys_cache extends \SYSTEM\SAI\SaiModule {
- public static function html_content(){
+ public static function sai_mod__SYSTEM_SAI_saimod_sys_cache(){
$con = new \SYSTEM\DB\Connection(\SYSTEM\system::getSystemDBInfo());
if(\SYSTEM\system::isSystemDbInfoPG()){
$res = $con->query('SELECT COUNT(*)as "count" FROM system.cache');
@@ -39,10 +39,10 @@ class saimod_sys_cache extends \SYSTEM\SAI\SaiModule {
return 'success';
}
- public static function html_li_menu(){return '
';}
public static function right_public(){return false;}
- public static function right_right(){return \SYSTEM\SECURITY\Security::check(\SYSTEM\system::getSystemDBInfo(), \SYSTEM\SECURITY\RIGHTS::SYS_SAI);}
+ public static function right_right(){return \SYSTEM\SECURITY\Security::check(\SYSTEM\SECURITY\RIGHTS::SYS_SAI);}
- public static function src_css(){}
- public static function src_js(){}
+ public static function sai_mod__SYSTEM_SAI_saimod_sys_cache_flag_css(){}
+ public static function sai_mod__SYSTEM_SAI_saimod_sys_cache_flag_js(){}
}
\ No newline at end of file
diff --git a/sai/modules/saimod_sys_calls/saimod_sys_calls.php b/sai/modules/saimod_sys_calls/saimod_sys_calls.php
index 4a23077..a500259 100644
--- a/sai/modules/saimod_sys_calls/saimod_sys_calls.php
+++ b/sai/modules/saimod_sys_calls/saimod_sys_calls.php
@@ -2,52 +2,44 @@
namespace SYSTEM\SAI;
class saimod_sys_calls extends \SYSTEM\SAI\SaiModule {
- public static function html_content(){
- $result = '
Api Calls
'.
- '
'.
- '
'.'
'.'ID'.'
'.'
'.'flag'.'
'.'
'.'parentID'.'
'.'
'.'parentValue'.'
'.'
'.'name'.'
'.'
'.'allowedValues'.'
'.'
';
+ public static function sai_mod__SYSTEM_SAI_saimod_sys_calls(){
+ $last_group = -1;
$con = new \SYSTEM\DB\Connection(\SYSTEM\system::getSystemDBInfo());
if(\SYSTEM\system::isSystemDbInfoPG()){
- $res = $con->query('SELECT * FROM system.api_calls ORDER BY "ID" ASC;');
+ $res = $con->query('SELECT * FROM system.api ORDER BY "group", "ID" ASC;');
} else {
- $res = $con->query('SELECT * FROM system_api_calls ORDER BY ID ASC;');
+ $res = $con->query('SELECT * FROM system_api ORDER BY "group", "ID" ASC;');
}
-
+
+ $result = "";
while($r = $res->next()){
- $result .= '
'.'
'.$r['ID'].'
'.'
'.$r['flag'].'
'.'
'.$r['parentID'].'
'.'
'.$r['parentValue'].'
'.'
'.$r['name'].'
'.'
'.$r['allowedValues'].'
'.'
';}
-
- $result .= '
';
-
- $result .= '
Page Calls
'.
- '
'.
- '
'.'
'.'ID'.'
'.'
'.'flag'.'
'.'
'.'parentID'.'
'.'
'.'parentValue'.'
'.'
'.'name'.'
'.'
'.'allowedValues'.'
'.'
';
-
- if(\SYSTEM\system::isSystemDbInfoPG()){
- $res = $con->query('SELECT * FROM system.page_calls ORDER BY "ID" ASC;');
- } else {
- $res = $con->query('SELECT * FROM system_page_calls ORDER BY ID ASC;');
+ if($last_group != $r['group']){
+ $last_group = $r['group'];
+ if($last_group != -1){
+ $result .= '
';}
+ $result .= '
Api Table for Group '.$r["group"].'
'.
+ '
'.
+ '
'.'
'.'ID'.'
'.'
'.'Group'.'
'.'
'.'Type'.'
'.'
'.'ParentID'.'
'.'
'.'ParentValue'.'
'.'
'.'Name'.'
'.'
'.'Verify'.'
'.'
';
+ }
+ $result .= '
'.'
'.$r['ID'].'
'.'
'.$r['group'].'
'.'
'.$r['type'].'
'.'
'.$r['parentID'].'
'.'
'.$r['parentValue'].'
'.'
'.$r['name'].'
'.'
'.$r['verify'].'
'.'
';
}
-
- while($r = $res->next()){
- $result .= '
'.'
'.$r['ID'].'
'.'
'.$r['flag'].'
'.'
'.$r['parentID'].'
'.'
'.$r['parentValue'].'
'.'
'.$r['name'].'
'.'
'.$r['allowedValues'].'
'.'
';}
-
- $result .= '
';
-
+ $result .= '';
return $result;
}
private static function tablerow_class($flag){
- if($flag == 1){
- return 'info';}
-
- return 'success';
+ switch($flag){
+ case 0: return 'info';
+ case 1: return '';
+ default: return 'success';
+ }
}
- public static function html_li_menu(){return '
';}
public static function right_public(){return false;}
- public static function right_right(){return \SYSTEM\SECURITY\Security::check(\SYSTEM\system::getSystemDBInfo(), \SYSTEM\SECURITY\RIGHTS::SYS_SAI);}
+ public static function right_right(){return \SYSTEM\SECURITY\Security::check(\SYSTEM\SECURITY\RIGHTS::SYS_SAI);}
- public static function src_css(){}
- public static function src_js(){}
+ public static function sai_mod__SYSTEM_SAI_saimod_sys_calls_flag_css(){}
+ public static function sai_mod__SYSTEM_SAI_saimod_sys_calls_flag_js(){}
}
\ No newline at end of file
diff --git a/sai/modules/saimod_sys_config/saimod_sys_config.php b/sai/modules/saimod_sys_config/saimod_sys_config.php
index 94a829f..fef116e 100644
--- a/sai/modules/saimod_sys_config/saimod_sys_config.php
+++ b/sai/modules/saimod_sys_config/saimod_sys_config.php
@@ -2,7 +2,7 @@
namespace SYSTEM\SAI;
class saimod_sys_config extends \SYSTEM\SAI\SaiModule {
- public static function html_content(){
+ public static function sai_mod__SYSTEM_SAI_saimod_sys_config(){
$result = '
';}
public static function right_public(){return false;}
- public static function right_right(){return \SYSTEM\SECURITY\Security::check(\SYSTEM\system::getSystemDBInfo(), \SYSTEM\SECURITY\RIGHTS::SYS_SAI);}
+ public static function right_right(){return \SYSTEM\SECURITY\Security::check(\SYSTEM\SECURITY\RIGHTS::SYS_SAI);}
- public static function src_css(){}
- public static function src_js(){}
+ public static function sai_mod__SYSTEM_SAI_saimod_sys_config_flag_css(){}
+ public static function sai_mod__SYSTEM_SAI_saimod_sys_config_flag_js(){}
}
\ No newline at end of file
diff --git a/sai/modules/saimod_sys_docu/saimod_sys_docu.php b/sai/modules/saimod_sys_docu/saimod_sys_docu.php
new file mode 100644
index 0000000..8f8e73f
--- /dev/null
+++ b/sai/modules/saimod_sys_docu/saimod_sys_docu.php
@@ -0,0 +1,15 @@
+Docu';}
+ 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_docu_flag_css(){}
+ public static function sai_mod__SYSTEM_SAI_saimod_sys_docu_flag_js(){}
+}
\ No newline at end of file
diff --git a/sai/modules/saimod_sys_locale/saimod_sys_locale.php b/sai/modules/saimod_sys_locale/saimod_sys_locale.php
index 4c38421..fc789b8 100644
--- a/sai/modules/saimod_sys_locale/saimod_sys_locale.php
+++ b/sai/modules/saimod_sys_locale/saimod_sys_locale.php
@@ -9,7 +9,7 @@ class saimod_sys_locale extends \SYSTEM\SAI\SaiModule {
return \SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_LANGS);
}
- public static function html_content(){
+ public static function sai_mod__SYSTEM_SAI_saimod_sys_locale(){
$entries = array_merge($_POST,$_GET);
if(isset($entries[self::INPUT_VAR])){
return self::html_content_entry_edit($entries[self::INPUT_VAR]);
@@ -19,7 +19,7 @@ class saimod_sys_locale extends \SYSTEM\SAI\SaiModule {
public static function html_content_table(){
$result = '
Locale String
'.
- '
'.
+ '
'.
'
'.'
'.'ID'.'
'.'
'.'Category'.'
';
foreach (self::getLanguages() as $lang){
@@ -36,10 +36,10 @@ class saimod_sys_locale extends \SYSTEM\SAI\SaiModule {
$res = $con->query('SELECT * FROM system_locale_string ORDER BY category ASC;');
}
while($r = $res->next()){
- $result .= '
';}
public static function right_public(){return false;}
- public static function right_right(){return \SYSTEM\SECURITY\Security::check(\SYSTEM\system::getSystemDBInfo(), \SYSTEM\SECURITY\RIGHTS::SYS_SAI);}
+ public static function right_right(){return \SYSTEM\SECURITY\Security::check(\SYSTEM\SECURITY\RIGHTS::SYS_SAI);}
- public static function src_css(){}
- public static function src_js(){return \SYSTEM\LOG\JsonResult::toString(
- array( \SYSTEM\WEBPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_log/sai_sys_log.js')));}
+ public static function sai_mod__SYSTEM_SAI_saimod_sys_log_flag_css(){}
+ public static function sai_mod__SYSTEM_SAI_saimod_sys_log_flag_js(){
+ return \SYSTEM\LOG\JsonResult::toString(
+ array(\SYSTEM\WEBPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_log/saimod_sys_log.js')));}
}
\ No newline at end of file
diff --git a/sai/modules/saimod_sys_login/logout.tpl b/sai/modules/saimod_sys_login/logout.tpl
index a31c3fa..a63e63a 100644
--- a/sai/modules/saimod_sys_login/logout.tpl
+++ b/sai/modules/saimod_sys_login/logout.tpl
@@ -1,13 +1,102 @@
Logout
-
You are logged in
+
You are logged in.
+
+
+
+
+
+
${ua_name}
+
+
+
+
${ua_email}
+
+
+
+
+
+
+
+
+
+
+
+
${ua_password}
+
+ ****
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
${ua_last_active}
+
+
+
+
${ua_joindate}
+
+
+
+
${ua_locale}
+
+
+
+
+
+
+
+
+
Admin Rights
+
${isadmin}
+
+
+
\ No newline at end of file
+
+
diff --git a/sai/modules/saimod_sys_login/register.tpl b/sai/modules/saimod_sys_login/register.tpl
new file mode 100644
index 0000000..6807cd9
--- /dev/null
+++ b/sai/modules/saimod_sys_login/register.tpl
@@ -0,0 +1,87 @@
+
';}
public static function right_public(){return false;}
- public static function right_right(){return \SYSTEM\SECURITY\Security::check(\SYSTEM\system::getSystemDBInfo(), \SYSTEM\SECURITY\RIGHTS::SYS_SAI);}
+ public static function right_right(){return \SYSTEM\SECURITY\Security::check(\SYSTEM\SECURITY\RIGHTS::SYS_SAI);}
- public static function src_css(){}
- public static function src_js(){}
+ public static function sai_mod__SYSTEM_SAI_saimod_sys_mod_flag_css(){}
+ public static function sai_mod__SYSTEM_SAI_saimod_sys_mod_flag_js(){
+ return \SYSTEM\LOG\JsonResult::toString(
+ array(\SYSTEM\WEBPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_mod/saimod_sys_mod.js')));}
}
\ No newline at end of file
diff --git a/sai/modules/saimod_sys_sai/saimod_sys_sai.php b/sai/modules/saimod_sys_sai/saimod_sys_sai.php
index d2860f6..dc5b3da 100644
--- a/sai/modules/saimod_sys_sai/saimod_sys_sai.php
+++ b/sai/modules/saimod_sys_sai/saimod_sys_sai.php
@@ -3,11 +3,11 @@
namespace SYSTEM\SAI;
class saimod_sys_sai extends \SYSTEM\SAI\SaiModule {
- public static function html_content(){return \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\WEBPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_sai/carousel.tpl'), array());}
- public static function html_li_menu(){return '
';}
+ public static function sai_mod__SYSTEM_SAI_saimod_sys_sai(){return \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\WEBPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_sai/carousel.tpl'), array());}
+ public static function html_li_menu(){return '
';}
public static function right_public(){return true;}
public static function right_right(){return true;}
- public static function src_css(){}
- public static function src_js(){}
+ public static function sai_mod__SYSTEM_SAI_saimod_sys_sai_flag_css(){}
+ public static function sai_mod__SYSTEM_SAI_saimod_sys_sai_flag_js(){}
}
\ No newline at end of file
diff --git a/sai/modules/saimod_sys_security/saimod_sys_security.css b/sai/modules/saimod_sys_security/saimod_sys_security.css
new file mode 100644
index 0000000..bc32379
--- /dev/null
+++ b/sai/modules/saimod_sys_security/saimod_sys_security.css
@@ -0,0 +1,3 @@
+.tab-content {
+ clear: none;
+}
\ No newline at end of file
diff --git a/sai/modules/saimod_sys_security/saimod_sys_security.js b/sai/modules/saimod_sys_security/saimod_sys_security.js
new file mode 100644
index 0000000..c168eb7
--- /dev/null
+++ b/sai/modules/saimod_sys_security/saimod_sys_security.js
@@ -0,0 +1,6 @@
+function init__SYSTEM_SAI_saimod_sys_security() {
+ $('#securitytab a').click(function (e) {
+ e.preventDefault();
+ $(this).tab('show');
+ })
+};
\ No newline at end of file
diff --git a/sai/modules/saimod_sys_security/saimod_sys_security.php b/sai/modules/saimod_sys_security/saimod_sys_security.php
index 21ff92b..68b3aa7 100644
--- a/sai/modules/saimod_sys_security/saimod_sys_security.php
+++ b/sai/modules/saimod_sys_security/saimod_sys_security.php
@@ -1,8 +1,30 @@
query('SELECT * FROM system.rights ORDER BY "ID" ASC;');
+ } else {
+ $res = $con->query('SELECT * FROM system_rights ORDER BY ID ASC;');
+ }
+ $result = ''.
+ '
'.
+ '
'.'
'.'ID'.'
'.'
'.'Name'.'
'.'
'.'Description'.'
'.'
'.'Action'.'
'.'
';
+ while($r = $res->next()){
+ $result .= '
'.'
'.$r['ID'].'
'.'
'.$r['name'].'
'.'
'.$r['description'].'
'.'
'.''.''.'
'.'
';
+ }
+ $result .= '
';
+ return $result;
+ }
+
+ public static function html_content_users(){
$con = new \SYSTEM\DB\Connection(\SYSTEM\system::getSystemDBInfo());
if(\SYSTEM\system::isSystemDbInfoPG()){
$res = $con->query('SELECT id,username,email,joindate,locale,last_active,account_flag FROM system.user ORDER BY last_active DESC;');
@@ -16,10 +38,18 @@ class saimod_sys_security extends \SYSTEM\SAI\SaiModule {
$result = '
'.
'
'.'
'.'ID'.'
'.'
'.'Username'.'
'.'
'.'E-Mail'.'
'.'
'.'JoinDate'.'
'.'
'.'Locale'.'
'.'
'.'Last Active'.'
'.'
'.'Flag'.'
'.'
'.'Rights'.'
reset password
'.'
';
while($r = $res->next()){
- $result .= '
'.'
'.$r['id'].'
'.'
'.$r['username'].' '.'
'.'
'.$r['email'].'
'.'
'.$r['joindate'].'
'.'
'.$r['locale'].'
'.'
'.$r['last_active'].'
'.'
'.$r['account_flag'].'
'.'
'.'
'.'
'.'
';
+ $result .= '
'.'
'.$r['id'].'
'.'
'.$r['username'].'
'.'
'.$r['email'].'
'.'
'.$r['joindate'].'
'.'
'.$r['locale'].'
'.'
'.self::time_elapsed_string($r['last_active']).'
'.'
'.$r['account_flag'].'
'.'
'.'
'.'
'.'
';
}
$result .= '
';
- return $result;
+ return $result;
+ }
+
+ public static function sai_mod__SYSTEM_SAI_saimod_sys_security(){
+ $vars = array();
+ $vars['content_users'] = self::html_content_users();
+ $vars['content_rights'] = self::html_content_rights();
+ $vars['content_groups'] = self::html_content_groups();
+ return \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_security/security.tpl'), $vars);
}
private static function tablerow_class($last_active){
@@ -35,10 +65,40 @@ class saimod_sys_security extends \SYSTEM\SAI\SaiModule {
return 'error';
}
- public static function html_li_menu(){return '
';}
+ 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_security_flag_css(){return \SYSTEM\LOG\JsonResult::toString(
+ array(\SYSTEM\WEBPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_security/saimod_sys_security.css')));}
+ public static function sai_mod__SYSTEM_SAI_saimod_sys_security_flag_js(){ return \SYSTEM\LOG\JsonResult::toString(
+ array(\SYSTEM\WEBPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_security/saimod_sys_security.js')));}
}
\ No newline at end of file
diff --git a/sai/modules/saimod_sys_security/security.tpl b/sai/modules/saimod_sys_security/security.tpl
new file mode 100644
index 0000000..9c793ca
--- /dev/null
+++ b/sai/modules/saimod_sys_security/security.tpl
@@ -0,0 +1,12 @@
+
\ No newline at end of file
diff --git a/sai/modules/saimod_sys_todo/saimod_sys_todo.php b/sai/modules/saimod_sys_todo/saimod_sys_todo.php
new file mode 100644
index 0000000..8fb4341
--- /dev/null
+++ b/sai/modules/saimod_sys_todo/saimod_sys_todo.php
@@ -0,0 +1,94 @@
+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 = '