diff --git a/api/api.php b/api/api.php
index 3aa2691..c5f9b56 100644
--- a/api/api.php
+++ b/api/api.php
@@ -7,7 +7,7 @@ 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)){
@@ -100,7 +100,7 @@ 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');}
+ throw new \SYSTEM\LOG\ERROR('Unhandled or misshandled parameters - api query is invalid: '.$_SERVER["REQUEST_URI"]);}
//Function Name
$call_funcname = "";
diff --git a/sai/modules/saimod_sys_calls/saimod_sys_calls.php b/sai/modules/saimod_sys_calls/saimod_sys_calls.php
index f468600..c05d5e5 100644
--- a/sai/modules/saimod_sys_calls/saimod_sys_calls.php
+++ b/sai/modules/saimod_sys_calls/saimod_sys_calls.php
@@ -36,7 +36,7 @@ class saimod_sys_calls extends \SYSTEM\SAI\SaiModule {
}
}
- public static function html_li_menu(){return '
API Calls ';}
+ public static function html_li_menu(){return 'API Calls ';}
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);}
diff --git a/sai/modules/saimod_sys_config/saimod_sys_config.php b/sai/modules/saimod_sys_config/saimod_sys_config.php
index c017a9c..98847b1 100644
--- a/sai/modules/saimod_sys_config/saimod_sys_config.php
+++ b/sai/modules/saimod_sys_config/saimod_sys_config.php
@@ -28,7 +28,7 @@ class saimod_sys_config extends \SYSTEM\SAI\SaiModule {
return $result;
}
- public static function html_li_menu(){return 'Config ';}
+ public static function html_li_menu(){return 'Config ';}
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);}
diff --git a/sai/modules/saimod_sys_locale/saimod_sys_locale.php b/sai/modules/saimod_sys_locale/saimod_sys_locale.php
index 1183de4..1b0dd78 100644
--- a/sai/modules/saimod_sys_locale/saimod_sys_locale.php
+++ b/sai/modules/saimod_sys_locale/saimod_sys_locale.php
@@ -86,7 +86,7 @@ class saimod_sys_locale extends \SYSTEM\SAI\SaiModule {
return $result;
}
- public static function html_li_menu(){return 'DB Text ';}
+ public static function html_li_menu(){return 'DB Text ';}
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);}
diff --git a/sai/modules/saimod_sys_log/saimod_sys_log.js b/sai/modules/saimod_sys_log/saimod_sys_log.js
index 2963367..b1fbb83 100644
--- a/sai/modules/saimod_sys_log/saimod_sys_log.js
+++ b/sai/modules/saimod_sys_log/saimod_sys_log.js
@@ -9,7 +9,7 @@ function init__SYSTEM_SAI_saimod_sys_log() {
if(data == 1){
$('#info_box').html("deleting data...");
$('#truncate_modal').modal('hide');
- $('#content-wrapper').load('./?action=developer&sai_mod=.SYSTEM.SAI.saimod_sys_log');
+ $('#content-wrapper').load(SAI_ENDPOINT+'sai_mod=.SYSTEM.SAI.saimod_sys_log');
}else{
$('#info_box').html("You do not have the permission to truncate table!");
}
@@ -23,7 +23,7 @@ function init__SYSTEM_SAI_saimod_sys_log() {
$('img#loader').show();
- $('#content-wrapper').load('./?action=developer&sai_mod=.SYSTEM.SAI.saimod_sys_log');
+ $('#content-wrapper').load(SAI_ENDPOINT+'sai_mod=.SYSTEM.SAI.saimod_sys_log');
setTimeout("$('img#loader').hide()", 1300);
@@ -36,7 +36,7 @@ function init__SYSTEM_SAI_saimod_sys_log() {
$(this).addClass('active');
- $('#table-wrapper').load('./?action=developer&sai_mod=.SYSTEM.SAI.saimod_sys_log&filter_error='+$(this).attr('id'));
+ $('#table-wrapper').load(SAI_ENDPOINT+'sai_mod=.SYSTEM.SAI.saimod_sys_log&filter_error='+$(this).attr('id'));
}));
};
\ No newline at end of file
diff --git a/sai/modules/saimod_sys_log/saimod_sys_log.php b/sai/modules/saimod_sys_log/saimod_sys_log.php
index c0f3d17..6bdd195 100644
--- a/sai/modules/saimod_sys_log/saimod_sys_log.php
+++ b/sai/modules/saimod_sys_log/saimod_sys_log.php
@@ -122,7 +122,7 @@ class saimod_sys_log extends \SYSTEM\SAI\SaiModule {
}
}
- public static function html_li_menu(){return 'Log ';}
+ public static function html_li_menu(){return 'Log ';}
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);}
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}
+
+
+
+
+ deDE
+ enUS
+
+
+
+
+
+ Admin Rights
+ ${isadmin}
+
+
+
\ No newline at end of file
+
+
diff --git a/sai/modules/saimod_sys_login/sai_sys_login_submit.js b/sai/modules/saimod_sys_login/sai_sys_login_submit.js
index ca1de7c..708169f 100644
--- a/sai/modules/saimod_sys_login/sai_sys_login_submit.js
+++ b/sai/modules/saimod_sys_login/sai_sys_login_submit.js
@@ -1,34 +1,43 @@
function init__SYSTEM_SAI_saimod_sys_login() {
- //jqBootstrapValidation
- $("#login_form input").not("[type=submit]").jqBootstrapValidation({
- preventSubmit: true,
- submitError: function($form, event, errors) {},
- submitSuccess: function($form, event){
- $.get('./api.php?call=account&action=login&username='+$('#bt_login_user').val()+'&password_sha='+$.sha1($('#bt_login_password').val())+'&password_md5='+$.md5($('#bt_login_password').val()), function (data) {
- if(data == 1){
- $('.help-block').html("Login successfull.");
- location.reload(true);
- } else {
- $('.help-block').html("Login not successfull. User & Password combination wrong.")
- }
- });
- event.preventDefault();
- }
- });
-
- $("#logout_form input").not("[type=submit]").jqBootstrapValidation({
- preventSubmit: true,
- submitError: function($form, event, errors) {},
- submitSuccess: function($form, event){
- $.get('./api.php?call=account&action=logout', function (data) {
- if(data == 1){
- $('.help-block').html("Logout successfull.");
- location.reload(true);
- } else {
- $('.help-block').html("Logout not successfull.")
- }
- });
- event.preventDefault();
- }
- });
+ //jqBootstrapValidation
+ $("#login_form input").not("[type=submit]").jqBootstrapValidation({
+ preventSubmit: true,
+ submitError: function($form, event, errors) {},
+ submitSuccess: function($form, event){
+ $.get(SAI_ENDPOINT+'sai_mod=.SYSTEM.SAI.saimod_sys_login&action=login&username='+$('#bt_login_user').val()+'&password_sha='+$.sha1($('#bt_login_password').val())+'&password_md5='+$.md5($('#bt_login_password').val()), function (data) {
+ if(data == 1){
+ $('.help-block').html("Login successfull.");
+ location.reload(true);
+ } else {
+ $('.help-block').html("Login not successfull. User & Password combination wrong.")
+ }
+ });
+ event.preventDefault();
+ }
+ });
+
+ $("#logout_form input").not("[type=submit]").jqBootstrapValidation({
+ preventSubmit: true,
+ submitError: function($form, event, errors) {},
+ submitSuccess: function($form, event){
+ $.get(SAI_ENDPOINT+'sai_mod=.SYSTEM.SAI.saimod_sys_login&action=logout', function (data) {
+ if(data == 1){
+ $('.help-block').html("Logout successfull.");
+ location.reload(true);
+ } else {
+ $('.help-block').html("Logout not successfull.")
+ }
+ });
+ event.preventDefault();
+ }
+ });
+
+ $.getJSON('./?module=user&action=area&getUserDetails=1', function(data){
+ $('#user_email_input').attr('value', data.email);
+ $('span#user_username').text(data.username);
+ $('span#user_email').text(data.email);
+ $('span#user_joindate').text(data.joindate);
+ $('span#user_last_active').text(new Date(data.last_active * 1000).toString('yyyy-MM-dd h:mm:ss'));
+ $('span#user_locale').text(data.locale);
+ });
};
diff --git a/sai/modules/saimod_sys_login/saimod_sys_login.php b/sai/modules/saimod_sys_login/saimod_sys_login.php
index b9d5c93..65009c6 100644
--- a/sai/modules/saimod_sys_login/saimod_sys_login.php
+++ b/sai/modules/saimod_sys_login/saimod_sys_login.php
@@ -3,13 +3,7 @@
namespace SYSTEM\SAI;
class saimod_sys_login extends \SYSTEM\SAI\SaiModule {
- public static function sai_mod__SYSTEM_SAI_saimod_sys_login(){
- /*
- if( isset($_POST['username']) && isset($_POST['password']) &&
- \SYSTEM\SECURITY\Security::login(\SYSTEM\system::getSystemDBInfo(), $_POST['username'], sha1($_POST['password']), md5($_POST['password']))){
- return \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\WEBPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_login/login_success.tpl'), array());}
- */
-
+ public static function sai_mod__SYSTEM_SAI_saimod_sys_login(){
$vars = array();
$vars['login'] = 'Login';
$vars['logout'] = 'Logout';
@@ -17,13 +11,21 @@ class saimod_sys_login extends \SYSTEM\SAI\SaiModule {
$vars['loginPassword'] = 'Password';
$vars['login_username_too_short'] = 'Username to short.';
$vars['login_password_too_short'] = 'Password to short.';
+ $vars['isadmin'] = \SYSTEM\SECURITY\Security::check(new \DBD\dasensePostgres(), \SYSTEM\SECURITY\RIGHTS::SYS_SAI) ? "yes" : "no";
+ $vars = array_merge($vars, \SYSTEM\locale::getStrings(\DBD\locale_string::VALUE_CATEGORY_DASENSE_USERSTATISTICS));
if(\SYSTEM\SECURITY\Security::isLoggedIn()){
return \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\WEBPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_login/logout.tpl'), $vars);
} else {
return \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\WEBPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_login/login.tpl'), $vars);}
}
- public static function html_li_menu(){return 'Login ';}
+
+ public static function sai_mod__SYSTEM_SAI_saimod_sys_login_action_logout(){
+ return \SYSTEM\SECURITY\Security::logout();}
+ public static function sai_mod__SYSTEM_SAI_saimod_sys_login_action_login($username,$password_sha,$password_md5){
+ return \SYSTEM\SECURITY\Security::login(new \DBD\dasensePostgres(), $username, $password_sha, $password_md5);}
+
+ public static function html_li_menu(){return 'Login ';}
public static function right_public(){return true;}
public static function right_right(){return true;}
diff --git a/sai/modules/saimod_sys_mod/saimod_sys_mod.php b/sai/modules/saimod_sys_mod/saimod_sys_mod.php
index e73be88..b974a90 100644
--- a/sai/modules/saimod_sys_mod/saimod_sys_mod.php
+++ b/sai/modules/saimod_sys_mod/saimod_sys_mod.php
@@ -35,7 +35,7 @@ class saimod_sys_mod extends \SYSTEM\SAI\SaiModule {
}
- public static function html_li_menu(){return 'SAI Mods ';}
+ public static function html_li_menu(){return 'SAI Mods ';}
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);}
diff --git a/sai/modules/saimod_sys_sai/saimod_sys_sai.php b/sai/modules/saimod_sys_sai/saimod_sys_sai.php
index 2fac8fe..dc5b3da 100644
--- a/sai/modules/saimod_sys_sai/saimod_sys_sai.php
+++ b/sai/modules/saimod_sys_sai/saimod_sys_sai.php
@@ -4,7 +4,7 @@ namespace SYSTEM\SAI;
class saimod_sys_sai extends \SYSTEM\SAI\SaiModule {
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 'SYSTEM Admin Interface ';}
+ public static function html_li_menu(){return 'SYSTEM Admin Interface ';}
public static function right_public(){return true;}
public static function right_right(){return true;}
diff --git a/sai/modules/saimod_sys_security/saimod_sys_security.php b/sai/modules/saimod_sys_security/saimod_sys_security.php
index 0a1f9d8..ed07424 100644
--- a/sai/modules/saimod_sys_security/saimod_sys_security.php
+++ b/sai/modules/saimod_sys_security/saimod_sys_security.php
@@ -65,7 +65,7 @@ class saimod_sys_security extends \SYSTEM\SAI\SaiModule {
return 'error';
}
- public static function html_li_menu(){return 'Security ';}
+ public static function html_li_menu(){return 'Security ';}
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);}
diff --git a/sai/page/default_page/default_page.php b/sai/page/default_page/default_page.php
index 085d16f..aa232d0 100644
--- a/sai/page/default_page/default_page.php
+++ b/sai/page/default_page/default_page.php
@@ -37,11 +37,11 @@ class default_page extends \SYSTEM\PAGE\Page {
private function js(){
$result = ''.
''.
- ''.
- '';
+ ''.
''.
''.
- '';
+ ''.
+ '';
return $result;
}
diff --git a/sai/page/default_page/js/index.js b/sai/page/default_page/js/index.js
deleted file mode 100644
index 83f9dc8..0000000
--- a/sai/page/default_page/js/index.js
+++ /dev/null
@@ -1,65 +0,0 @@
-
-var last_id = '';
-var scripts_loaded = 0;
-var scripts_req = 0;
-/** jQuery on document ready */
-$(document).ready(function() {
-
- // initialize content
- loadModuleContent('.SYSTEM.SAI.saimod_sys_sai');
-
- //load content -> menu
- $('#sai_navbar ul li a, #project_navbar ul li a').click(function () {
- var id = $(this).attr("id");
- if(id !== undefined){
- console.log("Module: "+id);
-
- $('#sai_navbar li, #project_navbar li').each(function(){
- $(this).removeClass('active');});
- $(this).parent().addClass('active');
-
- loadModuleContent(id);
- }
- });
-
- $('.brand').click(function(){
- location.reload();
- });
-
-});
-
-function loadModuleContent(id){
- last_id = id;
- $('div#content-wrapper').load('./?action=developer&sai_mod='+id, function(){
- $.getJSON('./?action=developer&sai_mod='+id+'&css=1', function (data) {
- if(data){
- for(var i=0; i < data['result'].length; i++){
- loadCSS(data['result'][i]);}
- }
- });
-
- $.getJSON('./?action=developer&sai_mod='+id+'&js=1', function (data) {
- if(data){
- scripts_req = data['result'].length;
- for(var i=0; i < data['result'].length; i++){
- loadJS(unescape(data['result'][i]));}
- }
- });
-
-
- });
-}
-
-function script_loaded(){
- scripts_loaded += 1;
-
- if(scripts_loaded >= scripts_req){
- scripts_loaded = 0;
- func = 'init_'+last_id;
- //func = jssrc.substring(jssrc.lastIndexOf('/')+1);
- func = func.replace(/\./g,'_');
- if(typeof window[func] === 'function') {
- window[func]();
- console.log(func+' called');}
- }
-}
\ No newline at end of file
diff --git a/sai/page/default_page/js/loadcssjs.js b/sai/page/default_page/js/loadcssjs.js
deleted file mode 100644
index 928c867..0000000
--- a/sai/page/default_page/js/loadcssjs.js
+++ /dev/null
@@ -1,19 +0,0 @@
-function loadJS(jssrc) {
- if(jssrc){
- $.getScript(jssrc).done(function(script, textStatus) {
- console.log('Script: '+jssrc+' - '+textStatus );
- script_loaded();
- })
- }
-}
-
-function loadCSS(csssrc) {
- if(csssrc){
- var snode = document.createElement('link');
- snode.setAttribute('type','text/css');
- snode.setAttribute('rel', 'stylesheet');
- snode.setAttribute('href',csssrc);
- document.getElementsByTagName('head')[0].appendChild(snode);
- console.log('Css: '+csssrc+' loaded.');
- }
-}
\ No newline at end of file
diff --git a/sai/page/default_page/js/sai.js b/sai/page/default_page/js/sai.js
new file mode 100644
index 0000000..cbb4585
--- /dev/null
+++ b/sai/page/default_page/js/sai.js
@@ -0,0 +1,81 @@
+var last_id = '';
+var scripts_loaded = 0;
+var scripts_req = 0;
+/** jQuery on document ready */
+$(document).ready(function() {
+
+ // initialize content
+ loadModuleContent('.SYSTEM.SAI.saimod_sys_sai');
+
+ //load content -> menu
+ $('#sai_navbar ul li a, #project_navbar ul li a').click(function () {
+ var id = $(this).attr("saimenu");
+ if(id !== undefined){
+ console.log("Module: "+id);
+ $('#sai_navbar li, #project_navbar li').each(function(){
+ $(this).removeClass('active');});
+ $(this).parent().addClass('active');
+ loadModuleContent(id);
+ }
+ });
+
+ $('.brand').click(function(){
+ location.reload();
+ });
+});
+
+function loadModuleContent(id){
+ last_id = id;
+ $('div#content-wrapper').load(SAI_ENDPOINT+'sai_mod='+id, function(){
+ $.getJSON(SAI_ENDPOINT+'sai_mod='+id+'&css=1', function (data) {
+ if(data){
+ for(var i=0; i < data['result'].length; i++){
+ loadCSS(data['result'][i]);}
+ }
+ });
+
+ $.getJSON('./sai.php?sai_mod='+id+'&js=1', function (data) {
+ if(data){
+ scripts_req = data['result'].length;
+ for(var i=0; i < data['result'].length; i++){
+ loadJS(unescape(data['result'][i]));}
+ }
+ });
+
+
+ });
+}
+
+function script_loaded(){
+ scripts_loaded += 1;
+
+ if(scripts_loaded >= scripts_req){
+ scripts_loaded = 0;
+ func = 'init_'+last_id;
+ //func = jssrc.substring(jssrc.lastIndexOf('/')+1);
+ func = func.replace(/\./g,'_');
+ if(typeof window[func] === 'function') {
+ window[func]();
+ console.log(func+' called');}
+ }
+}
+
+function loadJS(jssrc) {
+ if(jssrc){
+ $.getScript(jssrc).done(function(script, textStatus) {
+ console.log('Script: '+jssrc+' - '+textStatus );
+ script_loaded();
+ })
+ }
+}
+
+function loadCSS(csssrc) {
+ if(csssrc){
+ var snode = document.createElement('link');
+ snode.setAttribute('type','text/css');
+ snode.setAttribute('rel', 'stylesheet');
+ snode.setAttribute('href',csssrc);
+ document.getElementsByTagName('head')[0].appendChild(snode);
+ console.log('Css: '+csssrc+' loaded.');
+ }
+}
\ No newline at end of file
diff --git a/sai/page/default_page/sai.tpl b/sai/page/default_page/sai.tpl
index d0308f8..430765b 100644
--- a/sai/page/default_page/sai.tpl
+++ b/sai/page/default_page/sai.tpl
@@ -30,7 +30,7 @@