From: Mischa POSLAWSKY Date: Mon, 27 Nov 2017 23:38:16 +0000 (+0100) Subject: auth: support unhashed passwords X-Git-Tag: v2.5~15 X-Git-Url: http://git.shiar.net/minimedit.git/commitdiff_plain/0cc681d32bf51c485d54e49f50dd1d0f74b35974 auth: support unhashed passwords String comparison for anything not starting with dollar (which identifies all modern crypts) to keep originals for later resend (deliberate user friendliness over security). --- diff --git a/auth.inc.php b/auth.inc.php index b8026f9..94f0dcc 100644 --- a/auth.inc.php +++ b/auth.inc.php @@ -16,7 +16,12 @@ function login($inuser, $inpass = NULL) # verify password $authhash = md5($usertest); if (isset($inpass)) { - if (!password_verify($inpass, $usertest)) return; + if (substr($usertest, 0, 1) == '$') { + if (!password_verify($inpass, $usertest)) return; + } + else { + if ($inpass !== $usertest) return; + } } else { if ($inauth !== $authhash) return;