<?php
require '../config/settings.php'; 

function err_404(){
	header('HTTP/1.0 404 Not Found');die('<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
				<html>
					<meta name="viewport" content="width=device-width, initial-scale=1.0">
					<head>
						<title>404 Not Found</title>
						</head>
					<body>
						<h1>Not Found..</h1>
						<p>The requested URL was not found on this server.</p><p>Check the url and make sure you\'re opening the right link.</p>
					</body>
				</html>');exit();}
				
if ($adminpanel != 1){err_404();};
if(!preg_match('/'.$adminfolder.'/',explode('?',$_SERVER['REQUEST_URI'])[0]) || strlen($adminfolder) < 5 || $adminfolder == 'admin'){err_404();};
if(!isset($_SESSION['ston']) && basename($_SERVER['PHP_SELF']) != 'index.php' && basename($_SERVER['PHP_SELF']) != 'prl.php'){header('location:./?');exit();};

?>