diff --git a/dbd/sql/mysql/data/sai_api.sql b/dbd/sql/mysql/data/sai_api.sql index b758d89..801a1cb 100644 --- a/dbd/sql/mysql/data/sai_api.sql +++ b/dbd/sql/mysql/data/sai_api.sql @@ -28,6 +28,7 @@ INSERT INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `nam 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 (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'); diff --git a/sai/modules/saimod_sys_locale/saimod_sys_locale.php b/sai/modules/saimod_sys_locale/saimod_sys_locale.php index ab885e2..3579008 100644 --- a/sai/modules/saimod_sys_locale/saimod_sys_locale.php +++ b/sai/modules/saimod_sys_locale/saimod_sys_locale.php @@ -95,7 +95,7 @@ class saimod_sys_locale extends \SYSTEM\SAI\SaiModule { return \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_locale/edit.tpl'), $vars); } - public static function html_li_menu(){return '
  • DB Text
  • ';} + public static function html_li_menu(){return '
  • Text
  • ';} public static function right_public(){return false;} public static function right_right(){return \SYSTEM\SECURITY\Security::check(\SYSTEM\SECURITY\RIGHTS::SYS_SAI) && \SYSTEM\SECURITY\Security::check(\SYSTEM\SECURITY\RIGHTS::SYS_SAI_LOCALE);} diff --git a/security/Security.php b/security/Security.php index 0c44034..89118aa 100644 --- a/security/Security.php +++ b/security/Security.php @@ -27,7 +27,7 @@ class Security { public static function login($username, $password_sha, $password_md5, $locale=NULL, $advancedResult=false, $password_sha_new=NULL){ self::startSession(); - $_SESSION['user'] = NULL; + $_SESSION[\SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_PATH_BASEURL)] = NULL; //Database check if(isset($password_md5)){ @@ -53,7 +53,8 @@ class Security { $row[\SYSTEM\DBD\system_user::FIELD_PASSWORD_SHA] = $pw; } // set session variables - $_SESSION['user'] = new User( $row[\SYSTEM\DBD\system_user::FIELD_ID], + $_SESSION[\SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_PATH_BASEURL)] = + new User( $row[\SYSTEM\DBD\system_user::FIELD_ID], $row[\SYSTEM\DBD\system_user::FIELD_USERNAME], $row[\SYSTEM\DBD\system_user::FIELD_EMAIL], $row[\SYSTEM\DBD\system_user::FIELD_JOINDATE], @@ -73,7 +74,7 @@ class Security { public static function getUser(){ if(!self::isLoggedIn()){ return NULL;} - return $_SESSION['user'];} + return $_SESSION[\SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_PATH_BASEURL)];} // Determine if username exists public static function available($username){ @@ -118,9 +119,8 @@ class Security { public static function isLoggedIn(){ self::startSession(); - return (isset($_SESSION['user']) && - $_SESSION['user'] instanceof User && - $_SESSION['user']->base_url === \SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_PATH_BASEURL));} + return (isset($_SESSION[\SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_PATH_BASEURL)]) && + $_SESSION[\SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_PATH_BASEURL)] instanceof User);} private static function startSession(){ if(!isset($_SESSION) && !headers_sent()){