Add files via upload
							parent
							
								
									b80defbde1
								
							
						
					
					
						commit
						105947f5f8
					
				@ -0,0 +1,126 @@
 | 
			
		||||
 | 
			
		||||
<!DOCTYPE html>
 | 
			
		||||
<html lang="en">
 | 
			
		||||
<head>
 | 
			
		||||
<meta charset="utf-8">
 | 
			
		||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
 | 
			
		||||
<meta name="viewport" content="width=device-width, initial-scale=1">
 | 
			
		||||
 | 
			
		||||
<title>404 - Page Not Found</title>
 | 
			
		||||
 | 
			
		||||
<style id="" media="all">/* vietnamese */
 | 
			
		||||
@font-face {
 | 
			
		||||
  font-family: 'Cabin';
 | 
			
		||||
  font-style: normal;
 | 
			
		||||
  font-weight: 400;
 | 
			
		||||
  font-stretch: 100%;
 | 
			
		||||
  src: url(/fonts.gstatic.com/s/cabin/v18/u-4i0qWljRw-PfU81xCKCpdpbgZJl6XvptnsBXw.woff2) format('woff2');
 | 
			
		||||
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+1EA0-1EF9, U+20AB;
 | 
			
		||||
}
 | 
			
		||||
/* latin-ext */
 | 
			
		||||
@font-face {
 | 
			
		||||
  font-family: 'Cabin';
 | 
			
		||||
  font-style: normal;
 | 
			
		||||
  font-weight: 400;
 | 
			
		||||
  font-stretch: 100%;
 | 
			
		||||
  src: url(/fonts.gstatic.com/s/cabin/v18/u-4i0qWljRw-PfU81xCKCpdpbgZJl6Xvp9nsBXw.woff2) format('woff2');
 | 
			
		||||
  unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
 | 
			
		||||
}
 | 
			
		||||
/* latin */
 | 
			
		||||
@font-face {
 | 
			
		||||
  font-family: 'Cabin';
 | 
			
		||||
  font-style: normal;
 | 
			
		||||
  font-weight: 400;
 | 
			
		||||
  font-stretch: 100%;
 | 
			
		||||
  src: url(/fonts.gstatic.com/s/cabin/v18/u-4i0qWljRw-PfU81xCKCpdpbgZJl6Xvqdns.woff2) format('woff2');
 | 
			
		||||
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
 | 
			
		||||
}
 | 
			
		||||
/* vietnamese */
 | 
			
		||||
@font-face {
 | 
			
		||||
  font-family: 'Cabin';
 | 
			
		||||
  font-style: normal;
 | 
			
		||||
  font-weight: 700;
 | 
			
		||||
  font-stretch: 100%;
 | 
			
		||||
  src: url(/fonts.gstatic.com/s/cabin/v18/u-4i0qWljRw-PfU81xCKCpdpbgZJl6XvptnsBXw.woff2) format('woff2');
 | 
			
		||||
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+1EA0-1EF9, U+20AB;
 | 
			
		||||
}
 | 
			
		||||
/* latin-ext */
 | 
			
		||||
@font-face {
 | 
			
		||||
  font-family: 'Cabin';
 | 
			
		||||
  font-style: normal;
 | 
			
		||||
  font-weight: 700;
 | 
			
		||||
  font-stretch: 100%;
 | 
			
		||||
  src: url(/fonts.gstatic.com/s/cabin/v18/u-4i0qWljRw-PfU81xCKCpdpbgZJl6Xvp9nsBXw.woff2) format('woff2');
 | 
			
		||||
  unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
 | 
			
		||||
}
 | 
			
		||||
/* latin */
 | 
			
		||||
@font-face {
 | 
			
		||||
  font-family: 'Cabin';
 | 
			
		||||
  font-style: normal;
 | 
			
		||||
  font-weight: 700;
 | 
			
		||||
  font-stretch: 100%;
 | 
			
		||||
  src: url(/fonts.gstatic.com/s/cabin/v18/u-4i0qWljRw-PfU81xCKCpdpbgZJl6Xvqdns.woff2) format('woff2');
 | 
			
		||||
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
 | 
			
		||||
}
 | 
			
		||||
</style>
 | 
			
		||||
<style id="" media="all">/* cyrillic-ext */
 | 
			
		||||
@font-face {
 | 
			
		||||
  font-family: 'Montserrat';
 | 
			
		||||
  font-style: normal;
 | 
			
		||||
  font-weight: 900;
 | 
			
		||||
  src: url(/fonts.gstatic.com/s/montserrat/v18/JTURjIg1_i6t8kCHKm45_epG3gTD_u50.woff2) format('woff2');
 | 
			
		||||
  unicode-range: U+0460-052F, U+1C80-1C88, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
 | 
			
		||||
}
 | 
			
		||||
/* cyrillic */
 | 
			
		||||
@font-face {
 | 
			
		||||
  font-family: 'Montserrat';
 | 
			
		||||
  font-style: normal;
 | 
			
		||||
  font-weight: 900;
 | 
			
		||||
  src: url(/fonts.gstatic.com/s/montserrat/v18/JTURjIg1_i6t8kCHKm45_epG3g3D_u50.woff2) format('woff2');
 | 
			
		||||
  unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
 | 
			
		||||
}
 | 
			
		||||
/* vietnamese */
 | 
			
		||||
@font-face {
 | 
			
		||||
  font-family: 'Montserrat';
 | 
			
		||||
  font-style: normal;
 | 
			
		||||
  font-weight: 900;
 | 
			
		||||
  src: url(/fonts.gstatic.com/s/montserrat/v18/JTURjIg1_i6t8kCHKm45_epG3gbD_u50.woff2) format('woff2');
 | 
			
		||||
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+1EA0-1EF9, U+20AB;
 | 
			
		||||
}
 | 
			
		||||
/* latin-ext */
 | 
			
		||||
@font-face {
 | 
			
		||||
  font-family: 'Montserrat';
 | 
			
		||||
  font-style: normal;
 | 
			
		||||
  font-weight: 900;
 | 
			
		||||
  src: url(/fonts.gstatic.com/s/montserrat/v18/JTURjIg1_i6t8kCHKm45_epG3gfD_u50.woff2) format('woff2');
 | 
			
		||||
  unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
 | 
			
		||||
}
 | 
			
		||||
/* latin */
 | 
			
		||||
@font-face {
 | 
			
		||||
  font-family: 'Montserrat';
 | 
			
		||||
  font-style: normal;
 | 
			
		||||
  font-weight: 900;
 | 
			
		||||
  src: url(/fonts.gstatic.com/s/montserrat/v18/JTURjIg1_i6t8kCHKm45_epG3gnD_g.woff2) format('woff2');
 | 
			
		||||
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
 | 
			
		||||
}
 | 
			
		||||
</style>
 | 
			
		||||
 | 
			
		||||
<link type="text/css" rel="stylesheet" href="assets/404.css" />
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
<!--[if lt IE 9]>
 | 
			
		||||
		  <script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
 | 
			
		||||
		  <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
 | 
			
		||||
		<![endif]-->
 | 
			
		||||
<meta name="robots" content="noindex, follow">
 | 
			
		||||
</head>
 | 
			
		||||
<body>
 | 
			
		||||
<div id="notfound">
 | 
			
		||||
<div class="notfound">
 | 
			
		||||
<div class="notfound-404">
 | 
			
		||||
<h3>Oops! Page not found</h3>
 | 
			
		||||
<h1><span>4</span><span>0</span><span>4</span></h1>
 | 
			
		||||
</div>
 | 
			
		||||
<h2>we are sorry, but the page you requested was not found</h2>
 | 
			
		||||
</div>
 | 
			
		||||
</div>
 | 
			
		||||
@ -0,0 +1,48 @@
 | 
			
		||||
<?php
 | 
			
		||||
 | 
			
		||||
// Get the code
 | 
			
		||||
$code = isset($_GET['code']) ? $_GET['code'] : '';
 | 
			
		||||
 | 
			
		||||
// If the code isn't in the correct format, CloudFlare will throw a 1020
 | 
			
		||||
if (!preg_match("/^([a-f0-9]{8})-(([a-f0-9]{4})-){3}([a-f0-9]{12}) *$/i", $code)) {
 | 
			
		||||
	http_response_code(403);
 | 
			
		||||
	echo "error code: 1020";
 | 
			
		||||
	die;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
header('Content-Type: application/json; charset=utf-8');
 | 
			
		||||
 | 
			
		||||
// Handle valid codes
 | 
			
		||||
if ($code == "86781236-23d0-4b3c-7dfa-c1c147e0dece") {
 | 
			
		||||
	echo <<<EOD
 | 
			
		||||
{
 | 
			
		||||
  "amount": "19.84",
 | 
			
		||||
  "sold_at": "2016-09-07T10:54:28+10:00",
 | 
			
		||||
  "license": "Regular License",
 | 
			
		||||
  "support_amount": "0.00",
 | 
			
		||||
  "supported_until": "9999-03-09T01:54:28+11:00",
 | 
			
		||||
  "item": {
 | 
			
		||||
    "id": 17022701,
 | 
			
		||||
    "name": "AnonUpload - Secure and anonymous file sharing",
 | 
			
		||||
    "author_username": "Supernova3339",
 | 
			
		||||
    "updated_at": "2017-11-02T15:57:41+11:00",
 | 
			
		||||
    "site": "codecanyon.net",
 | 
			
		||||
    "price_cents": 2000,
 | 
			
		||||
    "published_at": "2016-07-13T19:07:03+10:00"
 | 
			
		||||
  },
 | 
			
		||||
  "buyer": "test",
 | 
			
		||||
  "purchase_count": 1
 | 
			
		||||
}
 | 
			
		||||
EOD;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// Handle invalid codes
 | 
			
		||||
else {
 | 
			
		||||
	http_response_code(404);
 | 
			
		||||
	echo <<<EOD
 | 
			
		||||
{
 | 
			
		||||
	"error": 404,
 | 
			
		||||
	"description": "No sale belonging to the current user found with that code"
 | 
			
		||||
}
 | 
			
		||||
EOD;
 | 
			
		||||
}
 | 
			
		||||
@ -0,0 +1,14 @@
 | 
			
		||||
<?php
 | 
			
		||||
    $code = $_SERVER['REDIRECT_STATUS'];
 | 
			
		||||
    $codes = array(
 | 
			
		||||
        403 => 'Forbidden',
 | 
			
		||||
        404 => '404 Not Found',
 | 
			
		||||
        500 => 'Internal Server Error'
 | 
			
		||||
    );
 | 
			
		||||
    $source_url = 'http'.((!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off') ? 's' : '').'://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
 | 
			
		||||
    if (array_key_exists($code, $codes) && is_numeric($code)) {
 | 
			
		||||
        die("Error $code: {$codes[$code]}");
 | 
			
		||||
    } else {
 | 
			
		||||
        die('Unknown error');
 | 
			
		||||
    }
 | 
			
		||||
?>
 | 
			
		||||
@ -0,0 +1,125 @@
 | 
			
		||||
<?php 
 | 
			
		||||
require_once(__DIR__ . '/system/core.class.php');
 | 
			
		||||
session_start();
 | 
			
		||||
 | 
			
		||||
// size converter
 | 
			
		||||
 | 
			
		||||
function sizeFormat($bytes){ 
 | 
			
		||||
$kb = 1024;
 | 
			
		||||
$mb = $kb * 1024;
 | 
			
		||||
$gb = $mb * 1024;
 | 
			
		||||
$tb = $gb * 1024;
 | 
			
		||||
 | 
			
		||||
if (($bytes >= 0) && ($bytes < $kb)) {
 | 
			
		||||
return $bytes . ' B';
 | 
			
		||||
 | 
			
		||||
} elseif (($bytes >= $kb) && ($bytes < $mb)) {
 | 
			
		||||
return ceil($bytes / $kb) . ' KB';
 | 
			
		||||
 | 
			
		||||
} elseif (($bytes >= $mb) && ($bytes < $gb)) {
 | 
			
		||||
return ceil($bytes / $mb) . ' MB';
 | 
			
		||||
 | 
			
		||||
} elseif (($bytes >= $gb) && ($bytes < $tb)) {
 | 
			
		||||
return ceil($bytes / $gb) . ' GB';
 | 
			
		||||
 | 
			
		||||
} elseif ($bytes >= $tb) {
 | 
			
		||||
return ceil($bytes / $tb) . ' TB';
 | 
			
		||||
} else {
 | 
			
		||||
return $bytes . ' B';
 | 
			
		||||
}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
$maxsize = max_size;
 | 
			
		||||
$core = new Core();
 | 
			
		||||
?>
 | 
			
		||||
<!DOCTYPE html>
 | 
			
		||||
<html>
 | 
			
		||||
<head>
 | 
			
		||||
        
 | 
			
		||||
	<meta charset="utf-8">
 | 
			
		||||
	<meta name="viewport" content="width=device-width, initial-scale=1">
 | 
			
		||||
	<title><?= app_name; ?> - <?= app_desc; ?></title>
 | 
			
		||||
	    <!-- for discord -->
 | 
			
		||||
        <meta property="og:type" content="website">
 | 
			
		||||
        <meta property="og:title" content="<?= app_name; ?>" />
 | 
			
		||||
        <meta property="og:description" content="<?= app_desc; ?>" />
 | 
			
		||||
        
 | 
			
		||||
	<link rel="stylesheet" type="text/css" href="assets/main.css">
 | 
			
		||||
</head>
 | 
			
		||||
<body>
 | 
			
		||||
	<div class="wrapper">
 | 
			
		||||
		<img src="assets/images/logo.png">
 | 
			
		||||
<?php 
 | 
			
		||||
if(isset($_POST['submit'])){
 | 
			
		||||
	if($core->FileTypeVerification($_FILES["fileToUpload"])){
 | 
			
		||||
		if($core->FileSizeVerification($_FILES["fileToUpload"])){
 | 
			
		||||
			$newfilename = $core->FileNameConvertor($_FILES["fileToUpload"]);
 | 
			
		||||
			if($core->UploadFile($_FILES["fileToUpload"], $newfilename)){
 | 
			
		||||
				?>
 | 
			
		||||
				<div class="notification success">
 | 
			
		||||
					Success ! Your file is available here: <a href="<?= file_url_destination.'/'.file_destination.'/'.$newfilename; ?>"><?= file_url_destination.'/'.file_destination.'/'.$newfilename; ?></a>
 | 
			
		||||
				</div>
 | 
			
		||||
				<?php
 | 
			
		||||
			}else{
 | 
			
		||||
				?>
 | 
			
		||||
				<div class="notification error">
 | 
			
		||||
					An error occured while trying to upload your file
 | 
			
		||||
				</div>
 | 
			
		||||
				<?php
 | 
			
		||||
			}
 | 
			
		||||
		}else{
 | 
			
		||||
			?>
 | 
			
		||||
			<div class="notification error">
 | 
			
		||||
			Your File Is Too Big
 | 
			
		||||
			</div>
 | 
			
		||||
			<?php
 | 
			
		||||
		}
 | 
			
		||||
	}else{
 | 
			
		||||
		?>
 | 
			
		||||
		<div class="notification error">
 | 
			
		||||
			Incorrect File Format
 | 
			
		||||
		</div>
 | 
			
		||||
		<?php
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
?>
 | 
			
		||||
        <form method="post" action="#" enctype="multipart/form-data">
 | 
			
		||||
		  <input type="file" name="fileToUpload">
 | 
			
		||||
		  <p>Drag a file here or click to upload</p>
 | 
			
		||||
		  <button name="submit" type="submit">Upload</button>
 | 
			
		||||
		  <ul>
 | 
			
		||||
        		<li>Supported files: <?= FILELIST; ?></li> 
 | 
			
		||||
        	</ul>
 | 
			
		||||
        	<br>
 | 
			
		||||
        	<ul>
 | 
			
		||||
        	    <li>Maximum filesize: <?php echo sizeFormat($maxsize); ?></li>
 | 
			
		||||
        	</ul>
 | 
			
		||||
        	    <?php
 | 
			
		||||
                    // check if logged in
 | 
			
		||||
                    if (!isset($_SESSION["user"])) {
 | 
			
		||||
                    }else{
 | 
			
		||||
                    echo '
 | 
			
		||||
                    <br>
 | 
			
		||||
                    <ul>
 | 
			
		||||
                         <li><a href="admin/dashboard">Admin</a></li>
 | 
			
		||||
                    </ul>';
 | 
			
		||||
                    }
 | 
			
		||||
                    ?>
 | 
			
		||||
        </form>
 | 
			
		||||
    </div>
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
	<script src='https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script>
 | 
			
		||||
    <script type="text/javascript">
 | 
			
		||||
$(document).ready(function(){
 | 
			
		||||
  $('form input').change(function () {
 | 
			
		||||
  	if(this.files.length == 0){}else{
 | 
			
		||||
    	$('form p').text("File selected: "+this.files[0].name);
 | 
			
		||||
	}
 | 
			
		||||
  });
 | 
			
		||||
});
 | 
			
		||||
    </script>
 | 
			
		||||
</body>
 | 
			
		||||
</html>
 | 
			
		||||
@ -0,0 +1,125 @@
 | 
			
		||||
<?php 
 | 
			
		||||
require_once(__DIR__ . '/system/core.class.php');
 | 
			
		||||
session_start();
 | 
			
		||||
 | 
			
		||||
// size converter
 | 
			
		||||
 | 
			
		||||
function sizeFormat($bytes){ 
 | 
			
		||||
$kb = 1024;
 | 
			
		||||
$mb = $kb * 1024;
 | 
			
		||||
$gb = $mb * 1024;
 | 
			
		||||
$tb = $gb * 1024;
 | 
			
		||||
 | 
			
		||||
if (($bytes >= 0) && ($bytes < $kb)) {
 | 
			
		||||
return $bytes . ' B';
 | 
			
		||||
 | 
			
		||||
} elseif (($bytes >= $kb) && ($bytes < $mb)) {
 | 
			
		||||
return ceil($bytes / $kb) . ' KB';
 | 
			
		||||
 | 
			
		||||
} elseif (($bytes >= $mb) && ($bytes < $gb)) {
 | 
			
		||||
return ceil($bytes / $mb) . ' MB';
 | 
			
		||||
 | 
			
		||||
} elseif (($bytes >= $gb) && ($bytes < $tb)) {
 | 
			
		||||
return ceil($bytes / $gb) . ' GB';
 | 
			
		||||
 | 
			
		||||
} elseif ($bytes >= $tb) {
 | 
			
		||||
return ceil($bytes / $tb) . ' TB';
 | 
			
		||||
} else {
 | 
			
		||||
return $bytes . ' B';
 | 
			
		||||
}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
$maxsize = max_size;
 | 
			
		||||
$core = new Core();
 | 
			
		||||
?>
 | 
			
		||||
<!DOCTYPE html>
 | 
			
		||||
<html>
 | 
			
		||||
<head>
 | 
			
		||||
        
 | 
			
		||||
	<meta charset="utf-8">
 | 
			
		||||
	<meta name="viewport" content="width=device-width, initial-scale=1">
 | 
			
		||||
	<title><?= app_name; ?> - <?= app_desc; ?></title>
 | 
			
		||||
	    <!-- for discord -->
 | 
			
		||||
        <meta property="og:type" content="website">
 | 
			
		||||
        <meta property="og:title" content="<?= app_name; ?>" />
 | 
			
		||||
        <meta property="og:description" content="<?= app_desc; ?>" />
 | 
			
		||||
        
 | 
			
		||||
	<link rel="stylesheet" type="text/css" href="assets/main.css">
 | 
			
		||||
</head>
 | 
			
		||||
<body>
 | 
			
		||||
	<div class="wrapper">
 | 
			
		||||
		<img src="assets/images/logo.png">
 | 
			
		||||
<?php 
 | 
			
		||||
if(isset($_POST['submit'])){
 | 
			
		||||
	if($core->FileTypeVerification($_FILES["fileToUpload"])){
 | 
			
		||||
		if($core->FileSizeVerification($_FILES["fileToUpload"])){
 | 
			
		||||
			$newfilename = $core->FileNameConvertor($_FILES["fileToUpload"]);
 | 
			
		||||
			if($core->UploadFile($_FILES["fileToUpload"], $newfilename)){
 | 
			
		||||
				?>
 | 
			
		||||
				<div class="notification success">
 | 
			
		||||
					Success ! Your file is available here: <a href="<?= file_url_destination.'/'.file_destination.'/'.$newfilename; ?>"><?= file_url_destination.'/'.file_destination.'/'.$newfilename; ?></a>
 | 
			
		||||
				</div>
 | 
			
		||||
				<?php
 | 
			
		||||
			}else{
 | 
			
		||||
				?>
 | 
			
		||||
				<div class="notification error">
 | 
			
		||||
					An error occured while trying to upload your file
 | 
			
		||||
				</div>
 | 
			
		||||
				<?php
 | 
			
		||||
			}
 | 
			
		||||
		}else{
 | 
			
		||||
			?>
 | 
			
		||||
			<div class="notification error">
 | 
			
		||||
			Your File Is Too Big
 | 
			
		||||
			</div>
 | 
			
		||||
			<?php
 | 
			
		||||
		}
 | 
			
		||||
	}else{
 | 
			
		||||
		?>
 | 
			
		||||
		<div class="notification error">
 | 
			
		||||
			Incorrect File Format
 | 
			
		||||
		</div>
 | 
			
		||||
		<?php
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
?>
 | 
			
		||||
        <form method="post" action="#" enctype="multipart/form-data">
 | 
			
		||||
		  <input type="file" name="fileToUpload">
 | 
			
		||||
		  <p>Drag a file here or click to upload</p>
 | 
			
		||||
		  <button name="submit" type="submit">Upload</button>
 | 
			
		||||
		  <ul>
 | 
			
		||||
        		<li>Supported files: <?= FILELIST; ?></li> 
 | 
			
		||||
        	</ul>
 | 
			
		||||
        	<br>
 | 
			
		||||
        	<ul>
 | 
			
		||||
        	    <li>Maximum filesize: <?php echo sizeFormat($maxsize); ?></li>
 | 
			
		||||
        	</ul>
 | 
			
		||||
        	    <?php
 | 
			
		||||
                    // check if logged in
 | 
			
		||||
                    if (!isset($_SESSION["user"])) {
 | 
			
		||||
                    }else{
 | 
			
		||||
                    echo '
 | 
			
		||||
                    <br>
 | 
			
		||||
                    <ul>
 | 
			
		||||
                         <li><a href="admin/dashboard">Admin</a></li>
 | 
			
		||||
                    </ul>';
 | 
			
		||||
                    }
 | 
			
		||||
                    ?>
 | 
			
		||||
        </form>
 | 
			
		||||
    </div>
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
	<script src='https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script>
 | 
			
		||||
    <script type="text/javascript">
 | 
			
		||||
$(document).ready(function(){
 | 
			
		||||
  $('form input').change(function () {
 | 
			
		||||
  	if(this.files.length == 0){}else{
 | 
			
		||||
    	$('form p').text("File selected: "+this.files[0].name);
 | 
			
		||||
	}
 | 
			
		||||
  });
 | 
			
		||||
});
 | 
			
		||||
    </script>
 | 
			
		||||
</body>
 | 
			
		||||
</html>
 | 
			
		||||
@ -0,0 +1,433 @@
 | 
			
		||||
<?php
 | 
			
		||||
// Get server url
 | 
			
		||||
$url = 'https://' . $_SERVER['HTTP_HOST'];
 | 
			
		||||
// Output messages
 | 
			
		||||
$response = '';
 | 
			
		||||
 | 
			
		||||
/* Install function */
 | 
			
		||||
function install($config_file = 'system/config.php') {
 | 
			
		||||
	$contents = '<?php' . PHP_EOL;
 | 
			
		||||
	// Write new variables to files
 | 
			
		||||
	foreach ($_POST as $k => $v) {
 | 
			
		||||
		if ($k == 'code') continue;
 | 
			
		||||
        $v = in_array(strtolower($v), ['true', 'false']) || is_numeric($v) ? strtolower($v) : '\'' . $v . '\'';
 | 
			
		||||
        $contents .= 'define(\'' . $k . '\',' . $v . ');' . PHP_EOL;
 | 
			
		||||
    }
 | 
			
		||||
	$contents .= '?>';
 | 
			
		||||
	if (!file_put_contents($config_file, $contents)) {
 | 
			
		||||
		return FALSE;
 | 
			
		||||
	}
 | 
			
		||||
	return TRUE;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/*Verify Purchase Code function*/
 | 
			
		||||
function verify($code)
 | 
			
		||||
{
 | 
			
		||||
	
 | 
			
		||||
	/*If the submit form is success*/
 | 
			
		||||
	if(!empty($code)){
 | 
			
		||||
		
 | 
			
		||||
		/*add purchase code to the API link*/
 | 
			
		||||
		$purchase_code = $code;
 | 
			
		||||
		$url = "https://dl.supers0ft.us/anonuptest/api.php?code=".$purchase_code;
 | 
			
		||||
		$curl = curl_init($url);
 | 
			
		||||
		
 | 
			
		||||
		/*Set your personal token*/
 | 
			
		||||
		// $personal_token = "9COT6mduU2sZSMIlC09aYAQveaRdQ2H9";
 | 
			
		||||
		
 | 
			
		||||
		/*Correct header for the curl extension*/
 | 
			
		||||
		$header = array();
 | 
			
		||||
		$header[] = 'Authorization: Bearer '.$personal_token;
 | 
			
		||||
		$header[] = 'User-Agent: Purchase code verification';
 | 
			
		||||
		$header[] = 'timeout: 20';
 | 
			
		||||
		curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
 | 
			
		||||
		curl_setopt($curl, CURLOPT_HTTPHEADER,$header);
 | 
			
		||||
		
 | 
			
		||||
		/*Connect to the API, and get values from there*/
 | 
			
		||||
		$envatoCheck = curl_exec($curl);
 | 
			
		||||
		curl_close($curl);
 | 
			
		||||
		$envatoCheck = json_decode($envatoCheck);
 | 
			
		||||
		
 | 
			
		||||
		/*Variable request from the API*/
 | 
			
		||||
		$date = new DateTime(isset($envatoCheck->supported_until) ? $envatoCheck->supported_until : false);							
 | 
			
		||||
		$support_date = $date->format('Y-m-d H:i:s');
 | 
			
		||||
		$sold = new DateTime(isset($envatoCheck->sold_at) ? $envatoCheck->sold_at : false);
 | 
			
		||||
		$sold_at = $sold->format('Y-m-d H:i:s');
 | 
			
		||||
		$buyer = (isset( $envatoCheck->buyer) ? $envatoCheck->buyer : false);
 | 
			
		||||
		$license = (isset( $envatoCheck->license) ? $envatoCheck->license : false);
 | 
			
		||||
		$count = (isset( $envatoCheck->purchase_count) ? $envatoCheck->purchase_count : false);
 | 
			
		||||
		$support_amount = (isset( $envatoCheck->support_amount) ? $envatoCheck->support_amount : false);
 | 
			
		||||
		$item  = (isset( $envatoCheck->item->previews->landscape_preview->landscape_url ) ? $envatoCheck->item->previews->landscape_preview->landscape_url  : false);
 | 
			
		||||
 | 
			
		||||
		
 | 
			
		||||
		/*Check for Special Characters*/
 | 
			
		||||
		if (preg_match('/[\'^£$%&*()}{@#~?><>,|=_+¬]/', $code)){
 | 
			
		||||
		   	return 'Not allowed to use special characters!';	
 | 
			
		||||
		}
 | 
			
		||||
		
 | 
			
		||||
		/*Check for Empty Spaces*/
 | 
			
		||||
		if(!isset($code) || trim($code) == ''){
 | 
			
		||||
			return 'You need to fill up the input area!';	
 | 
			
		||||
		}
 | 
			
		||||
		
 | 
			
		||||
		/*If Purchase code exists, But Purchase ended*/
 | 
			
		||||
		if (isset($envatoCheck->item->name) && (date('Y-m-d H:i:s') >= $support_date)){   
 | 
			
		||||
			return "
 | 
			
		||||
				<div class='alert alert-danger' role='alert'>
 | 
			
		||||
					<h3>{$envatoCheck->item->name}</h3>										
 | 
			
		||||
					<div class='row'>
 | 
			
		||||
						<div class='center-box'>
 | 
			
		||||
							<div class='col-md-6'>
 | 
			
		||||
								<img src='{$item}' class='img-responsive' />
 | 
			
		||||
							</div>
 | 
			
		||||
							<div class='col-md-6'>
 | 
			
		||||
								<table class='table table-striped'>
 | 
			
		||||
								<thead>
 | 
			
		||||
									<tbody>
 | 
			
		||||
									<tr>
 | 
			
		||||
										<td><b>CLIENT:</b></td>													
 | 
			
		||||
										<td>{$buyer}</td>
 | 
			
		||||
									</tr>
 | 
			
		||||
									<tr>
 | 
			
		||||
										<td><b>SOLD AT:</b></td>
 | 
			
		||||
										<td> {$sold_at}</td>
 | 
			
		||||
									</tr>
 | 
			
		||||
									<tr>
 | 
			
		||||
										<td><b>SUPPORT UNTIL:</b></td>
 | 
			
		||||
										<td> {$support_date}</td>
 | 
			
		||||
									</tr>
 | 
			
		||||
									<tr>
 | 
			
		||||
										<td><b>LICENSE:</b></td>
 | 
			
		||||
										<td> {$license}</td>
 | 
			
		||||
									</tr>
 | 
			
		||||
									<tr>
 | 
			
		||||
										<td><b>COUNT:</b></td>
 | 
			
		||||
										<td> {$count}</td>
 | 
			
		||||
									</tr>
 | 
			
		||||
									<tr>
 | 
			
		||||
										<td><b>SUPPORT EXTENSION:</b></td>
 | 
			
		||||
										<td> {$support_amount}</td>
 | 
			
		||||
									</tr>
 | 
			
		||||
								</tbody>
 | 
			
		||||
							  </table>  													
 | 
			
		||||
							</div>
 | 
			
		||||
						</div>
 | 
			
		||||
					</div>
 | 
			
		||||
				</div>
 | 
			
		||||
			";
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		/*If Purchase code exists, display client information*/
 | 
			
		||||
		if (isset($envatoCheck->item->name) && (date('Y-m-d H:i:s') < $support_date)){    
 | 
			
		||||
			if (!install()) {
 | 
			
		||||
				return '<h3>Error!</h3><p>Could not write to file! Please check permissions and try again!</a>';
 | 
			
		||||
			}
 | 
			
		||||
			return "
 | 
			
		||||
				<div class='alert alert-success' role='alert'>
 | 
			
		||||
					<h3>{$envatoCheck->item->name}</h3>										
 | 
			
		||||
					<div class='row'>
 | 
			
		||||
						<div class='center-box'>
 | 
			
		||||
							<div class='col-md-6'>
 | 
			
		||||
								<img src='{$item}' class='img-responsive' />
 | 
			
		||||
							</div>
 | 
			
		||||
							<div class='col-md-6'>
 | 
			
		||||
								<table class='table table-striped'>
 | 
			
		||||
								<thead>
 | 
			
		||||
									<tbody>
 | 
			
		||||
									<tr>
 | 
			
		||||
										<td><b>CLIENT:</b></td>													
 | 
			
		||||
										<td>{$buyer}</td>
 | 
			
		||||
									</tr>
 | 
			
		||||
									<tr>
 | 
			
		||||
										<td><b>SOLD AT:</b></td>
 | 
			
		||||
										<td> {$sold_at}</td>
 | 
			
		||||
									</tr>
 | 
			
		||||
									<tr>
 | 
			
		||||
										<td><b>SUPPORT UNTIL:</b></td>
 | 
			
		||||
										<td> {$support_date}</td>
 | 
			
		||||
									</tr>
 | 
			
		||||
									<tr>
 | 
			
		||||
										<td><b>LICENSE:</b></td>
 | 
			
		||||
										<td> {$license}</td>
 | 
			
		||||
									</tr>
 | 
			
		||||
									<tr>
 | 
			
		||||
										<td><b>COUNT:</b></td>
 | 
			
		||||
										<td> {$count}</td>
 | 
			
		||||
									</tr>
 | 
			
		||||
									<tr>
 | 
			
		||||
										<td><b>SUPPORT EXTENSION:</b></td>
 | 
			
		||||
										<td> {$support_amount}</td>
 | 
			
		||||
									</tr>
 | 
			
		||||
								</tbody>
 | 
			
		||||
							  </table>  													
 | 
			
		||||
							</div>
 | 
			
		||||
						</div>
 | 
			
		||||
					</div>
 | 
			
		||||
				</div> 
 | 
			
		||||
			";
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		/*If Purchase Code doesn't exist, no information will be displayed*/
 | 
			
		||||
		if (!isset($envatoCheck->item->name)){ 											
 | 
			
		||||
			return " 
 | 
			
		||||
				<div class='alert alert-danger' role='alert'>
 | 
			
		||||
					<h3>INVALID PURCHASE CODE.</h3>
 | 
			
		||||
					<div class='row'>
 | 
			
		||||
						<div class='center-box'>
 | 
			
		||||
							<div class='col-md-6'>
 | 
			
		||||
								<img src='img/profile.png' class='img-responsive' />
 | 
			
		||||
							</div>
 | 
			
		||||
							<div class='col-md-6'>
 | 
			
		||||
								<table class='table table-striped'>
 | 
			
		||||
								<thead>
 | 
			
		||||
									<tbody>
 | 
			
		||||
									<tr>
 | 
			
		||||
										<td><b>CLIENT:</b></td>													
 | 
			
		||||
										<td> NOT VERIFIED</td>
 | 
			
		||||
									</tr>
 | 
			
		||||
									<tr>
 | 
			
		||||
										<td><b>SOLD AT:</b></td>
 | 
			
		||||
										<td> NONE</td>
 | 
			
		||||
									</tr>
 | 
			
		||||
									<tr>
 | 
			
		||||
										<td><b>SUPPORT UNTIL:</b></td>
 | 
			
		||||
										<td> NONE</td>
 | 
			
		||||
									</tr>
 | 
			
		||||
									<tr>
 | 
			
		||||
										<td><b>LICENSE:</b></td>
 | 
			
		||||
										<td> NONE</td>
 | 
			
		||||
									</tr>
 | 
			
		||||
									<tr>
 | 
			
		||||
										<td><b>COUNT:</b></td>
 | 
			
		||||
										<td> NONE</td>
 | 
			
		||||
									</tr>
 | 
			
		||||
									<tr>
 | 
			
		||||
										<td><b>SUPPORT EXTENSION:</b></td>
 | 
			
		||||
										<td> NONE</td>
 | 
			
		||||
									</tr>
 | 
			
		||||
								</tbody>
 | 
			
		||||
							  </table>  													
 | 
			
		||||
							</div>
 | 
			
		||||
						</div>
 | 
			
		||||
					</div>
 | 
			
		||||
				</div>
 | 
			
		||||
			";
 | 
			
		||||
		} 
 | 
			
		||||
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
if ($_POST) {
 | 
			
		||||
    if (isset($_POST['code'])) {
 | 
			
		||||
		// Validate code
 | 
			
		||||
		$response = verify($_POST['code']);
 | 
			
		||||
	} else {
 | 
			
		||||
		// No code specified
 | 
			
		||||
		$response = '<h3>Error!</h3><p>Please enter your Envato code!</p>';
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
?>
 | 
			
		||||
<!DOCTYPE html>
 | 
			
		||||
<html lang="en">
 | 
			
		||||
	<head>
 | 
			
		||||
		<meta charset="utf-8">
 | 
			
		||||
		<meta name="viewport" content="width=device-width,minimum-scale=1">
 | 
			
		||||
		<title>Installer</title>
 | 
			
		||||
		<link rel="stylesheet" href="https://use.fontawesome.com/releases/v6.0.0/css/all.css">
 | 
			
		||||
		<link rel="stylesheet" href="style.css">
 | 
			
		||||
	</head>
 | 
			
		||||
	<body>
 | 
			
		||||
		<form class="installer-form" method="post" action="">
 | 
			
		||||
			
 | 
			
		||||
			<h1><i class="fa-solid fa-box-open"></i>Installer</h1>
 | 
			
		||||
 | 
			
		||||
			<div class="steps">
 | 
			
		||||
				<div class="step current"></div>
 | 
			
		||||
				<div class="step"></div>
 | 
			
		||||
				<div class="step"></div>
 | 
			
		||||
				<div class="step"></div>
 | 
			
		||||
				<div class="step"></div>
 | 
			
		||||
			</div>
 | 
			
		||||
 | 
			
		||||
			<div class="step-content current" data-step="1">
 | 
			
		||||
				<div class="fields">
 | 
			
		||||
 | 
			
		||||
					<label for="email">Admin Email</label>
 | 
			
		||||
					<div class="field">
 | 
			
		||||
						<i class="fas fa-envelope"></i>
 | 
			
		||||
						<input id="email" type="email" name="email" placeholder="Your Email Address" required>
 | 
			
		||||
					</div>
 | 
			
		||||
 | 
			
		||||
					<label for="password">Password</label>
 | 
			
		||||
					<div class="field">
 | 
			
		||||
						<i class="fas fa-lock"></i>
 | 
			
		||||
						<input id="password" type="password" name="password" placeholder="Password" minlength="8" required>
 | 
			
		||||
					</div>
 | 
			
		||||
 | 
			
		||||
					<label for="app_name">App Name</label>
 | 
			
		||||
					<div class="field">
 | 
			
		||||
						<input id="app_name" type="text" name="app_name" placeholder="App Name" required>
 | 
			
		||||
					</div>
 | 
			
		||||
 | 
			
		||||
					<label for="app_desc">App Description</label>
 | 
			
		||||
					<div class="field">
 | 
			
		||||
						<input id="app_desc" type="text" name="app_desc" placeholder="App Description" required>
 | 
			
		||||
					</div>
 | 
			
		||||
 | 
			
		||||
				</div>
 | 
			
		||||
				<div class="buttons">
 | 
			
		||||
					<a href="#" class="btn" data-set-step="2">Next</a>
 | 
			
		||||
				</div>
 | 
			
		||||
			</div>
 | 
			
		||||
 | 
			
		||||
			<div class="step-content" data-step="2">
 | 
			
		||||
				<div class="fields">
 | 
			
		||||
 | 
			
		||||
					<label for="FILELIST">File List</label>
 | 
			
		||||
					<div class="field">
 | 
			
		||||
						<input id="FILELIST" type="text" name="FILELIST" placeholder="Comma-seperated list of supported files" required value="jpeg,jpg,gif,png,zip,xls,doc,mp3,mp4,mpeg,wav,avi,rar,7z,txt">
 | 
			
		||||
					</div>
 | 
			
		||||
 | 
			
		||||
					<p>Options</p>
 | 
			
		||||
					<div class="group">
 | 
			
		||||
						<label for="size_verification">
 | 
			
		||||
							<input type="checkbox" name="size_verification" id="size_verification">
 | 
			
		||||
							Size Verification
 | 
			
		||||
						</label>
 | 
			
		||||
					</div>
 | 
			
		||||
 | 
			
		||||
					<!-- file destination - do not change or script won't work -->
 | 
			
		||||
					<div class="field">
 | 
			
		||||
						<input id="file_destination" type="hidden" name="file_destination" placeholder="File Destination" value="files"readonly required>
 | 
			
		||||
					</div>
 | 
			
		||||
 | 
			
		||||
					<label for="file_destination">Site URL</label>
 | 
			
		||||
					<div class="field">
 | 
			
		||||
						<input id="file_destination" type="text" name="file_url_destination" placeholder="https://example.com/anonupload" value="<?php echo $url; ?>" required>
 | 
			
		||||
					</div>
 | 
			
		||||
 | 
			
		||||
				</div>
 | 
			
		||||
				<div class="buttons">
 | 
			
		||||
					<a href="#" class="btn" data-set-step="1">Prev</a>
 | 
			
		||||
					<a href="#" class="btn" data-set-step="3">Next</a>
 | 
			
		||||
				</div>
 | 
			
		||||
			</div>
 | 
			
		||||
 | 
			
		||||
			<div class="step-content" data-step="3">
 | 
			
		||||
				<div class="fields">
 | 
			
		||||
 | 
			
		||||
					<label for="max_size">Maximum Size In Bytes</label>
 | 
			
		||||
					<div class="field">
 | 
			
		||||
						<input id="max_size" type="number" name="max_size" placeholder="Maximum Size" required>
 | 
			
		||||
					</div>
 | 
			
		||||
 | 
			
		||||
					<label for="min_size">Minimum Size In Bytes</label>
 | 
			
		||||
					<div class="field">
 | 
			
		||||
						<input id="min_size" type="number" name="min_size" placeholder="Minimum Size" required>
 | 
			
		||||
					</div>
 | 
			
		||||
 | 
			
		||||
					<!-- OTHER FORM ELEMENTS
 | 
			
		||||
					<p>Features</p>
 | 
			
		||||
					<div class="group">
 | 
			
		||||
						<label for="feature1">
 | 
			
		||||
							<input type="checkbox" name="feature1" id="feature1">
 | 
			
		||||
							Enable Feature 1
 | 
			
		||||
						</label>
 | 
			
		||||
						<label for="feature2">
 | 
			
		||||
							<input type="checkbox" name="feature2" id="feature2">
 | 
			
		||||
							Enable Feature 2
 | 
			
		||||
						</label>
 | 
			
		||||
						<label for="feature3">
 | 
			
		||||
							<input type="checkbox" name="feature3" id="feature3">
 | 
			
		||||
							Enable Feature 3
 | 
			
		||||
						</label>		
 | 
			
		||||
					</div>
 | 
			
		||||
 | 
			
		||||
					<p>Account Permissions</p>
 | 
			
		||||
					<div class="group">
 | 
			
		||||
						<label for="radio6">
 | 
			
		||||
							<input type="radio" name="account_permissions" id="radio6" value="full">
 | 
			
		||||
							Full
 | 
			
		||||
						</label>
 | 
			
		||||
						<label for="radio7">
 | 
			
		||||
							<input type="radio" name="account_permissions" id="radio7" value="strict">
 | 
			
		||||
							Strict
 | 
			
		||||
						</label>		
 | 
			
		||||
					</div>
 | 
			
		||||
 | 
			
		||||
					<p>Maximum number of accounts</p>
 | 
			
		||||
					<div class="rating">
 | 
			
		||||
						<input type="radio" name="maximum_accounts" id="radio1" value="5">
 | 
			
		||||
						<label for="radio1">5</label>
 | 
			
		||||
						<input type="radio" name="maximum_accounts" id="radio2" value="10">
 | 
			
		||||
						<label for="radio2">10</label>
 | 
			
		||||
						<input type="radio" name="maximum_accounts" id="radio3" value="20">
 | 
			
		||||
						<label for="radio3">20</label>
 | 
			
		||||
						<input type="radio" name="maximum_accounts" id="radio4" value="50">
 | 
			
		||||
						<label for="radio4">50</label>
 | 
			
		||||
						<input type="radio" name="maximum_accounts" id="radio5" value="80">
 | 
			
		||||
						<label for="radio5">80</label>
 | 
			
		||||
					</div>
 | 
			
		||||
					-->
 | 
			
		||||
 | 
			
		||||
				</div>
 | 
			
		||||
				<div class="buttons">
 | 
			
		||||
					<a href="#" class="btn alt" data-set-step="2">Prev</a>
 | 
			
		||||
					<a href="#" class="btn" data-set-step="4">Next</a>
 | 
			
		||||
				</div>
 | 
			
		||||
			</div>
 | 
			
		||||
 | 
			
		||||
			<div class="step-content" data-step="4">
 | 
			
		||||
				<div class="fields">
 | 
			
		||||
					<label for="code">Envato Code</label>
 | 
			
		||||
					<div class="field">
 | 
			
		||||
						<i class="fa-solid fa-key"></i>
 | 
			
		||||
						<input id="code" type="text" name="code" placeholder="Your Purchase Code" required>
 | 
			
		||||
					</div>
 | 
			
		||||
				</div>
 | 
			
		||||
				<div class="buttons">
 | 
			
		||||
					<a href="#" class="btn alt" data-set-step="3">Prev</a>
 | 
			
		||||
					<input type="submit" class="btn" value="Submit">
 | 
			
		||||
				</div>
 | 
			
		||||
			</div>
 | 
			
		||||
 | 
			
		||||
			<div class="step-content" data-step="5">
 | 
			
		||||
				<div class="result"><?=$response?></div>
 | 
			
		||||
			</div>
 | 
			
		||||
 | 
			
		||||
		</form>
 | 
			
		||||
 | 
			
		||||
		<script>
 | 
			
		||||
		document.querySelectorAll("input[type='checkbox']").forEach(checkbox => {
 | 
			
		||||
			checkbox.onclick = () => checkbox.value = checkbox.checked ? 'true' : 'false';
 | 
			
		||||
		});
 | 
			
		||||
		const setStep = step => {
 | 
			
		||||
			document.querySelectorAll(".step-content").forEach(element => element.style.display = "none");
 | 
			
		||||
			document.querySelector("[data-step='" + step + "']").style.display = "block";
 | 
			
		||||
			document.querySelectorAll(".steps .step").forEach((element, index) => {
 | 
			
		||||
				index < step-1 ? element.classList.add("complete") : element.classList.remove("complete");
 | 
			
		||||
				index == step-1 ? element.classList.add("current") : element.classList.remove("current");
 | 
			
		||||
			});
 | 
			
		||||
		};
 | 
			
		||||
		document.querySelectorAll("[data-set-step]").forEach(element => {
 | 
			
		||||
			element.onclick = event => {
 | 
			
		||||
				event.preventDefault();
 | 
			
		||||
				let canContinue = true;
 | 
			
		||||
				document.querySelectorAll('input').forEach(element => {
 | 
			
		||||
					if (!element.checkValidity() && element.offsetWidth !== 0 && element.offsetHeight !== 0) {
 | 
			
		||||
						canContinue = false;
 | 
			
		||||
						element.reportValidity();
 | 
			
		||||
					}
 | 
			
		||||
				});
 | 
			
		||||
				if (canContinue) {
 | 
			
		||||
					setStep(parseInt(element.dataset.setStep));
 | 
			
		||||
				}
 | 
			
		||||
			};
 | 
			
		||||
		});
 | 
			
		||||
		<?php if (!empty($_POST)): ?>
 | 
			
		||||
		setStep(5);
 | 
			
		||||
		<?php endif; ?>
 | 
			
		||||
		</script>
 | 
			
		||||
 | 
			
		||||
	</body>
 | 
			
		||||
</html>
 | 
			
		||||
@ -0,0 +1,110 @@
 | 
			
		||||
<?php
 | 
			
		||||
$LOGIN_INFORMATION = array(
 | 
			
		||||
'user' => 'userpass',
 | 
			
		||||
'admin' => 'adminpass'
 | 
			
		||||
);
 | 
			
		||||
define('USE_USERNAME', true);
 | 
			
		||||
define('LOGOUT_URL', 'https://dl.supers0ft.us/logout.php/');
 | 
			
		||||
define('TIMEOUT_MINUTES', 0);
 | 
			
		||||
define('TIMEOUT_CHECK_ACTIVITY', true);
 | 
			
		||||
if(isset($_GET['help'])) {
 | 
			
		||||
die('Include following code into every page you would like to protect, at the very beginning (first line):<br><?php include("' . str_replace('\\','\\\\',__FILE__) . '"); ?>');
 | 
			
		||||
}
 | 
			
		||||
$timeout = (TIMEOUT_MINUTES == 0 ? 0 : time() + TIMEOUT_MINUTES * 60);
 | 
			
		||||
if(isset($_GET['logout'])) {
 | 
			
		||||
setcookie("verify", '', $timeout, '/');
 | 
			
		||||
header('Location: ' . LOGOUT_URL);
 | 
			
		||||
exit();
 | 
			
		||||
}
 | 
			
		||||
if(!function_exists('showLoginPasswordProtect')) {
 | 
			
		||||
function showLoginPasswordProtect($error_msg) {
 | 
			
		||||
?>
 | 
			
		||||
<!DOCTYPE html>
 | 
			
		||||
<html>
 | 
			
		||||
<head>
 | 
			
		||||
<title>Admin Panel - Login</title>
 | 
			
		||||
<meta charset="utf-8" />
 | 
			
		||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
 | 
			
		||||
<meta name="description" content="Admin Panel - Dashboard">
 | 
			
		||||
<meta name="author" content="Supernova Software">
 | 
			
		||||
<meta name="viewport" content="width=device-width, initial-scale=1">
 | 
			
		||||
<link rel="apple-touch-icon" sizes="57x57" href="img/apple-icon-57x57.png">
 | 
			
		||||
<link rel="apple-touch-icon" sizes="60x60" href="img/apple-icon-60x60.png">
 | 
			
		||||
<link rel="apple-touch-icon" sizes="72x72" href="img/apple-icon-72x72.png">
 | 
			
		||||
<link rel="apple-touch-icon" sizes="76x76" href="img/apple-icon-76x76.png">
 | 
			
		||||
<link rel="apple-touch-icon" sizes="114x114" href="img/apple-icon-114x114.png">
 | 
			
		||||
<link rel="apple-touch-icon" sizes="120x120" href="img/apple-icon-120x120.png">
 | 
			
		||||
<link rel="apple-touch-icon" sizes="144x144" href="img/apple-icon-144x144.png">
 | 
			
		||||
<link rel="apple-touch-icon" sizes="152x152" href="img/apple-icon-152x152.png">
 | 
			
		||||
<link rel="apple-touch-icon" sizes="180x180" href="img/apple-icon-180x180.png">
 | 
			
		||||
<link rel="icon" type="image/png" sizes="192x192"  href="img/android-icon-192x192.png">
 | 
			
		||||
<link rel="icon" type="image/png" sizes="32x32" href="img/favicon-32x32.png">
 | 
			
		||||
<link rel="icon" type="image/png" sizes="96x96" href="img/favicon-96x96.png">
 | 
			
		||||
<link rel="icon" type="image/png" sizes="16x16" href="img/favicon-16x16.png">
 | 
			
		||||
<link rel="manifest" href="img/manifest.json">
 | 
			
		||||
<meta name="msapplication-TileColor" content="#ffffff">
 | 
			
		||||
<meta name="msapplication-TileImage" content="img/ms-icon-144x144.png">
 | 
			
		||||
<meta name="theme-color" content="#ffffff">
 | 
			
		||||
<link rel="stylesheet" type="text/css" media="screen" href="assets/login.css" />
 | 
			
		||||
<link href="https://fonts.googleapis.com/css2?family=Nunito:wght@300;700&display=swap" rel="stylesheet">
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
<div class="boxmain">
 | 
			
		||||
<div class="boxone">
 | 
			
		||||
<p><b>Admin Login</b></p></div>
 | 
			
		||||
<style>
 | 
			
		||||
input { border: 1px solid black; }
 | 
			
		||||
</style>
 | 
			
		||||
<div style="width:500px; margin-left:auto; margin-right:auto; text-align:center">
 | 
			
		||||
<form method="post">
 | 
			
		||||
<div class="boxinvite">
 | 
			
		||||
<p><b> Administration Panel</b></p></div>
 | 
			
		||||
<div class="errmessage">
 | 
			
		||||
<font color="#2f80ed"><?php echo $error_msg; ?></font></div>
 | 
			
		||||
<?php if (USE_USERNAME) echo '<span class="login"></span><br /><input type="input" placeholder="Username" name="access_login" /><br /><span class="pass"></span><br />'; ?>
 | 
			
		||||
<input type="password" placeholder="Password" name="access_password" /><p></p>
 | 
			
		||||
<div class="buttonlogin"><input type="submit" name="join" value="🔒" /></div>
 | 
			
		||||
</form>
 | 
			
		||||
 | 
			
		||||
<!--End HTML, PHP and JavaScript.-->
 | 
			
		||||
 | 
			
		||||
<!--Login query.-->
 | 
			
		||||
<?php
 | 
			
		||||
die();
 | 
			
		||||
}
 | 
			
		||||
}
 | 
			
		||||
if (isset($_POST['access_password'])) {
 | 
			
		||||
$login = isset($_POST['access_login']) ? $_POST['access_login'] : '';
 | 
			
		||||
$pass = $_POST['access_password'];
 | 
			
		||||
if (!USE_USERNAME && !in_array($pass, $LOGIN_INFORMATION)
 | 
			
		||||
|| (USE_USERNAME && ( !array_key_exists($login, $LOGIN_INFORMATION) || $LOGIN_INFORMATION[$login] != $pass ) ) 
 | 
			
		||||
) {
 | 
			
		||||
showLoginPasswordProtect("Incorrect data.");
 | 
			
		||||
}
 | 
			
		||||
else {
 | 
			
		||||
setcookie("auth", md5($login.'%'.$pass), $timeout, '/');
 | 
			
		||||
unset($_POST['access_login']);
 | 
			
		||||
unset($_POST['access_password']);
 | 
			
		||||
unset($_POST['Submit']);
 | 
			
		||||
}
 | 
			
		||||
}
 | 
			
		||||
else {
 | 
			
		||||
if (!isset($_COOKIE['auth'])) {
 | 
			
		||||
showLoginPasswordProtect("");
 | 
			
		||||
}
 | 
			
		||||
$found = false;
 | 
			
		||||
foreach($LOGIN_INFORMATION as $key=>$val) {
 | 
			
		||||
$lp = (USE_USERNAME ? $key : '') .'%'.$val;
 | 
			
		||||
if ($_COOKIE['auth'] == md5($lp)) {
 | 
			
		||||
$found = true;
 | 
			
		||||
if (TIMEOUT_CHECK_ACTIVITY) {
 | 
			
		||||
setcookie("auth", md5($lp), $timeout, '/');
 | 
			
		||||
}
 | 
			
		||||
break;
 | 
			
		||||
}
 | 
			
		||||
}
 | 
			
		||||
if (!$found) {
 | 
			
		||||
showLoginPasswordProtect("");
 | 
			
		||||
}
 | 
			
		||||
}
 | 
			
		||||
?>
 | 
			
		||||
@ -0,0 +1,311 @@
 | 
			
		||||
html, body, div, input, span, a, select, textarea, option, h1, h2, h3, h4, main, aside, article, section, header, p, footer, nav, pre {
 | 
			
		||||
    box-sizing: border-box;
 | 
			
		||||
    font-family: Tahoma, Geneva, sans-serif;
 | 
			
		||||
}
 | 
			
		||||
html {
 | 
			
		||||
    background: #f8f9f9 linear-gradient(0deg, #f8f9f9 0%, #f8f9f9 80%, #51b47c 80%, #51b47c 100%) no-repeat;
 | 
			
		||||
    padding: 30px;
 | 
			
		||||
    height: 100%;
 | 
			
		||||
}
 | 
			
		||||
input,textarea,select {
 | 
			
		||||
    outline: 0;
 | 
			
		||||
}
 | 
			
		||||
h1 {
 | 
			
		||||
    margin: 0;
 | 
			
		||||
    padding: 35px 25px 25px 25px;
 | 
			
		||||
    font-size: 20px;
 | 
			
		||||
    color: #6a737f;
 | 
			
		||||
    font-weight: 600;
 | 
			
		||||
}
 | 
			
		||||
h1 i {
 | 
			
		||||
    padding-right: 10px;
 | 
			
		||||
    font-size: 24px;
 | 
			
		||||
}
 | 
			
		||||
.installer-form {
 | 
			
		||||
    background-color: #fff;
 | 
			
		||||
    width: 500px;
 | 
			
		||||
    margin: 0 auto;
 | 
			
		||||
    box-shadow: 0px 0px 5px 0px rgba(0,0,0,.2);
 | 
			
		||||
}
 | 
			
		||||
.installer-form .fields {
 | 
			
		||||
    position: relative;
 | 
			
		||||
    padding: 20px;
 | 
			
		||||
}
 | 
			
		||||
.installer-form select {
 | 
			
		||||
    appearance: none;
 | 
			
		||||
    background-image: linear-gradient(45deg, transparent 50%, #c7c9cb 50%), linear-gradient(135deg, #c7c9cb 50%, transparent 50%), linear-gradient(to right, #dfe0e0, #dfe0e0);
 | 
			
		||||
    background-position: calc(100% - 20px) 20px, calc(100% - 15px) 20px, calc(100% - 40px) 10px;
 | 
			
		||||
    background-size: 5px 5px, 5px 5px, 1px 25px;
 | 
			
		||||
    background-repeat: no-repeat;
 | 
			
		||||
}
 | 
			
		||||
.installer-form select option:first-child {
 | 
			
		||||
    display: none;
 | 
			
		||||
 }
 | 
			
		||||
.installer-form input[type="date"]::-webkit-calendar-picker-indicator {
 | 
			
		||||
    color: #ddd;
 | 
			
		||||
    filter: invert(0.8);
 | 
			
		||||
}
 | 
			
		||||
.installer-form input[type="text"], 
 | 
			
		||||
.installer-form input[type="password"], 
 | 
			
		||||
.installer-form input[type="email"],
 | 
			
		||||
.installer-form input[type="date"],
 | 
			
		||||
.installer-form input[type="tel"],
 | 
			
		||||
.installer-form select {
 | 
			
		||||
    display: flex;
 | 
			
		||||
    margin-top: 10px;
 | 
			
		||||
    padding: 15px;
 | 
			
		||||
    border: 1px solid #dfe0e0;
 | 
			
		||||
    width: 100%;
 | 
			
		||||
    flex-basis: 100%;
 | 
			
		||||
    height: 47px;
 | 
			
		||||
}
 | 
			
		||||
.installer-form input[type="text"]:focus, 
 | 
			
		||||
.installer-form input[type="email"]:focus,
 | 
			
		||||
.installer-form input[type="tel"]:focus,
 | 
			
		||||
.installer-form input[type="date"]:focus,
 | 
			
		||||
.installer-form select:focus {
 | 
			
		||||
    border: 1px solid #c6c7c7;
 | 
			
		||||
}
 | 
			
		||||
.installer-form input[type="text"]::placeholder, 
 | 
			
		||||
.installer-form input[type="email"]::placeholder, 
 | 
			
		||||
.installer-form input[type="tel"]::placeholder, 
 | 
			
		||||
.installer-form input[type="date"]:invalid, 
 | 
			
		||||
.installer-form textarea::placeholder,
 | 
			
		||||
.installer-form select:invalid {
 | 
			
		||||
    color: #858688;
 | 
			
		||||
}
 | 
			
		||||
.installer-form textarea {
 | 
			
		||||
    resize: none;
 | 
			
		||||
    margin-top: 15px;
 | 
			
		||||
    padding: 15px;
 | 
			
		||||
    border: 1px solid #dfe0e0;
 | 
			
		||||
    width: 100%;
 | 
			
		||||
    height: 150px;
 | 
			
		||||
}
 | 
			
		||||
.installer-form textarea:focus {
 | 
			
		||||
    border: 1px solid #c6c7c7;
 | 
			
		||||
}
 | 
			
		||||
.installer-form .buttons {
 | 
			
		||||
    padding: 20px;
 | 
			
		||||
    border-top: 1px solid #eceff2;
 | 
			
		||||
}
 | 
			
		||||
.installer-form .btn {
 | 
			
		||||
    display: inline-block;
 | 
			
		||||
    padding: 10px 20px;
 | 
			
		||||
    border: 0;
 | 
			
		||||
    background-color: #c9704c;
 | 
			
		||||
    font-weight: bold;
 | 
			
		||||
    color: #fff;
 | 
			
		||||
    cursor: pointer;
 | 
			
		||||
    border-radius: 25px;
 | 
			
		||||
    margin-right: 5px;
 | 
			
		||||
    text-decoration: none;
 | 
			
		||||
    font-size: 14px;
 | 
			
		||||
}
 | 
			
		||||
.installer-form .btn:hover {
 | 
			
		||||
    background-color: #c26c4a;
 | 
			
		||||
}
 | 
			
		||||
.installer-form .btn.alt {
 | 
			
		||||
    background-color: transparent;
 | 
			
		||||
    border: 1px solid #c9704c;
 | 
			
		||||
    color: #c9704c;
 | 
			
		||||
}
 | 
			
		||||
.installer-form .btn.alt:hover {
 | 
			
		||||
    border: 1px solid #c26c4a;
 | 
			
		||||
    color: #c26c4a;  
 | 
			
		||||
}
 | 
			
		||||
.installer-form input[name="email"] {
 | 
			
		||||
    position: relative;
 | 
			
		||||
    display: block;
 | 
			
		||||
}
 | 
			
		||||
.installer-form .field {
 | 
			
		||||
    display: inline-flex;
 | 
			
		||||
    position: relative;
 | 
			
		||||
    width: 100%;
 | 
			
		||||
    padding-bottom: 20px;
 | 
			
		||||
}
 | 
			
		||||
.installer-form label, .installer-form p {
 | 
			
		||||
    font-size: 14px;
 | 
			
		||||
    font-weight: 600;
 | 
			
		||||
    color: #8e939b;
 | 
			
		||||
}
 | 
			
		||||
.installer-form .field i {
 | 
			
		||||
    position: absolute;
 | 
			
		||||
    color: #dfe2e5;
 | 
			
		||||
    top: 25px;
 | 
			
		||||
    left: 15px;
 | 
			
		||||
    z-index: 10;
 | 
			
		||||
}
 | 
			
		||||
.installer-form .field i ~ input {
 | 
			
		||||
    padding-left: 45px !important;
 | 
			
		||||
}
 | 
			
		||||
.installer-form .responses {
 | 
			
		||||
    padding: 15px;
 | 
			
		||||
    margin: 0;
 | 
			
		||||
}
 | 
			
		||||
.installer-form .fields .wrapper {
 | 
			
		||||
    display: flex;
 | 
			
		||||
    justify-content: space-between;
 | 
			
		||||
}
 | 
			
		||||
.installer-form .fields .wrapper > div {
 | 
			
		||||
    width: 100%;
 | 
			
		||||
}
 | 
			
		||||
.installer-form .fields .wrapper .gap {
 | 
			
		||||
    width: 35px;
 | 
			
		||||
}
 | 
			
		||||
.installer-form .steps {
 | 
			
		||||
    position: relative;
 | 
			
		||||
    display: flex;
 | 
			
		||||
    justify-content: space-between;
 | 
			
		||||
    margin-top: 10px;
 | 
			
		||||
    width: calc(100% - 35px);
 | 
			
		||||
    align-self: center;
 | 
			
		||||
    margin: 0 auto;
 | 
			
		||||
}
 | 
			
		||||
.installer-form .steps::before {
 | 
			
		||||
    content: "";
 | 
			
		||||
    position: absolute;
 | 
			
		||||
    top: 0;
 | 
			
		||||
    left: 0;
 | 
			
		||||
    width: 100%;
 | 
			
		||||
    height: 4px;
 | 
			
		||||
    background-color: #f2f4f7;
 | 
			
		||||
    margin: auto 0;
 | 
			
		||||
    top: 0;
 | 
			
		||||
    bottom: 0;
 | 
			
		||||
    z-index: 0;
 | 
			
		||||
}
 | 
			
		||||
.installer-form .steps .step {
 | 
			
		||||
    width: 25px;
 | 
			
		||||
    height: 25px;
 | 
			
		||||
    background-color: #f2f4f7;
 | 
			
		||||
    border: 3px solid #f2f4f7;
 | 
			
		||||
    border-radius: 50px;
 | 
			
		||||
    
 | 
			
		||||
    z-index: 1;
 | 
			
		||||
}
 | 
			
		||||
.installer-form .steps .step.current {
 | 
			
		||||
    background-color: #8cc6f2;
 | 
			
		||||
}
 | 
			
		||||
.installer-form .steps .step.complete {
 | 
			
		||||
    background-color: #6ECBA4;
 | 
			
		||||
}
 | 
			
		||||
.installer-form .rating {
 | 
			
		||||
    display: flex;
 | 
			
		||||
    justify-content: space-between;
 | 
			
		||||
    padding: 5px 0;
 | 
			
		||||
}
 | 
			
		||||
.installer-form .rating input[type="radio"]:checked,
 | 
			
		||||
.installer-form .rating input[type="radio"]:not(:checked) {
 | 
			
		||||
    position: absolute;
 | 
			
		||||
    left: -9999px;
 | 
			
		||||
}
 | 
			
		||||
.installer-form .rating input[type="radio"]:checked + label,
 | 
			
		||||
.installer-form .rating input[type="radio"]:not(:checked) + label
 | 
			
		||||
{
 | 
			
		||||
    display: flex;
 | 
			
		||||
    position: relative;
 | 
			
		||||
    font-size: 14px;
 | 
			
		||||
    justify-content: center;
 | 
			
		||||
    align-items: center;
 | 
			
		||||
    width: 31px;
 | 
			
		||||
    height: 31px;
 | 
			
		||||
    cursor: pointer;
 | 
			
		||||
    color: #8e939b;
 | 
			
		||||
    z-index: 10;
 | 
			
		||||
}
 | 
			
		||||
.installer-form .rating input[type="radio"]:checked + label:before,
 | 
			
		||||
.installer-form .rating input[type="radio"]:not(:checked) + label:before {
 | 
			
		||||
    content: "";
 | 
			
		||||
    position: absolute;
 | 
			
		||||
    left: 0;
 | 
			
		||||
    top: 0;
 | 
			
		||||
    width: 30px;
 | 
			
		||||
    height: 30px;
 | 
			
		||||
    border: 1px solid #dfe0e0;
 | 
			
		||||
    border-radius: 100%;
 | 
			
		||||
    background: #fff;
 | 
			
		||||
    z-index: -1;
 | 
			
		||||
}
 | 
			
		||||
.installer-form .rating input[type="radio"]:checked + label:after,
 | 
			
		||||
.installer-form .rating input[type="radio"]:not(:checked) + label:after {
 | 
			
		||||
    content: "";
 | 
			
		||||
    position: absolute;
 | 
			
		||||
    top: 0;
 | 
			
		||||
    left: 0;
 | 
			
		||||
    width: 31px;
 | 
			
		||||
    height: 31px;
 | 
			
		||||
    border-radius: 100%;
 | 
			
		||||
    background: #c9704c;
 | 
			
		||||
    z-index: -1;
 | 
			
		||||
}
 | 
			
		||||
.installer-form .rating input[type="radio"]:not(:checked) + label:after {
 | 
			
		||||
    opacity: 0;
 | 
			
		||||
}
 | 
			
		||||
.installer-form .rating input[type="radio"]:checked + label {
 | 
			
		||||
    color: #fff;
 | 
			
		||||
}
 | 
			
		||||
.installer-form .rating input[type="radio"]:checked + label:after {
 | 
			
		||||
    opacity: 1;
 | 
			
		||||
}
 | 
			
		||||
.installer-form .rating-footer {
 | 
			
		||||
    display: flex;
 | 
			
		||||
    justify-content: space-between;
 | 
			
		||||
    font-size: 14px;
 | 
			
		||||
    color: #8e939b;
 | 
			
		||||
    padding: 15px 0 25px;      
 | 
			
		||||
}
 | 
			
		||||
.installer-form .group {
 | 
			
		||||
    display: flex;
 | 
			
		||||
    flex-flow: column;
 | 
			
		||||
    justify-content: center;
 | 
			
		||||
    padding-bottom: 15px;
 | 
			
		||||
}
 | 
			
		||||
.installer-form .group label {
 | 
			
		||||
    display: flex;
 | 
			
		||||
    font-weight: 500;
 | 
			
		||||
    height: 25px;
 | 
			
		||||
    align-items: center;
 | 
			
		||||
    padding-bottom: 5px;
 | 
			
		||||
}
 | 
			
		||||
.installer-form .group input[type="radio"],
 | 
			
		||||
.installer-form .group input[type="checkbox"] {
 | 
			
		||||
    appearance: none;
 | 
			
		||||
    display: inline-flex;
 | 
			
		||||
    cursor: pointer;
 | 
			
		||||
    width: 16px;
 | 
			
		||||
    height: 16px;
 | 
			
		||||
    padding: 2px;
 | 
			
		||||
    background-clip: content-box;
 | 
			
		||||
    border: 1px solid #dfe0e0;
 | 
			
		||||
    background-color: #eef1f1;
 | 
			
		||||
    border-radius: 50%;
 | 
			
		||||
    margin-right: 10px;
 | 
			
		||||
}
 | 
			
		||||
.installer-form .group input[type="radio"]:hover,
 | 
			
		||||
.installer-form .group input[type="checkbox"]:hover {
 | 
			
		||||
    border: 1px solid #d2d3d3;
 | 
			
		||||
}
 | 
			
		||||
.installer-form .group input[type="radio"]:checked,
 | 
			
		||||
.installer-form .group input[type="checkbox"]:checked {
 | 
			
		||||
    border: 1px solid #d2d3d3;
 | 
			
		||||
    background-color: #2996ed;
 | 
			
		||||
}
 | 
			
		||||
.installer-form .group input[type="checkbox"] {
 | 
			
		||||
    border-radius: 0;
 | 
			
		||||
}
 | 
			
		||||
.installer-form .step-content {
 | 
			
		||||
    display: none;
 | 
			
		||||
}
 | 
			
		||||
.installer-form .step-content.current {
 | 
			
		||||
    display: block;
 | 
			
		||||
}
 | 
			
		||||
.installer-form .result {
 | 
			
		||||
    padding: 25px;
 | 
			
		||||
}
 | 
			
		||||
.installer-form .result h3 {
 | 
			
		||||
    color: #6a737f;
 | 
			
		||||
}
 | 
			
		||||
.installer-form .result p {
 | 
			
		||||
    font-weight: 500;
 | 
			
		||||
}
 | 
			
		||||
					Loading…
					
					
				
		Reference in New Issue