If this is your first visit, check our documentation. To post, register or login.

Custom Login Box

Started by seeinteriors on 5 Jun 2012, 3:18 PM · Views: 632

Results 1 to 5 of 5
5 Jun 2012, 3:18 PM
#1
seeinteriors avatar

seeinteriors

New Zenner

Join Date:
Dec 2010
Posts:
20
Plugin Contributions:
0

Post #1 by seeinteriors

We are trying to setup a custom login box on our site, the test page is at http://seeinteriors.co.uk/login_test_page.html and the login is in the top right corner in case you miss it.

When I enter correct login details I get a security error logging in any ideas on how to fix this?

Thanks in advance

5 Jun 2012, 3:49 PM
#2
rbarbour avatar

rbarbour

Totally Zenned

Join Date:
Feb 2010
Posts:
2,159
Plugin Contributions:
10

Post #2 by rbarbour

hard to tell without seeing the code that you are using to send the login info

I can see this

<?php echo zen_draw_hidden_field('securityToken', $_SESSION['securityToken']); ?>

appears in your html code and should not

also, just an fyi - login box wont work if javascript is disabled

5 Jun 2012, 8:26 PM
#3
seeinteriors avatar

seeinteriors

New Zenner

Join Date:
Dec 2010
Posts:
20
Plugin Contributions:
0

Post #3 by seeinteriors

rbarbour:

hard to tell without seeing the code that you are using to send the login info

I can see this

<?php echo zen_draw_hidden_field('securityToken', $_SESSION['securityToken']); ?>

appears in your html code and should not

also, just an fyi - login box wont work if javascript is disabled

The code you can see it the full code that is currently in that file. I thought I removed the PHP code but obviously not.

If must be an issue with the security token but I can't work out how to fix it.

5 Jun 2012, 10:08 PM
#4
rbarbour avatar

rbarbour

Totally Zenned

Join Date:
Feb 2010
Posts:
2,159
Plugin Contributions:
10

Post #4 by rbarbour

seems to work for me

nicely too :-)

in your /includes/templates/YOUR_TEMPLATE/common/tpl_header.php file

<nav>
<ul>
<li id="login">
<a id="login-trigger" href="#">
Log In <span></span>
</a>
<div id="login-content">
<?php echo zen_draw_form('login', zen_href_link(FILENAME_LOGIN, 'action=process', 'SSL'), 'post', 'id="loginForm"'); ?>
<fieldset id="inputs">
<?php echo zen_draw_input_field('email_address', '', 'size="18" id="username" placeholder="Your email address" required'); ?>
<?php echo zen_draw_password_field('password', '', 'size="18" id="password" placeholder="Password" required'); ?>
<?php echo zen_draw_hidden_field('securityToken', $_SESSION['securityToken']); ?>
</fieldset>
<fieldset id="actions">
<input type="submit" id="submit" value="Log in"><br/><br/>
<?php echo '<a href="' . zen_href_link(FILENAME_PASSWORD_FORGOTTEN, '', 'SSL') . '">' . TEXT_PASSWORD_FORGOTTEN . '</a>'; ?>
</fieldset></form></div></li><li id="signup">
<?php echo '<a href="' . zen_href_link(FILENAME_CREATE_ACCOUNT, '', 'NONSSL') . '">' . Register . '</a>'; ?>
</li></ul></nav>
5 Jun 2012, 10:36 PM
#5
rbarbour avatar

rbarbour

Totally Zenned

Join Date:
Feb 2010
Posts:
2,159
Plugin Contributions:
10

Post #5 by rbarbour

replace this:

<a id="login-trigger" href="#">

with

<a id="login-trigger" href="<?php echo zen_href_link(FILENAME_DEFAULT, zen_get_all_get_params()); ?># " onclick="('');return false;">

this way if on home page it will not reload to home/index, actually it won't reload any page