Results 1 to 10 of 209

Threaded View

  1. #15
    Join Date
    Mar 2009
    Posts
    169
    Plugin Contributions
    2

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

    Hi lat9!

    Yes, exactly. I'm not sure why I thought my little one line of code would actually make this work.

    Turns out my testing was completely botched by the fact that I was testing isset on $_SESSION['emp_admin_login'] rather than testing whether $_SESSION['emp_admin_login'] = true...

    Wow...anyhow...

    Here's what I did to solve the issue:

    Below:
    PHP Code:
    $customers_hashed_password = (isset ($remember_info['password'])) ? $remember_info['password'] : '~~~~'
    Put:
    PHP Code:
    $emp = (isset ($remember_info['emp'])) ? $remember_info['emp'] : false


    Then Below:
    PHP Code:
    $_SESSION['customer_zone_id'] = $check_country->fields['entry_zone_id']; 
    Put:
    PHP Code:
    $_SESSION['emp_admin_login'] = $emp

    Also, as per my previous change, it should remain intact:

    After:
    PHP Code:
    'password' => md5 ($this->secret $password_info->fields['customers_password']) 
    Add:
    PHP Code:
    'emp' => $_SESSION['emp_admin_login'
    (including the comma for anyone unfamiliar of what's going on there)

    So that it looks like:
    PHP Code:
    'password' => md5 ($this->secret $password_info->fields['customers_password']), 'emp' => $_SESSION['emp_admin_login'] ); 

    Based on a previous post with a different issue (the shopping cart restore) - we need to test if $_SESSION['emp_admin_login'] isset to avoid php errors...

    So I've done this (need advice here):

    Below:
    PHP Code:
    $password_info $db->Execute ("SELECT customers_password FROM " TABLE_CUSTOMERS " WHERE customers_id = '" $_SESSION['customer_id'] . "'"); 
    Put:
    PHP Code:
    if(!isset($_SESSION['emp_admin_login']))
    {
    $_SESSION['emp_admin_login'] = false;

    Last edited by yaseent; 20 Aug 2016 at 12:52 AM.

 

 

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