Call this v1.1.0...

master
Pentium44 2020-11-04 23:25:32 -08:00
parent 79d77f891b
commit 91a6409b1c
12 changed files with 155 additions and 198 deletions

10
README
View File

@ -8,7 +8,15 @@ This software is released under the GPLv3.
*Connect to SOFM from any web browser.
--- Changelog ---
11/3/2020 -
11/4/2020 - v1.1.0
*Other subtle CSS changes, W3S verified
*Fixed some mimetypes, and added file extensions to database
*Modifications to about page
*Removed two step linking for registeration and login
*Removed unneeded code from past projects.
*Modified footer / header.php
11/3/2020 - v1.0.1
*CSS cleanup, and re-work
*Modified header / footer files from parsing text to parsing via php for usage of the server side functions

View File

@ -2,7 +2,7 @@
//$config_var[0] = "password"; // Registration validation key - not needed //
$config_var[1] = "5368709120"; // Max virtual disk space usage - default 500MB //
$config_var[2] = "52428800"; // Max file upload space - default 10MB //
$config_var[2] = "157291000"; // Max file upload space - default 10MB //
$config_var[3] = "SOFM"; // Title //
$config_var[4] = "Simple Online File Manager"; // Description //
@ -11,6 +11,8 @@ $desc = $config_var[4];
$user_max_webspace = $config_var[1];
$user_max_upload = $config_var[2];
$version = "v1.0.1";
$version = "v1.1.0"; // Current version ~ displayed in footer.
// Allowed file extensions within array. Easy to handle as well as loop
$allowedExts = array("gif", "jpeg", "jpg", "png", "bmp", "ico", "swf", "txt", "html", "htm", "xhtml", "css", "js", "c", "cpp", "lua", "py", "tar", "zip", "rar", "gz", "7z", "bz2", "tgz", "mp3", "mp4", "ogg", "wav", "ogv", "flv", "webm", "pdf", "json", "ttf", "rtf", "otf", "svg");
?>

View File

@ -86,7 +86,7 @@ if(isset($_GET['action']))
}
file_put_contents("data/log.txt", $oldcontent . "Backtracking: $ip\n");
echo "<div class='ptitle'>Control Panel - $username</div>\n";
echo "<div class='ptitle'>$title: $desc ~ ERROR!</div>\n";
print <<<EOD
@ -115,7 +115,7 @@ CSS;
else
{
print <<<EOD
<div class='ptitle'>Upload - $username</div>
<div class='ptitle'>$title: $desc ~ upload</div>
<div id='ctrlnav'><a href='ctrl.php?p=$path'>Back to /$path</a>
<div class="progress">
<div class="bar"></div >
@ -183,7 +183,7 @@ EOD;
{
print <<<EOD
<div class='ptitle'>Upload - $username</div>
<div class='ptitle'>$title: $desc ~ upload</div>
<div id='ctrlnav'><a href="ctrl.php">Back to /</a>
<div class="progress">
<div class="bar"></div >
@ -265,7 +265,7 @@ EOD;
else
{
print <<<EOD
<div class='ptitle'>New Directory - $username</div>
<div class='ptitle'>$title: $desc ~ new directory</div>
<div id='ctrlnav'>
<a href='ctrl.php?p=$path'>Back to /$path</a>
@ -282,8 +282,8 @@ EOD;
}
else
{
echo "<div class='ptitle'>$title: $desc ~ new directory</div>\n";
print <<<EOD
<div class='ptitle'>New Directory - $username</div>
<div id='ctrlnav'>
<a href='ctrl.php'>Back to /</a>
<div class="form">
@ -320,7 +320,7 @@ EOD;
{
mkdir("users/$username/$path/$dirname", 0777);
//file_put_contents("users/$username/$path/$dirname/index.html", "<html><meta http-equiv='refresh' content='o;url=/'></html>");
header("Location: ctrl.php");
header("Location: ctrl.php?p=$path");
}
}
}
@ -460,23 +460,25 @@ EOD;
}
else
{
echo "<div class='ptitle'>Control Panel - $username</div>\n\n";
echo "<div class='ptitle'>$title: $desc ~ file tree</div>\n";
echo "<div id='ctrlnav'>\n";
if(isset($_GET['p']))
{
$path = $_GET['p'];
echo "<a href='index.php'>Home</a> &bull; \n";
echo "<a href='ctrl.php'>Back to /</a> &bull; \n";
echo "<a href='ctrl.php?action=upload&p=$path'>Upload</a> &bull; \n";
echo "<a href='ctrl.php?action=newdir&p=$path'>Create Directory</a>\n";
echo "&bull; <a href='users/$username/$path'>Drive URL</a>";
echo "&bull; <a href='http://ho.st.us.to/$username/$path'>Short URL</a>";
echo "<a href='ctrl.php?action=newdir&p=$path'>Create Directory</a> \n";
//echo "&bull; <a href='users/$username/$path'>Drive URL</a> ";
echo "&bull; <a href='https://ho.st.us.to/$username/$path'>Web URL</a> &bull; <a href='logout.php'>Logout</a>";
}
else
{
echo "<a href='index.php'>Home</a> &bull; \n";
echo "<a href='ctrl.php?action=upload'>Upload</a> &bull; \n";
echo "<a href='ctrl.php?action=newdir'>Create Directory</a>\n";
echo "&bull; <a href='users/$username/'>Drive URL</a>";
echo "&bull; <a href='http://ho.st.us.to/$username'>Short URL</a>";
echo "<a href='ctrl.php?action=newdir'>Create Directory</a> \n";
//echo "&bull; <a href='users/$username/'>Drive URL</a> ";
echo "&bull; <a href='https://ho.st.us.to/$username'>Web URL</a> &bull; <a href='logout.php'>Logout</a>";
}
//echo "&bull; <a href='users/$username/'>Drive URL</a>";
@ -484,7 +486,7 @@ else
$size = file_get_contents("users/$username.usage");
$size = tomb($size);
$user_max_webspace = tomb($user_max_webspace);
echo "Usage: $size / $user_max_webspace";
echo "$username ~ $size / $user_max_webspace";
echo "</div><div id='filelist'>\n";
echo "<u>Your virtual disk files:</u><br>";

View File

@ -3,6 +3,11 @@ include("config.php");
?>
</div>
<div class="footer">SOFM <?php echo $version; ?>, 2014-2020 &bull; <a href="terms.php">Terms Of Service</a></div>
<div class="footer">
SOFM <?php echo $version; ?>, 2014-2020 &bull; <a href="terms.php">Terms Of Service</a><br />Powered by:<br />
<a href="https://freedns.afraid.org/"><img style="width:100px;" src="https://freedns.afraid.org/images/freedns_crop.png" /></a>
<a href="https://letsencrypt.org/"><img style="width: 100px;" src="https://letsencrypt.org/images/le-logo-wide.png" /></a>
<a href="http://jigsaw.w3.org/css-validator/validator?uri=hosting.cddo.cf&profile=css3svg"><img style="border:0;width:80px" src="http://jigsaw.w3.org/css-validator/images/vcss-blue" alt="Valid CSS!" /></a>
</div>
</body>
</html>

View File

@ -1,8 +1,8 @@
<?php include("config.php"); session_start(); ?>
<!DOCTYPE html>
<html>
<html lang="en-US">
<head>
<title><?php echo $title; ?></title>
<title>SOFM <?php echo $version; ?></title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link rel="stylesheet" href="style.css" type="text/css">
<script src="data/jquery.1.7.js"></script>
@ -10,7 +10,3 @@
</head>
<body>
<div class="contain">
<div class="title"><?php echo $title . "<br />\n<div style='font-size: 20px;'>" . $desc . "</div>"; ?></div>
<br />

View File

@ -15,37 +15,85 @@ $max_upload = tomb($config_var[2]);
include_once("header.php");
echo "<div class='ptitle'>$title: $desc</div>\n";
?>
<div class="navbar">
<?php
if(!isset($_SESSION['hostz-user']) && !isset($_SESSION['hostz-passwd'])) {
?>
<a href="register.php">Register</a>&bull;<a href="login.php">Login</a>
<?php
} else {
?>
<a href="ctrl.php">My Drive</a>&bull;<a href="logout.php">Logout</a>
<?php
}
?>
</div>
<?php
print <<<EOD
<table style="margin:auto;">
<tr>
<td>
<div id="packages">
Web Space: $webspace<br>
Max Upload: $max_upload<br>
</div>
</td>
</tr>
</table>
EOD;
echo "<div id='ctrlnav'>\n";
if(!isset($_SESSION['hostz-user']) && !isset($_SESSION['hostz-passwd'])) {
?>
<a href="register.php">Register</a> &bull; <a href="login.php">Login</a>
<?php
} else {
?>
<a href="ctrl.php">My Drive</a> &bull; <a href="logout.php">Logout</a>
<?php
}
echo "</div>\n";
?>
<table style="margin:auto;">
<tr>
<td>
<div id="packages">
<?php echo $title; ?> was developed while influenced by ads, so we're extremely
grateful to bring a 100% ad-free, cost-free hosting platform. We plan to stay, to
show people that free hosting can still exist without the invasive ads or fees.
The shared location for each users static storage / web hosting is secured by SSL (https).
The downside is, CGI is disabled for users. <?php echo $title; ?> is more-so here
for static hosting, but do remember if you have a small repository, or want to use
for mirroring FOSS (free and open source software); please feel to do so!<br /><br />
If you're looking for FreeBox, we sincerely apologize for the shut-down of our free
VPS hosting services... Due to DMCA contact over piracy of copywritten data, we've
seized usage to all users. If you were using FreeBox for web hosting, freehost is
always an option.<br /><br />
Remember, we charge absolutely no one, so if you like our services; please consider
donating to cover a cup of coffee and maybe that internet bill!
<br />
<form action="https://www.paypal.com/donate" method="post" target="_top">
<input type="hidden" name="cmd" value="_donations" />
<input type="hidden" name="business" value="cdorm245@gmail.com" />
<input type="hidden" name="currency_code" value="USD" />
<input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_donate_LG.gif" name="submit" title="PayPal - The safer, easier way to pay online!" alt="Donate with PayPal button" />
<img alt="" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1" />
</form>
<br />
Web Space: <?php echo $webspace; ?><br />
Max Upload: <?php echo $max_upload; ?><br />
User count: <?php
$totalUsers = count( glob("users/*", GLOB_ONLYDIR) );
echo $totalUsers;
?><br /><br />
Allowed upload extensions:
<?php
$array = $allowedExts;
for ($i = 0; $i < count($array); $i++) {
echo $array[$i];
if($i < (count($array)-1)) {
echo ", ";
}
}
?>.<br />
</div>
</td>
</tr>
</table>
<?php
include_once("footer.php");
?>

View File

@ -4,18 +4,11 @@ session_start();
if(isset($_SESSION['hostz-user']) && isset($_SESSION['hostz-passwd'])) { header("Location: ctrl.php"); }
if(isset($_SESSION['hostz-vpspanel-user']) && isset($_SESSION['hostz-vpspanel-passwd'])) { header("Location: vps-panel.php"); }
//$header = file_get_contents("header.txt");
//echo $header;
//$page_title = "Drive";
//$indir = "true";
//include_once("../data/header.php");
include("config.php");
include_once("header.php");
echo "<div class='ptitle'>$title - Login</div>\n\n";
echo "<div class='ptitle'>$title: $desc ~ login</div>\n\n";
if(isset($_GET['action']))
{
@ -50,61 +43,9 @@ if(isset($_GET['action']))
echo "Error: No username or password provided";
}
}
/*if($action=="dovps")
{
if($_POST['vpsusername']!="" && $_POST['vpspassword']!="")
{
$username = $_POST['vpsusername'];
if(file_exists("vpsusers/$username.php"))
{
$password = md5(sha1($_POST['vpspassword']));
include("vpsusers/$username.php");
if($user_password==$password)
{
$_SESSION['hostz-vpspanel-user'] = $_POST['vpsusername'];
$_SESSION['hostz-vpspanel-passwd'] = $password;
echo "Logged in, <a href=\"vps-panel.php\">Redirecting to VPS panel in 3 seconds</a><meta http-equiv='refresh' content='3;url=vps-panel.php'>";
}
else
{
echo "Error: Wrong password";
}
}
else
{
echo "Error: User not found.";
}
}
else
{
echo "Error: No username or password provided";
}
}*/
}
/*else if(isset($_GET['vps'])) {
print <<<EOD
<div class="form">
<form method="post" action="login.php?action=dovps">
<table>
<tr>
<td>Username:</td>
<td><input type="text" name="vpsusername"></td>
</tr>
<tr>
<td>Password:</td>
<td><input type="password" name="vpspassword"></td>
</tr>
<tr>
<td>Go!</td>
<td><input type="submit" value="Login"></td>
</tr>
</table>
</form>
</div>
EOD;
}*/
else if(isset($_GET['filehost'])) {
else
{
print <<<EOD
<div class="form">
<form method="post" action="login.php?action=filehost">
@ -125,12 +66,6 @@ else if(isset($_GET['filehost'])) {
</form>
</div>
EOD;
} else {
print <<<EOD
<div class="indexl">
<a href="login.php?filehost">Login</a>
</div>
EOD;
}

View File

@ -16,6 +16,7 @@ include_once("header.php");
if(isset($_GET['error']))
{
echo "<div class='ptitle'>$title: $desc</div>\n";
$error = $_GET['error'];
if($error=="1") { echo "Error: No username provided."; }
if($error=="2") { echo "Error: No password provided."; }
@ -27,51 +28,12 @@ if(isset($_GET['error']))
if($error=="8") { echo "Error: Register form not completely filled out."; }
if($error=="9") { echo "Error: VPS package not available at this time."; }
if($error=="10") { echo "Error: The provided email has already been registered with EEZE Host."; }
}
/*else if(isset($_GET['vps'])) {
print <<<EOD
<div class="form">
<form method="post" action="create.php?vps">
<table>
<tr>
<td>Email:</td>
<td><input type="text" name="email"></td>
</tr>
<tr>
<td>Username:</td>
<td><input type="text" name="username"></td>
</tr>
<tr>
<td>Password:</td>
<td><input type="password" name="password"></td>
</tr>
<tr>
<td>Confirm Password:</td>
<td><input type="password" name="passwordagain"></td>
</tr>
<tr>
<td>VPS Package:</td>
<td>
<select name="package">
<option value="1">VPS Package 1</option>
</select>
</td>
</tr>
<tr>
<td>Terms Of Service:</td>
<td>By signing up for this service, you are <br>agreeing to the <a href='terms.php'>Terms Of Service</a></td>
</tr>
<tr>
<td>Go!</td>
<td><input type="submit" value="Get Your VPS"></td>
</tr>
</table>
</form>
</div>
EOD;
}*/
else if(isset($_GET['filehost'])) {
}
else
{
echo "<div class='ptitle'>$title: $desc ~ register</div>\n";
print <<<EOD
<br /><br />
<div class="form">
<form method="post" action="create.php">
<table>
@ -99,13 +61,6 @@ else if(isset($_GET['filehost'])) {
</form>
</div>
EOD;
} else {
print <<<EOD
<div class="indexl">
<a href="register.php?filehost">Register</a>
</div>
EOD;
}
//include_once("../data/footer.php");

View File

@ -1,12 +1,14 @@
@import url(http://fonts.googleapis.com/css?family=Alef);
@import url(http://fonts.googleapis.com/css?family=Pontano+Sans);
@import url('https://fonts.googleapis.com/css2?family=DM+Mono:ital,wght@0,400;0,500;1,400&display=swap');
body {
background-color: #000000;
font-family: "Pontano Sans", sans-serif;
font-family: "DM Mono", sans-serif;
font-size: 16px;
letter-spacing: -1px;
color: #f9f9f9;
margin: 0;
padding: 10px;
padding-top: 15px;
}
.ctrl_navbar {
@ -15,29 +17,24 @@ body {
border: solid 1px #666666;
}
.title {
font-family: "Alef", "Pontano Sans", sans-serif;
font-size: 32px;
text-align: center;
min-width: 200px;
max-width: 600px;
margin: auto;
}
.ptitle {
font-size: 24px;
font-size: 20px;
font-weight: normal;
font-style: italic;
letter-spacing: -1px;
margin: auto;
padding-bottom: 5px;
text-align: center;
width: fit-content(20%);
}
.contain {
background: #545454;
background: #161616;
padding: 10px;
min-width: 650px;
max-width: 800px;
margin: auto;
border: solid 1px #444444;
border: solid 1px #222222;
border-radius: 10px;
-webkit-border-radius: 10px;
-moz-border-radius: 10px;
@ -46,8 +43,8 @@ body {
}
.footer {
font-family: Alef, sans-serif;
text-align:center;
font-family: "DM Mono", sans-serif;
text-align: center;
padding: 4px;
}
@ -57,6 +54,7 @@ body {
}
.indexl a {
font-family: "DM Mono", sans-serif;
padding: 0px;
padding-left: 4px;
padding-right: 4px;
@ -82,9 +80,10 @@ a:hover { color: #3377ff; }
color: #dddddd;
padding: 4px;
border-radius: 6px;
border: solid 1px #222222;
border: solid 1px #444444;
background-color: #323232;
text-decoration: none;
box-shadow: 0px 0px 6px #000000;
}
#ctrlnav a {
@ -125,8 +124,6 @@ a:hover { color: #3377ff; }
font-size: 16px;
color: #dddddd;
padding: 4px;
border-radius: 6px;
border: solid 1px #222222;
background-color: #323232;
width: 230px;
width: 450px;
text-align: center;
}

View File

@ -11,8 +11,9 @@ include("config.php");
include_once("header.php");
echo "<div class='ptitle'>$title: $desc ~ terms of usage</div>\n";
print <<<EOD
<div class='ptitle'>$title - Terms of Service</div>
<div id="ctrlnav" style="text-align: left;">
<table>
<tr>
<td>
@ -40,6 +41,11 @@ include_once("header.php");
</td>
</tr>
</table>
<br />
<div style="font-weight: bold;">DMCA / Contact:</div>
cddo [AT] riseup [DOT] net
</div>
EOD;
include_once("footer.php");

View File

@ -31,8 +31,6 @@ if($password!=$user_password)
echo "<html>";
for($i=0; $i<count($_FILES["file"]["name"]); $i++)
{
$allowedExts = array("gif", "jpeg", "jpg", "png", "bmp", "ico", "swf", "txt", "html", "htm", "css", "js", "c", "cpp", "lua", "py", "tar", "zip", "rar", "gz", "7z", "bz2", "tgz", "mp3", "mp4", "ogg", "wav", "ogv", "flv", "webm", "oft", "pdf", "json", "ttf", "rtf", "oft", "svg");
$temp = explode(".", $_FILES["file"]["name"][$i]);
$extension = end($temp);
if ((($_FILES["file"]["type"][$i] == "image/gif")
@ -49,6 +47,10 @@ for($i=0; $i<count($_FILES["file"]["name"]); $i++)
|| ($_FILES["file"]["type"][$i] == "application/octet-stream")
|| ($_FILES["file"]["type"][$i] == "text/html")
|| ($_FILES["file"]["type"][$i] == "text/htm")
|| ($_FILES["file"]["type"][$i] == "text/xhtml")
|| ($_FILES["file"]["type"][$i] == "text/xml")
|| ($_FILES["file"]["type"][$i] == "application/xhtml+xml")
|| ($_FILES["file"]["type"][$i] == "application/xml")
|| ($_FILES["file"]["type"][$i] == "text/plain")
|| ($_FILES["file"]["type"][$i] == "application/octet-stream")
|| ($_FILES["file"]["type"][$i] == "application/x-gunzip")
@ -95,8 +97,8 @@ for($i=0; $i<count($_FILES["file"]["name"]); $i++)
|| ($_FILES["file"]["type"][$i] == "application/pdf")
|| ($_FILES["file"]["type"][$i] == "image/svg+xml")
|| ($_FILES["file"]["type"][$i] == "application/rtf")
|| ($_FILES["file"]["type"][$i] == "text/ttf")
|| ($_FILES["file"]["type"][$i] == "text/otf")
|| ($_FILES["file"]["type"][$i] == "font/ttf")
|| ($_FILES["file"]["type"][$i] == "font/otf")
|| ($_FILES["file"]["type"][$i] == "video/x-flv")
|| ($_FILES["file"]["type"][$i] == "video/mp4v-es")
|| ($_FILES["file"]["type"][$i] == "application/x-python")
@ -104,6 +106,7 @@ for($i=0; $i<count($_FILES["file"]["name"]); $i++)
|| ($_FILES["file"]["type"][$i] == "text/python")
|| ($_FILES["file"]["type"][$i] == "application/x-compressed")
|| ($_FILES["file"]["type"][$i] == "text/javascript")
|| ($_FILES["file"]["type"][$i] == "application/x-shockwave-flash")
|| ($_FILES["file"]["type"][$i] == "application/x-javascript")
|| ($_FILES["file"]["type"][$i] == "application/bzip2")
|| ($_FILES["file"]["type"][$i] == "application/x-bzip")
@ -146,8 +149,8 @@ for($i=0; $i<count($_FILES["file"]["name"]); $i++)
file_put_contents("users/$username.usage", $usage);
move_uploaded_file($_FILES["file"]["tmp_name"][$i],
"users/$username/$path/" . $_FILES["file"]["name"][$i]);
file_put_contents("users/$username.files", $_FILES["file"]["name"][$i] . "<br />\n" . $filelist);
echo "Success: " . $_FILES["file"]["name"][$i] . " Uploaded! Size: " . tomb($_FILES["file"]["size"][$i]) . "<br>";
file_put_contents("users/$username.files", $_FILES["file"]["name"][$i] . "\n" . $filelist);
echo "Success: " . $_FILES["file"]["name"][$i] . " Uploaded! Size: " . tomb($_FILES["file"]["size"][$i]) . "<br />\n";
}
}
}

View File

@ -1,3 +1,3 @@
<html>
<meta http-equiv="refresh" content="0;url=/">
<meta http-equiv="refresh" content="0;url=https://hosting.cddo.cf">
</html>