Page 2 of 21 FirstFirst 123412 ... LastLast
Results 11 to 20 of 209
  1. #11
    Join Date
    Oct 2004
    Location
    Southport, UK
    Posts
    4,236
    Plugin Contributions
    20

    Default Re: Is a Permanent Login (Auto-Login) Possible?

    Thankyou - much appreciated.
    Development Manager @ JSWeb Ltd
    Over 15 years with Zencart

  2. #12
    Join Date
    Sep 2006
    Posts
    61
    Plugin Contributions
    0

    Default Re: Is a Permanent Login (Auto-Login) Possible?

    Ok, I have done a few searches, but I couldn't find anything definitive.


    add a checkbox to your login-form called something like "permLogin".

    How would I go about adding a checkbox. From your instructions I can definately do the rest, but the checkbox stumps me.

    Oh and thank you very much for the instructions, I love that my customers can be logged in all of the time.

    Pat

  3. #13
    Join Date
    Feb 2007
    Location
    Vienna
    Posts
    38
    Plugin Contributions
    0

    Default Re: Is a Permanent Login (Auto-Login) Possible?

    hey, no problem!

    it's a template file you should first copy into your own template-directory.
    1. copy the file "includes/templates/template_default/templates/tpl_login_default.php" to "your_template_dir/templates/tpl_login_default.php"
      _
    2. in this file the login box is around line 50. just there add the checkbox with a code like that:
      "<input id="permLogin" name="permLogin" type="checkbox" checked> stay logged in"

  4. #14
    Join Date
    Sep 2004
    Posts
    1,388
    Plugin Contributions
    4

    Default Re: Is a Permanent Login (Auto-Login) Possible?

    Good stuff, crazy_chris.
    Frank Koehl
    "Cleverly Disguised as a Responsible Adult"

    frankkoehl.com

  5. #15
    Join Date
    Sep 2006
    Posts
    61
    Plugin Contributions
    0

    Default Re: Is a Permanent Login (Auto-Login) Possible?

    Hi crazy_chris, I just wanted to stop by and thank you for this.

    I haven't got it working yet, (I got the tick box and the cookie imbeds it'self, but it does not log me back in again) but I will play around with it and I am sure I will be able to figure it out. It is likely I just put the code in the wrong spot, so I will look at the logic of the statements.

    Again, thanks

    Pat

  6. #16
    Join Date
    Oct 2004
    Location
    Southport, UK
    Posts
    4,236
    Plugin Contributions
    20

    Default Re: Is a Permanent Login (Auto-Login) Possible?

    Hmm - I get this error
    Code:
    1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
    in:
    [SELECT customers_password FROM zen_customers WHERE customers_id=]
    And the code I have copied and pasted from above and placed exactly where recommended in includes/modules/pages/login/header_php.php is
    Code:
    if (substr_count($_COOKIE["zencart_cookie_permlogin"], "~~~") > 1) {
    		if (empty($_SESSION['customer_id'])) {
    			$c = explode("~~~", $_COOKIE["zencart_cookie_permlogin"]);
    
    			$q = "SELECT customers_password FROM " . TABLE_CUSTOMERS . " WHERE customers_id=" . $c[0];
    			$r = $db->Execute($q);
    
    			$pw_cookie = zen_db_prepare_input($c[7]);
    			$pw_zencart = $r->fields['customers_password'];
    
    			if ($pw_cookie == $pw_zencart) {
    				$_SESSION['customer_id'] = $c[0];
    				$_SESSION['customer_default_address_id'] = $c[1];
    				$_SESSION['customers_authorization'] = $c[2];
    				$_SESSION['customer_first_name'] = $c[3];
    				$_SESSION['customer_last_name'] = $c[4];
    				$_SESSION['customer_country_id'] = $c[5];	
    				$_SESSION['customer_zone_id'] = $c[6];
    				$_SESSION['cart']->restore_contents();
    			}
    		}
    	}
    I'm no expert, but there doesn't seem to be anything wrong with that. And I've checked in the db that the required data is present.
    Development Manager @ JSWeb Ltd
    Over 15 years with Zencart

  7. #17
    Join Date
    Feb 2007
    Location
    Vienna
    Posts
    38
    Plugin Contributions
    0

    Default Re: Is a Permanent Login (Auto-Login) Possible?

    hey, is this a joke... because you just put the lines in the wrong file!!

    the code you just posted (for automatically logging in) is meant to be put in "/includes/modules/pages/index/header_php.php"

    the file "includes/modules/pages/login/header_php.php" (where you put the mentioned code) is for the original login-process where you set the cookie for the permanent login.

    if you experience any troubles, post again!

  8. #18
    Join Date
    Oct 2004
    Location
    Southport, UK
    Posts
    4,236
    Plugin Contributions
    20

    Default Re: Is a Permanent Login (Auto-Login) Possible?

    Damn - my human side is showing again!

    But actually, not as bas as it seemed...I HAD put it in the right place - I had just pasted the wrong filename in that previous post.
    Last edited by Ryk; 23 Feb 2007 at 11:38 AM.
    Development Manager @ JSWeb Ltd
    Over 15 years with Zencart

  9. #19
    Join Date
    Feb 2007
    Location
    Vienna
    Posts
    38
    Plugin Contributions
    0

    Default Re: Is a Permanent Login (Auto-Login) Possible?

    hehe, alright then

    well, it seems, it doesn't find the customer_id in the cookie.

    could you please add this code before the "$c = explode(....)":
    "echo $_COOKIE["zencart_cookie_permlogin"];"
    and post the output here?

  10. #20
    Join Date
    Oct 2004
    Location
    Southport, UK
    Posts
    4,236
    Plugin Contributions
    20

    Default Re: Is a Permanent Login (Auto-Login) Possible?

    Will do . but while I'm doing that, could you be a bit more specific about
    does all the stuff around line 70. just after this we hook in. put that code there
    Should it be at about line 72 after $check_country or about line 80 after the $_SESSION lines?

    This one is in login/header_php.php
    Development Manager @ JSWeb Ltd
    Over 15 years with Zencart

 

 
Page 2 of 21 FirstFirst 123412 ... LastLast

Similar Threads

  1. Admin auto login for a cron job
    By Gigo in forum Customization from the Admin
    Replies: 20
    Last Post: 9 Aug 2012, 07:39 AM
  2. Is there a way to auto-login to admin?
    By mikejd in forum General Questions
    Replies: 4
    Last Post: 3 Nov 2009, 09:55 AM
  3. Auto-switching DB login to end 1226 Error
    By Camarilladee in forum Basic Configuration
    Replies: 7
    Last Post: 2 Jun 2006, 05:56 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR