Lockdown (force a template to use https)
Posted: 24 April 2007 10:50 AM   [ Ignore ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  749
Joined  07-18-2006

In another thread D3453 had been asking about encrypting log-in forms, and since I had recently been doing the same thing I figured I’d post this plug-in.

All it does is check whether the server is using https - if it’s not, it will redirect you to the same page but use https.

Just add {exp:lockdown} to any templates you want to encrypt.

File Attachments
pi.lockdown_1.0.1.zip  (File Size: 1KB - Downloads: 106)
Profile
 
 
Posted: 24 April 2007 11:41 AM   [ Ignore ]   [ # 1 ]  
Grad Student
Rank
Total Posts:  61
Joined  10-23-2006

Thanks Brian for the plug-in.  I am having a bit of trouble getting it to work though.  It redirects to https but the page won’t load.  The first problem was with throttling.  So I disabled it and now I get an error page that says:

The page isn’t redirecting properly

Firefox has detected that the server is redirecting the request for this address in a way that will never complete.

  *  This problem can sometimes be caused by disabling or refusing to accept
      cookies.

My site uses cookies so I don’t understand this error.  Any ideas?  Did you have this problem?  Thanks so much for your time.
Dave

Profile
 
 
Posted: 24 April 2007 12:25 PM   [ Ignore ]   [ # 2 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  749
Joined  07-18-2006
D3453 - 24 April 2007 11:41 AM
Thanks Brian for the plug-in.  I am having a bit of trouble getting it to work though.  It redirects to https but the page won’t load.  The first problem was with throttling.  So I disabled it and now I get an error page that says:

The page isn’t redirecting properly

Firefox has detected that the server is redirecting the request for this address in a way that will never complete.

  *  This problem can sometimes be caused by disabling or refusing to accept
      cookies.

My site uses cookies so I don’t understand this error.  Any ideas?  Did you have this problem?  Thanks so much for your time.
Dave

Hi Dave - I’m pretty sure I know what’s happening. Who is your host? The plug-in uses a server variable called ‘HTTPS’ (of all things), but I’ve found out that not all server setups actually honor this variable. I think it has to do with server clustering.

Can you take the attached file (unzip it), upload it to your server and then point a browser to it using https? Let me know what it says. Unfortunately if your server doesn’t support the HTTPS variable there isn’t a really good way of doing this.  I have a client on EngineHosting and they were kind enough to enable it for us, but I doubt many shared hosting environments will be as helpful.

File Attachments
test.php.zip  (File Size: 1KB - Downloads: 75)
Profile
 
 
Posted: 24 April 2007 12:54 PM   [ Ignore ]   [ # 3 ]  
Grad Student
Rank
Total Posts:  61
Joined  10-23-2006

Hi Brian, I am in a server cluster and the response was https response:  What do I need to do to enable this?  Thanks so much

Profile
 
 
Posted: 24 April 2007 01:26 PM   [ Ignore ]   [ # 4 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  749
Joined  07-18-2006

I’m not sure what Nevyn and co. did to enable this, but they did enable it.  You should get in touch with your host and ask them if it is possible to enable the $_SERVER[‘HTTPS’] response as you’re trying to use it to encrypt parts of your website.

Without that there’s really no way this plug-in can work unfortunately. I searched for other ways to get it accomplished (and asked the advice of EngineHosting) but as strange as it is there really wasn’t a way around it that we could find.

Sorry Dave.

Profile
 
 
Posted: 24 April 2007 03:04 PM   [ Ignore ]   [ # 5 ]  
Grad Student
Rank
Total Posts:  61
Joined  10-23-2006

My host said they will make the changes.  As soon as they do, I will check to see if it works with login forms.  Thanks for the great script.

Profile
 
 
Posted: 24 April 2007 04:26 PM   [ Ignore ]   [ # 6 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  749
Joined  07-18-2006

It’s even better when it works!  wink

Profile
 
 
Posted: 26 April 2007 12:37 PM   [ Ignore ]   [ # 7 ]  
Grad Student
Rank
Total Posts:  61
Joined  10-23-2006

Hi once again,
I am still getting errors with the script.  First I still have to disable throttling.  Second I get the following error:

Notice: Undefined index: HTTPS in /www/{removed}/public_html/system/plugins/pi.lockdown.php on line 17

Warning: Cannot modify header information - headers already sent by (output started at /www/{removed}/public_html/system/plugins/pi.lockdown.php:17) in /www/{removed}/public_html/system/core/core.functions.php on line 296

.

I have asked my host to update the settings and they said they will.  Does this mean they have not done that yet, it has been a couple of days?
Thanks

Note: moderator edited to remove user account information.

Profile
 
 
Posted: 26 April 2007 02:56 PM   [ Ignore ]   [ # 8 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  749
Joined  07-18-2006
D3453 - 26 April 2007 12:37 PM

Hi once again,
I am still getting errors with the script.  First I still have to disable throttling.  Second I get the following error:

Notice: Undefined index: HTTPS in /www/{removed}/public_html/system/plugins/pi.lockdown.php on line 17

Warning: Cannot modify header information - headers already sent by (output started at /www/{removed}/public_html/system/plugins/pi.lockdown.php:17) in /www/{removed}/public_html/system/core/core.functions.php on line 296

.

I have asked my host to update the settings and they said they will.  Does this mean they have not done that yet, it has been a couple of days?
Thanks

Hi Dave - sorry about that. I was running with error reporting off and didn’t notice the index notice.  I’ve fixed that, and uploaded version 1.0.1.  Let me know how that works for you - if they haven’t made the change it’s going to loop until it throws a fault (Firefox will alert you with that same redirection notice).

Profile
 
 
Posted: 27 April 2007 10:59 AM   [ Ignore ]   [ # 9 ]  
Grad Student
Rank
Total Posts:  61
Joined  10-23-2006

Hi Brian,
Your script works great now.  Many thanks.  cheese

But unfortunately, for the login script, it gets redirected back to index.php with http.  My login form still submits unencrypted even though the form is sent to the user encrypted.  Do you use this script for login’s also? 

Many thanks for the plug-in.
Dave

Profile
 
 
Posted: 27 April 2007 11:05 AM   [ Ignore ]   [ # 10 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  749
Joined  07-18-2006
D3453 - 27 April 2007 10:59 AM

Hi Brian,
Your script works great now.  Many thanks.  cheese

But unfortunately, for the login script, it gets redirected back to index.php with http.  My login form still submits unencrypted even though the form is sent to the user encrypted.  Do you use this script for login’s also? 

Many thanks for the plug-in.
Dave

I don’t use it for log-ins actually (or haven’t).  To modify that behavior I think you’d have to manually build a log-in form and use https in the action.

Profile
 
 
   
 
 
Post Marker Legend
New Topic New posts Hot Topic Hot Topic with new posts New Poll New Poll Moved Topic Moved Topic Sticky Topic Sticky topic
Old Topic No new posts Hot Old Topic Hot Topic with no new posts Old Poll Old Poll Closed Topic Closed Topic Announcement Announcements
Theme
Change Theme
Visitor Statistics
The most visitors ever was 1149, on July 16, 2007 10:33 AM
Total Registered Members: 62686 Total Logged-in Users: 47
Total Topics: 77250 Total Anonymous Users: 32
Total Replies: 417007 Total Guests: 250
Total Posts: 494257    
Members ( View Memberlist )