From 6ae21577802462f38d98dd0e5415166008b1b13f Mon Sep 17 00:00:00 2001 From: Jeffrey Armstrong Date: Wed, 27 Apr 2022 12:48:26 -0400 Subject: Started work on user-facing user stuff for web interface. --- captain/db.f90 | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'captain/db.f90') diff --git a/captain/db.f90 b/captain/db.f90 index 77e12ed..7a8052d 100644 --- a/captain/db.f90 +++ b/captain/db.f90 @@ -1543,5 +1543,26 @@ contains end if end function get_session_auth_db + + subroutine get_session_username_db(session, username) + implicit none + + character(len=*), intent(in)::session + character(len=*), intent(out)::username + + type(sqlite3_stmt)::stmt + + username = ' ' + + if(stmt%prepare(db, "SELECT username FROM session_auth WHERE session=? LIMIT 1") == SQLITE_OK) then + if(stmt%bind_text(1, session) == SQLITE_OK) then + if(stmt%step() == SQLITE_ROW) then + call stmt%column_text(0, username) + end if + end if + call stmt%finalize() + end if + + end subroutine get_session_username_db end module captain_db -- cgit v1.2.3