Index: openacs-4/packages/acs-authentication/tcl/authentication-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-authentication/tcl/authentication-procs.tcl,v diff -u -r1.58.2.3 -r1.58.2.4 --- openacs-4/packages/acs-authentication/tcl/authentication-procs.tcl 2 Jan 2004 16:57:50 -0000 1.58.2.3 +++ openacs-4/packages/acs-authentication/tcl/authentication-procs.tcl 25 Feb 2004 21:10:16 -0000 1.58.2.4 @@ -47,6 +47,27 @@ ad_script_abort } +ad_proc -public auth::refresh_login {} { + If there currently is a user associated with this session, + but the user's authentication is expired, redirect the + user to refresh his/her login. This allows for users to not be logged in, + but if the user is logged in, then we require that the authentication is not expired. + + @return user_id of user, if the user is logged in and auth_status is not expired, or 0 if the user is not logged in. + If user's auth_status is expired, this proc will issue a returnredirect and abort the current page. + + @see ad_script_abort +} { + if { ![string equal [ad_conn auth_level] "expired"] } { + return [ad_conn user_id] + } + + + # The -return switch causes the URL to return to the current page + ad_returnredirect [ad_get_login_url -return] + ad_script_abort +} + ad_proc -public auth::get_user_id { {-level ok} {-account_status ok}