diff options
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 |