Index: openacs-4/packages/acs-tcl/tcl/acs-permissions-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/acs-permissions-procs.tcl,v diff -u -r1.18 -r1.19 --- openacs-4/packages/acs-tcl/tcl/acs-permissions-procs.tcl 3 Nov 2003 12:55:26 -0000 1.18 +++ openacs-4/packages/acs-tcl/tcl/acs-permissions-procs.tcl 17 Dec 2003 20:21:41 -0000 1.19 @@ -54,16 +54,31 @@ @param nocache force loading from db even if cached (flushes cache as well) @param party_id if null then it is the current user_id } { - if {[empty_string_p $party_id]} { + if { [empty_string_p $party_id] } { set party_id [ad_conn user_id] } + if { $no_cache_p || ![permission::cache_p] } { util_memoize_flush "permission::permission_p_not_cached -party_id $party_id -object_id $object_id -privilege $privilege" - return [permission::permission_p_not_cached -party_id $party_id -object_id $object_id -privilege $privilege] + set permission_p [permission::permission_p_not_cached -party_id $party_id -object_id $object_id -privilege $privilege] } else { - return [util_memoize "permission::permission_p_not_cached -party_id $party_id -object_id $object_id -privilege $privilege" \ + set permission_p [util_memoize "permission::permission_p_not_cached -party_id $party_id -object_id $object_id -privilege $privilege" \ [parameter::get -package_id [ad_acs_kernel_id] -parameter PermissionCacheTimeout -default 300]] } + + if { $party_id == 0 && [ad_conn user_id] == 0 && [ad_conn untrusted_user_id] != 0 && ![template::util::is_true $permission_p] } { + set untrusted_permission_p [permission_p_not_cached \ + -party_id [ad_conn untrusted_user_id] \ + -object_id $object_id \ + -privilege $privilege] + if { $permission_p != $untrusted_permission_p } { + # Bump to registration page + ns_log Notice "permission_p: party_id=$party_id ([acs_object_name $party_id]), object_id=$object_id ([acs_object_name $object_id]), privilege=$privilege. Result=>$permission_p. Untrusted-Result=>$untrusted_permission_p\n[ad_get_tcl_call_stack]" + auth::require_login + } + } + + return $permission_p } @@ -83,6 +98,7 @@ if {[empty_string_p $party_id]} { set party_id [ad_conn user_id] } + return [db_0or1row select_permission_p {}] } Index: openacs-4/packages/acs-tcl/tcl/text-html-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/text-html-procs.tcl,v diff -u -r1.31 -r1.32 --- openacs-4/packages/acs-tcl/tcl/text-html-procs.tcl 11 Dec 2003 21:39:56 -0000 1.31 +++ openacs-4/packages/acs-tcl/tcl/text-html-procs.tcl 17 Dec 2003 20:21:41 -0000 1.32 @@ -124,7 +124,7 @@ regsub -all {[ \t]*\n} $text "\n" text # Wrap P's around paragraphs - set text "
$text
" + set text "$text
" regsub -all {([^\n\s])\n\n([^\n\s])} $text {\1\2} text
# Convert _single_ CRLF's to
's to preserve line breaks
@@ -144,6 +144,12 @@
# Add line breaks to P tags
regsub -all {
tag + set idx [string last "
" [string tolower $text]] + if { $idx != -1 } { + set text "[string range $text 0 [expr $idx-1]]
[string range $text [expr $idx+3] end]" + } + return $text }