Index: openacs-4/packages/file-manager/tcl/file-manager-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/file-manager/tcl/file-manager-procs.tcl,v diff -u -r1.3 -r1.3.2.1 --- openacs-4/packages/file-manager/tcl/file-manager-procs.tcl 10 Oct 2003 15:44:32 -0000 1.3 +++ openacs-4/packages/file-manager/tcl/file-manager-procs.tcl 26 Nov 2003 14:34:42 -0000 1.3.2.1 @@ -33,10 +33,17 @@ } } +ad_proc -private fm_check_permission {} { + Require that the user have sitewide admin +} { + permission::require_permission -object_id [site_node::get_element -url / -element package_id] -privilege admin +} + + ad_proc fm_admin_context_bar {} { Returns a context bar that will break out of the frames } { - regsub -all "href" [ad_admin_context_bar "File Manager"] "target=_top href" context_bar + regsub -all "href" [ad_context_bar {File Manager}] "target=_top href" context_bar return $context_bar } Index: openacs-4/packages/file-manager/www/file-edit.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/file-manager/www/file-edit.tcl,v diff -u -r1.3 -r1.3.6.1 --- openacs-4/packages/file-manager/www/file-edit.tcl 18 Sep 2002 12:12:43 -0000 1.3 +++ openacs-4/packages/file-manager/www/file-edit.tcl 26 Nov 2003 14:34:42 -0000 1.3.6.1 @@ -8,6 +8,8 @@ {path} } +fm_check_permission + # check for image files and redirect to the upload page if [string match "image/*" [ns_guesstype [file tail $path]]] { Index: openacs-4/packages/file-manager/www/file-list.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/file-manager/www/file-list.tcl,v diff -u -r1.2 -r1.2.6.1 --- openacs-4/packages/file-manager/www/file-list.tcl 10 Sep 2002 22:22:54 -0000 1.2 +++ openacs-4/packages/file-manager/www/file-list.tcl 26 Nov 2003 14:34:42 -0000 1.2.6.1 @@ -9,6 +9,8 @@ {path ""} } +fm_check_permission + set output " [ad_admin_header "File Manager"] Index: openacs-4/packages/file-manager/www/file-mkdir-2.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/file-manager/www/file-mkdir-2.tcl,v diff -u -r1.3 -r1.3.6.1 --- openacs-4/packages/file-manager/www/file-mkdir-2.tcl 18 Sep 2002 12:12:43 -0000 1.3 +++ openacs-4/packages/file-manager/www/file-mkdir-2.tcl 26 Nov 2003 14:34:42 -0000 1.3.6.1 @@ -12,6 +12,8 @@ {subdir:trim,notnull} } +fm_check_permission + set errcnt 0 set errmsg "" Index: openacs-4/packages/file-manager/www/file-mkdir.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/file-manager/www/file-mkdir.tcl,v diff -u -r1.2 -r1.2.6.1 --- openacs-4/packages/file-manager/www/file-mkdir.tcl 10 Sep 2002 22:22:54 -0000 1.2 +++ openacs-4/packages/file-manager/www/file-mkdir.tcl 26 Nov 2003 14:34:42 -0000 1.2.6.1 @@ -11,6 +11,8 @@ {path:trim} } +fm_check_permission + doc_return 200 text/html " [ad_admin_header "File Manager"] Index: openacs-4/packages/file-manager/www/file-tree.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/file-manager/www/file-tree.tcl,v diff -u -r1.2 -r1.2.6.1 --- openacs-4/packages/file-manager/www/file-tree.tcl 10 Sep 2002 22:22:54 -0000 1.2 +++ openacs-4/packages/file-manager/www/file-tree.tcl 26 Nov 2003 14:34:42 -0000 1.2.6.1 @@ -10,6 +10,8 @@ @cvs-id $Id$ } +fm_check_permission + proc get_dirs { path } { set files [list] Index: openacs-4/packages/file-manager/www/file-upload-2.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/file-manager/www/file-upload-2.tcl,v diff -u -r1.7 -r1.7.2.1 --- openacs-4/packages/file-manager/www/file-upload-2.tcl 10 Oct 2003 16:03:45 -0000 1.7 +++ openacs-4/packages/file-manager/www/file-upload-2.tcl 26 Nov 2003 14:34:42 -0000 1.7.2.1 @@ -13,6 +13,8 @@ {title:trim,notnull} } +fm_check_permission + set the_file [ns_queryget the_file.tmpfile] # Make sure the incoming filename is valid Index: openacs-4/packages/file-manager/www/file-upload.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/file-manager/www/file-upload.tcl,v diff -u -r1.2 -r1.2.6.1 --- openacs-4/packages/file-manager/www/file-upload.tcl 10 Sep 2002 22:22:54 -0000 1.2 +++ openacs-4/packages/file-manager/www/file-upload.tcl 26 Nov 2003 14:34:42 -0000 1.2.6.1 @@ -11,6 +11,8 @@ {path:trim} } +fm_check_permission + set page_content " [ad_admin_header "File Manager"] Index: openacs-4/packages/file-manager/www/index.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/file-manager/www/index.tcl,v diff -u -r1.2 -r1.2.6.1 --- openacs-4/packages/file-manager/www/index.tcl 10 Sep 2002 22:22:54 -0000 1.2 +++ openacs-4/packages/file-manager/www/index.tcl 26 Nov 2003 14:34:42 -0000 1.2.6.1 @@ -10,6 +10,8 @@ } { } +fm_check_permission + doc_return 200 text/html "