login/mailpass: case-insensitive match of requested address
authorMischa POSLAWSKY <perl@shiar.org>
Mon, 8 Mar 2021 18:10:26 +0000 (19:10 +0100)
committerMischa POSLAWSKY <perl@shiar.org>
Mon, 8 Mar 2021 18:10:26 +0000 (19:10 +0100)
login/form.inc.php
login/mailpass.inc.php

index 9a7c01503a4ba70bfc38ddd9fca2e61cb200be57..f2270927d163a65364c44a76b15d333caeeacf42 100644 (file)
@@ -20,7 +20,7 @@ is alleen toegankelijk voor leden.
 <p><a onclick="document.getElementById('mailpass').removeAttribute('hidden'); this.remove()">Wachtwoord vergeten?</a></p>
 <?php } ?>
 
-<form id="mailpass" action="/login/mailpass" method="post"<?php if (!isset($_POST['mail'])) { ?> hidden<?php } ?>>
+<form id="mailpass" action="" method="post"<?php if (!isset($_POST['mail'])) { ?> hidden<?php } ?>>
        <h3>Wachtwoord vergeten</h3>
        <p>Als er een e-mailadres was ingesteld kun je hieronder een verzoek indienen om opnieuw een wachtwoord in te stellen.</p>
        <input type="email" id="mail" name="mail" placeholder="E-mailadres" value="<?php
index 2b0c204915f20e7fe9f079734d098b73e724c81e..77314a4ccfa02f91e27f1ff3cd4c2cc37615222c 100644 (file)
@@ -1,9 +1,10 @@
 <?php
 function userbymail($email)
 {
+       $email = strtolower($email);
        foreach (glob("profile/*") as $useropt) {
                if ($mailopt = @file_get_contents("$useropt/email.txt")
-               and rtrim($mailopt) == $email) {
+               and strtolower(rtrim($mailopt)) == $email) {
                        return substr($useropt, strlen('profile/'));
                }
        }