start of changement to full https

This commit is contained in:
Marion Muszynski 2017-03-08 16:10:35 +01:00
parent 8fabe0bfa7
commit 2e6e1d23ec
8 changed files with 65 additions and 20 deletions

View File

@ -1,5 +1,5 @@
<!-- MODULE Gift Voucher -->
<link href="{$content_dir}modules/giftvoucher/giftvoucher.css" rel="stylesheet" type="text/css" />
<link href="{$base_dir_ssl}modules/giftvoucher/giftvoucher.css" rel="stylesheet" type="text/css" />
<script type="text/javascript">
var giftvoucher_products = "{$GIFT_VOUCHER_PRODUCTS}";
@ -23,5 +23,5 @@
{/literal}
</script>
<script type="text/javascript" src="{$content_dir}modules/giftvoucher/giftvoucher.js?v=3"></script>
<script type="text/javascript" src="{$base_dir_ssl}modules/giftvoucher/giftvoucher.js?v=3"></script>
<!-- /MODULE Gift Voucher -->

View File

@ -3,9 +3,9 @@ include(dirname(__FILE__).'/../../config/config.inc.php');
include(dirname(__FILE__).'/../../init.php');
if(($sponsor = Tools::getValue('sponsor')) && strlen($sponsor) > 12) {
setcookie('554b43403edef30d31412286d5098965', $sponsor, time() + 3600 * 24 * 365, '/', '.bebeboutik.com');
$email = base64_decode(strrev(substr($sponsor, 12)));
if(count(Db::getInstance()->ExecuteS('
SELECT `id_customer`
@ -23,7 +23,7 @@ if(($sponsor = Tools::getValue('sponsor')) && strlen($sponsor) > 12) {
if(Tools::getIsset('lp')) {
$lp = Tools::getValue('lp');
}
Tools::redirectLink($link->getPageLink('authentication.php').'?create_account=1&sponsor='.rawurlencode($cipherTool->encrypt('1|'.$email.'|')).(isset($url['query'])? '&'.$url['query']: '').(isset($lp)? '&lp='.$lp: ''));
Tools::redirectLink($link->getPageLinkSsl('authentication.php').'?create_account=1&sponsor='.rawurlencode($cipherTool->encrypt('1|'.$email.'|')).(isset($url['query'])? '&'.$url['query']: '').(isset($lp)? '&lp='.$lp: ''));
// Tools::redirectLink($link->getPageLink('authentication.php').'?create_account=1&sponsor='.rawurlencode($cipherTool->encrypt('1|'.$email.'|')).(isset($url['query'])? '&'.$url['query']: ''));
}
}

View File

@ -16,7 +16,7 @@
_ts.type = 'text/javascript';
_ts.charset = 'utf-8';
_ts.async = true;
_ts.src = 'http://widgets.trustedshops.com/js/' + _tsid + '.js';
_ts.src = 'https://widgets.trustedshops.com/js/' + _tsid + '.js';
var __ts = document.getElementsByTagName('script')[0];
__ts.parentNode.insertBefore(_ts, __ts);
})();

View File

@ -17,7 +17,7 @@
_ts.type = 'text/javascript';
_ts.charset = 'utf-8';
_ts.async = true;
_ts.src = 'http://widgets.trustedshops.com/js/' + _tsid + '.js';
_ts.src = 'https://widgets.trustedshops.com/js/' + _tsid + '.js';
var __ts = document.getElementsByTagName('script')[0];
__ts.parentNode.insertBefore(_ts, __ts);
})();

View File

@ -9,7 +9,7 @@ class FrontController extends FrontControllerCore {
$useSSL = $this->ssl;
}
}
public function displayHeader()
{
self::$smarty->assign(array(
@ -18,7 +18,7 @@ class FrontController extends FrontControllerCore {
parent::displayHeader();
}
public function init() {
public function init() {
global $useSSL, $cookie, $smarty, $cart, $iso, $defaultCountry, $protocol_link, $protocol_content, $link, $css_files, $js_files, $site_version;
if (self::$initialized)
@ -35,7 +35,7 @@ class FrontController extends FrontControllerCore {
header('Location: '.Tools::getShopDomainSsl(true).$_SERVER['REQUEST_URI']);
exit();
}
ob_start();
/* Loading default country */
@ -79,7 +79,7 @@ class FrontController extends FrontControllerCore {
global $currency;
$currency = Tools::setCurrency();
/* Cart already exists */
if ((int)$cookie->id_cart)
{
@ -168,7 +168,7 @@ class FrontController extends FrontControllerCore {
$cart->id_address_invoice = 0;
}
}
if (!$cart->nbProducts())
$cart->id_carrier = NULL;
@ -204,7 +204,8 @@ class FrontController extends FrontControllerCore {
$navigationPipe = (Configuration::get('PS_NAVIGATION_PIPE') ? Configuration::get('PS_NAVIGATION_PIPE') : '>');
$smarty->assign('navigationPipe', $navigationPipe);
$protocol_link = (Configuration::get('PS_SSL_ENABLED') OR Tools::usingSecureMode()) ? 'https://' : 'http://';
//$protocol_link = (Configuration::get('PS_SSL_ENABLED') OR Tools::usingSecureMode()) ? 'https://' : 'http://';
$protocol_link = (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off')?'https://':'http://';
$useSSL = ((isset($this->ssl) AND $this->ssl AND Configuration::get('PS_SSL_ENABLED')) OR Tools::usingSecureMode()) ? true : false;
$protocol_content = ($useSSL) ? 'https://' : 'http://';
@ -280,9 +281,11 @@ class FrontController extends FrontControllerCore {
);
foreach ($assignArray as $assignKey => $assignValue)
if (substr($assignValue, 0, 1) == '/' OR $protocol_content == 'https://')
if (substr($assignValue, 0, 1) == '/' OR $protocol_content == 'https://') {
$smarty->assign($assignKey, $protocol_content.Tools::getMediaServer($assignValue).$assignValue);
else
} else if (substr($assignValue, 0, 1) == '/' OR $protocol_link == 'https://') {
$smarty->assign($assignKey, $protocol_link.Tools::getMediaServer($assignValue).$assignValue);
} else
$smarty->assign($assignKey, $assignValue);
// setting properties from global var
@ -305,7 +308,7 @@ class FrontController extends FrontControllerCore {
$this->iso = $iso;
$this->setMedia();
}
protected function canonicalRedirection() {
global $link, $cookie;
@ -403,7 +406,7 @@ class FrontController extends FrontControllerCore {
'module-advsendtoafriend-sendtoafriend-form', 'featured',
'list-tag-sales', */
);
$countCols = count(array_keys($displayLeft + $displayRight, $page_name));
$addclass = '';

View File

@ -25,7 +25,47 @@ class Link extends LinkCore
private function moduleGuideDir($ssl)
{
$base = (($ssl AND Configuration::get('PS_SSL_ENABLED')) ? Tools::getShopDomainSsl(true) : Tools::getShopDomain(true));
return $base._MODULE_DIR_.'/'.Module::getModuleNameFromClass('AdminGuidePosts').'/';
}
public function getPageLinkSsl($filename, $ssl = false, $id_lang = NULL)
{
global $cookie;
if ($id_lang == NULL)
$id_lang = (int)($cookie->id_lang);
if (array_key_exists($filename.'_'.$id_lang, self::$cache['page']) AND !empty(self::$cache['page'][$filename.'_'.$id_lang]))
$uri_path = self::$cache['page'][$filename.'_'.$id_lang];
else
{
if ($this->allow == 1)
{
$url_rewrite = '';
if ($filename != 'index.php')
{
$pagename = substr($filename, 0, -4);
$url_rewrite = Db::getInstance()->getValue('
SELECT url_rewrite
FROM `'._DB_PREFIX_.'meta` m
LEFT JOIN `'._DB_PREFIX_.'meta_lang` ml ON (m.id_meta = ml.id_meta)
WHERE id_lang = '.(int)($id_lang).' AND `page` = \''.pSQL($pagename).'\'');
$uri_path = $this->getLangLink((int)$id_lang).($url_rewrite ? $url_rewrite : $filename);
}
else
$uri_path = $this->getLangLink((int)$id_lang);
}
else
{
$uri_path = '';
if ($filename != 'index.php')
$uri_path = $filename;
}
self::$cache['page'][$filename.'_'.$id_lang] = $uri_path;
}
$protocol = (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off')?'https://':'http://';
return $protocol.Tools::getShopDomainSsl().__PS_BASE_URI__.ltrim($uri_path, '/');
}
}

View File

@ -43,9 +43,10 @@
<link rel="icon" type="image/vnd.microsoft.icon" href="{$img_ps_dir}favicon.ico?{$img_update_time}" />
<link rel="shortcut icon" type="image/x-icon" href="{$img_ps_dir}favicon.ico?{$img_update_time}" />
{if isset($page_name) && $page_name == 'authentication'}
<link rel="canonical" href="{$link->getPageLink('authentication.php', TRUE)}" />
<link rel="canonical" href="{$link->getPageLinkSsl('authentication.php', TRUE)}" />
{/if}
<script type="text/javascript">
var baseDirSsl = '{$base_dir_ssl}';
var baseDir = '{$content_dir}';
var static_token = '{$static_token}';
var token = '{$token}';

View File

@ -49,9 +49,10 @@
<link rel="icon" type="image/vnd.microsoft.icon" href="{$img_ps_dir}favicon.ico?{$img_update_time}" />
<link rel="shortcut icon" type="image/x-icon" href="{$img_ps_dir}favicon.ico?{$img_update_time}" />
{if isset($page_name) && $page_name == 'authentication'}
<link rel="canonical" href="{$link->getPageLink('authentication.php', TRUE)}" />
<link rel="canonical" href="{$link->getPageLinkSsl('authentication.php', TRUE)}" />
{/if}
<script type="text/javascript">
var baseDirSsl = '{$base_dir_ssl}';
var baseDir = '{$content_dir}';
var static_token = '{$static_token}';
var token = '{$token}';