Index: openacs-4/packages/acs-tcl/tcl/security-procs-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/security-procs-postgresql.xql,v diff -u -r1.14 -r1.15 --- openacs-4/packages/acs-tcl/tcl/security-procs-postgresql.xql 20 Nov 2017 15:36:44 -0000 1.14 +++ openacs-4/packages/acs-tcl/tcl/security-procs-postgresql.xql 3 Sep 2024 15:37:34 -0000 1.15 @@ -2,44 +2,39 @@ postgresql7.1 - - + + update sec_session_properties set property_value = :value, secure_p = :secure, - last_hit = :last_hit + last_hit = :last_hit where session_id = :session_id and module = :module and property_name = :name - - - select sec_session_property__upsert(:session_id, :module, :name, :value, :secure, :last_hit) from dual - - - - + insert into secret_tokens(token_id, token, token_timestamp) values(nextval('t_sec_security_token_id_seq'), :random_token, now()) - + - - + + - + select token_id, token from secret_tokens, - (select trunc(random()*(select count(*)-15 from secret_tokens))::integer as first) r - where token_id >= r.first and r.first+15 > token_id; - + (select cast(random() * count(*) - :num_tokens as integer) as first + from secret_tokens) r + where token_id >= r.first and r.first + :num_tokens > token_id + - +