Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

Login Link

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions
 
Thread Tools Search this Thread
  #51  
Old 04-23-2008, 04:05 AM
 
TanyaG TanyaG is offline
 

Advanced Member
  
Join Date: Nov 2007
Posts: 94
 

Default Re: Login Link

Thanks a lot. Great idea!
__________________
Tanya

x-cart version: 4.1.7 4.1.9. 4.2
Reply With Quote
  #52  
Old 07-03-2008, 11:27 AM
  boomobile's Avatar 
boomobile boomobile is offline
 

eXpert
  
Join Date: Oct 2007
Posts: 306
 

Default Re: Login Link

Quote:
Originally Posted by B00MER
edit [skin1]/common_templates.tpl and add something similar:

Code:
{elseif $main eq "mainlogin"} {include file="customer/main/login.tpl"}
Note, place your login form from, auth.tpl in customer/main/login.tpl

Now just create the login.php file, with something like:

Code:
<? require "../smarty.php"; require "../config.php"; @include "./https.php"; require "./auth.php"; $smarty->assign("main","mainlogin"); $smarty->display("customer/home.tpl"); ?>

Should do the trick


I want to combine three templates into one page. I can't figure out how they are called. I don't need to edit the templates themselves, just have them all on the same page.
Here's specifics:

I have 3 separate pages as follows
login = secure_login_form.tpl
registration = register.tpl
recover lost password = change_password.tpl

these all come up on separate pages, I want them all on one.

My home_main.tpl includes this:

{elseif $main eq "register"}
{include file="customer/main/register.tpl"}

{elseif $main eq "secure_login_form"}
{include file="customer/main/secure_login_form.tpl"}

{elseif $main eq "change_password"}
{include file="customer/main/change_password.tpl"}

I'm not sure what file I need to modify.
__________________
X Cart Ver: 4.0.14
MySQL4 4.1.22
phpMyAdmin 2.6.0
Pearl 5.6.0
PHP 5.2.1
Python 2.2.2
Server: Apache/2.0.52 (Red Hat)
OS: Linux
www.cleanlinesurf.com
1. Customer Rewards Points
2. One Page Checkout (altercart)
3. Free shipping orders over $50 as Real Time Shipping
4. Gift Certificates
-----------------------------------------------
Graphic Design | Boomobile Design, LLC
www.boomobile.com
Reply With Quote
  #53  
Old 07-10-2008, 11:16 AM
  neaisha's Avatar 
neaisha neaisha is offline
 

eXpert
  
Join Date: May 2006
Posts: 276
 

Default Re: Login Link

i couldnt get this to work. so what i did was duplicate this page - xcart/error_message.php?need_login. i'm not sure what unnecessary code can/should be removed from the duplicated file beyond what i've already removed so that it continues to work but...

create a file called myaccount.php and insert the following code

Code:
<?php require "./auth.php"; require $xcart_dir."/include/categories.php"; # # Assign login information # x_session_register("login_antibot_on"); x_session_register("antibot_err"); x_session_register("username"); $smarty->assign("main","myaccount"); $smarty->assign("username", $username); $smarty->assign("login_antibot_on", $login_antibot_on); if ($antibot_err) { $smarty->assign("antibot_err", $antibot_err); $antibot_err = false; } # Assign the current location line $smarty->assign("location", $location); func_display("customer/home.tpl",$smarty); ?>


then upload it to /xcart directory.



then in skin1/common_templates.tpl add the following...

Code:
{elseif $main eq "myaccount" or $main eq "antibot_error" or $main eq "disabled"} {assign var="is_remember" value="Y"} {include file="main/error_login_incorrect.tpl"}

then add the link to your page http://www.mysite/xcart/myaccount.php where you want it to appear.
__________________
X-Cart Gold 4.4.3
--------------------------------------
Reply With Quote
  #54  
Old 07-10-2008, 01:04 PM
  neaisha's Avatar 
neaisha neaisha is offline
 

eXpert
  
Join Date: May 2006
Posts: 276
 

Default Re: Login Link

if it helps anyone, here's how i displayed the login link if logged out and vice versa...

Code:
{if $login ne ""} <form action="/store/include/login.php" method="post" name="loginform"><img src="{$ImagesDir}/spacer.gif" width="10" height="1" alt="" /><a href="javascript: document.loginform.submit();">log out</a> <input name="mode" value="logout" type="hidden"> <input name="redirect" value="customer" type="hidden"> </form> {else} <a href="mysite/xcart/myaccount.php">login</a> {/if}
__________________
X-Cart Gold 4.4.3
--------------------------------------
Reply With Quote
  #55  
Old 07-19-2008, 08:43 AM
  JWait's Avatar 
JWait JWait is offline
 

X-Man
  
Join Date: Nov 2005
Location: California
Posts: 2,440
 

Default Re: Login Link

Quote:
Originally Posted by boomobile
I have 3 separate pages as follows
login = secure_login_form.tpl
registration = register.tpl
recover lost password = change_password.tpl

these all come up on separate pages, I want them all on one.

My home_main.tpl includes this:

{elseif $main eq "register"}
{include file="customer/main/register.tpl"}

{elseif $main eq "secure_login_form"}
{include file="customer/main/secure_login_form.tpl"}

{elseif $main eq "change_password"}
{include file="customer/main/change_password.tpl"}

I'm not sure what file I need to modify.

I don't really understand why you would want them all on the same page, particularly since they do different things.

"Register" does just that, registers new customers.
"Secure Login" will login current customers using https.
"Change Password" will allow current customers to change their password, and is part of "modify profile".

"recover lost password = change_password.tpl" as you state is incorrect. "Recover Password" allows a current customer to retrieve their login information via email and has nothing to do with changing their password (unless of course you require them to change it at their next logon).

Anyway, to get more than one template on a page, just call it...

{elseif $main eq "whatever_you_want_to_name_your_page"}
{include file="customer/main/register.tpl"}
{include file="customer/main/secure_login_form.tpl"}
{include file="customer/main/change_password.tpl"}

You need to include the "requires" on "whatever_you_want_to_name_your_page.tpl"
__________________
Two Separate X-Cart Stores
Version 4.4.4 Gold - X-AOM - Vivid Dreams Aquamarine (modified) - Linux
Mods - Newest Products - View All -, and a few others. Numerous upgrades from 4.0.x series.
Integrated with Stone Edge Order Manager + POS

Version 4.1.12 Gold (fresh install) - X-AOM - Linux
Mods - XCSEO free
Reply With Quote
  #56  
Old 12-17-2008, 04:55 PM
 
drubarth drubarth is offline
 

Member
  
Join Date: Jul 2004
Posts: 23
 

Default Re: Login Link

I'm running X-cart 4.1.11 and to get a login page, I just link to secure_login.php. Ideally you should use https, but either way. I'm not sure how long this program has been part of X-cart.
__________________
x-cart 4.1.11
x-cart 4.1.12
x-cart 4.2.3
x-cart 4.3.2
Reply With Quote
  #57  
Old 01-30-2009, 05:24 AM
 
ChristineP ChristineP is offline
 

eXpert
  
Join Date: Jul 2008
Posts: 310
 

Default Re: Login Link

I've copied updated Laureon's mod with your code above. Now, I need to remove the previous {if $login ne ""} info and include what you have posted. Can you direct me where this should go in the myaccount.tpl?

I will also be adding a 'password protect' register login for this new login page. Any suggestions are welcome.

Christine


Quote:
Originally Posted by neaisha
if it helps anyone, here's how i displayed the login link if logged out and vice versa...

Code:
{if $login ne ""} <form action="/store/include/login.php" method="post" name="loginform"><img src="{$ImagesDir}/spacer.gif" width="10" height="1" alt="" /><a href="javascript: document.loginform.submit();">log out</a> <input name="mode" value="logout" type="hidden"> <input name="redirect" value="customer" type="hidden"> </form> {else} <a href="mysite/xcart/myaccount.php">login</a> {/if}
__________________
______________
version 4.1.9 Gold
Reply With Quote
  #58  
Old 01-30-2009, 12:14 PM
 
ChristineP ChristineP is offline
 

eXpert
  
Join Date: Jul 2008
Posts: 310
 

Default Re: Login Link

Boomer,

I've tried both your code and Laureon's, but I'm not having any luck. When I used your suggestion to copy the code from my site login_form.tpl <form> </form>, I could see the code and no way to submit. When I used your code and corrected any portion that points to your /lab/, then the login page shows, but still no submit button. Any suggestions?

Christine


Quote:
Originally Posted by B00MER
Here is mine from cart-lab [3.5.5]

Code:
If you already have an account, you can authenticate yourself by filling in the form below. The fields marked with <font class="TableCenterCustomerFormOrange">*</font> are mandatory. <table border=0> <form action="/lab/include/login.php" method=post name=errorform> <tr> <td height="10" width="78" class=FormButton>Login</td> <td width="10" height="10"><font class=Star>*</font></td> <td width="282" height="10"> <input type="text" name="username" size="30"> </td> </tr> <tr> <td height="10" width="78" class=FormButton>Password</td> <td width="10" height="10"><font class=Star>*</font></td> <td width="282" height="10"> <input type="password" name="password" size="30"> <input type="hidden" name="usertype" value="C"> <input type="hidden" name="redirect" value="customer"> <input type=hidden name=mode value=login> </td> </tr> <tr> <td height="10" width="78" class=FormButton></td> <td width="10" height="10"></td> <td width="282" height="10" class=ErrorMessage> </td> </tr> <tr> <td height="10" width="78" class=FormButton></td> <td width="10" height="10" class=FormButton></td> <td width="282" height="10"> [img]/lab/skin1/images/buttons/submit.gif[/img] </td> </tr> </form> </table> If you do not have an account, you can easily <font class=TableCenterCustomerform>register here</font>

secure_login.php in 4.0.x is in the root /
__________________
______________
version 4.1.9 Gold
Reply With Quote
  #59  
Old 02-03-2009, 12:56 PM
 
robertswww robertswww is offline
 

X-Adept
  
Join Date: Jul 2003
Posts: 586
 

Default Re: Login Link

Hi Christine,

In the sample code you posted it is showing a link to: skin1/images/buttons/submit.gif

I believe you will find no such file in your 4.1.x version of X-Cart.

There is now a skin1/buttons/ folder and inside you will find submit.tpl (TPL not GIF).

In place of the submit button, you may be able to use:

{include file="buttons/login_menu.tpl"}



Also, compare the source code on one of your existing web site login pages.

The customer login page uses this template: customer/main/secure_login_form.tpl

And here is part of the Submit Button code from that template:

{if $js_enabled}
{include file="buttons/submit.tpl" href="javascript:document.secureform.submit()" js_to_href="Y"}
{else}
{include file="submit_wo_js.tpl" value=$lng.lbl_submit}
{/if}
</td>
</tr>
</form>

The above code shows how they are including the file: buttons/submit.tpl if Javascript is enabled, else include submit_wo_js.tpl


Both submit.tpl and login_menu.tpl then include file="buttons/button.tpl" to create the Submit button image.

One of those methods should work for you. Just work on a copy of the file and a test site (if you have one available).

Robert
__________________
X-cart 4.1.10
Reply With Quote
  #60  
Old 02-03-2009, 04:27 PM
 
ChristineP ChristineP is offline
 

eXpert
  
Join Date: Jul 2008
Posts: 310
 

Default Re: Login Link

Thanks for your reply. I've made some progress with the login page, but I am having trouble with the submit-login button. I tried your code and your suggestion using {include file="buttons/login_menu.tpl"} with my original code from auth.tpl. Tonight the link is working in IE7, but earlier today it didn't work in Safari or Firefox. Do you have any suggestions for me to password protect register.php?

Christine



Quote:
Originally Posted by robertswww
Hi Christine,

In the sample code you posted it is showing a link to: skin1/images/buttons/submit.gif

I believe you will find no such file in your 4.1.x version of X-Cart.

There is now a skin1/buttons/ folder and inside you will find submit.tpl (TPL not GIF).

In place of the submit button, you may be able to use:

{include file="buttons/login_menu.tpl"}



Also, compare the source code on one of your existing web site login pages.

The customer login page uses this template: customer/main/secure_login_form.tpl

And here is part of the Submit Button code from that template:

{if $js_enabled}
{include file="buttons/submit.tpl" href="javascript:document.secureform.submit()" js_to_href="Y"}
{else}
{include file="submit_wo_js.tpl" value=$lng.lbl_submit}
{/if}
</td>
</tr>
</form>

The above code shows how they are including the file: buttons/submit.tpl if Javascript is enabled, else include submit_wo_js.tpl


Both submit.tpl and login_menu.tpl then include file="buttons/button.tpl" to create the Submit button image.

One of those methods should work for you. Just work on a copy of the file and a test site (if you have one available).

Robert
__________________
______________
version 4.1.9 Gold
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 05:32 AM.

   

 
X-Cart forums © 2001-2020