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.5 -r1.6 --- openacs-4/packages/new-portal/www/portal-ae.tcl 2 Oct 2001 21:25:01 -0000 1.5 +++ openacs-4/packages/new-portal/www/portal-ae.tcl 5 Oct 2001 02:17:36 -0000 1.6 @@ -1,37 +1,26 @@ # www/portal-ae.tcl ad_page_contract { - Add/edit a portal. + edit a portal. @author Arjun Sanyal @creation-date 9/28/2001 @cvs-id $Id$ } { - portal_id:naturalnum,notnull,optional + portal_id:naturalnum,notnull } set user_id [ad_conn user_id] set master_template [ad_parameter master_template] -# Did we get a portal_id passed in? -# If not, let make a new one! -if { ! [info exists portal_id] } { - 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" +# 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" +if { $owner_id != $user_id } { + # They are not allowed XXX perms 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" - if { $owner_id != $user_id } { - # They are not allowed XXX perms - return - } else { - set owner_where $user_id - } + set owner_where $user_id } @@ -49,11 +38,9 @@ ' ' as checked from portal_layouts order by name" { - if { ! [ regexp {^/} $resource_dir] } { - # aks - need this resource dir to be a param - set resource_dir "/packages/new-portal/www/$resource_dir" - } + set resource_dir "$resource_dir" + # this is evil and broken. # I should be able to pass it a list, straight from db_list. template::multirow append layouts $layout_id $name $description $filename $resource_dir $checked