[horde] Suggestion: HTTP/HTTPS switch

James james at james-web.net
Wed Jun 5 09:07:26 PDT 2002


Attached is my hackjob, for anyone for whatever silly reason interested.

All you should have to do is insert this into your motd.php and update the
four variables at the top as to where they should point.

I have this currently running on my IMP server, if you'd like to take a
look: http://mail.nbsd.org

- James



-----Original Message-----
From: horde-bounces at lists.horde.org
[mailto:horde-bounces at lists.horde.org]On Behalf Of Jon Parise
Sent: Tuesday, June 04, 2002 6:02 PM
To: horde at lists.horde.org
Subject: Re: [horde] Suggestion: HTTP/HTTPS switch


On Sat, Jun 01, 2002 at 04:30:48PM +0100, Cliff Green wrote:

> Actually, I think James' current method is better - use motd.php.

Agreed.

--
Jon Parise (jon at csh.rit.edu)  .  Information Technology (2001)
http://www.csh.rit.edu/~jon/  :  Computer Science House Member

--
Horde mailing list
Frequently Asked Questions: http://horde.org/faq/
To unsubscribe, mail: horde-unsubscribe at lists.horde.org
-------------- next part --------------
<?php

/**
 * Modify these variables
 *
 * $SERVER_SSL_PORT - Port on which your SSL server listens (Usually 443)
 * $SERVER_HTTP_PORT - Port on which your HTTP server listens (Usually 80)
 * $SERVER_SSL_URL - Full URL to your HTTPS server and Horde directory
 * $SERVER_HTTP_URL - Full URL to your HTTP server and Horde directory
 *
 */


$SERVER_SSL_PORT = "443";
$SERVER_HTTP_PORT = "80";

$SERVER_SSL_URL = "https://www.example.com";
$SERVER_HTTP_URL = "http://www.example.com";

$prot = GETENV('SERVER_PORT');
                
switch($prot) {

    case $SERVER_SSL_PORT:

        echo "You are currently using Secure HTTPS <br/>";
        break;

    case $SERVER_HTTP_PORT:

        echo "You are currently using Standard HTTP <br/>";
        break;

}

echo "<a class='small' href='$SERVER_HTTP_URL' target='_parent'>Click here for Standard HTTP</a> - <a class='small' href='$SERVER_SSL_URL' target='_parent'>Click here for Secure HTTPS</a>";

?>


More information about the horde mailing list