From f3b48d0678fe23c8ff4aed8bfdc370b3b8197b9f Mon Sep 17 00:00:00 2001 From: Jeffrey Armstrong Date: Wed, 4 May 2022 12:08:32 -0400 Subject: Auth levels are now read from a special config file. Both display and operations are now checked for auth level. --- captain/response.f90 | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'captain/response.f90') diff --git a/captain/response.f90 b/captain/response.f90 index 34c537c..e172cc1 100644 --- a/captain/response.f90 +++ b/captain/response.f90 @@ -73,6 +73,8 @@ implicit none character(len=:), pointer::token => null() character(len=4)::method = "GET" + integer::auth_level + type(query)::q type(cookies)::c @@ -111,6 +113,8 @@ contains subroutine request_init(self, str, server_explicit, protocol_explicit, method, cookiestring) use logging use utilities, only: toupper + use captain_db, only: get_session_auth_db + use auth_levels, only: AUTH_NONE implicit none class(request) :: self @@ -222,6 +226,14 @@ contains if(.not.associated(self%token) .and. associated(self%c%get_value("token"))) then self%token => self%c%get_value("token") end if + else + call self%c%init() + end if + + if(associated(self%token)) then + self%auth_level = get_session_auth_db(self%token) + else + self%auth_level = AUTH_NONE end if end subroutine request_init -- cgit v1.2.3