Index: openacs-4/packages/new-portal/www/portal-ae.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/new-portal/www/Attic/portal-ae.tcl,v diff -u -r1.4 -r1.5 --- openacs-4/packages/new-portal/www/portal-ae.tcl 30 Sep 2001 19:07:23 -0000 1.4 +++ openacs-4/packages/new-portal/www/portal-ae.tcl 2 Oct 2001 21:25:01 -0000 1.5 @@ -12,13 +12,17 @@ set user_id [ad_conn user_id] set master_template [ad_parameter master_template] -set create_p 0 + # Did we get a portal_id passed in? # If not, let make a new one! if { ! [info exists portal_id] } { - set create_p 1 - set portal_id [db_nextval acs_object_id_seq] + set title "Create a New Portal" + set name {} + set new_portal_id [portal_create_portal $user_id] + ns_log Notice "AKS17 new_portal_id is $new_portal_id" + return + } else { # We got a portal_id, check if the user is allowed to mess with it db_1row select_owner_id "select owner_id from portals where portal_id = :portal_id" @@ -56,20 +60,12 @@ incr layout_count } -# now, get the correct data and return it. -if {$create_p} { - # there's no data at all. Just return the template. - set title "Create a New Portal" - set name {} - ad_return_template - return -} else { - set title "Edit Your Portal" - # the portal we're editing exists. Return it. - db_1row get_portal "select - name, - layout_id - from portals - where portal_id = :portal_id" - ad_return_template -} +set title "Edit Your Portal" +# the portal we're editing exists. Return it. +db_1row get_portal "select +name, +layout_id +from portals +where portal_id = :portal_id" +ad_return_template +