Index: openacs-4/packages/dotlrn/www/one-community-configure.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/one-community-configure.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/dotlrn/www/one-community-configure.tcl 25 Oct 2001 02:35:08 -0000 1.1 +++ openacs-4/packages/dotlrn/www/one-community-configure.tcl 9 Nov 2001 02:24:59 -0000 1.2 @@ -1,40 +1,38 @@ ad_page_contract { - Displays a configuration page community + Displays a configuration page @author Ben Adida (ben@openforce.net) @author Arjun Sanyal (arjun@openforce.net) @creation-date 2001-10-24 } { } -# Check that this is a community type -if {[ad_parameter community_level_p] != 1} { - ns_returnredirect "./" +# Check if this is a community type level thing +if {[ad_parameter community_type_level_p] == 1} { + ad_returnredirect "one-community-type" return } -set user_id [ad_conn user_id] +# Check if this is a community level thing +if {[ad_parameter community_level_p] == 1} { + ad_returnredirect "one-community" + return +} -# What community type are we at? -set community_id [dotlrn_community::get_community_id] +# Make sure user is logged in +set user_id [ad_maybe_redirect_for_registration] -# Check that this user is a member -if {![dotlrn_community::member_p $community_id $user_id]} { - set context_bar [list "Not a member"] +# Get the page +set page_id [db_string select_page_id {} -default ""] - ad_return_template one-community-not-member - return +# If there is no page_id, this user is either a guest or something else +if {[empty_string_p $page_id]} { + # do something } else { - # Pull out the NPP page ID and render it! - set page_id [dotlrn_community::get_page_id $community_id $user_id] - - # Get the portal's name for the title - set name [portal::get_name $page_id] - set rendered_page [portal::configure $page_id] +} - set context_bar {Configure} - ad_return_template -} +ad_return_template +