scrub_access_to_unified_topics db user_idWhat it does:
Changes bboard_unified to ensure that user_id does not have unauthorized access to any forumsDefined in: /web/philip/tcl/bboard-unified.tcl
Source code:
set scrub_topics [list] set selection [ns_db select $db " SELECT DISTINCT bboard_unified.topic_id AS topic_id, bboard_topics.read_access AS read_access FROM bboard_topics, bboard_unified WHERE bboard_topics.topic_id = bboard_unified.topic_id AND bboard_topics.read_access not in ('any', 'public') AND bboard_unified.topic_id = $user_id "] set count 0 while { [ns_db getrow $db $selection] } { set_variables_after_query if { !( [validate_bboard_access $topic_id $read_access $user_id] ) } { lappend scrub_topics $topic_id incr count } } if { $count == 0 } { return } elseif { $count == 1 } { ns_db dml $db "UPDATE bboard_unified SET default_topic_p = 'f' WHERE user_id = $user_id AND topic_id = [lindex $scrub_topics 0]" } else { ns_db dml $db "UPDATE bboard_unified SET default_topic_p = 'f' WHERE user_id = $user_id AND topic_id in ([join $scrub_topics ", "])" }