Remove old exec calls
This commit is contained in:
parent
7e2859ffc0
commit
bad7a77676
|
@ -40,8 +40,6 @@ contains
|
|||
|
||||
subroutine create_db(db_path)
|
||||
character(len=128), intent(in) :: db_path
|
||||
|
||||
! character(len=:), allocatable :: command
|
||||
type(db_type) :: db
|
||||
integer :: rc
|
||||
|
||||
|
@ -49,35 +47,21 @@ contains
|
|||
rc = db_create_users(db)
|
||||
rc = db_close(db)
|
||||
|
||||
! command = 'sqlite3 '//db_path &
|
||||
! //' ''CREATE TABLE users ' &
|
||||
! //'(id INTEGER PRIMARY KEY ASC, ' &
|
||||
! //'username TEXT, password TEXT, ' &
|
||||
! //'apperance TEXT, x_pos INTEGER, ' &
|
||||
! //'y_pos INTEGER, last_login INTEGER, ' &
|
||||
! //' created INTEGER);'''
|
||||
! write (12, *) command
|
||||
! call execute_command_line(command)
|
||||
|
||||
end subroutine create_db
|
||||
|
||||
subroutine add_user(db_path, request, length)
|
||||
character(len=128), intent(in) :: db_path
|
||||
character, dimension(:), allocatable, intent(in) :: request
|
||||
integer, intent(in) :: length
|
||||
|
||||
integer :: i, j, s_idx, e_idx, username_len, password_len
|
||||
character(len=24) :: username
|
||||
character(len=24) :: password
|
||||
character(len=32) :: created
|
||||
character(len=8) :: appearance
|
||||
logical :: start = .false.
|
||||
|
||||
type(db_type) :: db
|
||||
integer :: rc
|
||||
|
||||
! character(len=:), allocatable :: command
|
||||
|
||||
j = 1
|
||||
get_username: do i = 1, length
|
||||
if (request(i) .eq. '=') then
|
||||
|
@ -125,19 +109,6 @@ contains
|
|||
end do get_appearance
|
||||
appearance = transfer(request(s_idx:length), appearance)
|
||||
|
||||
! write (created, *) time()
|
||||
! command = 'sqlite3 '//db_path(:Len_Trim(db_path)) &
|
||||
! //' "INSERT INTO users (username,password' &
|
||||
! //',apperance,x_pos,y_pos,last_login,created) VALUES (''' &
|
||||
! //username(:username_len) &
|
||||
! //''',''' &
|
||||
! //password(:password_len) &
|
||||
! //''',''' &
|
||||
! //appearance(:Len_Trim(appearance)) &
|
||||
! //''',0,0,0,' &
|
||||
! //created(:Len_Trim(created))//');"'
|
||||
! call execute_command_line(command)
|
||||
|
||||
rc = db_open(db, db_path(:Len_Trim(db_path)))
|
||||
rc = db_add_user(db, username(:username_len), password(:password_len), appearance(:Len_Trim(appearance)), 0, 0, 0, time())
|
||||
rc = db_close(db)
|
||||
|
|
Loading…
Reference in New Issue