diff options
author | Jeffrey Armstrong <jeff@approximatrix.com> | 2021-06-24 16:01:06 -0400 |
---|---|---|
committer | Jeffrey Armstrong <jeff@approximatrix.com> | 2021-06-24 16:01:06 -0400 |
commit | e9460ea44fe7c11dc6d7d668ca9cd1b36418f097 (patch) | |
tree | a6f5a0c8f7380a8e242dd1e2782458cd66c7770e /captain/web.f90 | |
parent | 3d7696972f5025be9612f87c0fe4203e0859641e (diff) | |
download | levitating-e9460ea44fe7c11dc6d7d668ca9cd1b36418f097.tar.gz levitating-e9460ea44fe7c11dc6d7d668ca9cd1b36418f097.zip |
Player tokens can now be set via web interface.
Diffstat (limited to 'captain/web.f90')
-rw-r--r-- | captain/web.f90 | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/captain/web.f90 b/captain/web.f90 index c18848e..9817775 100644 --- a/captain/web.f90 +++ b/captain/web.f90 @@ -609,7 +609,17 @@ contains end if ! Token assignment - res = trim(res)//new_line(' ')//"<h3>Security</h3>"//new_line(' ')// & + res = trim(res)//new_line(' ')//"<h3>Security</h3>"//new_line(' ')//"<p>" + + if(player_has_token_db(trim(player_name))) then + res = trim(res)//"Player currently has a token assigned." + else + res = trim(res)//"<em>Player is insecure! Please assign a token!</em>" + end if + + res = trim(res)//"</p>" + + res = trim(res)//new_line(' ')// & '<form action="assign_token.html" method="POST">'//new_line(' ')// & '<label for="token">Token:</label>'// & '<input name="token" id="token" />'//new_line(' ')// & @@ -1016,7 +1026,7 @@ contains end function request_templated function handle_post(req) result(resp) - use captain_db, only: add_player_db, add_group_db + use captain_db, only: add_player_db, add_group_db, update_player_token_db use page_template use config, only: template_filepath use logging @@ -1055,6 +1065,11 @@ contains call add_player_db(posted%get_value("name")) call page%assign('destination', 'players.html') + else if(trim(second) == "assign_token.html") then + + call update_player_token_db(posted%get_value("player"), posted%get_value("token")) + call page%assign('destination', "players/"//posted%get_value("player")//".html") + end if else if(trim(category) == "groups") then |