Mikrotik-自定义热点HTTP-CHAP

时间:2016-02-13 08:55:59

标签: mikrotik

我已经为我的mikrotik热点创建了一些自定义页面 但我有问题 使用默认热点主题,当我选中“HTTP-CHAP”客户端用户登录时没有任何错误 但由于我的自定义错误客户端用户无法登录热点,他们看到此错误“网络浏览器未发送质询响应(再试一次,启用JavaScript)” 这是我的自定义HTML

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<!--META-->
<link href="css/font-awesome.min.css" type="text/css" rel="stylesheet">
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<meta http-equiv="pragma" content="no-cache" />
<meta http-equiv="expires" content="-1" />
<meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0;"/>
<link href="css/style.css" rel="stylesheet" type="text/css" />
<title>ورود کاربر</title>
</head>
$(if chap-id)
    <form name="sendin" action="$(link-login-only)" method="post">
        <input type="hidden" name="username" />
        <input type="hidden" name="password" />
        <input type="hidden" name="dst" value="$(link-orig)" />
        <input type="hidden" name="popup" value="true" />
    </form>

    <script type="text/javascript" src="/md5.js"></script>
    <script type="text/javascript">
    <!--
        function doLogin() {
        document.sendin.username.value = document.login.username.value;
        document.sendin.password.value = hexMD5('$(chap-id)' + document.login.password.value + '$(chap-challenge)');
        document.sendin.submit();
        return false;
        }
    //-->
    </script>
$(endif)
<!--STYLESHEETS-->
<!--SCRIPTS-->
<script type="text/javascript" src="/jquery.min.js"></script>
<!--Slider-in icons-->


<body id="login-body">
<form name="login-form" class="login-form" action="" method="post">
    <div class="header">
    <center><p style="text-align: center;"><img  src="images/logo.png" /></p></center><!--END TITLE-->

    </div>
    <div class="content">
    <form name="login" action="$(link-login-only)" method="post" 
            $(if chap-id) onSubmit="return doLogin()" $(endif)>
            <input type="hidden" name="dst" value="$(link-orig)" />
            <input type="hidden" name="popup" value="true" />
    <input name="username" type="text" required="required" placeholder="نام کاربری خود را وارد نمایید" class="login-input"  onfocus="this.value=''" size="30" /><!--END USERNAME-->
    <input name="password" type="password" required="required" placeholder="رمز عبور خود را وارد نمایید" class="login-input" onfocus="this.value=''" size="30" /><!--END PASSWORD-->
    <button class="login-btn" type="submit">اتصال   <i class="fa fa-sign-in fa-lg"></i></button>
    <font color="#AC2925"><center>$(if error) $(error) $(endif)</center></font>
    </div>
</form>
</body>
<script type="text/javascript">
<!--
document.login.username.focus();
//-->
</script>
</html>

0 个答案:

没有答案