diff --git a/App/Auth/__init__.py b/App/Auth/__init__.py index 4d4ad1e..6e92707 100644 --- a/App/Auth/__init__.py +++ b/App/Auth/__init__.py @@ -9,14 +9,14 @@ def auth(): return render_template('auth.html') else: data = request.form.to_dict() - data['table'] = 'internal_users' if 'internal' in data else 'external_users' + print(data) auth_data = auth_model(data) if auth_data.status: session.update({ 'login': auth_data.result[0]['login'], + 'access_user': data['access'], 'role': auth_data.result[0]['user_role'], 'db_config': current_app.config['db_config'], - 'access_user': 'in' if 'internal' in data else 'ext', 'permanent': True }) return redirect(url_for('index')) diff --git a/App/Auth/sql/auth.sql b/App/Auth/sql/auth.sql index 0902578..4fb90bf 100644 --- a/App/Auth/sql/auth.sql +++ b/App/Auth/sql/auth.sql @@ -1,4 +1,4 @@ -SELECT login, user_role FROM $table +SELECT login, user_role FROM $access WHERE login = '$login' AND password = '$password' LIMIT 1; \ No newline at end of file diff --git a/App/Auth/templates/auth.html b/App/Auth/templates/auth.html index 5ce4b62..3bed3b2 100644 --- a/App/Auth/templates/auth.html +++ b/App/Auth/templates/auth.html @@ -13,10 +13,15 @@
-

Внутренний пользователь

+

+ Уровень доступа: + +

-