Merge branch 'master' into dist/envole/6/master

This commit is contained in:
Arnaud Fornerot 2020-07-23 10:09:10 +02:00
commit 95784beed6
3 changed files with 50 additions and 0 deletions

View File

@ -15,6 +15,8 @@
<file filelist="ninegate" name="/var/www/html/ninegate/src/Cadoles/CoreBundle/Command/data/core-init-01.sql" source="ninegate-init-01.sql" rm="True"/>
<file filelist='ninegate' name='/etc/cron.d/ninegate' source='ninegate.cron' rm='True'/>
<file filelist='ninegate-migration' name='/var/www/html/envole-migration/config/config-db-ninegate.php' source='ninegate-migration.php' mkdir='True'/>
<service method='apache' servicelist='ninegate'>ninegate</service>
<service_access service='ninegate_websocket'>
@ -452,9 +454,16 @@
<target type='variable'>ninegate_dbpass</target>
<target type='filelist'>ninegate</target>
<target type='filelist'>ninegate-migration</target>
<target type='servicelist'>ninegate</target>
</condition>
<condition name='hidden_if_in' source='activer_envole_migration' fallback='True'>
<param>non</param>
<target type='filelist'>ninegate-migration</target>
</condition>
<condition name='hidden_if_in' source='ninegate_masteridentity'>
<param>LDAP</param>
<param>SSO</param>

View File

@ -38,3 +38,10 @@ pwd_files:
end_pattern: '',
owner: 'root:www-data',
mod: '660' }
%if %%is_defined('activer_envole_migration') and %%activer_envole_migration == 'oui'
- {file: '%%cnt_prefix/var/www/html/envole-migration/config/config-db-ninegate.php',
pattern: '$dbpwd_ninegate = "',
end_pattern: ';',
owner: 'root:www-data',
mod: '660' }
%end if

View File

@ -0,0 +1,34 @@
<?php
try
{
global $bdd_ninegate;
%if %%getVar("ninegate_db_mode", 'non') == "externe"
$dbhost_ninegate = "%%ninegate_dbserver";
%else if %%getVar("ninegate_db_mode", 'non') == "default"
%set dbhost = %%getVar('edb_host', 'non')
%if %%dbhost == 'non' and %%mode_conteneur_actif == 'oui':
$dbhost_ninegate = "%%adresse_ip_mysql";
%else
%if %%dbhost == 'non'
$dbhost_ninegate = "localhost";
%else
$dbhost_ninegate = "%%edb_host";
%end if
%end if
%else
$dbhost_ninegate = "%%adresse_ip_mysql";
%end if
$dbname_ninegate = "ninegate";
$dbuser_ninegate = "ninegate";
$dbpwd_ninegate = "changeme";
$pdo_options[PDO::ATTR_ERRMODE] = PDO::ERRMODE_EXCEPTION;
$pdo_options[PDO::MYSQL_ATTR_INIT_COMMAND] = "SET NAMES utf8";
$bdd_ninegate = new PDO('mysql:host='.$dbhost_ninegate.';dbname='.$dbname_ninegate.'',$dbuser_ninegate,$dbpwd_ninegate, $pdo_options);
}
catch (PDOException $e)
{
die('Erreur sur BDD ninegate : ' . $e->getMessage());
}