Jump to content
SCH_001

Login with PayPal saying return url is wrong

Recommended Posts

Ok a quick bit of back ground info. We have been running a osc store now for ages last was osCommerce Online Merchant v2.3.4 and have now installed osCommerce Online Merchant v2.3.4.1 CE Frozen BS in the same location that the old store was in.

The old store was working very happy with logon with PayPal but now even thou the return url is exactly the same I can get past the error (invalid client_ID or redirect_uri) I have checked it heaps of times and created a new secret

Any idea's on how to debug this?

Share this post


Link to post
Share on other sites

So just an update, I left it alone for the afternoon and trying it again and once I matched the tick boxes in the app with what was on paypal it now loads

BUT --- after entering paypal username and password the box closes and does nothing.. So enough for today, I will turn it off and try again tomorrow

Share this post


Link to post
Share on other sites

try opening Developer tools in your browser and checking the Network tab

once you get the hang of it there might be a clue as to what's going on


For a new install or if your store isn't mobile-friendly, get the community-supported responsive osCommerce (Phoenix).

here: on the official osc download page

Working on generalising bespoke solutions for Quickbooks integration, Easify integration and pay4later (DEKO) integration at 2.3.x

Share this post


Link to post
Share on other sites

Are you sure it was working on the old site? I think that paypal just replaced login with paypal with something else (connect?)


For a new install or if your store isn't mobile-friendly, get the community-supported responsive osCommerce (Phoenix).

here: on the official osc download page

Working on generalising bespoke solutions for Quickbooks integration, Easify integration and pay4later (DEKO) integration at 2.3.x

Share this post


Link to post
Share on other sites

The connect with paypal is creating a customer but with no first or last name and does not log on correctly

Going to try and spend some time on this tonight

Does anyone still have this working correctly especially on frozen

Share this post


Link to post
Share on other sites

Hey Troy,

I know about the issue with the first and last name.

Osc looks for indexes given_name and family_name in the response from PayPal.  I don't think these are available anymore or not always populated.  To overcome this I've had to use a different index i the response to reference called 'name' which contains both the first and last name.  So my code looks a little like this

if (!isset($response['given_name']) && !isset($response['family_name'])) {
  //code to extract firstname and lastname from name
  $name = explode(' ', $response['name']);

  $response['given_name'] = tep_db_prepare_input($name[0]);
  $response['family_name'] = tep_db_prepare_input((isset($name[count($name)-1]) ? $name[count($name)-1] : ''));
}

If you post the contents of your file includes/modules/content/login/cm_paypal_login.php I'll take a look and give you a solution from mine (this is the location and name for the stock OSC 2.3.4.1 so it may differ in your installation but should be similar).


If it still don't work, hit it again!

Senior PHP Dev with 18+ years of commercial experience for hire, all requirements considered, see profile for more information.

Is your version of osC up to date? You'll find the latest osC version (the community-supported responsive version) here.

Share this post


Link to post
Share on other sites

Is this issue the same as (or related to)

 ? If it is, at the very least please put a pointer in that thread pointing to this one.

Share this post


Link to post
Share on other sites

Hi Phil, I suspect this is similar but different. I asked OP to create a separate topic for this instead of posting on my original topic about deprecation. It's all good.


If it still don't work, hit it again!

Senior PHP Dev with 18+ years of commercial experience for hire, all requirements considered, see profile for more information.

Is your version of osC up to date? You'll find the latest osC version (the community-supported responsive version) here.

Share this post


Link to post
Share on other sites

Many thanks for the reply @peterbuzzin

file below

<?php
/*
  $Id$

  osCommerce, Open Source E-Commerce Solutions
  http://www.oscommerce.com

  Copyright (c) 2014 osCommerce

  Released under the GNU General Public License
*/

  if ( !class_exists('OSCOM_PayPal') ) {
    include(DIR_FS_CATALOG . 'includes/apps/paypal/OSCOM_PayPal.php');
  }

  class cm_paypal_login {
    var $code;
    var $group;
    var $title;
    var $description;
    var $sort_order;
    var $enabled = false;
    var $_app;

    function __construct() {
      global $PHP_SELF;

      $this->_app = new OSCOM_PayPal();
      $this->_app->loadLanguageFile('modules/LOGIN/LOGIN.php');

      $this->signature = 'paypal|paypal_login|4.0|2.3';

      $this->code = get_class($this);
      $this->group = basename(dirname(__FILE__));

      $this->title = $this->_app->getDef('module_login_title');
      $this->description = '<div align="center">' . $this->_app->drawButton($this->_app->getDef('module_login_legacy_admin_app_button'), tep_href_link('paypal.php', 'action=configure&module=LOGIN'), 'primary', null, true) . '</div>';

      if ( defined('OSCOM_APP_PAYPAL_LOGIN_STATUS') ) {
        $this->sort_order = OSCOM_APP_PAYPAL_LOGIN_SORT_ORDER;
        $this->enabled = in_array(OSCOM_APP_PAYPAL_LOGIN_STATUS, array('1', '0'));

        if ( OSCOM_APP_PAYPAL_LOGIN_STATUS == '0' ) {
          $this->title .= ' [Sandbox]';
        }

        if ( !function_exists('curl_init') ) {
          $this->description .= '<div class="secWarning">' . $this->_app->getDef('module_login_error_curl') . '</div>';

          $this->enabled = false;
        }

        if ( $this->enabled === true ) {
          if ( ((OSCOM_APP_PAYPAL_LOGIN_STATUS == '1') && (!tep_not_null(OSCOM_APP_PAYPAL_LOGIN_LIVE_CLIENT_ID) || !tep_not_null(OSCOM_APP_PAYPAL_LOGIN_LIVE_SECRET))) || ((OSCOM_APP_PAYPAL_LOGIN_STATUS == '0') && (!tep_not_null(OSCOM_APP_PAYPAL_LOGIN_SANDBOX_CLIENT_ID) || !tep_not_null(OSCOM_APP_PAYPAL_LOGIN_SANDBOX_SECRET))) ) {
            $this->description .= '<div class="secWarning">' . $this->_app->getDef('module_login_error_credentials') . '</div>';

            $this->enabled = false;
          }
        }
      }
    }

    function execute() {
      global $oscTemplate;

      if ( isset($_GET['action']) ) {
        if ( $_GET['action'] == 'paypal_login' ) {
          $this->preLogin();
        } elseif ( $_GET['action'] == 'paypal_login_process' ) {
          $this->postLogin();
        }
      }

      $scopes = cm_paypal_login_get_attributes();
      $use_scopes = array('openid');

      foreach ( explode(';', OSCOM_APP_PAYPAL_LOGIN_ATTRIBUTES) as $a ) {
        foreach ( $scopes as $group => $attributes ) {
          foreach ( $attributes as $attribute => $scope ) {
            if ( $a == $attribute ) {
              if ( !in_array($scope, $use_scopes) ) {
                $use_scopes[] = $scope;
              }
            }
          }
        }
      }

      $cm_paypal_login = $this;

      ob_start();
      include('includes/modules/content/' . $this->group . '/templates/tpl_' . basename(__FILE__));
      $template = ob_get_clean();

      $oscTemplate->addContent($template, $this->group);
    }

    function preLogin() {
      global $paypal_login_access_token, $paypal_login_customer_id, $sendto, $billto;

      $return_url = tep_href_link('login.php', '', 'SSL');

      if ( isset($_GET['code']) ) {
        $paypal_login_customer_id = false;

        $params = array('code' => $_GET['code'],
                        'redirect_uri' => str_replace('&amp;', '&', tep_href_link('login.php', 'action=paypal_login', 'SSL')));

        $response_token = $this->_app->getApiResult('LOGIN', 'GrantToken', $params);

        if ( !isset($response_token['access_token']) && isset($response_token['refresh_token']) ) {
          $params = array('refresh_token' => $response_token['refresh_token']);

          $response_token = $this->_app->getApiResult('LOGIN', 'RefreshToken', $params);
        }

        if ( isset($response_token['access_token']) ) {
          $params = array('access_token' => $response_token['access_token']);

          $response = $this->_app->getApiResult('LOGIN', 'UserInfo', $params);

          if ( isset($response['email']) ) {
            $paypal_login_access_token = $response_token['access_token'];
            tep_session_register('paypal_login_access_token');

            $force_login = false;

// check if e-mail address exists in database and login or create customer account
            if ( !tep_session_is_registered('customer_id') ) {
              $customer_id = 0;
              $customer_default_address_id = 0;

              $force_login = true;

              $email_address = tep_db_prepare_input($response['email']);

              $check_query = tep_db_query("select customers_id from customers where customers_email_address = '" . tep_db_input($email_address) . "' limit 1");
              if (tep_db_num_rows($check_query)) {
                $check = tep_db_fetch_array($check_query);

                $customer_id = (int)$check['customers_id'];
              } else {
                $customers_firstname = tep_db_prepare_input($response['given_name']);
                $customers_lastname = tep_db_prepare_input($response['family_name']);

                $sql_data_array = array('customers_firstname' => $customers_firstname,
                                        'customers_lastname' => $customers_lastname,
                                        'customers_email_address' => $email_address,
                                        'customers_telephone' => '',
                                        'customers_fax' => '',
                                        'customers_newsletter' => '0',
                                        'customers_password' => '');

                if ($this->hasAttribute('phone') && isset($response['phone_number']) && tep_not_null($response['phone_number'])) {
                  $customers_telephone = tep_db_prepare_input($response['phone_number']);

                  $sql_data_array['customers_telephone'] = $customers_telephone;
                }

                tep_db_perform('customers', $sql_data_array);

                $customer_id = (int)tep_db_insert_id();

                tep_db_query("insert into customers_info (customers_info_id, customers_info_number_of_logons, customers_info_date_account_created) values ('" . (int)$customer_id . "', '0', now())");
              }
            }

// check if paypal shipping address exists in the address book
            $ship_firstname = tep_db_prepare_input($response['given_name']);
            $ship_lastname = tep_db_prepare_input($response['family_name']);
            $ship_address = tep_db_prepare_input($response['address']['street_address']);
            $ship_city = tep_db_prepare_input($response['address']['locality']);
            $ship_zone = tep_db_prepare_input($response['address']['region']);
            $ship_zone_id = 0;
            $ship_postcode = tep_db_prepare_input($response['address']['postal_code']);
            $ship_country = tep_db_prepare_input($response['address']['country']);
            $ship_country_id = 0;
            $ship_address_format_id = 1;

            $country_query = tep_db_query("select countries_id, address_format_id from countries where countries_iso_code_2 = '" . tep_db_input($ship_country) . "' limit 1");
            if (tep_db_num_rows($country_query)) {
              $country = tep_db_fetch_array($country_query);

              $ship_country_id = $country['countries_id'];
              $ship_address_format_id = $country['address_format_id'];
            }

            if ($ship_country_id > 0) {
              $zone_query = tep_db_query("select zone_id from zones where zone_country_id = '" . (int)$ship_country_id . "' and (zone_name = '" . tep_db_input($ship_zone) . "' or zone_code = '" . tep_db_input($ship_zone) . "') limit 1");
              if (tep_db_num_rows($zone_query)) {
                $zone = tep_db_fetch_array($zone_query);

                $ship_zone_id = $zone['zone_id'];
              }
            }

            $check_query = tep_db_query("select address_book_id from address_book where customers_id = '" . (int)$customer_id . "' and entry_firstname = '" . tep_db_input($ship_firstname) . "' and entry_lastname = '" . tep_db_input($ship_lastname) . "' and entry_street_address = '" . tep_db_input($ship_address) . "' and entry_postcode = '" . tep_db_input($ship_postcode) . "' and entry_city = '" . tep_db_input($ship_city) . "' and (entry_state = '" . tep_db_input($ship_zone) . "' or entry_zone_id = '" . (int)$ship_zone_id . "') and entry_country_id = '" . (int)$ship_country_id . "' limit 1");
            if (tep_db_num_rows($check_query)) {
              $check = tep_db_fetch_array($check_query);

              $sendto = $check['address_book_id'];
            } else {
              $sql_data_array = array('customers_id' => $customer_id,
                                      'entry_firstname' => $ship_firstname,
                                      'entry_lastname' => $ship_lastname,
                                      'entry_street_address' => $ship_address,
                                      'entry_postcode' => $ship_postcode,
                                      'entry_city' => $ship_city,
                                      'entry_country_id' => $ship_country_id);

              if (ACCOUNT_STATE == 'true') {
                if ($ship_zone_id > 0) {
                  $sql_data_array['entry_zone_id'] = $ship_zone_id;
                  $sql_data_array['entry_state'] = '';
                } else {
                  $sql_data_array['entry_zone_id'] = '0';
                  $sql_data_array['entry_state'] = $ship_zone;
                }
              }

              tep_db_perform('address_book', $sql_data_array);

              $address_id = tep_db_insert_id();

              $sendto = $address_id;

              if ($customer_default_address_id < 1) {
                tep_db_query("update customers set customers_default_address_id = '" . (int)$address_id . "' where customers_id = '" . (int)$customer_id . "'");
                $customer_default_address_id = $address_id;
              }
            }

            if ($force_login == true) {
              $paypal_login_customer_id = $customer_id;
            } else {
              $paypal_login_customer_id = false;
            }

            if ( !tep_session_is_registered('paypal_login_customer_id') ) {
              tep_session_register('paypal_login_customer_id');
            }

            $billto = $sendto;

            if ( !tep_session_is_registered('sendto') ) {
              tep_session_register('sendto');
            }

            if ( !tep_session_is_registered('billto') ) {
              tep_session_register('billto');
            }

            $return_url = tep_href_link('login.php', 'action=paypal_login_process', 'SSL');
          }
        }
      }

//      echo '<script>window.opener.location.href="' . str_replace('&amp;', '&', $return_url) . '";window.close();</script>';
echo '<script>
		if( typeof window.opener === \'undefined\' || window.opener === null ){
			window.location.href="' . str_replace('&amp;', '&', $return_url) . '";
		}else{
			window.opener.location.href="' . str_replace('&amp;', '&', $return_url) . '";
			window.close();
		}
	</script>';

      exit;
    }

    function postLogin() {
      global $paypal_login_customer_id, $login_customer_id, $language, $payment;

      if ( tep_session_is_registered('paypal_login_customer_id') ) {
        if ( $paypal_login_customer_id !== false ) {
          $login_customer_id = $paypal_login_customer_id;
        }

        tep_session_unregister('paypal_login_customer_id');
      }

// Register PayPal Express Checkout as the default payment method
      if ( !tep_session_is_registered('payment') || ($payment != 'paypal_express') ) {
        if (defined('MODULE_PAYMENT_INSTALLED') && tep_not_null(MODULE_PAYMENT_INSTALLED)) {
          if ( in_array('paypal_express.php', explode(';', MODULE_PAYMENT_INSTALLED)) ) {
            if ( !class_exists('paypal_express') ) {
              include('includes/languages/' . $language . '/modules/payment/paypal_express.php');
              include('includes/modules/payment/paypal_express.php');
            }

            $ppe = new paypal_express();

            if ( $ppe->enabled ) {
              $payment = 'paypal_express';
              tep_session_register('payment');
            }
          }
        }
      }
    }

    function isEnabled() {
      return $this->enabled;
    }

    function check() {
      return defined('OSCOM_APP_PAYPAL_LOGIN_STATUS');
    }

    function install() {
      tep_redirect(tep_href_link('paypal.php', 'action=configure&subaction=install&module=LOGIN'));
    }

    function remove() {
      tep_redirect(tep_href_link('paypal.php', 'action=configure&subaction=uninstall&module=LOGIN'));
    }

    function keys() {
      return array('OSCOM_APP_PAYPAL_LOGIN_CONTENT_WIDTH', 'OSCOM_APP_PAYPAL_LOGIN_SORT_ORDER');
    }

    function hasAttribute($attribute) {
      return in_array($attribute, explode(';', OSCOM_APP_PAYPAL_LOGIN_ATTRIBUTES));
    }

    function get_default_attributes() {
      $data = array();

      foreach ( cm_paypal_login_get_attributes() as $group => $attributes ) {
        foreach ( $attributes as $attribute => $scope ) {
          $data[] = $attribute;
        }
      }

      return $data;
    }
  }

  function cm_paypal_login_get_attributes() {
    return array('personal' => array('full_name' => 'profile',
                                     'date_of_birth' => 'profile',
                                     'age_range' => 'https://uri.paypal.com/services/paypalattributes',
                                     'gender' => 'profile'),
                 'address' => array('email_address' => 'email',
                                    'street_address' => 'address',
                                    'city' => 'address',
                                    'state' => 'address',
                                    'country' => 'address',
                                    'zip_code' => 'address',
                                    'phone' => 'phone'),
                 'account' => array('account_status' => 'https://uri.paypal.com/services/paypalattributes',
                                    'account_type' => 'https://uri.paypal.com/services/paypalattributes',
                                    'account_creation_date' => 'https://uri.paypal.com/services/paypalattributes',
                                    'time_zone' => 'profile',
                                    'locale' => 'profile',
                                    'language' => 'profile'),
                 'checkout' => array('seamless_checkout' => 'https://uri.paypal.com/services/expresscheckout'));
  }
?>

 

Share this post


Link to post
Share on other sites

Ok,

So there is an issue that your login with PayPal is 3 years out of date, the newest version is 2017 but I've ran a comparison and the differences are largely the replacement of HTTP_GET_VARS for $_GET and hardcoded db table names .  So all indicators at the moment look good, we'll see how it goes.

On approx line 123 find:

if ( isset($response['email']) ) {
  $paypal_login_access_token = $response_token['access_token'];
  tep_session_register('paypal_login_access_token');

  $force_login = false;

Replace with:

if ( isset($response['email']) ) {
  $paypal_login_access_token = $response_token['access_token'];
  tep_session_register('paypal_login_access_token');

  $force_login = false;

  if (!isset($response['given_name']) && !isset($response['family_name'])) {
  	//code to extract firstname and lastname from name
  	$name = explode(' ', $response['name']);

  	$response['given_name'] = tep_db_prepare_input($name[0]);
  	$response['family_name'] = tep_db_prepare_input((isset($name[count($name)-1]) ? $name[count($name)-1] : ''));
  }

 

Try that and we'll see how far we get and what might need doing after


If it still don't work, hit it again!

Senior PHP Dev with 18+ years of commercial experience for hire, all requirements considered, see profile for more information.

Is your version of osC up to date? You'll find the latest osC version (the community-supported responsive version) here.

Share this post


Link to post
Share on other sites

Ok that's now got the customers first and last name entered but still no logon

The screen refreshes the connect with paypal box closes but still not logged in

Share this post


Link to post
Share on other sites

1 down, 1 to go, cool.

So I can see you already have the redirect fix added to your code, so unlikely to be that as a next step.

Can you confirm the account belonging to the registered paypal address you used to login with has been added to your customers list?  If it hasn't then a process elsewhere is failing.

If the account has been added, delete it.  Then clear your cookies and session data, close the browser, reopen and try again.

Osc may be storing navigation history and attempting to redirect you elsewhere or may have partially saved user account information and is missing others which is causing a logged in check to be incomplete.


If it still don't work, hit it again!

Senior PHP Dev with 18+ years of commercial experience for hire, all requirements considered, see profile for more information.

Is your version of osC up to date? You'll find the latest osC version (the community-supported responsive version) here.

Share this post


Link to post
Share on other sites

Ok

Yes the paypal user got added to the customer list

account deleted

swapped to google chrome browser cleared all history etc using the advanced tab and tried again same result

 

Share this post


Link to post
Share on other sites
Posted (edited)

Update

Behind the scenes I've been working on this for supercheaphobb to find out what the cause is.

After a lot of investigation today we have found the issue and been able to introduce a solution without much change to the code.

This issue is present in every install of the Frozen 2.3.4.1 Fork (straight out of the box) and stores will need to make this change in order to use Login with PayPal (now called Connect with PayPal) or any other similar oAuth/token authorisation service such as Login with Google or Facebook.  A some point a decision was made to move script from top of login.php and place it amongst the code of includes/modules/content/login/cm_login_form.php.  This would have been fine if that code was only intended for the login form but it's intended to be shared amongst and used by any other modules/content/login/***.php modules that need to (i.e. Login with PayPal).  This code was originally designed to execute if $login_customer_id was set and more than zero (that was all it needed), but in cm_login_form.php it's been buried within other conditional statements so it will only execute if the traditional login form has been completed and a user/pass match has been found another reason why this code will always fail when using other authentication methods.

Full thanks and credit go to supercheaphobb for his sponsorship of this solution.

The original script previously located in login.php is 

//from login.php (originally)
if ( is_int($login_customer_id) && ($login_customer_id > 0) ) {
  if (SESSION_RECREATE == 'True') {
  tep_session_recreate();
  }

  $customer_info_query = tep_db_query("select c.customers_firstname, c.customers_default_address_id, ab.entry_country_id, ab.entry_zone_id from " . TABLE_CUSTOMERS . " c left join " . TABLE_ADDRESS_BOOK . " ab on (c.customers_id = ab.customers_id and c.customers_default_address_id = ab.address_book_id) where c.customers_id = '" . (int)$login_customer_id . "'");
  $customer_info = tep_db_fetch_array($customer_info_query);

  $customer_id = $login_customer_id;
  tep_session_register('customer_id');

  $customer_default_address_id = $customer_info['customers_default_address_id'];
  tep_session_register('customer_default_address_id');

  $customer_first_name = $customer_info['customers_firstname'];
  tep_session_register('customer_first_name');

  $customer_country_id = $customer_info['entry_country_id'];
  tep_session_register('customer_country_id');

  $customer_zone_id = $customer_info['entry_zone_id'];
  tep_session_register('customer_zone_id');

  tep_db_query("update " . TABLE_CUSTOMERS_INFO . " set customers_info_date_of_last_logon = now(), customers_info_number_of_logons = customers_info_number_of_logons+1, password_reset_key = null, password_reset_date = null where customers_info_id = '" . (int)$customer_id . "'");

  // reset session token
  $sessiontoken = md5(tep_rand() . tep_rand() . tep_rand() . tep_rand());

  // restore cart contents
  $cart->restore_contents();

  if (sizeof($navigation->snapshot) > 0) {
  $origin_href = tep_href_link($navigation->snapshot['page'], tep_array_to_string($navigation->snapshot['get'], array(tep_session_name())), $navigation->snapshot['mode']);
  $navigation->clear_snapshot();
  tep_redirect($origin_href);
  }

  tep_redirect(tep_href_link('index.php'));
}

And has now been moved to includes/modules/content/login/cm_login_form.php at approximately line 61.  

There are two possible fixes for this and you can choose whichever will best suit your current/future needs.

1: Relocate/move the code back to login.php (but make sure you remove it from cm_login_form.php)

or

2: Move the code outside of the conditionals (if statements) that surround it in cm_login_form.php

If you choose option 2, you'll need to ensure that you give Login with PayPal a lower sort value in Admin > Modules > Content than the sort value of Login Form as the Login with PayPal code needs to execute before Login Form (as it would have originally before Frozen). So if Login Form has a sort value of 100, give Login with PayPal a sort value of 50.

Option 2 Fix below

Select the following code on line 61

//from login.php
if ( is_int($login_customer_id) && ($login_customer_id > 0) ) {
  if (SESSION_RECREATE == 'True') {
  tep_session_recreate();
  }

  $customer_info_query = tep_db_query("select c.customers_firstname, c.customers_default_address_id, ab.entry_country_id, ab.entry_zone_id from " . TABLE_CUSTOMERS . " c left join " . TABLE_ADDRESS_BOOK . " ab on (c.customers_id = ab.customers_id and c.customers_default_address_id = ab.address_book_id) where c.customers_id = '" . (int)$login_customer_id . "'");
  $customer_info = tep_db_fetch_array($customer_info_query);

  $customer_id = $login_customer_id;
  tep_session_register('customer_id');

  $customer_default_address_id = $customer_info['customers_default_address_id'];
  tep_session_register('customer_default_address_id');

  $customer_first_name = $customer_info['customers_firstname'];
  tep_session_register('customer_first_name');

  $customer_country_id = $customer_info['entry_country_id'];
  tep_session_register('customer_country_id');

  $customer_zone_id = $customer_info['entry_zone_id'];
  tep_session_register('customer_zone_id');

  tep_db_query("update " . TABLE_CUSTOMERS_INFO . " set customers_info_date_of_last_logon = now(), customers_info_number_of_logons = customers_info_number_of_logons+1, password_reset_key = null, password_reset_date = null where customers_info_id = '" . (int)$customer_id . "'");

  // reset session token
  $sessiontoken = md5(tep_rand() . tep_rand() . tep_rand() . tep_rand());

  // restore cart contents
  $cart->restore_contents();

  if (sizeof($navigation->snapshot) > 0) {
    $origin_href = tep_href_link($navigation->snapshot['page'], tep_array_to_string($navigation->snapshot['get'], array(tep_session_name())), $navigation->snapshot['mode']);
    $navigation->clear_snapshot();
    tep_redirect($origin_href);
  }

  tep_redirect(tep_href_link('index.php'));
}

Cut and paste it on what will then be approx line 65, the line immediately after the closing/right curly brace/bracket and above the line of code starting with if($error == true){

}

//PASTE THE CODE HERE

if ($error == true) {
	$messageStack->add('login', MODULE_CONTENT_LOGIN_TEXT_LOGIN_ERROR);
}

@burt you might want to patch/fix this, if not in frozen then in the Edge version.

Edited by peterbuzzin

If it still don't work, hit it again!

Senior PHP Dev with 18+ years of commercial experience for hire, all requirements considered, see profile for more information.

Is your version of osC up to date? You'll find the latest osC version (the community-supported responsive version) here.

Share this post


Link to post
Share on other sites

I'll include it in the next release of Frozen patches. This is a separate issue from the Login/Connect with PayPal in the other thread, or does it affect it, too?

Share this post


Link to post
Share on other sites

Hey @MrPhil it's separate as although it needs to be done in order for Login with PayPal to work it would also need to be done in order to use any other "Login with *" module.

For simplicity, I'd recommend Option 1 "Relocating the code back to login.php" and then you don't have to remember to always have all "Login with *" set with a lower sort value than "Login Form", it could be any sort value once reverted back to login.php.  The code isn't specific to cm_login_form.php and was intended to be available to all login modules, it should not have been moved.


If it still don't work, hit it again!

Senior PHP Dev with 18+ years of commercial experience for hire, all requirements considered, see profile for more information.

Is your version of osC up to date? You'll find the latest osC version (the community-supported responsive version) here.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×