开发者

Customize cPanel login with AdsCaptcha

开发者 https://www.devze.com 2023-03-30 10:44 出处:网络
I am trying to customize my cPanel login to require a captcha (AdsCaptcha to be exact.) The way I have it setup now is that the user sees the captcha first (in an iframe) and once they successfully

I am trying to customize my cPanel login to require a captcha (AdsCaptcha to be exact.)

The way I have it setup now is that the user sees the captcha first (in an iframe) and once they successfully answer it, it loads the login to cPanel (which works.)

This is the snippet that does that:

<?php
    } else {
        if (ValidateCaptcha($captchaId, $privateKey, $challengeValue, $responseValue, $remoteAddress) == "true")
        {
            require("loginframe.php");
            // Corrent answer, continue with your submission process
        } else {
            echo "Wrong";
            // Wrong answer, you may display a new AdsCaptcha and add an error message 
        }
    }       
    ?>

This validates and loads the login fields; loginframe.php:

    <p><br>

  <?php
if ($_GET['failed'] == "1") {
?>
  <font color=#FF0000>Your login attempt failed!</font>
  <?php
}
print "<form action='http://removed.com:2082' method=POST>";
?>
  Username: 
  <input type="text" name="user"><br>
  Password: 
  <input type="password" name="pass"><br>
  <?php
print "<input type=hidden name=failurl value=\"http://" .  $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF'] . "?failed=1\">";
?>
  <input type="hidden" name="login_theme" value="default">
  <input type="submit" value="Login">
  </form><br>
</p>

My problem is that it's just reloading to the captcha once you enter the login details. Any suggestions to开发者_StackOverflow中文版 make this work? I am using cPanel and AdsCaptcha.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号