Index: openacs-4/packages/acs-developer-support/www/shell.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-developer-support/www/shell.adp,v
diff -u -r1.1 -r1.2
--- openacs-4/packages/acs-developer-support/www/shell.adp 3 Nov 2003 11:08:10 -0000 1.1
+++ openacs-4/packages/acs-developer-support/www/shell.adp 4 Jun 2004 08:04:51 -0000 1.2
@@ -4,4 +4,10 @@
@result@+
+ +@out@ + +Index: openacs-4/packages/acs-developer-support/www/shell.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-developer-support/www/shell.tcl,v diff -u -r1.4 -r1.5 --- openacs-4/packages/acs-developer-support/www/shell.tcl 8 Jan 2004 15:45:44 -0000 1.4 +++ openacs-4/packages/acs-developer-support/www/shell.tcl 4 Jun 2004 08:04:51 -0000 1.5 @@ -1,32 +1,36 @@ ad_page_contract { - @Author Nis Jorgensen + @Author Nis Jorgensen } { - {script:optional,allhtml {}} - } -properties { - result + {script:optional,allhtml {}} +} -properties { + out } ds_require_permission [ad_conn package_id] "admin" -set page_title "OpenACS Shell" -set context $page_title - if { ![acs_user::site_wide_admin_p] } { ad_return_warning "Error" "Sorry, only site-wide admins may use this." ad_script_abort } -set result "" +set page_title "OpenACS Shell" +set context [list $page_title] +set out {} + ad_form -name shell -form { { - script:text(textarea),nospell - {label {Input tcl_script}} - {html {cols 80 rows 10}} + script:text(textarea),nospell + {label {Input tcl_script}} + {html {cols 80 rows 10}} } - } -on_submit { - if {[catch {set result [uplevel 1 $script]}]} { - global errorInfo - set result "ERROR:\n$errorInfo" +} -on_submit { + if { ![string equal POST [ns_conn method]] } { + set out "You cannot use GET to invoke a script on this page.\nClick OK to resubmit the form as a POST." + } else { + if {[catch {set out [uplevel 1 $script]}]} { + global errorInfo + set out "ERROR:\n$errorInfo" + } } - } +}