diff --git a/hblink-SAMPLE.cfg b/hblink-SAMPLE.cfg index 4b18423..00c6a99 100755 --- a/hblink-SAMPLE.cfg +++ b/hblink-SAMPLE.cfg @@ -141,6 +141,7 @@ TGID_ACL: PERMIT:ALL # USER MANAGER # This is where to configure the details for use with a user managment script [USER_MANAGER] +THIS_SERVER_NAME: My MMDVM Server USE_USER_MAN: True # URL of the user managment server URL: http://localhost:8080/auth diff --git a/user_managment/app.py b/user_managment/app.py index 80c11f6..8fbc820 100644 --- a/user_managment/app.py +++ b/user_managment/app.py @@ -774,15 +774,32 @@ def create_app():

 

-

Email confirmed: ''' + str(u.email_confirmed_at) + '''

- - -

Update user information from RadioID.net

+

 Options for: ''' + u.username + ''' 

+ + + + + + + + + + + + + + + +
  +

Update from RadioID.net

 ''' + confirm_link + ''' 

Email confirmed: ''' + str(u.email_confirmed_at) + '''

 

Send user an email

- -

View auth log for: ''' + u.username + '''

 ''' + role_link + ''' 
 

View user auth log

  +

Deleted user

@@ -843,11 +860,6 @@ def create_app():

 

-

Deleted user: ''' + str(u.username) + '''

\n -''' + confirm_link + ''' -

 

-''' + role_link + ''' -

 

 Passphrase Authentication Method Key

@@ -858,7 +870,7 @@ def create_app(): - + @@ -943,120 +955,154 @@ def create_app(): content = '''

Flushed entire auth DB.

\n''' authlog_flush() elif request.args.get('portal_username'): - a = AuthLog.query.filter_by(portal_username=request.args.get('portal_username')).all() + a = AuthLog.query.filter_by(portal_username=request.args.get('portal_username')).order_by(AuthLog.login_dmr_id.desc()).all() + content = ''' -

 

- - -
Custom
0 - default
1+ new calculation)
0 - default,
1-999 - new calculation
'' 'passphrase'
+

 

+

Log for user: ''' + request.args.get('portal_username') + '''

+ +
\n''' for i in a: if i.login_type == 'Attempt': content = content + ''' - - - - - - - + + + + + + + ''' if i.login_type == 'Confirmed': content = content + ''' - - - - - - - + + + + + + + + +''' + if i.login_type == 'Failed': + content = content + ''' + + + + + + + + ''' content = content + '
-

DMR ID

+

 DMR ID 

-

Portal Username

+

 Portal Username 

-

Login IP

+

 Login IP 

-

Calculated Passphrase

+

 Calculated Passphrase 

-

Server

+

 Server 

-

Time (UTC)

+

 Time (UTC) 

-

Login Type

+

 Login Status 

''' + str(i.login_dmr_id) + '''''' + i.portal_username + '''''' + i.peer_ip + '''''' + i.login_auth_method + '''''' + i.server_name + '''''' + str(i.login_time) + '''''' + str(i.login_type) + ''' ''' + str(i.login_dmr_id) + '''  ''' + i.portal_username + '''  ''' + i.peer_ip + '''  ''' + i.login_auth_method + '''  ''' + i.server_name + '''  ''' + str(i.login_time) + '''  ''' + str(i.login_type) + ''' 
''' + str(i.login_dmr_id) + '''''' + i.portal_username + '''''' + i.peer_ip + '''''' + i.login_auth_method + '''''' + i.server_name + '''''' + str(i.login_time) + '''''' + str(i.login_type) + ''' ''' + str(i.login_dmr_id) + '''  ''' + i.portal_username + '''  ''' + i.peer_ip + '''  ''' + i.login_auth_method + '''  ''' + i.server_name + '''  ''' + str(i.login_time) + '''  ''' + str(i.login_type) + ''' 
 ''' + str(i.login_dmr_id) + '''  ''' + i.portal_username + '''  ''' + i.peer_ip + '''  ''' + i.login_auth_method + '''  ''' + i.server_name + '''  ''' + str(i.login_time) + '''  ''' + str(i.login_type) + ''' 
' else: - a = AuthLog.query.all() + #a = AuthLog.query.all().order_by(AuthLog.login_dmr_id) + #a = AuthLog.query.all() + a = AuthLog.query.order_by(AuthLog.login_dmr_id.desc()).limit(300).all() + recent_list = [] + r = AuthLog.query.order_by(AuthLog.login_dmr_id.desc()).all() + print(r) content = '''

 

Flush entire auth log

 

+

Auth log by DMR ID

- - +
\n''' for i in a: - if i.login_type == 'Attempt': - content = content + ''' + if i.login_dmr_id not in recent_list: + print() + recent_list.append(i.login_dmr_id) + if i.login_type == 'Attempt': + content = content + ''' - - - - - - - + + + + + + + ''' - if i.login_type == 'Confirmed': - content = content + ''' + if i.login_type == 'Confirmed': + content = content + ''' - - - - - - - + + + + + + + ''' + if i.login_type == 'Failed': + content = content + ''' + + + + + + + + + +''' + content = content + '
-

DMR ID

+

 DMR ID 

-

Portal Username

+

 Portal Username 

-

Login IP

+

 Login IP 

-

Calculated Passphrase

+

 Calculated Passphrase 

-

Server

+

 Server 

-

Time (UTC)

+

 Time (UTC) 

-

Login Type

+

 Login Status 

''' + str(i.login_dmr_id) + '''''' + i.portal_username + '''''' + i.peer_ip + '''''' + i.login_auth_method + '''''' + i.server_name + '''''' + str(i.login_time) + '''''' + str(i.login_type) + ''' ''' + str(i.login_dmr_id) + '''  ''' + i.portal_username + '''  ''' + i.peer_ip + '''  ''' + i.login_auth_method + '''  ''' + i.server_name + '''  ''' + str(i.login_time) + '''  ''' + str(i.login_type) + ''' 
''' + str(i.login_dmr_id) + '''''' + i.portal_username + '''''' + i.peer_ip + '''''' + i.login_auth_method + '''''' + i.server_name + '''''' + str(i.login_time) + '''''' + str(i.login_type) + ''' ''' + str(i.login_dmr_id) + '''  ''' + i.portal_username + '''  ''' + i.peer_ip + '''  ''' + i.login_auth_method + '''  ''' + i.server_name + '''  ''' + str(i.login_time) + '''  ''' + str(i.login_type) + ''' 
 ''' + str(i.login_dmr_id) + '''  ''' + i.portal_username + '''  ''' + i.peer_ip + '''  ''' + i.login_auth_method + '''  ''' + i.server_name + '''  ''' + str(i.login_time) + '''  ''' + str(i.login_type) + ''' 
' return render_template('flask_user_layout.html', markup_content = Markup(content)) @@ -1313,8 +1359,11 @@ def create_app(): mode='override', value=authorized_peer(hblink_req['login_id'])[1] ) - if authorized_peer(hblink_req['login_id'])[0] == False: - mmdvm_logins.append([hblink_req['login_id'], 'Not registered', 'None', 'Not authorized', time.time()]) + elif authorized_peer(hblink_req['login_id'])[0] == False: + print('log fail') + #mmdvm_logins.append([hblink_req['login_id'], 'Not registered', 'None', 'Not authorized', time.time()]) + + authlog_add(hblink_req['login_id'], hblink_req['login_ip'], hblink_req['login_server'], 'Not Registered', '-', 'Failed') response = jsonify( allow=False) elif not type(hblink_req['login_id']) == int: