Source of “index.php”.
37 lines, 1.5 KBytes.   Last modified 10:19 pm, 1st September 2015 PDT.
1 <?php // Emacs settings: -*- mode: Fundamental; tab-width: 4; -*- 2 3 //////////////////////////////////////////////////////////////////////////// 4 // // 5 // Pachylet: Andrew's Web Mail Interface, Version 2 // 6 // // 7 // Copyright (c) 2002-2010 // 8 // // 9 // See http://birrell.org/pachylet/help.html // 10 // // 11 // index.php: top-level switch // 12 // // 13 //////////////////////////////////////////////////////////////////////////// 14 15 if (!isset($_SERVER["HTTPS"]) || $_SERVER["HTTPS"] != "on") { 16 header("Location: https://" . $_SERVER["SERVER_NAME"] . 17 $_SERVER["REQUEST_URI"]); 18 ?> 19 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html 4/strict.dtd"> 20 <html> 21 <head><title>Redirect</title></head> 22 <body>This service requires that you use TLS (https).</body> 23 </html> 24 <?php 25 exit; 26 } 27 28 if (isset($_GET["mobile"]) || 29 (!isset($_GET["desktop"]) && 30 preg_match("#Mobile#i", $_SERVER["HTTP_USER_AGENT"]) && 31 !preg_match("#iPad#i", $_SERVER["HTTP_USER_AGENT"]))) { 32 readfile("iphone.html"); 33 } else { 34 readfile("pachyletV2.html"); 35 } 36 37 ?>
End of listing