Index: openacs-4/packages/bookmarks/www/bookmark-access.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/bookmarks/www/bookmark-access.tcl,v diff -u -r1.6 -r1.7 --- openacs-4/packages/bookmarks/www/bookmark-access.tcl 7 Aug 2014 07:36:54 -0000 1.6 +++ openacs-4/packages/bookmarks/www/bookmark-access.tcl 19 Jan 2019 07:36:51 -0000 1.7 @@ -2,26 +2,37 @@ This script updates the access date of the bookmark (any other auditing could be done here as well) and redirects the user to the url. - + Credit for the ACS 3 version of this module goes to: @author David Hill (dh@arsdigita.com) @author Aurelius Prochazka (aure@arsdigita.com) - + The upgrade of this module to ACS 4 was done by @author Peter Marklund (pmarklun@arsdigita.com) @author Ken Kennedy (kenzoid@io.com) in December 2000. @creation-date December 2000 @cvs-id $Id$ -} { +} { bookmark_id:naturalnum,notnull url } -db_dml update_access_date "update bm_bookmarks set last_access_date = sysdate where bookmark_id = :bookmark_id -or bookmark_id in (select bookmark_id from bm_bookmarks -start with bookmark_id = (select parent_id from bm_bookmarks where bookmark_id = :bookmark_id) -connect by prior parent_id = bookmark_id)" +set complete_url [db_string get_url { + select complete_url from bm_urls u, bm_bookmarks b + where b.bookmark_id = :bookmark_id + and b.url_id = u.url_id +} -default ""] -ad_returnredirect -allow_complete_url "$url" +if {$complete_url ne $url} { + ad_log warning "attempt to use OpenACS as URL redirector to: $url" +} + +if {$complete_url ne ""} { + db_dml update_access_date {} + ad_returnredirect -allow_complete_url $complete_url +} else { + ad_return_error "Invalid bookmark_id" "No bookmark URL available for this bookmark_id" +} +ad_script_abort