Page 1 of 1

API problem to edit order

Posted: Sat Mar 11, 2017 1:32 pm
by delalibera
I upgraded my 1.5.6 OpenCart to 2.3.0.2 version and I have several problems when I edit my received orders.
In Brazil 90% of the internet connections are through dynamic ips, dynamic ips are ips that change daily. To manage my orders I have to add my new IP in API every day, sometimes it happens several times in a day, It's very difficult to work this way.
I think that the opencart system, when the user is logged in the administrative area, this user must to be able to change the orders without the API.
I think that the API is very usefull for external accesses and not when the user is logged in admin area.
When one user is logged in the admin area and this user still needs the api to change an order, THIS IS VERY STUPID.

Does anyone have an extension that allow logged in users change the orders?
Or can help me to change this in code?

Re: API problem to edit order

Posted: Mon Mar 13, 2017 9:11 pm
by delalibera
Some help?

Re: API problem to edit order

Posted: Mon Mar 13, 2017 10:54 pm
by thekrotek
In catalog/controller/api/login.php find this line:

Code: Select all

if (!in_array($this->request->server['REMOTE_ADDR'], $ip_data)) {
And comment the line AFTER it, this will disable error IP message completely, no matter the IP-address.

Re: API problem to edit order

Posted: Wed Jul 04, 2018 9:17 pm
by motion2082
So change from this

Code: Select all

if (!in_array($this->request->server['REMOTE_ADDR'], $ip_data)) {
				$json['error']['ip'] = sprintf($this->language->get('error_ip'), $this->request->server['REMOTE_ADDR']);
			}
to this?

Code: Select all

if (!in_array($this->request->server['REMOTE_ADDR'], $ip_data)) {
				 $this->request->server['REMOTE_ADDR']);
			}
I get an error