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.
Printable View
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.
Updated the "with master password" portion for 1.5.5; fixed a few bugs.
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
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:
Which is the line modified by Alac.PHP Code:
$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 . '"');
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
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.
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:
I'll try to make some changes to see if it will be solved.PHP Code:
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;
change the one line of code as such:
notice the (int) in front of the cInfo->customers_id.PHP Code:
$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 . '"');
i am not use how you have ended up with a blank customers_id, but that should address the error you reported.
best.
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?
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..