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.1 -r1.2 --- openacs-4/packages/photo-album/www/photos-add-2.tcl 10 Jun 2003 10:07:11 -0000 1.1 +++ openacs-4/packages/photo-album/www/photos-add-2.tcl 12 Jun 2003 06:55:45 -0000 1.2 @@ -4,7 +4,7 @@ Process and insert photos. - @author Jeff Davis (davis@xarg.net) + @author Jeff Davis (davis@xorch.net) @creation-date 6/28/2002 @cvs_id $Id$ } { @@ -25,42 +25,37 @@ } directory_exists -requires {directory:notnull} { if {![empty_string_p $directory] && ![file isdirectory $directory]} { - ad_complain "The directory file does not exist" + ad_complain "The directory file does not exist" } } directory_tmp -requires {directory:notnull} { - if {![empty_string_p $directory] - && !([ad_conn user_id] == 2599 || [ad_conn user_id] == 2601) - && ( ![string match "/tmp/pa-tmp" $directory ] || [string match ".." $directory]) } { + if {!([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" if { ![empty_string_p $upload_file] && [ catch {set tmp_dir [pa_expand_archive $upload_file ${upload_file.tmpfile} pa-$album_id] } errMsg] } { ad_return_complaint 1 "Unable to expand your archive file" ad_script_abort } -ReturnHeaders text/html -ns_write "