Skip to content

Commit

Permalink
captcha in sendsms check when needed only fix ltb-project#720
Browse files Browse the repository at this point in the history
- revert to previous behavior of sendsms to place captcha check.
  - sendsms is called mutliple times during sms sending process
    one the first need captcha check.

- was a regression of ltb-project#680
  • Loading branch information
philhaworteks committed Sep 27, 2022
1 parent e022f79 commit 030168c
Showing 1 changed file with 9 additions and 12 deletions.
21 changes: 9 additions & 12 deletions htdocs/sendsms.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,7 @@
$sessiontoken = "";
$attempts = 0;

#==============================================================================
# Check captcha
#==============================================================================
if ($use_captcha) { $result = global_captcha_check();}

if (! ($result === "") ) {
# result was already set
# done this way to keep indentation
} elseif (!$crypt_tokens) {
if (!$crypt_tokens) {
$result = "crypttokensrequired";
} elseif (isset($_REQUEST["smstoken"]) and isset($_REQUEST["token"])) {
$token = strval($_REQUEST["token"]);
Expand Down Expand Up @@ -106,9 +98,15 @@
$result = "emptysendsmsform";
}

# Check the entered username for characters that our installation doesn't support
if ( $result === "" ) {
$result = check_username_validity($login,$login_forbidden_chars);
# Check captcha
if ($use_captcha) {
$result = global_captcha_check();
}
# Check the entered username for characters that our installation doesn't support
if ( $result === "" ) {
$result = check_username_validity($login,$login_forbidden_chars);
}
}

#==============================================================================
Expand Down Expand Up @@ -261,7 +259,6 @@
}
}
}

}

#==============================================================================
Expand Down

0 comments on commit 030168c

Please sign in to comment.