[isf-wifidog] Fwd: Wifidog doesn't read login template!

Jeff Schallenberg schallenberg.jeff at gmail.com
Mer 5 Sep 14:11:18 EDT 2007


On 9/5/07, Benoit Grégoire <bock at step.polymtl.ca> wrote:
>
> I think in this specific change, you want to patch the code to make the
> HTML more flexible, and propose to patch it permanently.


Thanks, Benoit, I would love to do that if I knew how. To get the MSF login
page to look like this ("dirty hack"):

http://auth.monteregiesansfil.org/login/

1) I modified the login.tpl file - I moved the HTML code that creates the
signup button to a separate div id "signup", and added a new heading, "Not
yet a member?":

Before =================================
    <div id="login_form">
        <h1>{"Login or Signup here"|_}:</h1>
        <form name="login_form" action="{$base_ssl_path}login/index.php"
method="post" onsubmit="return validateForm(this);">
                <input type="hidden" name="form_request" value="login">
            {if $gw_address != null}
                <input type="hidden" name="gw_address"
value="{$gw_address}">
            {/if}
            {if $gw_port != null}
                <input type="hidden" name="gw_port" value="{$gw_port}">
            {/if}
            {if $gw_id != null}
                <input type="hidden" name="gw_id" value="{$gw_id}">
            {/if}
            {if $origin != null}
                <input type="hidden" name="origin" value="{$origin}" />
            {/if}

            <p>
            {$selectNetworkUI}
            </p>

            {"Username (or email)"|_}:<br/>
            <input type="text" name="username" id="form_username"
tabindex="1" value="{$username}" size="20" /><br/>
            {"Password"|_}:<br/>
            <input type="password" name="password" id="form_password"
tabindex="2" size="20" /><br/>

            <div id="form_errormsg" class="errormsg">
            {if $error == null}
              &nbsp;
            {else}
              {$error}
            {/if}
            </div>

            <input class="submit" type="submit" tabindex="3"
name="form_submit" value="{"Login"|_}" />&nbsp;
            <input class="submit" type="button" tabindex="5"
name="form_signup" value="{$create_a_free_account}" onclick="
location.href='{$base_ssl_path}signup.php';" />
        </form>
    </div>
After ============================================================
   <div id="login_form">
        <h1>{"Members login here"|_}:</h1>
        <form name="login_form" action="{$base_ssl_path}login/index.php"
method="post" onsubmit="return validateForm(this);">
                <input type="hidden" name="form_request" value="login">
            {if $gw_address != null}
                <input type="hidden" name="gw_address"
value="{$gw_address}">
            {/if}
            {if $gw_port != null}
                <input type="hidden" name="gw_port" value="{$gw_port}">
            {/if}
            {if $gw_id != null}
                <input type="hidden" name="gw_id" value="{$gw_id}">
            {/if}
            {if $origin != null}
                <input type="hidden" name="origin" value="{$origin}" />
            {/if}

            <p>
            {$selectNetworkUI}
            </p>

            {"Username (or email)"|_}:<br/>
            <input type="text" name="username" id="form_username"
tabindex="1" value="{$username}" size="20" /><br/>
            {"Password"|_}:<br/>
            <input type="password" name="password" id="form_password"
tabindex="2" size="20" /><br/>

            <div id="form_errormsg" class="errormsg">
            {if $error == null}
              &nbsp;
            {else}
              {$error}
            {/if}
            </div>

            <input class="submit" type="submit" tabindex="3"
name="form_submit" value="{"Login"|_}" />&nbsp;

        </form>
    </div>
    <div id="login_help">
        <h1>{"I'm having difficulties"|_}:</h1>
        <ul>
            <li><a href="{$base_url_path}lost_username.php">{"I Forgot my
username"|_}</a></li>
            <li><a href="{$base_url_path}lost_password.php">{"I Forgot my
password"|_}</a></li>
            <li><a href="{$base_url_path}resend_validation.php">{"Re-send
the validation email"|_}</a></li>
        </ul>
    </div>
*<div id="signup">
<h1>Not yet a Member?</h1>
<input class="submit" type="button" tabindex="4" name="form_signup"
value="{$create_a_free_account}" onclick="
location.href='{$base_ssl_path}signup.php';" />
</div>
*
2) Then I added an entry in our MSF theme pack stylesheet.css to style the
new div id. I was "inspired" by the base stylesheet, to which Wadih kindly
sent me the link:
http://auth.monteregiesansfil.org/media/base_theme/styleshee t.css
<http://auth.monteregiesansfil.org/media/base_theme/stylesheet.css>
==================================
#login_help {
       float: left;
    margin: 1em 1em 1em 4em;
    padding: 0em 1em;
    border: 1px solid #d7d5d5;
}

*#signup {
       float: left;
    margin: 1em 1em 1em 4em;
    padding: 0em 1em;
    border: 2px solid #ff0000;
}
*
Then I sent both files to our sandbox using WinSCP.

So, that is how I did it. There is still the problem of translating the new
and edited strings, which I was hoping to do on my captive server, once I
learned how...

But with the new version of wifidog, I can't even make a "dirty hack" of the
login.tpl file, because it is no longer read. So, if the above simple
modification of the underlying HTML is deemed useful, how can it be applied?
Does it require editing of some of the PHP files? I would be glad to learn
how. Maybe I should attach the above code as a comment to ticket 343, and
let a developer take it from there?

-- 
> - Jeff
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://listes.ilesansfil.org/pipermail/wifidog/attachments/20070905/60357c32/attachment.htm 


Plus d'informations sur la liste de diffusion WiFiDog