diff --git a/user_managment/app.py b/user_managment/app.py index 7feb0e1..b914ac2 100644 --- a/user_managment/app.py +++ b/user_managment/app.py @@ -951,6 +951,9 @@ def create_app(): elif request.args.get('flush_user_db') == 'true' and request.args.get('portal_username'): content = '''

Flushed auth DB for: ''' + request.args.get('portal_username') + '''

\n''' authlog_flush_user(request.args.get('portal_username')) + elif request.args.get('flush_user_mmdvm') == 'true' and request.args.get('mmdvm_server'): + content = '''

Flushed auth DB for: ''' + request.args.get('mmdvm_server') + '''

\n''' + authlog_flush_mmdvm_server(request.args.get('mmdvm_server')) elif request.args.get('flush_dmr_id_db') == 'true' and request.args.get('dmr_id'): content = '''

Flushed auth DB for: ''' + request.args.get('dmr_id') + '''

\n''' authlog_flush_dmr_id(request.args.get('dmr_id')) @@ -1003,7 +1006,80 @@ def create_app(): if i.login_type == 'Attempt': content = content + ''' -  ''' + str(i.login_dmr_id) + '''  +  ''' + str(i.login_dmr_id) + '''  +   ''' + i.portal_username + '''  +  ''' + i.peer_ip + '''  +  ''' + i.login_auth_method + '''  +  ''' + str(i.server_name) + '''  +  ''' + str(i.login_time) + '''  +  ''' + str(i.login_type) + '''  + +''' + if i.login_type == 'Confirmed': + content = content + ''' + +  ''' + str(i.login_dmr_id) + '''  +  ''' + i.portal_username + '''  +  ''' + i.peer_ip + '''  +  ''' + i.login_auth_method + '''  +  ''' + str(i.server_name) + '''  +  ''' + str(i.login_time) + '''  +  ''' + str(i.login_type) + '''  + +''' + if i.login_type == 'Failed': + content = content + ''' + +  ''' + str(i.login_dmr_id) + '''  +  ''' + i.portal_username + '''  +  ''' + i.peer_ip + '''  +  ''' + i.login_auth_method + '''  +  ''' + str(i.server_name) + '''  +  ''' + str(i.login_time) + '''  +  ''' + str(i.login_type) + '''  + +''' + content = content + '' + + elif request.args.get('mmdvm_server'): + print('mmdvm') + a = AuthLog.query.filter_by(server_name=request.args.get('mmdvm_server')).order_by(AuthLog.login_time.desc()).all() + content = ''' +

 

+

Flush authentication log for server: ''' + request.args.get('mmdvm_server') + '''

+

Log for MMDVM server: ''' + request.args.get('mmdvm_server') + '''

+ + + + + + + + + + + + + \n''' + for i in a: + if i.login_type == 'Attempt': + content = content + ''' + + @@ -1015,7 +1091,7 @@ def create_app(): if i.login_type == 'Confirmed': content = content + ''' - + @@ -1027,7 +1103,7 @@ def create_app(): if i.login_type == 'Failed': content = content + ''' - + @@ -1037,6 +1113,7 @@ def create_app(): ''' content = content + '
+

 DMR ID 

+
+

 Portal Username 

+
+

 Login IP 

+
+

 Calculated Passphrase 

+
+

 Server 

+
+

 Time (UTC) 

+
+

 Login Status 

+
 ''' + str(i.login_dmr_id) + '''    ''' + i.portal_username + '''   ''' + i.peer_ip + '''   ''' + i.login_auth_method + ''' 
 ''' + str(i.login_dmr_id) + '''  ''' + str(i.login_dmr_id) + '''   ''' + i.portal_username + '''   ''' + i.peer_ip + '''   ''' + i.login_auth_method + ''' 
 ''' + str(i.login_dmr_id) + '''  ''' + str(i.login_dmr_id) + '''   ''' + i.portal_username + '''   ''' + i.peer_ip + '''   ''' + i.login_auth_method + ''' 
' + else: #a = AuthLog.query.all().order_by(AuthLog.login_dmr_id) #a = AuthLog.query.all() @@ -1045,8 +1122,7 @@ def create_app(): ## r = AuthLog.query.order_by(AuthLog.login_dmr_id.desc()).all() content = '''

 

-

Flush entire auth log

-

 

+

Flush entire authentication log

Auth log by DMR ID

@@ -1084,7 +1160,7 @@ def create_app(): - + @@ -1096,7 +1172,7 @@ def create_app(): - + @@ -1108,7 +1184,7 @@ def create_app(): - + @@ -1281,6 +1357,11 @@ def create_app(): for i in flush_e: db.session.delete(i) db.session.commit() + def authlog_flush_mmdvm_server(_mmdvm_serv): + flush_e = AuthLog.query.filter_by(server_name=_mmdvm_serv).all() + for i in flush_e: + db.session.delete(i) + db.session.commit() @app.route('/add_user', methods=['POST', 'GET']) @login_required
 ''' + i.portal_username + '''   ''' + i.peer_ip + '''   ''' + i.login_auth_method + '''  ''' + i.server_name + '''  ''' + str(i.server_name) + '''   ''' + str(i.login_time) + '''   ''' + str(i.login_type) + ''' 
 ''' + i.portal_username + '''   ''' + i.peer_ip + '''   ''' + i.login_auth_method + '''  ''' + i.server_name + '''  ''' + str(i.server_name) + '''   ''' + str(i.login_time) + '''   ''' + str(i.login_type) + ''' 
 ''' + i.portal_username + '''   ''' + i.peer_ip + '''   ''' + i.login_auth_method + '''  ''' + i.server_name + '''  ''' + str(i.server_name) + '''   ''' + str(i.login_time) + '''   ''' + str(i.login_type) + '''