PageRenderTime 64ms CodeModel.GetById 30ms RepoModel.GetById 1ms app.codeStats 0ms

/www/dl.php

https://github.com/kjk/web-arslexis
PHP | 100 lines | 79 code | 15 blank | 6 comment | 2 complexity | 1968a50091584885a22b8c20d6c6ef78 MD5 | raw file
  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/strict.dtd">
  2. <HTML>
  3. <HEAD>
  4. <link href="css/default.css" rel="stylesheet" type="text/css">
  5. <TITLE>Download ArsLexis software</TITLE>
  6. </HEAD>
  7. <BODY>
  8. <center>
  9. <a href="/index.html"> <img border="0" src="gfx/arslexis-logo-4.gif" width="264" height="29" alt="ArsLexis home page"></a>
  10. </center>
  11. <H4> <a href="/">Home</a> &raquo; Download ArsLexis software</h4>
  12. <p/>
  13. <h3> Download ArsLexis software </h3>
  14. <?php
  15. # Author: Krzysztof Kowalczyk (krzysztofk@pobox.com)
  16. #
  17. # This page gets the login and password from the form,
  18. # checks their validity and displays list of software
  19. # to download
  20. require( "../phpinc/settings.inc" );
  21. error_reporting(E_ALL);
  22. set_error_handler( "errorHandler" );
  23. function getLoginForm()
  24. {
  25. $txt = '<form method=POST action="/dl.php">';
  26. $txt .= "<table>\n";
  27. $txt .= "<tr>\n";
  28. $txt .= " <td> Login: </td>\n";
  29. $txt .= ' <td> <input type="text" name="login" size="40" maxlength="80"> </td>';
  30. $txt .= "</tr>\n";
  31. $txt .= "<tr>\n";
  32. $txt .= " <td> Password: </td>\n";
  33. $txt .= ' <td> <input type="text" name="pwd" size="40" maxlength="80"> </td>';
  34. $txt .= "</tr>\n";
  35. $txt .= "<tr> <td>&nbsp;</td></tr>\n";
  36. $txt .= "<tr>\n";
  37. $txt .= ' <td> <input type="submit" value="download"> </td>';
  38. $txt .= "</tr>\n";
  39. $txt .= "</table>\n";
  40. $txt .= "</form>\n";
  41. return $txt;
  42. }
  43. verifyMethodPost();
  44. # check if all the POST variables are present (login, pwd)
  45. verifyPostVarExists( 'login' );
  46. verifyPostVarExists( 'pwd' );
  47. $login = stripQuotes( myUrlDecode(getPostVar( 'login' ) ));
  48. $pwd = stripQuotes( myUrlDecode(getPostVar( 'pwd' ) ));
  49. $productList = getProductsForLoginPwd( $login, $pwd );
  50. if (0 == count( $productList))
  51. {
  52. echo "<b><font color=\"red\">The login '$login' and password '$pwd' combination didn't match anything in our database.\n";
  53. echo "Please try again. </font></b>\n";
  54. echo "If problem persists, please e-mail <a href=\"mailto:support@arslexis.com\">ArsLexis</a>\n";
  55. echo "<p>\n";
  56. echo getLoginForm();
  57. $subject = "[PAYPAL ERROR] failed login";
  58. $body = "Failed attempt to login using login='$login' and pwd='$pwd'\n";
  59. $body .= getInterestingVars();
  60. sendEmail( MYEMAIL, $subject, $body );
  61. } else {
  62. # display a list of products with links to download
  63. echo "<table>\n<tr>\n";
  64. echo "<td width=\"30\">&nbsp;</td>\n<td>\n";
  65. echo "<table>\n";
  66. foreach ($productList as $name => $dlCount)
  67. {
  68. $fullName = getProductFullName( $name );
  69. $dlUrl= "dl-2.php?login=" . urlencode($login) . "&pwd=" . urlencode($pwd) . "&name=" . urlencode($name);
  70. echo "<tr>\n";
  71. echo " <td valign=\"top\"><img src=\"/gfx2/black_bullet.gif\">&nbsp;$fullName &nbsp;&nbsp;&nbsp;</td>\n";
  72. echo " <td><a href=\"$dlUrl\">Download</a></td>\n";
  73. # echo " <td>current download count: $dlCount</td>\n";
  74. echo "</tr>\n";
  75. }
  76. echo "</table>\n";
  77. echo "</td>\n</tr>\n</table>\n";
  78. }
  79. ?>
  80. <hr>
  81. Please e-mail <a href="mailto:support@arslexis.com">ArsLexis</a> in case of any difficulties.
  82. </body>
  83. </html>