Mise à jour de sécurité

This commit is contained in:
2025-04-03 12:45:32 +02:00
parent f692414698
commit dbe918cfcf
32 changed files with 302 additions and 437 deletions
+14 -20
View File
@@ -4,6 +4,7 @@ import configparser
import shutil
import tempfile
import base64
import socket
import psycopg2
import psycopg2.extras
from os.path import abspath, join, pardir, dirname
@@ -107,27 +108,20 @@ def load_ui(*args):
return ui_class
'''
def login_base(take=None):
from CenRa_METABASE.tools.PythonSQL import host,port,dbname,password,os_user
first_conn = psycopg2.connect("host=" + host + " port=" + port + " dbname="+dbname+" user=first_cnx password=" + password)
first_cur = first_conn.cursor(cursor_factory = psycopg2.extras.DictCursor)
first_cur.execute("SELECT mdp_w, login_w FROM pg_catalog.pg_user t1, admin_sig.vm_users_sig t2 WHERE t2.oid = t1.usesysid AND (login_w = '" + os_user + "' OR login_w = '" + os_user + "')")
res_ident = first_cur.fetchone()
def pyperclip():
IPAddr=socket.gethostbyname(socket.gethostname())
dst = abspath(abspath(join(plugin_path(), "CenRa_AUTOMAP\\tools\\")))
if IPAddr[0:11] == "100.100.100": #4269
src = '\\\\100.100.100.100\\nuage\\SI_Systeme d information\\Z_QGIS\\PLUGIN\\StyleLayer.py'
if IPAddr[0:9] == "192.168.0": #01
src = '\\\\100.100.100.100\\nuage\\SI_Systeme d information\\Z_QGIS\\PLUGIN\\StyleLayer.py'
if IPAddr[0:9] == "192.168.1": #0726
src = '\\\\100.100.100.100\\nuage\\SI_Systeme d information\\Z_QGIS\\PLUGIN\\StyleLayer.py'
try:
shutil.copy(src, dst)
except:
print('404')
mdp = base64.b64decode(str(res_ident[0])).decode('utf-8')
user = res_ident[1]
con = psycopg2.connect("host=" + host + " port=" + port + " dbname="+dbname+" user=" + user + " password=" + mdp)
cur = con.cursor(cursor_factory = psycopg2.extras.DictCursor)
first_conn.close()
if take:
return cur,con
else:
return cur
'''
def send_issues(url,titre,body,labels):
import requests
import json