Index: openacs-4/packages/dotlrn/www/configure.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/configure.adp,v
diff -u -r1.1 -r1.2
--- openacs-4/packages/dotlrn/www/configure.adp	9 Nov 2001 03:56:43 -0000	1.1
+++ openacs-4/packages/dotlrn/www/configure.adp	9 Nov 2001 04:03:02 -0000	1.2
@@ -1,6 +1,5 @@
 <master src="master">
-<property name="context_bar">@context_bar@</property>
-<property name="title">Configure Main Portlet: @name@</property>
+<property name="title">Configure @name@</property>
 <p>
 
 @rendered_page@
Index: openacs-4/packages/dotlrn/www/configure.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/configure.tcl,v
diff -u -r1.1 -r1.2
--- openacs-4/packages/dotlrn/www/configure.tcl	9 Nov 2001 03:56:43 -0000	1.1
+++ openacs-4/packages/dotlrn/www/configure.tcl	9 Nov 2001 04:03:15 -0000	1.2
@@ -1,24 +1,58 @@
 
 ad_page_contract {
-    Displays a configuration page for the main portal
+    Displays a configuration page
     
     @author Ben Adida (ben@openforce.net)
     @author Arjun Sanyal (arjun@openforce.net)
-    @creation-date 2001-11-08
+    @creation-date 2001-10-24
 } {
 }
 
-set user_id [ad_conn user_id]
+# Check if this is a community type level thing
+if {[ad_parameter community_type_level_p] == 1} {
+    ad_returnredirect "one-community-type"
+    return
+}
 
-# Pull out the NPP page ID and render it!
-set page_id [dotlrn_community::get_workspace_page_id $user_id]
+# Make sure user is logged in
+set user_id [ad_maybe_redirect_for_registration]
 
-# Get the portal's name for the title
-set name [portal::get_name $page_id]
 
-set rendered_page [portal::configure $page_id]
+if {[ad_parameter community_level_p] == 1} {
+    # This is a community
+    # What community type are we at?
+    set community_id [dotlrn_community::get_community_id]
 
-set context_bar {Configure}
+    # Check that this user is a member
+    if {![dotlrn_community::member_p $community_id $user_id]} {
+	set context_bar [list "Not a member"]
 
+	ad_return_template one-community-not-member
+	return
+    } else {
+	set page_id [dotlrn_community::get_page_id $community_id $user_id]
+	set rendered_page [portal::configure $page_id "one-community"]
+	set context_bar {Configure}
+	set name [portal::get_name $page_id]
+    }
+} else {
+    # this not a community, it is the "workspace" deal
+
+    # Get the page
+    set page_id [db_string select_page_id {} -default ""]
+    
+    # If there is no page_id, this user is either a guest or something else
+    if {[empty_string_p $page_id]} {
+
+	# do something
+	ad_returnredirect "/."
+    } else {
+	set rendered_page [portal::configure $page_id "index"]
+	set name [portal::get_name $page_id]
+    }
+}
+    
 ad_return_template
 
+
+
Index: openacs-4/packages/dotlrn/www/configure.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/Attic/configure.xql,v
diff -u
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/dotlrn/www/configure.xql	9 Nov 2001 04:02:48 -0000	1.1
@@ -0,0 +1,11 @@
+<?xml version="1.0"?>
+
+<queryset>
+
+<fullquery name="select_page_id">
+<querytext>
+select page_id from dotlrn_users where user_id= :user_id
+</querytext>
+</fullquery>
+
+</queryset>