Post by straightlight » Fri Sep 25, 2015 8:58 am

I believe I may have found the cause on why the well known JSON error window pop-up issue. I am not sure if this fix has been posted before but one solution I would have would be to go

In catalog/controller/api/login.php file,

find:

Code: Select all

$this->load->model('account/api');

		$api_info = $this->model_account_api->login($this->request->post['username'], $this->request->post['password']);

		if ($api_info) {
			$this->session->data['api_id'] = $api_info['api_id'];

			$json['cookie'] = $this->session->getId();

			$json['success'] = $this->language->get('text_success');
		} else {
			$json['error'] = $this->language->get('error_login');
		}
replace with:

Code: Select all

if (!isset($this->request->post['username']) || !isset($this->request->post['password'])) {
			$json['error'] = $this->language->get('error_login');
			
		} else {
			$this->load->model('account/api');

			$api_info = $this->model_account_api->login($this->request->post['username'], $this->request->post['password']);

			if ($api_info) {
				$this->session->data['api_id'] = $api_info['api_id'];

				$json['cookie'] = $this->session->getId();

				$json['success'] = $this->language->get('text_success');
			} else {
				$json['error'] = $this->language->get('error_login');
			}
		}

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by IP_CAM » Fri Sep 25, 2015 10:06 am

what Versions does this include?
Ernie

My Github OC Site: https://github.com/IP-CAM
5'600 + FREE OC Extensions, on the World's largest private Github OC Repository Archive Site.


User avatar
Legendary Member

Posts

Joined
Tue Mar 04, 2014 1:37 am
Location - Switzerland

Post by straightlight » Fri Sep 25, 2015 8:05 pm

Latest version; 2.0.3.1 .

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON
Who is online

Users browsing this forum: No registered users and 2 guests