Web certification how to release different operating systems
In the Web authentication configuration of WFilter NGF (WSG Internet behavior Management Gateway), the client to be authenticated by Web can be configured based on the IP scope. In practical use, some LAN computers and mobile phone wireless terminals are mixed in the same network segment, in this case, if only the computer authentication, or only the mobile phone authentication, can not be achieved through the IP range. You need to modify the default authentication page, obtain the client operating system type based on the browser's useragent, and determine whether to release it (directly without authentication).
As shown in the following figure, click "Edit Web Authentication Page", and then click the source code icon.
You can view the Web certified interface source code.
Add a function to it, as follows:
Function checkbypassPC () {
/ / alert ("userAgent=" + window.navigator.userAgent)
If (window.navigator.userAgent! = undefined & & window.navigator.userAgent.indexOf ("Windows") >-1) {
/ / if it is a windows system, bypass automatically.
$.ajax ("/ cgi-bin/verify?tid=bypasspc", {
Method: 'GET'
Cache: false
DataType: 'text'
Success: function (data) {
/ / Jump to the jump page of successful verification
Check_landing_page ()
}
});
}
}
As shown below:
Then switch to edit mode and click Save. (note: do not save in source code mode)
After the above configuration, the authentication can be completed automatically after jumping out of the authentication page on the PC, and there is no need to scan the code. If you do not want to authenticate the phone, you can directly modify the useragent in the function, as follows:
Function checkbypassPC () {
/ / alert ("userAgent=" + window.navigator.userAgent)
If (/ Android | webOS | iPhone | iPad | iPod | Opera Mini/i.test (window.navigator.userAgent)) {
/ / Android, iphone, ipad automatic bypass.
$.ajax ("/ cgi-bin/verify?tid=bypasspc", {
Method: 'GET'
Cache: false
DataType: 'text'
Success: function (data) {
/ / Jump to the jump page of successful verification
Check_landing_page ()
}
});
}
}