aboutsummaryrefslogtreecommitdiff
path: root/captain/web.f90
diff options
context:
space:
mode:
Diffstat (limited to 'captain/web.f90')
-rw-r--r--captain/web.f9031
1 files changed, 7 insertions, 24 deletions
diff --git a/captain/web.f90 b/captain/web.f90
index 9d8fc3c..4242083 100644
--- a/captain/web.f90
+++ b/captain/web.f90
@@ -51,25 +51,7 @@ contains
end if
end function method
-
- function request_is_authenticated(req)
- use captain_db
- use server_response
- implicit none
-
- class(request), intent(in)::req
- logical::request_is_authenticated
-
- request_is_authenticated = .false.
- if(associated(req%token)) then
- request_is_authenticated = is_valid_session_db(req%token)
- if(request_is_authenticated) then
- call update_session_db(req%token)
- end if
- end if
-
- end function request_is_authenticated
-
+
subroutine echo_error_stdout(error_code)
implicit none
@@ -95,7 +77,7 @@ contains
call page%assign('project', project)
call page%assign('base_url', req%server)
- if(request_is_authenticated(req)) then
+ if(req%is_authenticated_user()) then
call page%assign('user_link_page', "profile")
call get_session_username_db(req%token, username)
@@ -1011,7 +993,7 @@ contains
use config, only: template_filepath, project
use logging
use server_response, only:request, response
- use http, only: HTTP_CODE_SUCCESS, HTTP_CODE_NOTFOUND
+ use http_codes, only: HTTP_CODE_SUCCESS, HTTP_CODE_NOTFOUND
use request_utils, only: get_job_page_title, handle_instruction_command
use captain_db, only: scan_instructions_for_db, get_session_username_db, destroy_session_db
use utilities, only: build_date
@@ -1031,7 +1013,7 @@ contains
integer::i
logical::authenticated
- authenticated = request_is_authenticated(req)
+ authenticated = req%is_authenticated_user()
if(trim(req%location) == "/" .or. &
trim(req%location) == "/index.html" .or. &
@@ -1211,9 +1193,9 @@ contains
use config, only: template_filepath, global_permissions
use logging
use server_response, only:request, response
- use http, only: HTTP_CODE_FAILURE, HTTP_CODE_SUCCESS
use http_post_utilities
use query_utilities, only: query
+ use http_codes
implicit none
type(request), intent(in)::req
@@ -1300,7 +1282,8 @@ contains
use server_response, only:request, response
use logging
use request_utils
- use http
+ use http_codes
+ use http, only: write_response_headers, write_redirect
use iso_fortran_env, only: output_unit
use utilities, only: echo_file_stdout
implicit none