X-Git-Url: https://git.p6c8.net/jirafeau/jirafeau.git/blobdiff_plain/ea13ecd5272b130c028b76b91b2a05ea65fd565b..95228d17b576cb30af5c754b7a2c01ea0c86d891:/index.php diff --git a/index.php b/index.php index 435e059..29562ff 100644 --- a/index.php +++ b/index.php @@ -25,8 +25,13 @@ require(JIRAFEAU_ROOT . 'lib/settings.php'); require(JIRAFEAU_ROOT . 'lib/functions.php'); require(JIRAFEAU_ROOT . 'lib/lang.php'); -if ($cfg['download_password_requirement'] === "generated") { - $download_pass = jirafeau_gen_download_pass($cfg['download_password_gen_len'], $cfg['download_password_gen_chars']); +$download_pass = null; + +if ($cfg['download_password_requirement'] === 'generated') { + $download_pass = jirafeau_gen_download_pass( + $cfg['download_password_gen_len'], + $cfg['download_password_gen_chars'] + ); } check_errors($cfg); @@ -36,16 +41,18 @@ if (has_error()) { require(JIRAFEAU_ROOT . 'lib/template/footer.php'); exit; } + require(JIRAFEAU_ROOT . 'lib/template/header.php'); // Logout action -if (isset($_POST['action']) && (strcmp($_POST['action'], 'logout') == 0)) { +if (isset($_POST['action']) && strcmp($_POST['action'], 'logout') === 0) { jirafeau_session_end(); } /* Check if user is allowed to upload. */ // First check: Is user already logged if (jirafeau_user_session_logged()) { + // nothing to do here } // Second check: Challenge by IP NO PASSWORD elseif (true === jirafeau_challenge_upload_ip_without_password($cfg, get_ip_address($cfg))) { @@ -71,157 +78,164 @@ elseif (true === jirafeau_challenge_upload_ip($cfg, get_ip_address($cfg))) { if (!jirafeau_user_session_logged()) { ?>
- +- -
- - + + + +