X-Git-Url: https://git.p6c8.net/jirafeau_mojo42.git/blobdiff_plain/d8192d6d361c2d707bac679facce23c7167cb93b..6c49ea194c030a04ce8b303aae2a51dce01c7382:/script.php diff --git a/script.php b/script.php old mode 100755 new mode 100644 index 3185de7..d109d4a --- a/script.php +++ b/script.php @@ -263,7 +263,9 @@ if (has_error ()) if (isset ($_FILES['file']) && is_writable (VAR_FILES) && is_writable (VAR_LINKS)) { - if (strlen ($cfg['upload_password']) > 0 && (!isset ($_POST['upload_password']) || $_POST['upload_password'] != $cfg['upload_password'])) + if (jirafeau_has_upload_password ($cfg) && + (!isset ($_POST['upload_password']) || + !jirafeau_challenge_upload_password ($cfg, $_POST['upload_password']))) { echo "Error"; exit; @@ -529,7 +531,9 @@ fi /* Initialize an asynchronous upload. */ elseif (isset ($_GET['init_async'])) { - if (strlen ($cfg['upload_password']) > 0 && (!isset ($_POST['upload_password']) || $_POST['upload_password'] != $cfg['upload_password'])) + if (jirafeau_has_upload_password ($cfg) && + (!isset ($_POST['upload_password']) || + !jirafeau_challenge_upload_password ($cfg, $_POST['upload_password']))) { echo "Error"; exit; @@ -546,8 +550,8 @@ elseif (isset ($_GET['init_async'])) $type = $_POST['type']; $key = ''; - if (isset ($_POST['password'])) - $key = $_POST['password']; + if (isset ($_POST['key'])) + $key = $_POST['key']; $time = time (); if (!isset ($_POST['time'])) @@ -603,7 +607,9 @@ elseif (isset ($_GET['end_async'])) /* Initialize block. */ elseif (isset ($_GET['init_block']) && $cfg['enable_blocks']) { - if (strlen ($cfg['upload_password']) > 0 && (!isset ($_POST['upload_password']) || $_POST['upload_password'] != $cfg['upload_password'])) + if (jirafeau_has_upload_password ($cfg) && + (!isset ($_POST['upload_password']) || + !jirafeau_challenge_upload_password ($cfg, $_POST['upload_password']))) { echo "Error"; exit;