diff --git a/sai/modules/saimod_sys_calls/saimod_sys_calls.php b/sai/modules/saimod_sys_calls/saimod_sys_calls.php
index 4a23077..91e27d1 100644
--- a/sai/modules/saimod_sys_calls/saimod_sys_calls.php
+++ b/sai/modules/saimod_sys_calls/saimod_sys_calls.php
@@ -3,48 +3,40 @@ 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'.'
'.'
';
+ $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 '
';}
@@ -29,5 +40,6 @@ class saimod_sys_mod extends \SYSTEM\SAI\SaiModule {
public static function right_right(){return \SYSTEM\SECURITY\Security::check(\SYSTEM\system::getSystemDBInfo(), \SYSTEM\SECURITY\RIGHTS::SYS_SAI);}
public static function src_css(){}
- public static function src_js(){}
+ public static function src_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_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..026f81f 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;');
@@ -19,7 +41,15 @@ class saimod_sys_security extends \SYSTEM\SAI\SaiModule {
$result .= '
'.'
'.$r['id'].'
'.'
'.$r['username'].' '.'
'.'
'.$r['email'].'
'.'
'.$r['joindate'].'
'.'
'.$r['locale'].'
'.'
'.$r['last_active'].'
'.'
'.$r['account_flag'].'
'.'
'.'
'.'
'.'
';
}
$result .= '';
- return $result;
+ return $result;
+ }
+
+ public static function html_content(){
+ $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){
@@ -39,6 +69,8 @@ class saimod_sys_security extends \SYSTEM\SAI\SaiModule {
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 src_css(){}
- public static function src_js(){}
+ public static function src_css(){return \SYSTEM\LOG\JsonResult::toString(
+ array(\SYSTEM\WEBPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_security/saimod_sys_security.css')));}
+ public static function src_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/page/default_page/sai.tpl b/sai/page/default_page/sai.tpl
index 7025f08..d0308f8 100644
--- a/sai/page/default_page/sai.tpl
+++ b/sai/page/default_page/sai.tpl
@@ -21,21 +21,18 @@
-
-