Jump to content

force backoffice over SSL


Recommended Posts

Change line 118 of init.php from:

$protocol_link = (Configuration::get('PS_SSL_ENABLED') OR (isset($_SERVER['HTTPS']) AND strtolower($_SERVER['HTTPS']) == 'on')) ? $protocol_ssl : $protocol;



to:

$protocol_link = /*(Configuration::get('PS_SSL_ENABLED') OR (isset($_SERVER['HTTPS']) AND strtolower($_SERVER['HTTPS']) == 'on')) ? */$protocol_ssl/* : $protocol*/;

Link to comment
Share on other sites

  • 3 months later...
Change line 118 of init.php from:

$protocol_link = (Configuration::get('PS_SSL_ENABLED') OR (isset($_SERVER['HTTPS']) AND strtolower($_SERVER['HTTPS']) == 'on')) ? $protocol_ssl : $protocol;



to:

$protocol_link = /*(Configuration::get('PS_SSL_ENABLED') OR (isset($_SERVER['HTTPS']) AND strtolower($_SERVER['HTTPS']) == 'on')) ? */$protocol_ssl/* : $protocol*/;



This didn't seem to do anything for me. The Back Office login is still going over HTTP and not HTTPS. Do we need to change something in init.php within the admin folder as well?

I've added

$useSSL = true; 



to the top of login.php and that seems to have secure the BO login, although I'm not sure if this is the correct way to go about it or not. Any thoughts, rocky?

Link to comment
Share on other sites

  • 5 months later...
  • 1 year later...

For those like me looking for a solution with PS 1.5

In :

/var/www/controllers/admin/AdminLoginController.php

there is :

 

// You can uncomment these lines if you want to force https even from localhost and automatically redirect

// header('HTTP/1.1 301 Moved Permanently');

// header('Location: '.Tools::getShopDomainSsl(true).$_SERVER['REQUEST_URI']);

// exit();

 

that you simply have to uncomment to :

 

// You can uncomment these lines if you want to force https even from localhost and automatically redirect

header('HTTP/1.1 301 Moved Permanently');

header('Location: '.Tools::getShopDomainSsl(true).$_SERVER['REQUEST_URI']);

exit();

 

and the backoffice login will be forced in ssl mode

It won't force all the backoffice.. But at least you shall be in https as long as you don't remove the s manually

 

Mike

  • Like 1
Link to comment
Share on other sites

  • 4 years later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...