Added admin_auth for apps independent of admin_app
This commit is contained in:
parent
779605ee7c
commit
f689dc5f63
4 changed files with 145 additions and 9 deletions
|
|
@ -16,6 +16,7 @@ from paramecio2.modules.admin import admin_app, t
|
|||
from paramecio2.libraries.sendmail import SendMail
|
||||
from paramecio2.libraries.formsutils import check_csrf
|
||||
from hmac import compare_digest as compare_hash
|
||||
from paramecio2.modules.admin.libraries.admin_auth import admin_prepare, admin_finished
|
||||
|
||||
try:
|
||||
import crypt
|
||||
|
|
@ -47,7 +48,8 @@ if hasattr(config, 'email_address'):
|
|||
|
||||
#admin_app=Blueprint('admin_app', __name__, static_folder='static')
|
||||
|
||||
@admin_app.before_request
|
||||
#@admin_app.before_request
|
||||
"""
|
||||
def admin_prepare():
|
||||
|
||||
g.connection=WebModel.connection()
|
||||
|
|
@ -87,13 +89,12 @@ def admin_prepare():
|
|||
|
||||
return redirect(url_redirect)
|
||||
|
||||
|
||||
"""
|
||||
if request.method=='POST':
|
||||
check_csrf()
|
||||
"""
|
||||
"""
|
||||
#home=welcome_app.route("/")(home)
|
||||
admin_prepare=admin_app.before_request(admin_prepare)
|
||||
|
||||
@admin_app.after_request
|
||||
#@admin_app.after_request
|
||||
"""
|
||||
def admin_finished(response):
|
||||
|
||||
#print('pepe')
|
||||
|
|
@ -101,6 +102,9 @@ def admin_finished(response):
|
|||
g.connection.close()
|
||||
|
||||
return response
|
||||
"""
|
||||
|
||||
admin_finished=admin_app.after_request(admin_finished)
|
||||
|
||||
# Load modules from admin
|
||||
|
||||
|
|
@ -115,6 +119,7 @@ for app in config.apps:
|
|||
|
||||
a=import_module(config_path)
|
||||
|
||||
|
||||
arr_modules_admin={}
|
||||
|
||||
for app_load in config_admin:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue