From 91a6409b1c22c48342bd0b13496e78491db41a23 Mon Sep 17 00:00:00 2001 From: Pentium44 Date: Wed, 4 Nov 2020 23:25:32 -0800 Subject: [PATCH] Call this v1.1.0... --- README | 10 ++++- config.php | 6 ++- ctrl.php | 30 ++++++++------- footer.php | 7 +++- header.php | 8 +--- index.php | 98 ++++++++++++++++++++++++++++++++++++------------ login.php | 71 ++--------------------------------- register.php | 57 +++------------------------- style.css | 41 ++++++++++---------- terms.php | 8 +++- upload.php | 15 +++++--- users/index.html | 2 +- 12 files changed, 155 insertions(+), 198 deletions(-) diff --git a/README b/README index 85e05f7..329db2e 100755 --- a/README +++ b/README @@ -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 diff --git a/config.php b/config.php index 5385a2d..8b6a83d 100755 --- a/config.php +++ b/config.php @@ -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"); ?> diff --git a/ctrl.php b/ctrl.php index 0da19ca..c77040c 100755 --- a/ctrl.php +++ b/ctrl.php @@ -86,7 +86,7 @@ if(isset($_GET['action'])) } file_put_contents("data/log.txt", $oldcontent . "Backtracking: $ip\n"); - echo "
Control Panel - $username
\n"; + echo "
$title: $desc ~ ERROR!
\n"; print <<Upload - $username +
$title: $desc ~ upload
Back to /$path
@@ -183,7 +183,7 @@ EOD; { print <<Upload - $username
+
$title: $desc ~ upload
Back to /
@@ -265,7 +265,7 @@ EOD; else { print <<New Directory - $username
+
$title: $desc ~ new directory
Back to /$path @@ -282,8 +282,8 @@ EOD; } else { + echo "
$title: $desc ~ new directory
\n"; print <<New Directory - $username
Back to /
@@ -320,7 +320,7 @@ EOD; { mkdir("users/$username/$path/$dirname", 0777); //file_put_contents("users/$username/$path/$dirname/index.html", ""); - header("Location: ctrl.php"); + header("Location: ctrl.php?p=$path"); } } } @@ -460,23 +460,25 @@ EOD; } else { - echo "
Control Panel - $username
\n\n"; + echo "
$title: $desc ~ file tree
\n"; echo "
\n"; if(isset($_GET['p'])) { $path = $_GET['p']; + echo "Home • \n"; echo "Back to / • \n"; echo "Upload • \n"; - echo "Create Directory\n"; - echo "• Drive URL"; - echo "• Short URL"; + echo "Create Directory \n"; + //echo "• Drive URL "; + echo "• Web URLLogout"; } else { + echo "Home • \n"; echo "Upload • \n"; - echo "Create Directory\n"; - echo "• Drive URL"; - echo "• Short URL"; + echo "Create Directory \n"; + //echo "• Drive URL "; + echo "• Web URLLogout"; } //echo "• Drive URL"; @@ -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 "
\n"; echo "Your virtual disk files:
"; diff --git a/footer.php b/footer.php index 45a0102..fa75e6a 100755 --- a/footer.php +++ b/footer.php @@ -3,6 +3,11 @@ include("config.php"); ?>
- + diff --git a/header.php b/header.php index c608373..7996f58 100755 --- a/header.php +++ b/header.php @@ -1,8 +1,8 @@ - + - <?php echo $title; ?> + SOFM <?php echo $version; ?> @@ -10,7 +10,3 @@
- -
\n
" . $desc . "
"; ?>
- -
diff --git a/index.php b/index.php index d46e41b..d892944 100755 --- a/index.php +++ b/index.php @@ -15,37 +15,85 @@ $max_upload = tomb($config_var[2]); include_once("header.php"); +echo "
$title: $desc
\n"; + ?> - - - -
- Web Space: $webspace
- Max Upload: $max_upload
-
- - - -EOD; + echo "
\n"; + if(!isset($_SESSION['hostz-user']) && !isset($_SESSION['hostz-passwd'])) { +?> + RegisterLogin + + My DriveLogout +\n"; + +?> + + + + + +
+
+ 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. 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!

+ 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.

+ 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! +
+
+ + + + + +
+
+ Web Space:
+ Max Upload:
+ User count:

+ Allowed upload extensions: + .
+
+
+ + diff --git a/login.php b/login.php index 91196ad..458a493 100755 --- a/login.php +++ b/login.php @@ -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 "
$title - Login
\n\n"; +echo "
$title: $desc ~ login
\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, Redirecting to VPS panel in 3 seconds"; - } - 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 << -
- - - - - - - - - - - - - -
Username:
Password:
Go!
-
-
-EOD; -}*/ -else if(isset($_GET['filehost'])) { +else +{ print <<
@@ -125,12 +66,6 @@ else if(isset($_GET['filehost'])) {
EOD; -} else { - print << - Login -
-EOD; } diff --git a/register.php b/register.php index 901451b..5559eff 100755 --- a/register.php +++ b/register.php @@ -16,6 +16,7 @@ include_once("header.php"); if(isset($_GET['error'])) { + echo "
$title: $desc
\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 << -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Email:
Username:
Password:
Confirm Password:
VPS Package: - -
Terms Of Service:By signing up for this service, you are
agreeing to the Terms Of Service
Go!
-
-
-EOD; -}*/ -else if(isset($_GET['filehost'])) { +} +else +{ + echo "
$title: $desc ~ register
\n"; print <<
@@ -99,13 +61,6 @@ else if(isset($_GET['filehost'])) { EOD; -} else { - print << - Register - -EOD; - } //include_once("../data/footer.php"); diff --git a/style.css b/style.css index ad7bbb7..96c3599 100755 --- a/style.css +++ b/style.css @@ -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; } diff --git a/terms.php b/terms.php index 36e5956..033394f 100755 --- a/terms.php +++ b/terms.php @@ -11,8 +11,9 @@ include("config.php"); include_once("header.php"); + echo "
$title: $desc ~ terms of usage
\n"; print <<$title - Terms of Service +
@@ -40,6 +41,11 @@ include_once("header.php");
+ +
+
DMCA / Contact:
+ cddo [AT] riseup [DOT] net +
EOD; include_once("footer.php"); diff --git a/upload.php b/upload.php index 591e319..70ba317 100755 --- a/upload.php +++ b/upload.php @@ -31,8 +31,6 @@ if($password!=$user_password) echo ""; for($i=0; $i\n" . $filelist); - echo "Success: " . $_FILES["file"]["name"][$i] . " Uploaded! Size: " . tomb($_FILES["file"]["size"][$i]) . "
"; + 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]) . "
\n"; } } } diff --git a/users/index.html b/users/index.html index 8ce6d09..eadbc8a 100755 --- a/users/index.html +++ b/users/index.html @@ -1,3 +1,3 @@ - +