From 58e9e0c4432fc0d87150f238f1088f625fa38a1b Mon Sep 17 00:00:00 2001 From: rylon Date: Fri, 5 Jul 2013 21:05:34 +0200 Subject: [PATCH] ms compatibility for sysmods --- .../saimod_sys_calls/saimod_sys_calls.php | 14 ++++++++++--- .../saimod_sys_locale/saimod_sys_locale.php | 6 +++++- sai/modules/saimod_sys_log/saimod_sys_log.php | 21 ++++++++++++++----- .../saimod_sys_security.php | 6 +++++- 4 files changed, 37 insertions(+), 10 deletions(-) diff --git a/sai/modules/saimod_sys_calls/saimod_sys_calls.php b/sai/modules/saimod_sys_calls/saimod_sys_calls.php index cef2a6c..4a23077 100644 --- a/sai/modules/saimod_sys_calls/saimod_sys_calls.php +++ b/sai/modules/saimod_sys_calls/saimod_sys_calls.php @@ -8,7 +8,11 @@ class saimod_sys_calls extends \SYSTEM\SAI\SaiModule { ''.''.'ID'.''.''.'flag'.''.''.'parentID'.''.''.'parentValue'.''.''.'name'.''.''.'allowedValues'.''.''; $con = new \SYSTEM\DB\Connection(\SYSTEM\system::getSystemDBInfo()); - $res = $con->query('SELECT * FROM system.api_calls ORDER BY "ID" ASC;'); + if(\SYSTEM\system::isSystemDbInfoPG()){ + $res = $con->query('SELECT * FROM system.api_calls ORDER BY "ID" ASC;'); + } else { + $res = $con->query('SELECT * FROM system_api_calls ORDER BY ID ASC;'); + } while($r = $res->next()){ $result .= ''.''.$r['ID'].''.''.$r['flag'].''.''.$r['parentID'].''.''.$r['parentValue'].''.''.$r['name'].''.''.$r['allowedValues'].''.'';} @@ -18,8 +22,12 @@ class saimod_sys_calls extends \SYSTEM\SAI\SaiModule { $result .= '

Page Calls

'. ''. ''.''.''.''.''.''.''.''; - - $res = $con->query('SELECT * FROM system.page_calls ORDER BY "ID" ASC;'); + + 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;'); + } while($r = $res->next()){ $result .= ''.''.''.''.''.''.''.'';} diff --git a/sai/modules/saimod_sys_locale/saimod_sys_locale.php b/sai/modules/saimod_sys_locale/saimod_sys_locale.php index c017b4d..050dcb5 100644 --- a/sai/modules/saimod_sys_locale/saimod_sys_locale.php +++ b/sai/modules/saimod_sys_locale/saimod_sys_locale.php @@ -8,7 +8,11 @@ class saimod_sys_locale extends \SYSTEM\SAI\SaiModule { ''.''.''.''.''.''; $con = new \SYSTEM\DB\Connection(\SYSTEM\system::getSystemDBInfo()); - $res = $con->query('SELECT * FROM system.locale_string ORDER BY "category" ASC;'); + if(\SYSTEM\system::isSystemDbInfoPG()){ + $res = $con->query('SELECT * FROM system.locale_string ORDER BY "category" ASC;'); + } else { + $res = $con->query('SELECT * FROM system_locale_string ORDER BY category ASC;'); + } while($r = $res->next()){ $result .= ''.''.''.''.''.'';} diff --git a/sai/modules/saimod_sys_log/saimod_sys_log.php b/sai/modules/saimod_sys_log/saimod_sys_log.php index 1a6bbcd..408c708 100644 --- a/sai/modules/saimod_sys_log/saimod_sys_log.php +++ b/sai/modules/saimod_sys_log/saimod_sys_log.php @@ -20,12 +20,23 @@ class saimod_sys_log extends \SYSTEM\SAI\SaiModule { $con = new \SYSTEM\DB\Connection(\SYSTEM\system::getSystemDBInfo()); $res = null; - if($filter !== NULL && $filter !== 'all'){ - $res = $con->prepare( 'selectSysLogFilter', - 'SELECT * FROM system.sys_log WHERE class ILIKE $1 ORDER BY time DESC LIMIT 100;', - array('%'.$filter.'%')); + if($filter !== NULL && $filter !== 'all'){ + if(\SYSTEM\system::isSystemDbInfoPG()){ + $res = $con->prepare( 'selectSysLogFilter', + 'SELECT * FROM system.sys_log WHERE class ILIKE $1 ORDER BY time DESC LIMIT 100;', + array('%'.$filter.'%')); + } else { + $res = $con->prepare( 'selectSysLogFilter', + 'SELECT * FROM system_sys_log WHERE class ILIKE $1 ORDER BY time DESC LIMIT 100;', + array('%'.$filter.'%')); + } } else { - $res = $con->query('SELECT * FROM system.sys_log ORDER BY time DESC LIMIT 100;');} + if(\SYSTEM\system::isSystemDbInfoPG()){ + $res = $con->query('SELECT * FROM system.sys_log ORDER BY time DESC LIMIT 100;'); + } else { + $res = $con->query('SELECT * FROM system_sys_log ORDER BY time DESC LIMIT 100;'); + } + } $now = microtime(true); diff --git a/sai/modules/saimod_sys_security/saimod_sys_security.php b/sai/modules/saimod_sys_security/saimod_sys_security.php index c8af008..29a893e 100644 --- a/sai/modules/saimod_sys_security/saimod_sys_security.php +++ b/sai/modules/saimod_sys_security/saimod_sys_security.php @@ -4,7 +4,11 @@ namespace SYSTEM\SAI; class saimod_sys_security extends \SYSTEM\SAI\SaiModule { public static function html_content(){ $con = new \SYSTEM\DB\Connection(\SYSTEM\system::getSystemDBInfo()); - $res = $con->query('SELECT id,username,email,joindate,locale,last_active,account_flag FROM system.user ORDER BY last_active DESC;'); + 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;'); + } else { + $res = $con->query('SELECT id,username,email,joindate,locale,last_active,account_flag FROM system_user ORDER BY last_active DESC;'); + } $now = microtime(true);
'.'ID'.''.'flag'.''.'parentID'.''.'parentValue'.''.'name'.''.'allowedValues'.'
'.$r['ID'].''.$r['flag'].''.$r['parentID'].''.$r['parentValue'].''.$r['name'].''.$r['allowedValues'].'
'.'ID'.''.'Category'.''.'enUS'.''.'deDE'.'
'.$r['id'].''.$r['category'].''.$r['enUS'].''.$r['deDE'].'