Commit 18851dd4 authored by Ingemar Ceicer's avatar Ingemar Ceicer

DEPRECTED

parent 8b819f35
<?php
$status=$_SERVER['REDIRECT_STATUS'];
$codes=array(
400 => array('400 Bad Request', 'The request cannot be fulfilled due to bad syntax.'),
401 => array('401 Login Error', 'It appears that the password and/or user-name you entered was incorrect. <a href="#" onclick="window.location.reload()">Click here</a> to return to the login page.'),
403 => array('403 Forbidden', 'The server has refused to fulfill your request.'),
404 => array('404 Not Found', 'Whoops, sorry, but the document you requested was not found on this server.'),
405 => array('405 Method Not Allowed', 'The method specified in the Request-Line is not allowed for the specified resource.'),
408 => array('408 Request Timeout', 'Your browser failed to send a request in the time allowed by the server.'),
414 => array('414 URL To Long', 'The URL you entered is longer than the maximum length.'),
500 => array('500 Internal Server Error', 'The request was unsuccessful due to an unexpected condition encountered by the server.'),
502 => array('502 Bad Gateway', 'The server received an invalid response from the upstream server while trying to fulfill the request.'),
504 => array('504 Gateway Timeout', 'The upstream server failed to send a request in the time allowed by the server.'),
);
$errortitle = $codes[$status][0];
$message = $codes[$status][1];
?>
<!doctype html>
<html>
<head>
<title>That's an Error!</title>
<style>
html
{color:#333;
font-family: "Lucida Console", Courier, monospace;
font-size:14px;
background:#eeeeee;}
.content
{margin:0 auto;
width:1000px;
margin-top:20px;
padding:10px 0 10px 0;
border:1px solid #EEE;
background: none repeat scroll 0 0 white;
box-shadow: 0 5px 10px -5px rgba(0, 0, 0, 0.5);
position: relative;
}
h1
{font-size:18px;
text-align:center;}
h1.title
{color:red;}
h2
{font-size:16px;
text-align:center;}
p
{text-align:center;}
hr
{border:#fe4902 solid 1px;}
</style>
</head>
<body>
<div class="content">
<h1>Sorry, but that's an error!</h1>
<h1 class="title"><?php echo $errortitle; ?></h1>
<hr>
<p><?php echo $message;?></p>
</div>
</body>
</html>
\ No newline at end of file
ErrorDocument 400 /.error.php
ErrorDocument 401 /.error.php
ErrorDocument 403 /.error.php
ErrorDocument 404 /.error.php
ErrorDocument 405 /.error.php
ErrorDocument 408 /.error.php
ErrorDocument 414 /.error.php
ErrorDocument 500 /.error.php
ErrorDocument 502 /.error.php
ErrorDocument 504 /.error.php
DirectoryIndex index.htm index.html index.shtml index.php default.php .index.php
\ No newline at end of file
<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<link rel="shortcut icon" href="../.favicon.ico">
<title>Cliff-Linux Contents</title>
<style>
*
{padding:0;
margin:0;
-o-transition:all 200ms linear;
-moz-transition:all 200ms linear;
-webkit-transition:all 200ms linear;
transition:all 200ms linear;}
html,body
{color:#333;
font-family: "Lucida Console", Courier, monospace;
font-size:14px;}
#container
{margin:0 auto;
width:900px;
margin-top:20px;
padding-top:10px;
border:1px solid #EEE;
border-radius:10px;
position:relative;}
table
{background-color:#F3F3F3;
border-collapse:collapse;
width:100%;
margin:15px 0;}
th
{text-align:left;
background-color:#FE4902;
color:#FFF;
font-weight:bold;
padding:7px 0 5px 22px;
font-size:14px;
letter-spacing:1px;
font-family: Verdana, Arial, Helvetica, sans-serif;
margin-bottom:5px;}
th span
{font-size:9px;
letter-spacing:0;}
td
{padding:0px 0;
position:relative;
overflow:hidden;}
a
{text-decoration:none;}
table a
{padding: 6px 0 6px 24px;
color:#663300;
display:block;
width:100%;
height:100%;}
table tr td:first-of-type a
{background: url(./.images/file.png) no-repeat left 50%;}
table tr td:not(:first-of-type) a
{background-image:none !important;}
tr:nth-of-type(odd)
{background-color:#E6E6E6;}
tr:hover td
{background-color:#CACACA;}
tr:hover a
{color:#000;}
h1
{font-size:18px;
font-weight:bold;
padding:0 0 10px 10px;
text-align:center;}
h2
{font-size:16px;
text-align:center;}
/* icons for file types (icons by famfamfam.) */
/* images */
table tr td:first-of-type a[href$=".jpg"],
table tr td:first-of-type a[href$=".png"],
table tr td:first-of-type a[href$=".gif"],
table tr td:first-of-type a[href$=".svg"],
table tr td:first-of-type a[href$=".jpeg"]
{background-image: url(./.images/image.png);}
/* pdfs */
table tr td:first-of-type a[href$=".pdf"]
{background-image: url(./.images/pdf.gif);}
/* zips */
table tr td:first-of-type a[href$=".zip"]
{background-image: url(./.images/zip.png);}
/* css */
table tr td:first-of-type a[href$=".css"]
{background-image: url(./.images/css.png);}
/* docs */
table tr td:first-of-type a[href$=".doc"],
table tr td:first-of-type a[href$=".docx"],
table tr td:first-of-type a[href$=".ppt"],
table tr td:first-of-type a[href$=".pptx"],
table tr td:first-of-type a[href$=".pps"],
table tr td:first-of-type a[href$=".ppsx"],
table tr td:first-of-type a[href$=".xls"],
table tr td:first-of-type a[href$=".xlsx"]
{background-image: url(./.images/office.png)}
/* videos */
table tr td:first-of-type a[href$=".avi"],
table tr td:first-of-type a[href$=".wmv"],
table tr td:first-of-type a[href$=".mp4"],
table tr td:first-of-type a[href$=".mov"],
table tr td:first-of-type a[href$=".m4a"]
{background-image: url(./.images/video.png);}
/* audio */
table tr td:first-of-type a[href$=".mp3"],
table tr td:first-of-type a[href$=".ogg"],
table tr td:first-of-type a[href$=".aac"],
table tr td:first-of-type a[href$=".wma"]
{background-image: url(./.images/audio.png);}
/* web pages */
table tr td:first-of-type a[href$=".html"],
table tr td:first-of-type a[href$=".xml"]
{background-image: url(./.images/xml.png);}
table tr td:first-of-type a[href$=".php"]
{background-image: url(./.images/php.png);}
table tr td:first-of-type a[href$=".js"]
{background-image: url(./.images/script.png);}
/* directories */
table tr.dir td:first-of-type a
{background-image: url(./.images/folder.png);}
</style>
</head>
<body>
<div id="container">
<h1>Cliff-Linux Contents (192.168.1.74)</h1>
<h2>Your IP Address is: <?php echo getenv('REMOTE_ADDR'); ?></h2>
<table>
<tr>
<th>Filename</th>
<th>Type</th>
<th>Size <span>(bytes)</span></th>
<th>Date Modified</th>
</tr>
<?php
// Opens directory
$myDirectory=opendir(".");
// Gets each entry
while($entryName=readdir($myDirectory)) {
$dirArray[]=$entryName;
}
// Finds extensions of files
function findexts ($filename)
{
$filename=strtolower($filename);
$exts=split("[/\\.]", $filename);
$n=count($exts)-1;
$exts=$exts[$n];
return $exts;
}
// Closes directory
closedir($myDirectory);
// Counts elements in array
$indexCount=count($dirArray);
// Sorts files
sort($dirArray);
// Loops through the array of files
for($index=0; $index < $indexCount; $index++) {
// Allows ./?hidden to show hidden files
if($_SERVER['QUERY_STRING']=="hidden")
{$hide="";
$ahref="./";
$atext="Hide";}
else
{$hide=".";
$ahref="./?hidden";
$atext="Show";}
if(substr("$dirArray[$index]", 0, 1) != $hide) {
// Gets File Names
$name=$dirArray[$index];
$namehref=$dirArray[$index];
// Gets Extensions
$extn=findexts($dirArray[$index]);
// Gets file size
$size=number_format(filesize($dirArray[$index]));
// Gets Date Modified Data
$modtime=date("M j Y g:i A", filemtime($dirArray[$index]));
// Prettifies File Types
switch ($extn){
case "png": $extn="PNG Image"; break;
case "jpg": $extn="JPG Image"; break;
case "svg": $extn="SVG Image"; break;
case "gif": $extn="GIF Image"; break;
case "ico": $extn="Windows Icon"; break;
case "txt": $extn="Text File"; break;
case "htm": $extn="HTML File"; break;
case "php": $extn="PHP Script"; break;
case "js": $extn="Javascript"; break;
case "css": $extn="Stylesheet"; break;
case "pdf": $extn="PDF Document"; break;
case "AppImage": $extn="Linux AppImage"; break;
case "zip": $extn="ZIP Archive"; break;
default: $extn=strtoupper($extn)." File"; break;
}
// Separates directories
if(is_dir($dirArray[$index]))
{
$extn="&lt;directory&gt;";
$size="&lt;directory&gt;";
$class="dir";
}
else
{
$class="file";
}
// Cleans up . and .. directories
if($name=="."){$name=". (Current Directory)";}
if($name==".."){$name=".. (Parent Directory)";}
// Print 'em
print("
<tr class='$class'>
<td><a href='$namehref'>$name</a></td>
<td><a href='$namehref'>$extn</a></td>
<td><a href='$namehref'>$size</a></td>
<td><a href='$namehref'>$modtime</a></td>
</tr>");
}
}
?>
</table>
<h2><?php print("<a href='$ahref'>$atext hidden files</a>"); ?></h2>
</div>
</body>
</html>
<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<link rel="shortcut icon" href="./.favicon.ico">
<title>Directory Contents</title>
<link rel="stylesheet" href="./.style.css">
<script src="./.sorttable.js"></script>
</head>
<body>
<div id="container">
<!-- ipac -->
<h1>Directory Contents of hashSum BETA</h1>
<table class="sortable">
<thead>
<tr>
<th>Filename</th>
<th>Type</th>
<th>Size</th>
<th>Date Modified</th>
</tr>
</thead>
<tbody><?php
// Adds pretty filesizes
function pretty_filesize($file) {
$size=filesize($file);
if($size<1024){$size=$size." Bytes";}
elseif(($size<1048576)&&($size>1023)){$size=round($size/1024, 1)." KB";}
elseif(($size<1073741824)&&($size>1048575)){$size=round($size/1048576, 1)." MB";}
else{$size=round($size/1073741824, 1)." GB";}
return $size;
}
// Checks to see if veiwing hidden files is enabled
//ipac
// if($_SERVER['QUERY_STRING']=="hidden")
// {
// $hide="";
// $ahref="./";
// $atext="Hide";
// }
// else
// {
$hide=".";
$ahref="./?hidden";
$atext="Show";
// }
// Opens directory
$myDirectory=opendir(".");
// Gets each entry
while($entryName=readdir($myDirectory)) {
$dirArray[]=$entryName;
}
// Closes directory
closedir($myDirectory);
// Counts elements in array
$indexCount=count($dirArray);
// Sorts files
sort($dirArray);
// Loops through the array of files
for($index=0; $index < $indexCount; $index++) {
// Decides if hidden files should be displayed, based on query above.
if(substr("$dirArray[$index]", 0, 1)!=$hide) {
// Resets Variables
$favicon="";
$class="file";
// Gets File Names
$name=$dirArray[$index];
$namehref=$dirArray[$index];
// Gets Date Modified
$modtime=date("M j Y g:i A", filemtime($dirArray[$index]));
$timekey=date("YmdHis", filemtime($dirArray[$index]));
// Separates directories, and performs operations on those directories
if(is_dir($dirArray[$index]))
{
$extn="&lt;Directory&gt;";
$size="&lt;Directory&gt;";
$sizekey="0";
$class="dir";
// Gets favicon.ico, and displays it, only if it exists.
if(file_exists("$namehref/favicon.ico"))
{
$favicon=" style='background-image:url($namehref/favicon.ico);'";
$extn="&lt;Website&gt;";
}
// Cleans up . and .. directories
if($name=="."){$name=". (Current Directory)"; $extn="&lt;System Dir&gt;"; $favicon=" style='background-image:url($namehref/.favicon.ico);'";}
if($name==".."){$name=".. (Parent Directory)"; $extn="&lt;System Dir&gt;";}
}
// File-only operations
else{
// Gets file extension
$extn=pathinfo($dirArray[$index], PATHINFO_EXTENSION);
// Prettifies file type
switch ($extn){
case "png": $extn="PNG Image"; break;
case "jpg": $extn="JPEG Image"; break;
case "jpeg": $extn="JPEG Image"; break;
case "svg": $extn="SVG Image"; break;
case "gif": $extn="GIF Image"; break;
case "ico": $extn="Windows Icon"; break;
case "txt": $extn="Text File"; break;
case "log": $extn="Log File"; break;
case "htm": $extn="HTML File"; break;
case "html": $extn="HTML File"; break;
case "xhtml": $extn="HTML File"; break;
case "shtml": $extn="HTML File"; break;
case "php": $extn="PHP Script"; break;
case "js": $extn="Javascript File"; break;
case "css": $extn="Stylesheet"; break;
case "pdf": $extn="PDF Document"; break;
case "xls": $extn="Spreadsheet"; break;
case "xlsx": $extn="Spreadsheet"; break;
case "doc": $extn="Microsoft Word Document"; break;
case "docx": $extn="Microsoft Word Document"; break;
case "zip": $extn="ZIP Archive"; break;
case "htaccess": $extn="Apache Config File"; break;
case "exe": $extn="Windows Executable"; break;
case "AppImage": $extn="Linux AppImage File"; break;
// ipac
default: $extn="Linux Executable"; break;
// default: if($extn!=""){$extn=strtoupper($extn)." File";} else{$extn="Unknown";} break;
}
// Gets and cleans up file size
$size=pretty_filesize($dirArray[$index]);
$sizekey=filesize($dirArray[$index]);
}
// Output
echo("
<tr class='$class'>
<td><a href='./$namehref'$favicon class='name'>$name</a></td>
<td><a href='./$namehref'>$extn</a></td>
<td sorttable_customkey='$sizekey'><a href='./$namehref'>$size</a></td>
<td sorttable_customkey='$timekey'><a href='./$namehref'>$modtime</a></td>
</tr>");
}
}
?>
</tbody>
</table>
<!-- ipqc -->
<!-- <h2><?php /*echo("<a href='$ahref'>$atext hidden files</a>"); */?></h2> -->
</div>
</body>
</html>
This diff is collapsed.
* {
padding: 0;
margin: 0;
}
body {
color: #333;
font: 14px Sans-Serif;
padding: 50px;
/* ipac */
/* background: #eee; */
background: #339966;
}
h1 {
text-align: center;
padding: 20px 0 12px 0;
margin: 0;
}
h2 {
font-size: 16px;
text-align: center;
padding: 0 0 12px 0;
}
#container {
box-shadow: 0 5px 10px -5px rgba(0, 0, 0, 0.5);
position: relative;
background: white;
}
table {
background-color: #F3F3F3;
border-collapse: collapse;
width: 100%;
margin: 15px 0;
}
th {
background-color: #FE4902;
color: #FFF;
cursor: pointer;
padding: 5px 10px;
}
th small {
font-size: 9px;
}
td, th {
text-align: left;