summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
9040d6a)
This allows us to show the logout button only if the user is authenticated by password
// Second check: Challenge by IP NO PASSWORD
elseif (true === jirafeau_challenge_upload_ip_without_password($cfg, get_ip_address($cfg))) {
jirafeau_user_session_start();
// Second check: Challenge by IP NO PASSWORD
elseif (true === jirafeau_challenge_upload_ip_without_password($cfg, get_ip_address($cfg))) {
jirafeau_user_session_start();
+ $_SESSION['user_auth_type'] = JIRAFEAU_USER_AUTH_BY_IP_NO_PASSWORD;
}
// Third check: Challenge by IP
elseif (true === jirafeau_challenge_upload_ip($cfg, get_ip_address($cfg))) {
}
// Third check: Challenge by IP
elseif (true === jirafeau_challenge_upload_ip($cfg, get_ip_address($cfg))) {
if (isset($_POST['upload_password'])) {
if (jirafeau_challenge_upload_password($cfg, $_POST['upload_password'])) {
jirafeau_user_session_start();
if (isset($_POST['upload_password'])) {
if (jirafeau_challenge_upload_password($cfg, $_POST['upload_password'])) {
jirafeau_user_session_start();
+ $_SESSION['user_auth_type'] = JIRAFEAU_USER_AUTH_BY_PASSWORD;
} else {
jirafeau_session_end();
jirafeau_fatal_error(t('BAD_PSW'), $cfg);
} else {
jirafeau_session_end();
jirafeau_fatal_error(t('BAD_PSW'), $cfg);
</div> </fieldset></form>
<?php
</div> </fieldset></form>
<?php
- if (jirafeau_user_session_logged()) {
+ if (jirafeau_user_session_logged() && $_SESSION['user_auth_type'] == JIRAFEAU_USER_AUTH_BY_PASSWORD) {
?>
<form method="post" class="form logout">
<input type = "hidden" name = "action" value = "logout"/>
?>
<form method="post" class="form logout">
<input type = "hidden" name = "action" value = "logout"/>
define('JIRAFEAU_QUARTER', 7776000); // JIRAFEAU_DAY * 90
define('JIRAFEAU_YEAR', 31536000); // JIRAFEAU_DAY * 365
define('JIRAFEAU_QUARTER', 7776000); // JIRAFEAU_DAY * 90
define('JIRAFEAU_YEAR', 31536000); // JIRAFEAU_DAY * 365
+define('JIRAFEAU_USER_AUTH_BY_IP_NO_PASSWORD', 1);
+define('JIRAFEAU_USER_AUTH_BY_PASSWORD', 2);
+
define('JIRAFEAU_SODIUM_CHUNKSIZE', 1024);
// Define some Sodium constants from newer PHP versions if they are not available
define('JIRAFEAU_SODIUM_CHUNKSIZE', 1024);
// Define some Sodium constants from newer PHP versions if they are not available