diff options
Diffstat (limited to 'captain/db.f90')
-rw-r--r-- | captain/db.f90 | 21 |
1 files changed, 21 insertions, 0 deletions
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 |