Skip to content

Commit

Permalink
Fix indentation
Browse files Browse the repository at this point in the history
  • Loading branch information
bilde2910 committed May 24, 2024
1 parent 56e2163 commit 7dea87a
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions backend-php/include/inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -807,18 +807,18 @@ function authenticated() {
global $LANG;
if (!isset($_POST["usr"])) die($LANG["username_required"]);
requirePOST("pwd", "usr");
// Jump out if we cannot find the htpasswd file.
if (!file_exists(getConfig("htpasswd_path"))) die($LANG["cannot_find_password_file"]);
$file = fopen(getConfig("htpasswd_path"), "r");
$authed = false;
while (($line = fgets($file)) !== false && !$authed) {
$creds = explode(":", trim($line));
if ($creds[0] == $_POST["usr"]) {
$authed = password_verify($_POST["pwd"], $creds[1]);
}
}
fclose($file);
return $authed;
// Jump out if we cannot find the htpasswd file.
if (!file_exists(getConfig("htpasswd_path"))) die($LANG["cannot_find_password_file"]);
$file = fopen(getConfig("htpasswd_path"), "r");
$authed = false;
while (($line = fgets($file)) !== false && !$authed) {
$creds = explode(":", trim($line));
if ($creds[0] == $_POST["usr"]) {
$authed = password_verify($_POST["pwd"], $creds[1]);
}
}
fclose($file);
return $authed;

case LDAP:
// LDAP-based authentication.
Expand Down

0 comments on commit 7dea87a

Please sign in to comment.