Skip to content

Commit

Permalink
[IMP] IoT : Automatic registration of the IoT Box in HTTPS without ce…
Browse files Browse the repository at this point in the history
…rtificate

When we are on HTTPS and we want to connect a box with the scan
we need to accept manually the certificate of the box.
With this commit we don't need to accept manually the certificate.
We don't have problem of mixed content if we use the onload method of Image object
So we load a image and put on parameter the token of the odoo DB to make a connection.
  • Loading branch information
qle-odoo committed Feb 15, 2019
1 parent 6b97f7e commit d3fa0e5
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions addons/hw_drivers/controllers/driver.py
Expand Up @@ -77,7 +77,8 @@ def event(self, requests):
def connect_box(self, token):
server = get_odoo_server_url()
if server:
return _('This IoTBox has already been connected')
f = open('/var/www/False.jpg','rb')
return f.read()
else:
iotname = ''
token = b64decode(token).decode('utf-8')
Expand All @@ -87,7 +88,8 @@ def connect_box(self, token):
path = os.getenv("HOME") + '/odoo/addons/point_of_sale/tools/posbox/configuration/connect_to_server.sh'
subprocess.call([path, url, iotname, token, reboot])
m.send_alldevices()
return _('IoTBox connected')
f = open('/var/www/True.jpg','rb')
return f.read()

#----------------------------------------------------------
# Drivers
Expand Down

0 comments on commit d3fa0e5

Please sign in to comment.