From f3b48d0678fe23c8ff4aed8bfdc370b3b8197b9f Mon Sep 17 00:00:00 2001
From: Jeffrey Armstrong An Error Occurred:"
+ Print *, error_code
+ Print *, " "//one_link//" "//one_link//" No players currently can run these instructions Assign a player to these instructions Assign a player to these instructions Remove a player from these instructions Remove a player from these instructions "//scanlink//" "//scanlink//" This operation will not destroy any instructions This operation will not destroy any instructions None Yet "
-
- if(player_has_token_db(trim(player_name))) then
- res = trim(res)//"Player currently has a token assigned."
- else
- res = trim(res)//"Player is insecure! Please assign a token!"
+ if(req%auth_level >= global_permissions%get("modify-players")) then
+ ! Token assignment
+ res = trim(res)//new_line(' ')//" "
+
+ if(player_has_token_db(trim(player_name))) then
+ res = trim(res)//"Player currently has a token assigned."
+ else
+ res = trim(res)//"Player is insecure! Please assign a token!"
+ end if
+
+ res = trim(res)//""//trim(instruction_name)//"
"
- one_link => html_link(trim(instruction_name)//".json", &
- "View Raw")
- res = trim(res)//nl//"Launch Now
"//nl//""
do i = 1, n_players
@@ -260,39 +275,41 @@ contains
end if
- all_players => get_player_names()
- if(associated(all_players)) then
- res = trim(res)//nl//"
'
+ if(req%auth_level >= global_permissions%get("add-groups")) then
+ res = trim(res)//new_line(' ')//"Assign
"//nl//""
- do i = 1, size(all_players)
- if(n_players > 0) then
- j = get_player_id(all_players(i))
- if(any(j == players)) then
- cycle
+ if(req%auth_level >= global_permissions%get("assign-instructions")) then
+ all_players => get_player_names()
+ if(associated(all_players)) then
+ res = trim(res)//nl//"
"
+ deallocate(all_players)
+ end if
+
+ if(n_players > 0) then
+ res = trim(res)//nl//"Assign
"//nl//""
+ do i = 1, size(all_players)
+ if(n_players > 0) then
+ j = get_player_id(all_players(i))
+ if(any(j == players)) then
+ cycle
+ end if
end if
- end if
-
- one_link => html_link(req%page//"?assign="//trim(all_players(i)), &
- trim(all_players(i)))
-
- res = trim(res)//nl//"
"
- deallocate(all_players)
- end if
-
- if(n_players > 0) then
- res = trim(res)//nl//"Remove
"//nl//""
- do i = 1, n_players
- call get_player_name(players(i), player_name)
-
- one_link => html_link(req%page//"?remove="//trim(player_name), &
- trim(player_name))
-
- res = trim(res)//nl//"
"
+
+ one_link => html_link(req%page//"?assign="//trim(all_players(i)), &
+ trim(all_players(i)))
+
+ res = trim(res)//nl//"Remove
"//nl//""
+ do i = 1, n_players
+ call get_player_name(players(i), player_name)
+
+ one_link => html_link(req%page//"?remove="//trim(player_name), &
+ trim(player_name))
+
+ res = trim(res)//nl//"
"
+ end if
end if
end function generate_one_instuction_html
@@ -300,6 +317,7 @@ contains
function generate_instructions_html(req) result(res)
use captain_db
use server_response, only:request
+ use config, only: global_permissions
implicit none
type(request)::req
@@ -340,17 +358,20 @@ contains
end if
- res = trim(res)//new_line(' ')//"Management
"
-
- scanlink => html_link(req%page//"?scan", "Scan for instructions now")
- res = trim(res)//new_line(' ')//"Management
"
+
+ scanlink => html_link(req%page//"?scan", "Scan for instructions now")
+ res = trim(res)//new_line(' ')//"Management
"
-
- res = trim(res)//new_line(' ')// &
- 'Management
"
+
+ res = trim(res)//new_line(' ')// &
+ ''
+ end if
end function generate_groups_html
@@ -404,6 +427,7 @@ contains
use query_utilities
use logging
use remote_launch, only: launch_group
+ use config, only: global_permissions
implicit none
type(request)::req
@@ -437,7 +461,7 @@ contains
call q%init(req%query_string)
qreq => q%get_value("add")
- if(associated(qreq)) then
+ if(associated(qreq) .and. req%auth_level >= global_permissions%get("add-groups")) then
call write_log("ADD: "//trim(qreq))
@@ -454,7 +478,7 @@ contains
qreq => q%get_value("delete")
- if(associated(qreq)) then
+ if(associated(qreq) .and. req%auth_level >= global_permissions%get("modify-groups")) then
i = index(qreq, ',')
player_name = qreq(i+1:len(qreq))
@@ -465,12 +489,12 @@ contains
call remove_entry_from_group_db(id, i, j)
- else if(trim(req%query_string) == "launch") then
+ else if(trim(req%query_string) == "launch" .and. req%auth_level >= global_permissions%get("launch-job")) then
call launch_group(id)
write(launch_msg, '(I4, 1X, A13)') get_group_entries_count_db(id), "jobs launched"
- else if(trim(req%query_string) == "destroy") then
+ else if(trim(req%query_string) == "destroy" .and. req%auth_level >= global_permissions%get("modify-groups")) then
call delete_group_db(id)
@@ -511,15 +535,22 @@ contains
one_link => html_link("../instructions/"//trim(instruction_name)//".html", trim(instruction_name))
play_link => html_link("../players/"//trim(player_name)//".html", trim(player_name))
- delete_link => html_link(trim(group_name)//".html?delete="// &
- trim(instruction_name)//","//trim(player_name), &
- "Remove")
- res = trim(res)//new_line(' ')//"Add Instructions
"
@@ -559,16 +590,22 @@ contains
end if
end if
- res = trim(res)//new_line(' ')//'Destroy This Group
'//new_line(' ')// &
- ''//new_line(' ')// &
- 'Destroy This Group
'//new_line(' ')// &
+ ''//new_line(' ')// &
+ 'Management
"// &
- new_line(' ')//''
+ if(req%auth_level >= global_permissions%get("add-players")) then
+ res = trim(res)//new_line(' ')//"Management
"// &
+ new_line(' ')//''
+ end if
end function generate_players_html
@@ -629,6 +668,7 @@ contains
use captain_db
use server_response
use request_utils
+ use config, only: global_permissions
implicit none
type(request), intent(in)::req
@@ -683,24 +723,26 @@ contains
res = trim(res)//"Security
"//new_line(' ')//"Security
"//new_line(' ')//"