Zen Cart Logo
Forums / Addon Admin Tools / Login as Customer module [Support Thread]

Login as Customer module [Support Thread]

Views: 59,659

Results 201 to 220 of 241
30 Aug 2017, 3:20 PM
#201
design75 avatar

design75

Totally Zenned

Join Date:
Dec 2009
Location:
Amersfoort, The Netherlands
Posts:
2,862
Plugin Contributions:
5

Login as Customer module [Support Thread]

I think the reason this module is not working, is because there are a lot of php shortcodes used. This is only an observation, as I have not used/tested this nodule myself.

21 Aug 2018, 2:53 PM
#202
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,706
Plugin Contributions:
56

Re: Login as Customer module [Support Thread]

Updated the "with master password" portion for 1.5.5; fixed a few bugs.

29 Sep 2018, 4:19 AM
#203
twitchtoo avatar

twitchtoo

Totally Zenned

Join Date:
Apr 2007
Location:
Ontario, Canada
Posts:
1,733
Plugin Contributions:
14

Re: Login as Customer module [Support Thread]

**Admin Login as Customer for 1.55f
**
This fix may be useful for testing, definitely NOT recommended for a production site - To correct the 'failed attempt to load directly to SSL HTTPS link when no SSL certificate is installed'.

admin/customers.php
// BOF Set variables for login_as_customer module
$place_order_button = 'includes/languages/english/images/buttons/button_placeorder.gif';
$login_as_customer = 'index.php?main_page=login_as_customer';
// $p_url = HTTPS_CATALOG_SERVER . DIR_WS_HTTPS_CATALOG; // Twitch - uncomment to enable SSL
** $p_url = HTTP_CATALOG_SERVER . DIR_WS_CATALOG; // no SSL**
$p_url .= $login_as_customer;
//EOF Set Variables for login_as_customer module

Also define in admin/includes/configure.php

define('ENABLE_SSL_CATALOG', 'false');

and **includes/configure.php
**
define('ENABLE_SSL', 'false');

Just remember to install your SSL AND change all of the settings back to point at SSL - true

6 Nov 2018, 11:41 AM
#204
izar74 avatar

izar74

Zen Follower

Join Date:
Mar 2009
Location:
Italy
Posts:
155
Plugin Contributions:
0

Re: Login as Customer module [Support Thread]

Hi,
got this error while using "search" with a customer email:

[06-Nov-2018 12:07:34 Europe/Berlin] PHP Fatal error: 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 '"f234f8abe083c9aa2db842463ada0af8") ON DUPLICATE KEY UPDATE encrypted_data = "f2' at line 1 :: INSERT INTO log_in_as_customers (customers_id,encrypted_data) VALUES (,"f234f8abe083c9aa2db842463ada0af8") ON DUPLICATE KEY UPDATE encrypted_data = "f234f8abe083c9aa2db842463ada0af8" ==> (as called by) /var/xxx/customers.php on line 1469 <== in /var/xxx/includes/classes/db/mysql/query_factory.php on line 171

The line it refers to in customer.php are:

$db->Execute('INSERT INTO '.TABLE_LOG_IN_AS_CUSTOMERS.' (customers_id,encrypted_data) VALUES ('.$cInfo->customers_id.',"'.$encrypted_data.'") ON DUPLICATE KEY UPDATE encrypted_data = "' . $encrypted_data . '"');

Which is the line modified by Alac.

Don't know if it is related to the version of php or my sql i'm using on the server. I looked into it to see if there is any mistype but it seems all correct to me...

Following the details of the server and the complete error report:

HTTP Server: Apache
Versione PHP: 5.5.38 (Zend: 2.5.0)
PHP File Uploads: OnUpload
Max Size: 8MPHP
Memory Limit: 128MPOST
Max Size: 8M
Database: MySQL 5.5.62

Zencart 1.5.5f

Full error report:

[06-Nov-2018 12:37:31 Europe/Berlin] Request URI: /../customers.php?search=espositoba%40libero.it, IP address: 2.239.187.39
#1 array_merge() called at [/var/.../customers.php:1341]

[06-Nov-2018 12:37:31 Europe/Berlin] PHP Warning: array_merge(): Argument #1 is not an array in /var/.../customers.php on line 1341
[06-Nov-2018 12:37:31 Europe/Berlin] Request URI: /.../customers.php?search=espositoba%40libero.it, IP address: 2.239.187.39
#1 array_merge() called at [/.../customers.php:1343]

[06-Nov-2018 12:37:31 Europe/Berlin] PHP Warning: array_merge(): Argument #2 is not an array in /var/.../customers.php on line 1343
[06-Nov-2018 12:37:31 Europe/Berlin] Request URI: /.../customers.php?search=espositoba%40libero.it, IP address: 2.239.187.39
#1 trigger_error() called at [/var/.../includes/classes/db/mysql/query_factory.php:171]
#2 queryFactory->show_error() called at [/var/.../includes/classes/db/mysql/query_factory.php:143]
#3 queryFactory->set_error() called at [/var/..../includes/classes/db/mysql/query_factory.php:270]
#4 queryFactory->Execute() called at [/var/.../customers.php:1469]

[06-Nov-2018 12:37:31 Europe/Berlin] PHP Fatal error: 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 '"cbe380b4bdcee45fa5298752135b0384") ON DUPLICATE KEY UPDATE encrypted_data = "cb' at line 1 :: INSERT INTO log_in_as_customers (customers_id,encrypted_data) VALUES (,"cbe380b4bdcee45fa5298752135b0384") ON DUPLICATE KEY UPDATE encrypted_data = "cbe380b4bdcee45fa5298752135b0384" ==> (as called by) /var/.../customers.php on line 1469 <== in /var/.../includes/classes/db/mysql/query_factory.php on line 171

8 Nov 2018, 3:54 PM
#205
carlwhat avatar

carlwhat

zennedOut

Join Date:
Nov 2005
Location:
los angeles
Posts:
2,962
Plugin Contributions:
8

Re: Login as Customer module [Support Thread]

izar74:

The line it refers to in customer.php are:

$db->Execute('INSERT INTO '.TABLE_LOG_IN_AS_CUSTOMERS.' (customers_id,encrypted_data) VALUES ('.$cInfo->customers_id.',"'.$encrypted_data.'") ON DUPLICATE KEY UPDATE encrypted_data = "' . $encrypted_data . '"');

> 
> Which is the line modified by Alac.
> 
> 
> [06-Nov-2018 12:37:31 Europe/Berlin] PHP Fatal error:  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 '"cbe380b4bdcee45fa5298752135b0384") ON DUPLICATE KEY UPDATE encrypted_data = "cb' at line 1 :: INSERT INTO log_in_as_customers (customers_id,encrypted_data) VALUES (,"cbe380b4bdcee45fa5298752135b0384") ON DUPLICATE KEY UPDATE encrypted_data = "cbe380b4bdcee45fa5298752135b0384" ==> (as called by) /var/.../customers.php on line 1469 <== in /var/.../includes/classes/db/mysql/query_factory.php on line 171

customers_id is defined as int(10).  you are trying to put null into it as based on the values in your SQL statement.

in the code, it seems that:

$cInfo->customers_id

has nothing there.  you can cast that to an integer, in which case the value will be 0; but i am unsure why this table exists or what the encrypted data contains.

hope that helps.
9 Nov 2018, 9:46 AM
#206
izar74 avatar

izar74

Zen Follower

Join Date:
Mar 2009
Location:
Italy
Posts:
155
Plugin Contributions:
0

Re: Login as Customer module [Support Thread]

Hi Carl,

thanks for your answer. Actually the two lines are from the ALAC plugin so i don't what to do exactly. They are referring to the new table created while installing ALAC.
This is the code in the SQL patch:

INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) VALUES ('Master Password', 'MASTER_PASS', 'yourpassword', 'This password will allow you to login to any customer\'s account.', 1, 23, now(), now(), NULL, NULL);
CREATE TABLE IF NOT EXISTS `log_in_as_customers` (
  `customers_id` int(10) NOT NULL,
  `encrypted_data` varchar(256) COLLATE utf8_unicode_ci NOT NULL,
  PRIMARY KEY (`customers_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

I'll try to make some changes to see if it will be solved.

9 Nov 2018, 3:18 PM
#207
carlwhat avatar

carlwhat

zennedOut

Join Date:
Nov 2005
Location:
los angeles
Posts:
2,962
Plugin Contributions:
8

Re: Login as Customer module [Support Thread]

change the one line of code as such:

    $db->Execute('INSERT INTO '.TABLE_LOG_IN_AS_CUSTOMERS.' (customers_id,encrypted_data) VALUES ('.(int)$cInfo->customers_id.',"'.$encrypted_data.'") ON DUPLICATE KEY UPDATE encrypted_data = "' . $encrypted_data . '"');

notice the (int) in front of the cInfo->customers_id.

i am not use how you have ended up with a blank customers_id, but that should address the error you reported.

best.

21 Dec 2018, 1:12 AM
#208
gtgeorge avatar

gtgeorge

New Zenner

Join Date:
Mar 2005
Posts:
53
Plugin Contributions:
0

Re: Login as Customer module [Support Thread]

I have been using this contribution and wish to say thanks for it.

We are working on upgrading our storefront to 1.5.6 but do not wish to loose the ability to take phone orders through the admin. Will this module be updated to work?

21 Dec 2018, 3:21 PM
#209
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,706
Plugin Contributions:
56

Re: Login as Customer module [Support Thread]

gtgeorge:

We are working on upgrading our storefront to 1.5.6 but do not wish to loose the ability to take phone orders through the admin. Will this module be updated to work?

Yes. Someone will take care of it.

27 Dec 2018, 7:33 PM
#210
dustie avatar

dustie

Zen Follower

Join Date:
Nov 2010
Posts:
159
Plugin Contributions:
0

Re: Login as Customer module [Support Thread]

Hallo,

First of all, thanks for this great mod!

Just checking. I have just finished upgrading our Webshop to v.1.5.6. I use the Login as Customers module and so I installed the latest Version for v1.5.5, but it doesn't seem to be working.

I keep getting the following error…..

"Your admin token has expired, please refresh admin customer page before clicking place order to generate new token."

Is this because module still needs to be update for the new Version, or is this a different issue?

thanks for update..

27 Dec 2018, 7:46 PM
#211
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,706
Plugin Contributions:
56

Re: Login as Customer module [Support Thread]

It needs to be updated. I hope it will also be rationalized so there's only one copy of the mod in the zip file, since maintaining two copies (one with and one without) has led to a divergence in the two versions, and likely bugs. :(

27 Dec 2018, 8:25 PM
#212
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,706
Plugin Contributions:
56

Re: Login as Customer module [Support Thread]

ALAC has been updated to support 1.5.6. Please note that Master Password contribution has been separated out and now needs to be installed separately.

27 Dec 2018, 9:10 PM
#213
dustie avatar

dustie

Zen Follower

Join Date:
Nov 2010
Posts:
159
Plugin Contributions:
0

Re: Login as Customer module [Support Thread]

Thanks Scott

Unfortunately I was too quick in installing this update… it has now completely mucked up my "german" customer files. There isn't an update for the German pack yet and so this mod doesn't work together with old translations.

30 Dec 2018, 10:41 AM
#214
gtgeorge avatar

gtgeorge

New Zenner

Join Date:
Mar 2005
Posts:
53
Plugin Contributions:
0

Re: Login as Customer module [Support Thread]

It is installed and working on my test upgrade site. Now to figure out how to get it to login securely since I get a warning when confirming I wish to login as that customer that data is being transmitted over a non-secure connection.

1 Jan 2019, 1:42 PM
#215
jodean avatar

jodean

Totally Zenned

Join Date:
May 2011
Location:
Tennessee
Posts:
511
Plugin Contributions:
0

Re: Login as Customer module [Support Thread]

Installed plugin without any problem. Master plugin works as described. However when i click on the customer page button Place Order the Login As Customer page looks correct but when I click on place order the customer email account is not transferred to the login screen. I checked the installation file placement and the SQL record and everything if there. The Login_As_Customers does get records written.

Error: Sorry, there is no match for that email address and/or password.

1 Jan 2019, 1:50 PM
#216
jodean avatar

jodean

Totally Zenned

Join Date:
May 2011
Location:
Tennessee
Posts:
511
Plugin Contributions:
0

Re: Login as Customer module [Support Thread]

Correction
The SQL records are not written to the Login_As_Customer table.

1 Jan 2019, 2:23 PM
#217
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,706
Plugin Contributions:
56

Re: Login as Customer module [Support Thread]

The record is removed as soon as the catalog page is loaded. But I found some bugs in the display on the catalog side when I was using php 7.2 that might have caused some confusion. Please download the updated zip and try again.

1 Jan 2019, 3:15 PM
#218
jodean avatar

jodean

Totally Zenned

Join Date:
May 2011
Location:
Tennessee
Posts:
511
Plugin Contributions:
0

Re: Login as Customer module [Support Thread]

Login page problem still exists.

1 Jan 2019, 6:00 PM
#219
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,706
Plugin Contributions:
56

Re: Login as Customer module [Support Thread]

You'll have to work with your developer to review your installation then. It's impossible for me to know what went wrong.

2 Jan 2019, 6:51 PM
#220
jodean avatar

jodean

Totally Zenned

Join Date:
May 2011
Location:
Tennessee
Posts:
511
Plugin Contributions:
0

Re: Login as Customer module [Support Thread]

I have uninstalled and re-installed this plugin three times now. No modifications were made to the plugin code. I have merged the customer.php from a current download of 1.5.6 customer.PHP and I have tried the customer.php in the plugin getting the same results. If i enter the customers email address and the master password it works. Why do you think the customer email address is not passed from the Login as Customer page?