-
Notifications
You must be signed in to change notification settings - Fork 0
/
usuario.py
358 lines (338 loc) · 24.6 KB
/
usuario.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
from flask import Flask, render_template, url_for, redirect, request, session
from DBManager import DBManager
import sqlite3
from sqlite3.dbapi2 import Error
import base64
import hashlib
import os
import binascii
import random
import time
import utilsMethod
import usuario
import producto
from markupsafe import escape
import config
def nonAccess(request, session):
_Loggedin_ = utilsMethod.Loggedin(session)
_userID_ = utilsMethod.userIDSession(session)
_rolID_ = utilsMethod.rolIDSession(session)
_photo_ = usuario.get_imageProfile(session)
return render_template("nonAccess.html", pageName="Sin Acceso", Loggedin=_Loggedin_,userID=_userID_,rolID=_rolID_,photo=_photo_)
def ingreso(request, session):
_Loggedin_ = utilsMethod.Loggedin(session)
_userID_ = utilsMethod.userIDSession(session)
_rolID_ = utilsMethod.rolIDSession(session)
_photo_ = usuario.get_imageProfile(session)
utilsMethod.TokenCSRF()
username = ''
password = ''
if utilsMethod.Loggedin(session):
imageProfile = get_imageProfile(session)
return producto.listProducts(request, session)
if request.method == 'GET':
CSRF = utilsMethod.TokenCSRF()
session['TokenCSRF'] = CSRF
return render_template("login.html", pageName="Login", Loggedin=_Loggedin_,userID=_userID_,rolID=_rolID_,photo=_photo_, TokenCSRF = CSRF)
if request.method == 'POST':
token = request.form.get('token')
username = escape(str(request.form.get('username')).strip())
password = escape(str(request.form.get('password')).strip())
if utilsMethod.checkTokenCSRF(session['TokenCSRF'], token):
if usuario.checkLogin(username,password):
utilsMethod.createSession(session, username)
session['rolID'] = 1
imageProfile = get_imageProfile(session)
return producto.listProducts(request, session)
else:
m = "Usuario o Contraseña incorrecto."
CSRF = utilsMethod.TokenCSRF()
session['TokenCSRF'] = CSRF
return render_template('login.html', Loggedin=_Loggedin_,userID=_userID_,rolID=_rolID_,photo=_photo_, error = m, TokenCSRF = CSRF)
else:
m = "Token CSRF Errado."
CSRF = utilsMethod.TokenCSRF()
session['TokenCSRF'] = CSRF
return render_template('login.html', Loggedin=_Loggedin_,userID=_userID_,rolID=_rolID_,photo=_photo_, error = m, TokenCSRF = CSRF)
def ingresoAdmin(request, session):
_Loggedin_ = utilsMethod.Loggedin(session)
_userID_ = utilsMethod.userIDSession(session)
_rolID_ = utilsMethod.rolIDSession(session)
_photo_ = usuario.get_imageProfile(session)
utilsMethod.TokenCSRF()
username = ''
password = ''
if utilsMethod.Loggedin(session):
return producto.listProducts(request, session)
if request.method == 'GET':
CSRF = utilsMethod.TokenCSRF()
session['TokenCSRF'] = CSRF
return render_template('panelAdmin.html', pageName="Acceso Admin.", Loggedin=_Loggedin_,userID=_userID_,rolID=_rolID_,photo=_photo_, TokenCSRF = CSRF)
if request.method == 'POST':
token = request.form.get('token')
username = escape(str(request.form.get('username')).strip())
password = escape(str(request.form.get('password')).strip())
if utilsMethod.checkTokenCSRF(session['TokenCSRF'], token):
if usuario.checkLoginAdmin(username,password,session):
utilsMethod.createSession(session, username)
return producto.listProducts(request, session)
else:
m = "Usuario o Contraseña incorrecto."
CSRF = utilsMethod.TokenCSRF()
session['TokenCSRF'] = CSRF
return render_template('panelAdmin.html', pageName="Acceso Admin.", Loggedin=_Loggedin_,userID=_userID_,rolID=_rolID_,photo=_photo_, error = m, TokenCSRF = CSRF)
else:
m = "Token CSRF Errado."
CSRF = utilsMethod.TokenCSRF()
session['TokenCSRF'] = CSRF
return render_template('panelAdmin.html', pageName="Acceso Admin.", Loggedin=_Loggedin_,userID=_userID_,rolID=_rolID_,photo=_photo_, error = m, TokenCSRF = CSRF)
def logout(request,session):
utilsMethod.destroySession(session)
CSRF = utilsMethod.TokenCSRF()
session['TokenCSRF'] = CSRF
_Loggedin_ = utilsMethod.Loggedin(session)
return render_template("login.html", Loggedin=_Loggedin_, TokenCSRF = CSRF)
def existUserAdmin(user,session):
q_admin = "SELECT username,password,salt FROM administrador WHERE username = ?;"
d_param_admin = (str(user),)
q_superadmin = "SELECT username,password,salt FROM superAdministrador WHERE username = ?;"
d_param_superadmin = (str(user),)
with DBManager() as db:
r_admin = db.execute(q_admin, d_param_admin)
data_admin = db.fetchall()
r_superadmin = db.execute(q_superadmin, d_param_superadmin)
data_superadmin = db.fetchall()
if (len(data_admin) > 0):
session['rolID'] = 2
return data_admin
if (len(data_superadmin) > 0):
session['rolID'] = 3
return data_superadmin
def checkLoginAdmin(user, passwd, session):
checkUserName = existUserAdmin(user,session)
salt = ""
for row in checkUserName:
salt = row[2]
print(salt)
if session['rolID'] == 2: tableAdmin = "administrador"
if session['rolID'] == 3: tableAdmin = "superAdministrador"
if (len(checkUserName) > 0):
queries = "SELECT username,password FROM " +str(tableAdmin)+ " WHERE username = ? AND password = ?;"
passwd = utilsMethod.passwordSalt(passwd, salt)
print(passwd)
print(tableAdmin)
data_params = (str(user),str(passwd))
with DBManager() as db:
result = db.execute(queries, data_params)
if db.fetchall():
return True
else:
return False
def existUser(user):
queries = "SELECT username,password,salt FROM usuarios WHERE username = ?;"
data_params = (str(user),)
with DBManager() as db:
result = db.execute(queries, data_params)
data = db.fetchall()
return data
def checkLogin(user, passwd):
checkUserName = existUser(user)
salt = ""
for row in checkUserName:
salt = row[2]
if (len(checkUserName) > 0):
queries = "SELECT username,password FROM usuarios WHERE username = ? AND password = ?;"
passwd = utilsMethod.passwordSalt(passwd, salt)
data_params = (str(user),str(passwd))
with DBManager() as db:
result = db.execute(queries, data_params)
if db.fetchall():
return True
else:
return False
def registro(request,session):
_Loggedin_ = utilsMethod.Loggedin(session)
if request.method == 'GET':
return render_template('registro.html', Loggedin=_Loggedin_)
if request.method == 'POST':
username = escape(str(request.form.get('username')).strip())
if (len(existUser(username)) > 0): return render_template("registro.html", Loggedin=_Loggedin_, error = "El usuario ya existe!")
password = escape(str(request.form.get('password')).strip())
salt = utilsMethod.generateSaltPasswd()
password = utilsMethod.passwordSalt(password, salt)
nombres = escape(str(request.form.get('nombres')).strip())
apellidos = escape(str(request.form.get('apellidos')).strip())
tipoDoc = escape(str(request.form.get('tipoDoc')).strip())
documento = escape(str(request.form.get('numDoc')).strip())
telefono = escape(str(request.form.get('telefono')).strip())
email = escape(str(request.form.get('email')).strip())
direccion = escape(str(request.form.get('direccion')).strip())
if nombres is None: nombres = ""
if apellidos is None: apellidos = ""
if tipoDoc is None: tipoDoc = ""
if documento is None: documento = None
if telefono is None: telefono = None
if direccion is None: direccion = ""
file = request.files['imgUpload']
if file: mimetype = file.content_type
else: mimetype = ""
urlImage = base64.b64encode(utilsMethod.blobImageUpload(request,'imgUpload'))
getimgBase64Hex = urlImage
ImgDataURI = "data:%s;base64,%s" % (mimetype, getimgBase64Hex.decode("utf-8"))
queries = """INSERT INTO usuarios (username,password,salt,nombres,apellidos,tipoDoc,documento,telefono,email,direccion,imagen,tipoImagen)
VALUES (?,?,?,?,?,?,?,?,?,?,?,?);"""
data_params = (username,password,salt,nombres,apellidos,tipoDoc,documento,telefono,email,direccion,ImgDataURI,mimetype)
if len(username)!=0 and len(password)!=0:
with DBManager() as db:
try:
result = db.execute(queries, data_params)
return render_template('registro.html', Loggedin=_Loggedin_, success="Registro Exitoso.")
except sqlite3.OperationalError as msg:
return render_template('registro.html', Loggedin=_Loggedin_, error=str(msg))
else:
return render_template('registro.html', Loggedin=_Loggedin_, error="Error durante el registro del usuario.")
def changePassword(request,session):
_Loggedin_ = utilsMethod.Loggedin(session)
_userID_ = utilsMethod.userIDSession(session)
_rolID_ = utilsMethod.rolIDSession(session)
_photo_ = usuario.get_imageProfile(session)
if request.method == 'GET':
return render_template("cambiarPassword.html", pageName="Cambiar Contraseña", Loggedin=_Loggedin_,userID=_userID_,rolID=_rolID_,photo=_photo_)
if request.method == 'POST':
passwdCurrent = escape(str(request.form.get('passwdCurrent')).strip())
password = escape(str(request.form.get('password')).strip())
retypePasswd = escape(str(request.form.get('retypePasswd')).strip())
checkUserName = usuario.existUser(_userID_)
salt = ""
for row in checkUserName:
salt = row[2]
if (len(checkUserName) > 0):
queries = "SELECT username,password FROM usuarios WHERE username = ? AND password = ?;"
passwd = utilsMethod.passwordSalt(passwdCurrent, salt)
data_params = (str(_userID_),str(passwd))
with DBManager() as db:
result = db.execute(queries, data_params)
data = db.fetchall()
if len(data):
newSalt = utilsMethod.generateSaltPasswd()
newPasswd = utilsMethod.passwordSalt(password, newSalt)
sql_update_query = "UPDATE usuarios SET password=?, salt=? WHERE username=?;"
sql_data_params = (newPasswd,newSalt,_userID_)
with DBManager() as db:
db.execute(sql_update_query, sql_data_params)
db.commit()
return render_template("cambiarPassword.html", pageName="Cambiar Contraseña", Loggedin=_Loggedin_,userID=_userID_,rolID=_rolID_,photo=_photo_, success="La contraseña ha sido cambiada con exito.")
if len(data) <= 0:
return render_template("cambiarPassword.html", pageName="Cambiar Contraseña", Loggedin=_Loggedin_,userID=_userID_,rolID=_rolID_,photo=_photo_, error="Su actual contraseña no es correcta.")
def get_myProfile(request,session):
_Loggedin_ = utilsMethod.Loggedin(session)
_userID_ = utilsMethod.userIDSession(session)
_rolID_ = utilsMethod.rolIDSession(session)
_photo_ = usuario.get_imageProfile(session)
if request.method == 'GET':
if utilsMethod.Loggedin(session) == True:
elems = []
queries = "SELECT username,nombres,apellidos,tipoDoc,documento,telefono,email,direccion,imagen,tipoImagen FROM usuarios WHERE username = ?;"
data_params = (_userID_,)
with DBManager() as db:
try:
result = db.execute(queries, data_params)
data = db.fetchall()
for row in data:
username = row[0]
nombres = row[1]
apellidos = row[2]
tipoDoc = row[3]
documento = row[4]
telefono = row[5]
email = row[6]
direccion = row[7]
imagen = row[8]
elemento = [username,nombres,apellidos,tipoDoc,documento,telefono,email,direccion,str(imagen)]
elems.append( elemento )
except sqlite3.OperationalError as msg:
return str(msg)
return render_template("perfil.html", pageName="Mi Perfil", Loggedin=_Loggedin_,userID=_userID_,rolID=_rolID_,photo=_photo_, elems=elems)
if request.method == 'POST':
email = escape(str(request.form.get('email')).strip())
nombres = escape(str(request.form.get('nombres')).strip())
apellidos = escape(str(request.form.get('apellidos')).strip())
tipoDoc = escape(str(request.form.get('tipoDoc')).strip())
documento = escape(str(request.form.get('numDoc')).strip())
telefono = escape(str(request.form.get('telefono')).strip())
direccion = escape(str(request.form.get('direccion')).strip())
if nombres is None: nombres = ""
if apellidos is None: apellidos = ""
if tipoDoc is None: tipoDoc = ""
if documento is None: documento = None
if telefono is None: telefono = None
if direccion is None: direccion = ""
file = request.files['imgUpload']
if file:
mimetype = file.content_type
isImgUpload = True
else:
mimetype = ""
isImgUpload = False
if (isImgUpload):
urlImage = base64.b64encode(utilsMethod.blobImageUpload(request,'imgUpload'))
getimgBase64Hex = urlImage
ImgDataURI = "data:%s;base64,%s" % (mimetype, getimgBase64Hex.decode("utf-8"))
queries = "UPDATE usuarios SET nombres=?,apellidos=?,tipoDoc=?,documento=?,telefono=?,email=?,direccion=?,imagen=?,tipoImagen=? WHERE username=?;"
data_params = (nombres,apellidos,tipoDoc,documento,telefono,email,direccion,ImgDataURI,mimetype,_userID_)
else:
queries = "UPDATE usuarios SET nombres=?,apellidos=?,tipoDoc=?,documento=?,telefono=?,email=?,direccion=? WHERE username=?;"
data_params = (nombres,apellidos,tipoDoc,documento,telefono,email,direccion,_userID_)
if len(_userID_)!=0:
with DBManager() as db:
try:
db.execute(queries, data_params)
db.commit()
return render_template('perfil.html', pageName="Mi Perfil", Loggedin=_Loggedin_,userID=_userID_,rolID=_rolID_,photo=_photo_, success="Se actualizó su información.")
except sqlite3.OperationalError as msg:
return render_template('perfil.html', pageName="Mi Perfil", Loggedin=_Loggedin_,userID=_userID_,rolID=_rolID_,photo=_photo_, error=str(msg))
else:
return render_template('perfil.html', pageName="Mi Perfil", Loggedin=_Loggedin_,userID=_userID_,rolID=_rolID_,photo=_photo_, error="Error durante la actualización del usuario.")
def list_AllUsers(request,session):
_Loggedin_ = utilsMethod.Loggedin(session)
_userID_ = utilsMethod.userIDSession(session)
_rolID_ = utilsMethod.rolIDSession(session)
_photo_ = usuario.get_imageProfile(session)
queries = "SELECT * FROM usuarios;"
data_params = ()
with DBManager() as db:
try:
result = db.execute(queries, data_params)
data = db.fetchall()
return render_template("listAllUsuarios.html", pageName="Listado Usuarios (Todos)", Loggedin=_Loggedin_,userID=_userID_,rolID=_rolID_,photo=_photo_, data=data)
except sqlite3.OperationalError as msg:
return render_template("listAllUsuarios.html", pageName="Listado Usuarios (Todos)", Loggedin=_Loggedin_,userID=_userID_,rolID=_rolID_,photo=_photo_, error=str(msg))
def deleteUsuario(request,session,username):
_Loggedin_ = utilsMethod.Loggedin(session)
_userID_ = utilsMethod.userIDSession(session)
_rolID_ = utilsMethod.rolIDSession(session)
_photo_ = usuario.get_imageProfile(session)
queries = "DELETE FROM usuarios WHERE username = ?;"
data_params = (str(username),)
with DBManager() as db:
try:
result = db.execute(queries, data_params)
return str("ok")
except sqlite3.OperationalError as msg:
return str("fail")
def get_imageProfile(session):
if 'username' in session:
_rolID_ = utilsMethod.rolIDSession(session)
if (_rolID_ == 1):
userID = str(session['username'])
queries = "SELECT * FROM usuarios WHERE username = ?;"
data_params = (userID,)
with DBManager() as db:
result = db.execute(queries, data_params)
data = db.fetchone()
getImgBytes = data[10] #Field DB: imagen
return getImgBytes
else:
return str("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAQAAAAEACAYAAABccqhmAAAACXBIWXMAAAsTAAALEwEAmpwYAAAaeklEQVR4nO2de5QcVZ3HJwQQRd2FRRNg0rd6ZpJJum9Vz0xnZjoz032rJwlEwBXWzSp4EBcVMahJgMWj7q6I4rKICAhIIJHwDkRlFWTVBALsS1eOKJwDqKCiCIvKQx4B8ur93Z6ZkMc8+lFV33urfp9zPsc/1Ezd372/X99bt+pWSwvDMAzDMAzDMAzDMAzDMAzDMAzDMAzDMAwTCR1dQ28TbvkER/qfFa46L3Cl+p7j+vcHqZD+PY5b/lpH13AGHT+GsZKUO3QQJegq8jVKqoqtUoF5pDVzRAc6ngxjDfTr2UmJ/zg6eQNTqm1Clo5Cx5VhjId+LQ+mKfTv4Ekb/Exg2+HzFs1Gx5dhjMZx1Rp0soboL9DxZRhjSc0tHkq//lsMSNTwZgI51YWOM8MYieOV349O0PBVq9FxZhgjcaS6FJ+gISv9B9FxZhgjoQS5C56g4fscOs4MYyRCqqcNSNCQVdvRcWYY45iTV4fgkzMa+QlBhtkDWhsrdGJGpciqFeh4M4xRCE99FJ2YkRUAV92MjjfDGEUidgDG5J0AhtkdJxk7AGPyTgDD7EoydgBGFLwTwDCvk6QdgDFndy+ah447wxhBknYAdpr1l6PjzjBGIFx/GTwhI5aWAevQcWcYI0jUDsCYvBPAMCNQQmyCJ2T08k4Aw2iStAMwJu8EMExLMncAxqS2z0XHn2GgJHIHYEzeCWCSThJ3AHbxJnT8GQZKIncAxpT+A+j4MwwUJ5k7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