Index: openacs.org-dev/packages/edit-this-page/www/etp-create-2.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs.org-dev/packages/edit-this-page/www/etp-create-2.tcl,v diff -u -r1.1 -r1.2 --- openacs.org-dev/packages/edit-this-page/www/etp-create-2.tcl 9 Jul 2002 17:35:08 -0000 1.1 +++ openacs.org-dev/packages/edit-this-page/www/etp-create-2.tcl 8 Sep 2003 14:29:30 -0000 1.2 @@ -11,7 +11,7 @@ etp::check_write_access -if { [regexp {[^a-zA-Z0-9\-_]} $name] } { +if { [regexp {[^a-zA-Z0-9\-_.]} $name] } { ad_return_complaint 1 "The subtopic name must be a short identifier containing no spaces. It will be the final part of the URL that identifies this subtopic." Index: openacs.org-dev/packages/edit-this-page/www/etp-file-upload.adp =================================================================== RCS file: /usr/local/cvsroot/openacs.org-dev/packages/edit-this-page/www/etp-file-upload.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs.org-dev/packages/edit-this-page/www/etp-file-upload.adp 8 Sep 2003 14:29:30 -0000 1.1 @@ -0,0 +1,2 @@ + + \ No newline at end of file Index: openacs.org-dev/packages/edit-this-page/www/etp-file-upload.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs.org-dev/packages/edit-this-page/www/etp-file-upload.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs.org-dev/packages/edit-this-page/www/etp-file-upload.tcl 8 Sep 2003 14:29:30 -0000 1.1 @@ -0,0 +1,31 @@ +ad_page_contract { + upload a new page +} { +} + +set package_id [ad_conn package_id] +set user_id [ad_conn user_id] +permission::require_permission -party_id $user_id \ + -object_id $package_id \ + -privilege write + +ad_form -name file-upload -html { enctype multipart/form-data } -form { + item_id:key + {name:text {label "Name"}} + {title:text {label "Title"}} + {upload_file:file {label "Upload File"}} +} -new_data { + + etp::make_page $name $title $item_id + set upload_filename [template::util::file::get_property filename $upload_file] + set upload_tmpfile [template::util::file::get_property tmp_filename $upload_file] + set upload_mime_type [template::util::file::get_property mime_type $upload_file] + set fd [open $upload_tmpfile r] + set file_content [read $fd] + close $fd + db_dml update_content "update cr_revisions set content=:file_content where item_id=:item_id" + + ad_returnredirect "." +} + +ad_return_template \ No newline at end of file Index: openacs.org-dev/packages/edit-this-page/www/etp-publish.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs.org-dev/packages/edit-this-page/www/etp-publish.tcl,v diff -u -r1.1 -r1.2 --- openacs.org-dev/packages/edit-this-page/www/etp-publish.tcl 9 Jul 2002 17:35:08 -0000 1.1 +++ openacs.org-dev/packages/edit-this-page/www/etp-publish.tcl 8 Sep 2003 14:29:30 -0000 1.2 @@ -15,6 +15,7 @@ set latest_revision_id [etp::get_latest_revision_id $package_id $name] set live_revision_id [etp::get_live_revision_id $package_id $name] +set item_id [etp::get_item_id $package_id $name] if { $latest_revision_id > $live_revision_id } { db_transaction { Index: openacs.org-dev/packages/edit-this-page/www/etp-subtopic-create.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs.org-dev/packages/edit-this-page/www/etp-subtopic-create.tcl,v diff -u -r1.1 -r1.2 --- openacs.org-dev/packages/edit-this-page/www/etp-subtopic-create.tcl 9 Jul 2002 17:35:08 -0000 1.1 +++ openacs.org-dev/packages/edit-this-page/www/etp-subtopic-create.tcl 8 Sep 2003 14:29:30 -0000 1.2 @@ -11,15 +11,15 @@ { confirmed f } } -properties { page_title:onevalue - context_bar:onevalue + context:onevalue form_vars:onevalue } etp::check_write_access if { $confirmed == "t" } { if { [empty_string_p $subtopic_name] || - [regexp {[^a-zA-Z0-9\-_]} $subtopic_name] } { + [regexp {[^a-zA-Z0-9\-_.]} $subtopic_name] } { ad_return_complaint 1 "The subtopic name must be a short identifier containing no spaces. It will be the final part of the URL that identifies this subtopic." @@ -49,4 +49,4 @@ } set page_title "Create a new subtopic" -set context_bar [ad_context_bar [list "etp" "Edit"] "New subtopic"] +set context [list [list "etp" "Edit"] "New subtopic"] Index: openacs.org-dev/packages/edit-this-page/www/etp.adp =================================================================== RCS file: /usr/local/cvsroot/openacs.org-dev/packages/edit-this-page/www/etp.adp,v diff -u -r1.1 -r1.2 --- openacs.org-dev/packages/edit-this-page/www/etp.adp 9 Jul 2002 17:35:08 -0000 1.1 +++ openacs.org-dev/packages/edit-this-page/www/etp.adp 8 Sep 2003 14:29:30 -0000 1.2 @@ -1,6 +1,6 @@ @page_title@ -@context_bar@ +@context@ @@ -70,7 +70,8 @@
@@ -53,9 +53,9 @@

Configuration of this content section

Create a new -@application_params.content_object_name@ +@application_params.content_object_name@ or +Upload Page or @subtopic_object_name@ Index: openacs.org-dev/packages/edit-this-page/www/index.vuh =================================================================== RCS file: /usr/local/cvsroot/openacs.org-dev/packages/edit-this-page/www/index.vuh,v diff -u -r1.3 -r1.4 --- openacs.org-dev/packages/edit-this-page/www/index.vuh 22 Nov 2002 03:35:42 -0000 1.3 +++ openacs.org-dev/packages/edit-this-page/www/index.vuh 8 Sep 2003 14:29:30 -0000 1.4 @@ -20,6 +20,7 @@ ns_log Notice "index.vuh: request for $name" + if { [string index $name end] == "/" } { # it's in a subdirectory, and we know there's no # other package mounted on that subdirectory. @@ -47,9 +48,37 @@ ns_log Notice "Edit This Page index.vuh: serving $path" + +#rp_serve_abstract_file $path +### JCD: I switched this back since this change is making the +### server restart on a file not found recursion +# +#rp_internal_redirect -absolute_path $path + + +### Here is the log of a bad request... +#[13/Nov/2002:15:08:32][8276.16392][-conn2-] Notice: Security: 1037218112 sec_generate_session_id_cookie setting 51390002, 0. +#[13/Nov/2002:15:08:32][8276.16392][-conn2-] Notice: index.vuh: request for shared/84 +#[13/Nov/2002:15:08:32][8276.16392][-conn2-] Notice: ns_getform using encoding iso8859-1 for charset iso-8859-1 +#[13/Nov/2002:15:08:32][8276.16392][-conn2-] Notice: Edit This Page index.vuh: serving /web/openacs.org-dev/www/templates/default-content +#[13/Nov/2002:15:08:33][8276.16392][-conn2-] Notice: Error from etp::get_pa was: +# Query did not return any rows. +#[13/Nov/2002:15:08:33][8276.16392][-conn2-] Notice: index.vuh: request for global/file-not-found.html +#[13/Nov/2002:15:08:33][8276.16392][-conn2-] Notice: Edit This Page index.vuh: serving /web/openacs.org-dev/www/templates/default-content +#[13/Nov/2002:15:08:33][8276.16392][-conn2-] Notice: Error from etp::get_pa was: +# Query did not return any rows. +#[13/Nov/2002:15:08:33][8276.16392][-conn2-] Notice: index.vuh: request for global/file-not-found.html +#[13/Nov/2002:15:08:33][8276.16392][-conn2-] Notice: Edit This Page index.vuh: serving /web/openacs.org-dev/www/templates/default-content +#[13/Nov/2002:15:08:33][8276.16392][-conn2-] Notice: Error from etp::get_pa was: +# Query did not return any rows. +#[13/Nov/2002:15:08:33][8276.16392][-conn2-] Notice: index.vuh: request for global/file-not-found.html +#[13/Nov/2002:15:08:33][8276.16392][-conn2-] Notice: Edit This Page index.vuh: serving /web/openacs.org-dev/www/templates/default-content +#[13/Nov/2002:15:08:33][8343.1024][-main-] Notice: nsmain: AOLserver/3.3.1+ad13 starting + rp_internal_redirect $path +