[IMP] now in AJAX PHP file, it is not needed anymore to use DB IDs hard coded; Use the session dsn
This commit is contained in:
parent
b9bbb9598a
commit
ddbc3e12d2
11
index.php
11
index.php
@ -30,6 +30,7 @@ require_once './modules/InterfacePostgreSQL.php';
|
||||
require_once './modules/InterfaceTranslation.php';
|
||||
require_once './modules/InterfaceEmail.php';
|
||||
|
||||
require_once './modules/ClassDB.php';
|
||||
require_once './modules/ClassConfig.php';
|
||||
require_once './modules/ClassTranslation.php';
|
||||
require_once './modules/ClassController.php';
|
||||
@ -42,6 +43,7 @@ require_once './modules/ClassUser.php';
|
||||
require_once './modules/ClassEmail.php';
|
||||
require_once './modules/ClassForm.php';
|
||||
|
||||
$oDB = new ClassDB();
|
||||
$oConf = new ClassConfig();
|
||||
$oTrans = new ClassTranslation();
|
||||
$oController = new ClassController($_REQUEST);
|
||||
@ -70,7 +72,6 @@ if(file_exists($oConf->getPathCustom("modules.php"))){
|
||||
|
||||
// Load configuration in _SESSION
|
||||
//unset($_SESSION['config']); //uncomment this line, even for test, creates a bug for translations for logged users
|
||||
|
||||
if (!isset($_SESSION['config'])) {
|
||||
$_SESSION['config'] = $oConf->getConfig();
|
||||
|
||||
@ -93,8 +94,16 @@ if (!isset($_SESSION['config'])) {
|
||||
$_SESSION['currencies'] = $oCurrency->listCurrencies('priority ASC, name ASC');
|
||||
$_SESSION['languages'] = $oLang->listLanguages();
|
||||
$_SESSION['activeLanguages'] = $oLang->listActiveLanguages();
|
||||
//$_SESSION['dsn'] = $oPDOLink;
|
||||
}
|
||||
|
||||
|
||||
$_SESSION['dsn'] = ['host'=>$oDB->_host, 'port'=>$oDB->_port, 'dbname'=>$oDB->_dbname, 'user'=>$oDB->_user, 'password'=>$oDB->_password];
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if(!isset($_SESSION['translations'])){
|
||||
$_SESSION['translations'] = $oTrans->listTranslations('fr_fr');
|
||||
}
|
||||
|
13
modules/ClassDB.php
Normal file
13
modules/ClassDB.php
Normal file
@ -0,0 +1,13 @@
|
||||
<?php
|
||||
class ClassDB implements InterfacePostgreSQL {
|
||||
public function __construct(){
|
||||
$this->_host = InterfacePostgreSQL::PG_SERVER;
|
||||
$this->_port = InterfacePostgreSQL::PG_PORT;
|
||||
$this->_dbname = InterfacePostgreSQL::PG_DBNAME;
|
||||
$this->_user = InterfacePostgreSQL::PG_USER;
|
||||
$this->_password = InterfacePostgreSQL::PG_PASSWORD;
|
||||
}
|
||||
public function __desctruct(){}
|
||||
|
||||
public static function databaseConnect(){}
|
||||
}
|
Loading…
Reference in New Issue
Block a user