]> git.evergreen-ils.org Git - Evergreen.git/commit
Added a new login type "persist", as a peer of "opac", "staff", and "temp".
authorscottmk <scottmk@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Mon, 7 Jun 2010 13:52:29 +0000 (13:52 +0000)
committerscottmk <scottmk@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Mon, 7 Jun 2010 13:52:29 +0000 (13:52 +0000)
commit71d85bc02211a6984a127e1c6128c5bb817dce3a
tree13ae54b08acf21da63ed853f62d46888608b93ed
parentcb8f8738ea92c5ffcaa9ddf5bfe5a3e60a52fb70
Added a new login type "persist", as a peer of "opac", "staff", and "temp".
It is intended for sessions that may stay open for days or weeks at a time
even in the absence of activity.  The default timeout interval is defined
as two weeks in opensrf.xml, and may be overridden by the org unit
setting "auth.persistent_login_interval".

Timeout resets work a little differently for persistent logins.  They
have no effect unless the session is within ten minutes of expiring.  When
they do take effect, they reset the timeout to ten minutes, rather than to
the full length of the original timeout.  That way we can avoid rudely
interrupting an active session without extending it excessively.

The ten minute reset interval for persistent timeouts is currently
hard-coded.  With some further work it could be made configurable.

The timeout resets for the older login types still work the way they
always have.

------------

In order to make it easier to specify long timeout intervals, the
auth server now accepts PostgreSQL-style interval strings, such as
"15 minutes" or "2 weeks".  Such strings work for any of the login
types, and they work either in opensrf.xml or in the org unit setting
values.

If the timeout setting (in either context) is all digits, then it will
be interpreted as an integral number of seconds, as it has been in the
past.  So existing settings will almost certainly continue to work
without change.

The exception -- an unlikely one -- is if the existing setting carries
a leading plus sign.  Under the old regime, a leading plus sign was
simply superfluous, and had no effect.  With the new version, a
leading plus sign means that the following number is to be treated as
a number of hours, rather than a number of seconds (just because
that's what PostgreSQL does with it).

Hence in the unlikely event that existing settings use a leading
plus sign, this change will make those timeouts 3600 times as long
as they should be.

If the timeout interval is expressed as anything other than a string
of all digits (possibly with leading and/or trailing white space), we
make a database call to get PostgreSQL to interpret it for us.  So the
convenience of using interval strings comes at the price of some
additional overhead.

--------------

Besides applying the changes to the C code, it will be necessary to
update the opensrf.xml file in order to define a default timeout
interval for the new login type.

M    Open-ILS/include/openils/oils_constants.h
M    Open-ILS/src/c-apps/oils_auth.c
M    Open-ILS/examples/opensrf.xml.example

git-svn-id: svn://svn.open-ils.org/ILS/trunk@16612 dcc99617-32d9-48b4-a31d-7c20da2025e4
Open-ILS/examples/opensrf.xml.example
Open-ILS/include/openils/oils_constants.h
Open-ILS/src/c-apps/oils_auth.c