[Chilli] [chilli] How to modify status page content for blocking user

Le Tran Dat trandatnh at gmail.com
Fri Dec 13 09:19:28 UTC 2013


Hi All,

I am trying to implement a feature that will block clients base on
their MAC addresses. I allow those clients to log on into the captive
portal and show a message "You are blocked, please contact
administrator" in the status page. Then I will logoff the client in
question.

I've already done the part of allowing a client to logon and logoff it
right after that if the client's MAC address is in blacklist using
chilli_query logoff.

Now, I want to show the message on status page. I am new to
coovachilli so I have no knowledge about how to do it. I guess I can
check the authorize part in coovachilli's source code.
And do the following steps:

resp.message = ""
if authenticate_pass then
    if mac_is_blocked then
       resp.message = "you are blocked, Please contact administrator"

Here the resp.message will be present in status page.
ChilliLibrary.js
chilliController.processReply = function ( resp ) {

        if ( typeof (resp.message)  == 'string' ) {

                /* The following trick will replace HTML entities with
the corresponding
                 * character. This will not work in Flash (no innerHTML)
                 */

                var fakediv = document.createElement('div');
                fakediv.innerHTML = resp.message ;
                chilliController.message = fakediv.innerHTML  ;
        }


I don't know if it can work or not. Or you people can suggest me any
other approaches that can help to show the message to blocked clients.

Thanks,
Dat


More information about the Chilli mailing list