From 430762432532de0744d730e5f10ebe5bee520567 Mon Sep 17 00:00:00 2001 From: "Patrick Allaire, ptre" Date: Fri, 18 Feb 2022 21:03:54 -0500 Subject: [PATCH 1/2] =?UTF-8?q?R=C3=A9duction=20des=20branches=20=C3=A0=20?= =?UTF-8?q?deux:=20stable=20et=20master=20--=20c=C3=B4t=C3=A9=20stable?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/application/views/user/settings.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/app/application/views/user/settings.php b/app/application/views/user/settings.php index b7fa7db5..6c003221 100644 --- a/app/application/views/user/settings.php +++ b/app/application/views/user/settings.php @@ -25,7 +25,6 @@ - first('firstname', ':message'); ?> @@ -70,7 +69,6 @@ - first('password', ':message'); ?> From 5b81c6c33e08ec5e3e284c8f7e1c4dd20ed20ce6 Mon Sep 17 00:00:00 2001 From: "Patrick Allaire, ptre" Date: Fri, 25 Feb 2022 07:49:34 -0500 Subject: [PATCH 2/2] =?UTF-8?q?Fichier=20oubli=C3=A9=20...=20comment=20fut?= =?UTF-8?q?-ce=20possible=3F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- install/config-setup.php | 359 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 359 insertions(+) create mode 100644 install/config-setup.php diff --git a/install/config-setup.php b/install/config-setup.php new file mode 100644 index 00000000..cdede2e1 --- /dev/null +++ b/install/config-setup.php @@ -0,0 +1,359 @@ + + + $val) { + if (strstr($val, "<") != '' || strstr(htmlspecialchars_decode($val), "<") != '' || strstr($val, "script") != '' || trim($val) == '') { + unset($_GET[$ind]); + } +} +foreach (@$_POST as $ind => $val) { + if (strstr($ind, "password") == '' && (strstr($val, "<") != '' || strstr(htmlspecialchars_decode($val), "<") != '' || strstr($val, "script") != '') || trim($val) == '') { + unset($_POST[$ind]); + } +} +if(isset($_POST['create_config']) && isset($_POST['database_host'])) { + if(!file_exists('../config.app.example.php')) { die($NoConfigApp); } + $config_file = file_get_contents('../config.app.example.php'); + + /* Edit URL Information */ + $_POST['URL'] = (substr($_POST['URL'], -1) == '/') ? $_POST['URL'] : $_POST['URL'].'/'; + $config_file = str_replace("'url' => '',", "'url' => '".$_POST['URL']."',", $config_file); + + /* Edit Database Information */ + $config_file = str_replace('localhost', $_POST['database_host'], $config_file); + $config_file = str_replace('database_user', $_POST['database_username'], $config_file); + $config_file = str_replace('database_password', $_POST['database_password'], $config_file); + $config_file = str_replace('database_name', $_POST['database_name'], $config_file); + + /* Edit E-mail Information */ + $config_file = str_replace('Your E-Mail Name', $_POST['email_name'], $config_file); + $config_file = str_replace('name@domain.com', $_POST['email_address'], $config_file); + $config_file = str_replace("'transport' => 'smtp'", "'transport' => '".$_POST['email_transport']."'", $config_file); + $config_file = str_replace("'username' => 'xyzxyz'", "'username' => '".$_POST['email_username']."'", $config_file); + $config_file = str_replace("'server' => 'smtp.gmail.com'", "'server' => '".$_POST['email_server']."'", $config_file); + $config_file = str_replace("'port' => 587", "'port' => ".((trim($_POST['email_port']) == '') ? 25 : $_POST['email_port']), $config_file); + $config_file = str_replace("'encryption' => 'tls'", "'encryption' => '".$_POST['email_encryption']."'", $config_file); + $config_file = str_replace("'username' => 'xyzxyz'", "'username' => '".$_POST['email_username']."'", $config_file); + $config_file = str_replace("'password' => '******'", "'password' => '".$_POST['email_password']."'", $config_file); + + /* Timezone */ + $config_file = str_replace('Europe/Brussels', $_POST['timezone'], $config_file); + + /* Key */ + $config_file = str_replace('yourrandomkey', md5(serialize($_POST) . time() . $_SERVER['HTTP_HOST']), $config_file); + + if(!is_writable(realpath('../'))){ + echo ' + + + + + + + + +
+ + + + + + '; + + } else { + + file_put_contents('../config.app.php', $config_file); + + //From the freshly made mysql-structure.php file, we'll create tables and default data along the install.php process + require "./install.php"; + $install = new install(); + $database_check = $install->check_connect(); + $install->config = require '../config.app.php'; + + //Fill the database with basics + $command='mysql --host='.$_POST["database_host"].' --user='.$_POST["database_username"] .' --password='.$_POST["database_password"] .' \''.$_POST["database_name"].'\' < MySQL_DB_Schema.sql'; + unset($output); + exec($command,$output,$worked); + switch($worked){ + case 0: + //Success import of MySQL_DB_Schema.sql + break; + case 1: + //Import of MySQL_DB_Schema.sql didn't work, so we'll pass by long way + if (!file_exists('mysql-structure.php') && file_exists('MySQL_DB_Schema.sql') ) { + $FILEsql = file('MySQL_DB_Schema.sql'); + $FILEphp = fopen('mysql-structure.php', 'w+'); + $linePHP = ' $cnt) { + if (trim($cnt) == '#----- First line of this file .... please let it here, first with NO carriage return before nor after. -----') { $cnt = ''; continue;} + if (trim($cnt) == '#----- Last line of this file .... Anything bellow this line will be lost. -----') { $cnt = ''; break;} + if (substr($cnt, 0, 4) === '#--#') { $cnt = '"#'.substr($cnt, 4); } + if (substr($cnt, 0, 3) === '#--' ) { $cnt = '",'.substr($cnt, 3); } + $linePHP .= $cnt; + } + $linePHP .= ' " );'; + fwrite($FILEphp, $linePHP); + fclose($FILEphp); + //From the MySQL_DB_Schema.sql file, we create a usable php file for php install + $install->create_database($_POST); + } + break; + } + +?> + + + + + + + + +
+
+

'.$MyLng['NoAPPfile_0'].'

+

'.$MyLng['NoAPPfile_1'].'

+ + + +

'.$MyLng['NoAPPfile_2'].'

+

'.$MyLng['RunInstall'].'

+
+ + + +
+

+ +

+ +

" class="button primary">

+
600
+
+
+ + + + + + + + + + + + +
+

+ +

+
" autocomplete="off"> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ +

+ +

+
+

URL

+
+ + +
+

SQL

+
+ +
+

+

+
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+

+
+ ' . "\n"; + ?> + +
+ +
+
+

+
" enctype="multipart/form-data"> + + + + + + + + + + + + + + + + + + + + + + +

+
+
+