"; if (!is_writable(dirname($examplefile))) die('We don\'t have access to write to the current directory, please change the permissions to this directory.'); else { copy($examplefile, $configfile); sleep(2); echo ""; echo ""; echo "Form submitted"; echo ""; echo ""; echo ""; } } try { $config = parse_ini_file('settings.ini.php', true); } catch(Exception $e) { die('Unable to read config.ini.php. Did you rename it from settings.ini.php-example?

Error message: ' .$e->getMessage()); } foreach ($config as $keyname => $section) { if(($keyname == "general")) { $hash_pass = $section["password"]; } } /*$salt = substr(str_replace('+','.',base64_encode(md5(mt_rand(), true))),0,16); $rounds = 10000; $given_hash = crypt($realpass, sprintf('$5$rounds=%d$%s$', $rounds, $salt)); */ $pass = isset( $_POST["pass"] ) ? $_POST["pass"] : "none" ; if(isset( $_POST["pass"] ) && $pass !== "none"){ $error = "Wrong Password!";} $parts = explode('$', $hash_pass); $test_hash = crypt($pass, sprintf('$%s$%s$%s$', $parts[1], $parts[2], $parts[3])); if(($hash_pass == $test_hash)){ setcookie("logged", "Dashboard", time() + (86400 * 7), "/"); //echo ""; echo ""; echo ""; echo "Form submitted"; echo ""; echo ""; echo ""; } if((!isset($_COOKIE["logged"]))){ echo "
Please Login to Contiune

"; echo $error . "
"; echo ""; echo "
"; echo "Password: "; echo ""; echo "
"; }else{ echo ""; echo ""; echo "Form submitted"; echo ""; echo ""; echo ""; } ?>