Index: openacs-4/packages/photo-album/www/photos-add-2.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/photo-album/www/photos-add-2.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/photo-album/www/photos-add-2.tcl 12 Jun 2003 18:05:05 -0000 1.3 +++ openacs-4/packages/photo-album/www/photos-add-2.tcl 18 Nov 2003 18:27:53 -0000 1.4 @@ -10,7 +10,6 @@ } { upload_file:trim,optional upload_file.tmpfile:optional,tmpfile - directory:trim,optional album_id:integer,notnull } -validate { valid_album -requires {album_id:integer} { @@ -23,24 +22,13 @@ ad_complain "The upload failed or the file was empty" } } - directory_exists -requires {directory:notnull} { - if {![empty_string_p $directory] && ![file isdirectory $directory]} { + directory_exists { + if {([info exists $upload_file] && ![empty_string_p $upload_file]) && ![file isdirectory [parameter::get -parameter FullTempPhotoDir -package_id [ad_conn package_id]]]} { ad_complain "The directory file does not exist" } } - directory_tmp -requires {directory:notnull} { - if {![empty_string_p $directory] && !([ad_conn user_id] == 287 || [ad_conn user_id] == 2601) && ( ![string match "/tmp/pa-tmp" $directory ] || [string match ".." $directory]) } { - ad_complain "You can currently only load images from /tmp/pa-tmp for security" - } - } - one_or_other { - if {[empty_string_p $upload_file] && [empty_string_p $directory]} { - ad_complain "Either upload a file or specify a directory to load" - } - } } - #check permission set user_id [ad_conn user_id] ad_require_permission $album_id "pa_create_photo" @@ -55,20 +43,17 @@ ns_write "