Skip to content

Commit d4af13c

Browse files
authored
Merge pull request #375 from abhishek-webkul/gli-684
Added Enable SSL & improve install demo data configuration in installation process
2 parents 92ec35e + 8c1bd23 commit d4af13c

File tree

5 files changed

+30
-7
lines changed

5 files changed

+30
-7
lines changed

Diff for: config/defines.inc.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626

2727
/* Debug only */
2828
if (!defined('_PS_MODE_DEV_')) {
29-
define('_PS_MODE_DEV_', false);
29+
define('_PS_MODE_DEV_', false);
3030
}
3131
/* Compatibility warning */
3232
define('_PS_DISPLAY_COMPATIBILITY_WARNING_', false);

Diff for: install/controllers/http/configure.php

+6
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ public function processNextStep()
4343
$this->session->install_type = Tools::getValue('db_mode');
4444
$this->session->shop_country = Tools::getValue('shop_country');
4545
$this->session->shop_timezone = Tools::getValue('shop_timezone');
46+
$this->session->enable_ssl = Tools::getValue('enable_ssl');
4647

4748
// Save admin configuration
4849
$this->session->admin_firstname = trim(Tools::getValue('admin_firstname'));
@@ -306,6 +307,11 @@ public function display()
306307
// Install type
307308
$this->install_type = ($this->session->install_type) ? $this->session->install_type : 'full';
308309

310+
// Detect SSL mode
311+
if (!isset($this->session->enable_ssl)) {
312+
$this->session->enable_ssl = Tools::usingSecureMode() ? '1' : '0';
313+
}
314+
309315
$this->displayTemplate('configure');
310316
}
311317

Diff for: install/controllers/http/process.php

+1
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,7 @@ public function processConfigureShop()
198198
'shop_activity' => $this->session->shop_activity,
199199
'shop_country' => $this->session->shop_country,
200200
'shop_timezone' => $this->session->shop_timezone,
201+
'enable_ssl' => $this->session->enable_ssl,
201202
'admin_firstname' => $this->session->admin_firstname,
202203
'admin_lastname' => $this->session->admin_lastname,
203204
'admin_password' => $this->session->admin_password,

Diff for: install/models/install.php

+5
Original file line numberDiff line numberDiff line change
@@ -443,6 +443,7 @@ public function configureShop(array $data = array())
443443
'shop_activity' => '',
444444
'shop_country' => 'us',
445445
'shop_timezone' => 'US/Eastern',
446+
'enable_ssl' => false,
446447
'use_smtp' => false,
447448
'smtp_encryption' => 'off',
448449
'smtp_port' => 25,
@@ -477,6 +478,10 @@ public function configureShop(array $data = array())
477478
Configuration::updateGlobalValue('PS_TIMEZONE', $data['shop_timezone']);
478479
Configuration::updateGlobalValue('PS_CONFIGURATION_AGREMENT', (int)$data['configuration_agrement']);
479480

481+
// Set SSL configuration
482+
Configuration::updateGlobalValue('PS_SSL_ENABLED', (int) $data['enable_ssl']);
483+
Configuration::updateGlobalValue('PS_SSL_ENABLED_EVERYWHERE', (int) $data['enable_ssl']);
484+
480485
// Set mails configuration
481486
Configuration::updateGlobalValue('PS_MAIL_METHOD', ($data['use_smtp']) ? 2 : 1);
482487
Configuration::updateGlobalValue('PS_MAIL_SMTP_ENCRYPTION', $data['smtp_encryption']);

Diff for: install/theme/views/configure.phtml

+17-6
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,9 @@ var default_iso = '<?php echo $this->session->shop_country ?>';
3636
</div>
3737
*/ ?>
3838

39-
<?php if (_PS_MODE_DEV_): ?>
4039
<!-- Install type (with fixtures or not) -->
4140
<div class="field clearfix">
42-
<label class="aligned"><?php echo $this->l('Install demo products') ?></label>
41+
<label class="aligned"><?php echo $this->l('Install demo data') ?></label>
4342
<div class="contentinput">
4443
<label>
4544
<input value="full" type="radio" name="db_mode" style="vertical-align: middle;" <?php if ($this->install_type == 'full'): ?>checked="checked"<?php endif; ?> autocomplete="off" />
@@ -50,11 +49,8 @@ var default_iso = '<?php echo $this->session->shop_country ?>';
5049
<?php echo $this->l('No'); ?>
5150
</label>
5251
</div>
53-
<p class="userInfos aligned"><?php echo $this->l('Demo data are a good way to learn how to use QloApps. You should install them if you are not familiar with it.') ?></p>
52+
<p class="userInfos aligned"><?php echo $this->l('Installing demo data is a good way to learn how to use QloApps if you have not used it before. This demo data can later be erased using module QloApps Data Cleaner which comes pre-installed with this installation.') ?></p>
5453
</div>
55-
<?php else: ?>
56-
<input value="full" name="db_mode" type="hidden" />
57-
<?php endif; ?>
5854

5955
<!-- Country list -->
6056
<div class="field clearfix">
@@ -86,6 +82,21 @@ var default_iso = '<?php echo $this->session->shop_country ?>';
8682
<?php echo $this->displayError('shop_timezone') ?>
8783
</div>
8884

85+
<!-- Enable SSL -->
86+
<div class="field clearfix">
87+
<label class="aligned"><?php echo $this->l('Enable SSL') ?></label>
88+
<div class="contentinput">
89+
<label>
90+
<input value="1" type="radio" name="enable_ssl" style="vertical-align: middle;" <?php if ($this->session->enable_ssl == '1'): ?>checked="checked"<?php endif; ?> autocomplete="off" />
91+
<?php echo $this->l('Yes') ?>
92+
</label>
93+
<label>
94+
<input value="0" type="radio" name="enable_ssl" style="vertical-align: middle;" <?php if ($this->session->enable_ssl == '0'): ?>checked="checked"<?php endif; ?> autocomplete="off" />
95+
<?php echo $this->l('No'); ?>
96+
</label>
97+
</div>
98+
</div>
99+
89100
<!-- Shop logo
90101
<div class="field clearfix">
91102
<label for="uploadedImage" class="aligned logo"><?php echo $this->l('Shop logo') ?></label>

0 commit comments

Comments
 (0)