Guest

rabbieburns

By: a guest on Jul 24th, 2009  |  syntax: PHP  |  size: 4.97 KB  |  hits: 96  |  expires: Never
download  |  raw  |  embed  |  report abuse
Copied
  1. <?php
  2.  
  3. if (basename(__FILE__) == basename($_SERVER['PHP_SELF']))
  4. {
  5.     exit(0);
  6. }
  7.  
  8. echo '<?xml version="1.0" encoding="utf-8"?>';
  9.  
  10. ?>
  11.  
  12. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  13. <html xmlns="http://www.w3.org/1999/xhtml" lang="en-US" xml:lang="en-US">
  14. <head>
  15.   <title>Website Name - Short Description</title>
  16.   <link rel="stylesheet" type="text/css" href="stylesheet.css" title="Default Theme" media="all" />
  17. </head>
  18. <body onload="document.getElementById('address_box').focus()">
  19. <div id="container">
  20.   <h1 id="title">Website Name - Short Description</h1>
  21.   <ul id="navigation">
  22.     <li><a href="<?php echo $GLOBALS['_script_base'] ?>">URL Form</a></li>
  23.   </ul>
  24. <?php
  25.  
  26. switch ($data['category'])
  27. {
  28.     case 'auth':
  29. ?>
  30.   <div id="auth"><p>
  31.   <b>Enter your username and password for "<?php echo htmlspecialchars($data['realm']) ?>" on <?php echo $GLOBALS['_url_parts']['host'] ?></b>
  32.   <form method="post" action="">
  33.     <input type="hidden" name="<?php echo $GLOBALS['_config']['basic_auth_var_name'] ?>" value="<?php echo base64_encode($data['realm']) ?>" />
  34.     <label>Username <input type="text" name="username" value="" /></label> <label>Password <input type="password" name="password" value="" /></label> <input type="submit" value="Login" />
  35.   </form></p></div>
  36. <?php
  37.         break;
  38.     case 'error':
  39.         echo '<div id="error"><p>';
  40.        
  41.         switch ($data['group'])
  42.         {
  43.             case 'url':
  44.                 echo '<b>URL Error (' . $data['error'] . ')</b>: ';
  45.                 switch ($data['type'])
  46.                 {
  47.                     case 'internal':
  48.                         $message = 'Failed to connect to the specified host. '
  49.                                  . 'Possible problems are that the server was not found, the connection timed out, or the connection refused by the host. '
  50.                                  . 'Try connecting again and check if the address is correct.';
  51.                         break;
  52.                     case 'external':
  53.                         switch ($data['error'])
  54.                         {
  55.                             case 1:
  56.                                 $message = 'The URL you\'re attempting to access is blacklisted by this server. Please select another URL.';
  57.                                 break;
  58.                             case 2:
  59.                                 $message = 'The URL you entered is malformed. Please check whether you entered the correct URL or not.';
  60.                                 break;
  61.                         }
  62.                         break;
  63.                 }
  64.                 break;
  65.             case 'resource':
  66.                 echo '<b>Resource Error:</b> ';
  67.                 switch ($data['type'])
  68.                 {
  69.                     case 'file_size':
  70.                         $message = 'The file your are attempting to download is too large.<br />'
  71.                                  . 'Maxiumum permissible file size is <b>' . number_format($GLOBALS['_config']['max_file_size']/1048576, 2) . ' MB</b><br />'
  72.                                  . 'Requested file size is <b>' . number_format($GLOBALS['_content_length']/1048576, 2) . ' MB</b>';
  73.                         break;
  74.                     case 'hotlinking':
  75.                         $message = 'It appears that you are trying to access a resource through this proxy from a remote Website.<br />'
  76.                                  . 'For security reasons, please use the form below to do so.';
  77.                         break;
  78.                 }
  79.                 break;
  80.         }
  81.        
  82.         echo 'An error has occured while trying to browse through the proxy. <br />' . $message . '</p></div>';
  83.         break;
  84. }
  85. ?>
  86.    <form method="post" action="<?php echo $_SERVER['PHP_SELF'] ?>">
  87.     <ul id="form">
  88.       <li id="address_bar"><label>Web Address <input id="address_box" type="text" name="<?php echo $GLOBALS['_config']['url_var_name'] ?>" value="<?php echo isset($GLOBALS['_url']) ? htmlspecialchars($GLOBALS['_url']) : '' ?>" onfocus="this.select()" /></label> <input id="go" type="submit" value="Go" /></li>
  89.       <?php
  90.      
  91.       foreach ($GLOBALS['_flags'] as $flag_name => $flag_value)
  92.       {
  93.           if (!$GLOBALS['_frozen_flags'][$flag_name])
  94.           {
  95.               echo '<li class="option"><label><input type="checkbox" name="' . $GLOBALS['_config']['flags_var_name'] . '[' . $flag_name . ']"' . ($flag_value ? ' checked="checked"' : '') . ' />' . $GLOBALS['_labels'][$flag_name][1] . '</label></li>' . "\n";
  96.           }
  97.       }
  98.       ?>
  99.     </ul>
  100.   </form>
  101.   <!-- The least you could do is leave this link back as it is. This software is provided for free and I ask nothing in return except that you leave this link intact
  102.        You're more likely to recieve support should you require some if I see a link back in your installation than if not -->
  103.   <div id="footer"> <?php echo $GLOBALS['_version'] ?> </div>
  104. </div>
  105. </body>
  106. </html>