X-Git-Url: https://git.p6c8.net/jirafeau_mojo42.git/blobdiff_plain/bfbbf72959faa385b97d250484be1d25e4fd22aa..refs/heads/ldap:/index.php diff --git a/index.php b/index.php index f7aeb04..f60c37d 100644 --- a/index.php +++ b/index.php @@ -40,13 +40,60 @@ if (isset($_POST['action']) && (strcmp($_POST['action'], 'logout') == 0)) { } /* Check if user is allowed to upload. */ -// First check: Is user already logged -if (jirafeau_user_session_logged()) {} -// Second check: Challenge by IP NO PASSWORD +// check if user already logged +if (jirafeau_user_session_logged()) { +} +// check of ldap authentication +elseif (jirafeau_has_ldap_auth($cfg)) { + if (isset($_POST['ldap_user']) and isset($_POST['ldap_password'])) { + $result = jirafeau_challenge_ldap_auth($cfg, $_POST['ldap_user'], $_POST['ldap_password']); + if (true === $result) { + jirafeau_user_session_start(); + } else { + jirafeau_session_end(); + jirafeau_non_fatal_error(t('BAD_PSW')); + } + } + // Show login form if user session is not authorized yet + if (!jirafeau_user_session_logged()) { + ?> +
+ + ?> + } ?>@@ -164,22 +211,22 @@ elseif (true === jirafeau_challenge_upload_ip($cfg, get_ip_address($cfg))) {
0) { - echo t('2_BIG') . ', ' . t('FILE_LIM') . " " . $cfg['maximal_upload_size'] . " MB."; - } - ?>')"/> + if ($cfg['maximal_upload_size'] >= 1024) { + echo t('2_BIG') . ', ' . t('FILE_LIM') . " " . number_format($cfg['maximal_upload_size']/1024, 2) . " GB."; + } elseif ($cfg['maximal_upload_size'] > 0) { + echo t('2_BIG') . ', ' . t('FILE_LIM') . " " . $cfg['maximal_upload_size'] . " MB."; + } +?>')"/>
' . t('ONE_TIME_DL') . ': | '; - echo ''; - } - ?> + if ($cfg['one_time_download']) { + echo ' | ||
' . t('ONE_TIME_DL') . ': | '; + echo '|||
@@ -188,66 +235,66 @@ elseif (true === jirafeau_challenge_upload_ip($cfg, get_ip_address($cfg))) { |