|
|
@ -23,6 +23,7 @@ as $function$
|
|
|
|
begin
|
|
|
|
begin
|
|
|
|
return query select * from sos.v_session
|
|
|
|
return query select * from sos.v_session
|
|
|
|
where session_uuid = _session_uuid
|
|
|
|
where session_uuid = _session_uuid
|
|
|
|
|
|
|
|
and session_time_logged_out is null
|
|
|
|
and session_time_last_active + session_timeout_length > now();
|
|
|
|
and session_time_last_active + session_timeout_length > now();
|
|
|
|
end; $function$;
|
|
|
|
end; $function$;
|
|
|
|
|
|
|
|
|
|
|
@ -34,6 +35,7 @@ begin
|
|
|
|
update sos."session"
|
|
|
|
update sos."session"
|
|
|
|
set session_time_last_active = now()
|
|
|
|
set session_time_last_active = now()
|
|
|
|
where session_uuid = _session_uuid
|
|
|
|
where session_uuid = _session_uuid
|
|
|
|
|
|
|
|
and session_time_logged_out is null
|
|
|
|
and now() < (select session_time_last_active + session_timeout_length);
|
|
|
|
and now() < (select session_time_last_active + session_timeout_length);
|
|
|
|
|
|
|
|
|
|
|
|
return query select * from sos.validate_session(_session_uuid);
|
|
|
|
return query select * from sos.validate_session(_session_uuid);
|
|
|
@ -65,6 +67,20 @@ begin
|
|
|
|
return query select * from sos.validate_session(_session_uuid);
|
|
|
|
return query select * from sos.validate_session(_session_uuid);
|
|
|
|
end; $function$;
|
|
|
|
end; $function$;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
create or replace function sos.end_session(_session_uuid uuid)
|
|
|
|
|
|
|
|
returns setof sos.v_session
|
|
|
|
|
|
|
|
language plpgsql
|
|
|
|
|
|
|
|
as $function$
|
|
|
|
|
|
|
|
begin
|
|
|
|
|
|
|
|
update sos."session"
|
|
|
|
|
|
|
|
set session_time_logged_out = now()
|
|
|
|
|
|
|
|
where session_uuid = _session_uuid
|
|
|
|
|
|
|
|
and session_time_logged_out is null
|
|
|
|
|
|
|
|
and now() < (select session_time_last_active + session_timeout_length);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return query select * from sos.validate_session(_session_uuid);
|
|
|
|
|
|
|
|
end; $function$;
|
|
|
|
|
|
|
|
|
|
|
|
create or replace function sos.create_item(_name text, _urlslug citext, _description text, _price_cents integer, _published boolean)
|
|
|
|
create or replace function sos.create_item(_name text, _urlslug citext, _description text, _price_cents integer, _published boolean)
|
|
|
|
returns setof sos.v_item
|
|
|
|
returns setof sos.v_item
|
|
|
|
language plpgsql
|
|
|
|
language plpgsql
|
|
|
|