Source of “pachyparts2.php”.
160 lines, 4.2 KBytes.   Last modified 5:21 pm, 20th November 2014 PST.
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) 2014 // 8 // // 9 // See http://birrell.org/pachylet/help.html // 10 // // 11 // Login page for reading attachments // 12 // // 13 //////////////////////////////////////////////////////////////////////////// 14 15 require("pachysql.php"); // for C_program and C_version 16 17 $args = $_GET; 18 $user = (isset($args["user"]) ? $args["user"] : ""); 19 $partID = 0 + (isset($args["part"]) ? $args["part"] : 0); 20 $msg = (isset($args["msg"]) ? $args["msg"] : ""); 21 22 ?> 23 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html 4/strict.dtd"> 24 <html> 25 <head> 26 <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> 27 <meta name="viewport" content="width=356; user-scalable=no"> 28 <style type="text/css"><!-- 29 30 A:link { color: #000099; } 31 A:active { color: #ff0000; } 32 A:visited { color: #000099; } 33 A:hover { color: #006600; } 34 35 body { 36 background-color: #e0e0e0; 37 margin: 0px; 38 padding: 0px; 39 -webkit-text-size-adjust: 100%; 40 -moz-text-size-adjust: 100%; 41 -ms-text-size-adjust: 100%; 42 } 43 p { 44 margin-top: 1em; 45 margin-bottom: 0px; 46 } 47 table { 48 border-spacing: 0px; 49 } 50 form { 51 margin: 0px; 52 } 53 #login { 54 width: 19em; 55 margin-top: 1em; 56 margin-bottom: 1em; 57 margin-left: auto; 58 margin-right: auto; 59 border: 2px #cccccc ridge; 60 padding: 1em; 61 line-height: 1.25; 62 background-color: #99cc99; 63 } 64 #loginTable { 65 max-width: 19em; 66 margin-left: auto; 67 margin-right: auto; 68 } 69 #loginTitle { 70 text-align: center; 71 font-size: 1.5em; 72 } 73 td.formKey { 74 text-align: right; 75 padding-right: 0.5em; 76 } 77 #elephant { 78 margin-left: 6px; 79 border: 0px 80 } 81 #loginComment { 82 font-size: 0.75em; 83 } 84 div.cr { 85 border-top: 2px #cccccc ridge; 86 border-bottom: 2px #cccccc ridge; 87 padding-left: 6px; 88 padding-right: 6px; 89 padding-top: 2px; 90 padding-bottom: 2px; 91 background-color: #999999; 92 color: #ffffff; 93 font-size: 0.75em; 94 } 95 96 --> 97 </style> 98 <title>Pachylet: view part</title> 99 </head> 100 <body onload="document.getElementById('loginPwd').focus()"> 101 <div id=login> 102 <form action="pachyparts.php" method=POST> 103 <table id=loginTable> 104 <tr> 105 <td id=loginTitle colspan=3> 106 <b>Pachylet: view part</b> 107 <hr> 108 </td> 109 </tr><tr> 110 <td class=formKey>Name:</td> 111 <td><?php echo htmlspecialchars($user) ?></td> 112 <td rowspan=3><img id=elephant src=pachyletStatic.gif 113 width=88 height=108 alt=""></td> 114 </tr><tr> 115 <td class=formKey>Password:</td> 116 <td><input type=password id=loginPwd name=loginPwd size=12></td> 117 </tr><tr> 118 <td></td> 119 <td><input type=submit value=" Login "></td> 120 </tr><tr> 121 <td colspan=3><hr></td> 122 </tr><tr> 123 <td colspan=3 id=loginComment> 124 <?php 125 if ($msg == "notFound") { 126 echo "Part #" . htmlspecialchars($partID) . " not found"; 127 } else if ($msg == "mysql") { 128 echo "Failed to login to MySQL; consult expert"; 129 } else if ($msg == "pwdMissing") { 130 echo "Password required"; 131 } else if ($msg == "pwdIncorrect") { 132 echo "Incorrect password"; 133 } else if ($msg == "missing" || $msg == "incorrect") { 134 ?> 135 Login failed: <?php echo $msg ?> authentication cookie. 136 <p> 137 On an iPhone, most likely iOS failed to forward the cookie from the Pachylet 138 home screen web app to this window. 139 On other platforms, most likely you have logged out from the Pachylet 140 application then tried to reload this page. 141 <p> 142 In either case, login to this screen to view the message part. 143 A single login should work until you exit from this browser. 144 <?php 145 } else { 146 echo "missing or unknown message; consult expert"; 147 } 148 ?> 149 <input type=hidden name=user value=<?php echo htmlspecialchars($user) ?> > 150 <input type=hidden name=part value=<?php echo htmlspecialchars($partID) ?> > 151 </td> 152 </tr> 153 </table> 154 </form> 155 </div> <!-- login --> 156 <div class=cr> 157 <?php echo C_program . ", version " . C_version ?> 158 </div> 159 </body> 160 </html>
End of listing