HTTPS login only from frontside
3 posts by 2 authors in: Forums > CMS Builder: Plugins & Add-ons
Last Post: September 17, 2012 (RSS)
Hello,
I am working on a new project with 2.17 and membership plugin 1.07.
For the CMSBuilder admin panel (from settings) i can restrict HTTPS login only, but for the front side users how can i enable this restriction login feature?
Thank you in advance,
Karls
I am working on a new project with 2.17 and membership plugin 1.07.
For the CMSBuilder admin panel (from settings) i can restrict HTTPS login only, but for the front side users how can i enable this restriction login feature?
Thank you in advance,
Karls
Re: [ht1080z] HTTPS login only from frontside
Hi Karls,
The best way to force a user to log-in securely is to place the following PHP code at the top of your log-in page, or any page you want the user to be able to only visit using https:
This will force the page to redirect to HTTPS. I would also recommend changing any links to the page from http:// to https://, but this is not essential as the php code above will force the change anyway.
Thanks
Greg
The best way to force a user to log-in securely is to place the following PHP code at the top of your log-in page, or any page you want the user to be able to only visit using https:
if (preg_match('/^http:/i', thisPageUrl())) { redirectBrowserToURL(preg_replace('/^http:/i', 'https:', thisPageUrl())); }
This will force the page to redirect to HTTPS. I would also recommend changing any links to the page from http:// to https://, but this is not essential as the php code above will force the change anyway.
Thanks
Greg
Greg Thomas
PHP Programmer - interactivetools.com
PHP Programmer - interactivetools.com
Re: [greg] HTTPS login only from frontside
Thank you Greg, it worked just you said.
Karls
Karls