index.php.bak

Download index.php.bak

 1: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
 2: <html lang="en"> <head>
 3: <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
 4: <meta name="description" content="LDAP Sample Files">
 5: <meta name="author" content="Wayne Pollock">
 6: <link rel="contents" href="../../index.htm">
 7: <link rel="previous" href="../../index.htm">
 8: <link rel="stylesheet" href="../../Styles.css" type="text/css">
 9: <script type="text/JavaScript" src="../../Common.js"> </script>
10: 
11: <title> LDAP Sample Files </title>
12: 
13: </head>
14: <body>
15: <div class="Center">
16: <h1> <abbr>LDAP</abbr> Sample Configuration and Data Files </h1>
17: <h2 class="hide">&nbsp;</h2>
18: </div>
19: 
20: <div class="Indent">
21: <?php
22:    // Script to produce a list of links for all files in this directory.
23:    // Written 11/2009 by Wayne Pollock, Tampa Florida USA.  All Rights Reserved.
24:    // Updated 11/2013 to include "nodir" option to lister.php.
25: 
26:    function endsWith($whole, $end)
27:    {
28:       return (strpos($whole, $end, strlen($whole) - strlen($end)) !== false);
29:    }
30: 
31:    // Create a directory object for the current directory:
32:    $cwd = getcwd();
33:    if ( ! is_readable($cwd) )
34:    {  die( "$cwd is unreadable.\n" );
35:    }
36:    $dir = dir( $cwd ) or die( $php_errormsg );
37: 
38:    // Determine the name of this script (so not to show it in list):
39:    $myPathArray = explode( '/', $_SERVER['PHP_SELF'] );
40:    $last = count( $myPathArray ) - 1;
41:    $myName = $myPathArray[ $last ];
42: 
43:    // For each regular file in the current directory (except myself):
44:    while ( ($file = $dir->read()) !== false )
45:    {
46:       if ( is_dir( $file ) or $file == $myName or $file == "lister.php" )
47:       {  continue;
48:       }
49: 	  if ( endsWith($file, '.gif') or endsWith($file, '.jpg') or endsWith($file, '.png') )
50: 	  {
51:          echo "<p> View <a href=\"$file\">$file</a>\n";
52:          echo "</p>\n";
53: 	  } else
54: 	  {
55:          echo "<p> View <a href=\"lister.php?file=$file&amp;linenums&amp;dl&amp;nodir\">$file</a>\n";
56:          echo "</p>\n";
57: 	  }
58:    }
59: ?>
60: </div>
61: 
62: <div>
63: <script type="text/JavaScript"> <!--
64:    addFooter( "Question: LDAP Sample Configuration and Data Files" );
65: // --> </script>
66: <noscript>
67:     <p> This page was last updated by Wayne Pollock. </p>
68: </noscript>
69: 
70: </div></body></html>