Zipping Open Files","10"), array("Clipboard","images/clipboard.png","","javascript:alert('Doesn\'t do anything yet but will be a clipboard for copied text items, up to 100 levels')","_self","") ); $accountPassword = ""; // --------------- // End of settings // --------------- // Function to handle salted hashing define('SALT_LENGTH',9); function generateHash($plainText,$salt=null) { if ($salt === null) { $salt = substr(md5(uniqid(rand(), true)),0,SALT_LENGTH); } else { $salt = substr($salt,0,SALT_LENGTH); } return $salt.sha1($salt.$plainText); } session_start(); // Establish our user level if (!isset($_SESSION['userLevel'])) {$_SESSION['userLevel'] = 0;}; if(isset($_POST['loginPassword']) && generateHash($_POST['loginPassword'],$accountPassword)==$accountPassword) {$_SESSION['userLevel'] = 10;}; $_SESSION['userLevel'] = $_SESSION['userLevel']; if (!isset($_SESSION['restrictedFiles'])) {$_SESSION['restrictedFiles'] = $restrictedFiles;} if (!isset($_SESSION['bannedFiles'])) {$_SESSION['bannedFiles'] = $bannedFiles;} // Establish our shortened URL, explode the path based on server type (Linux or Windows) if (strpos($_SERVER['DOCUMENT_ROOT'],"/")>-1) {$slashType = "/";} else {$slashType = "\\";}; $shortURLStarts = explode($slashType,$_SERVER['DOCUMENT_ROOT']); // Then clear item at the end if there is one, plus trailing slash // We end up with the directory name of the server root if ($shortURLStarts[count($shortURLStarts)-1]!="") {$trimArray=1;} else {$trimArray=2;} $shortURLStarts = $shortURLStarts[count($shortURLStarts)-$trimArray]; // If we're due to show the settings screen if ($accountPassword == "" && isset($_GET['settings'])) { ?>