Index: openacs-4/packages/photo-album/tcl/photo-album-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/photo-album/tcl/photo-album-procs.tcl,v diff -u -r1.18 -r1.19 --- openacs-4/packages/photo-album/tcl/photo-album-procs.tcl 31 May 2013 20:27:17 -0000 1.18 +++ openacs-4/packages/photo-album/tcl/photo-album-procs.tcl 6 Sep 2013 17:17:43 -0000 1.19 @@ -83,7 +83,7 @@ # the grantee can be anything that is or returns a party_id such as an integer, a subquery, # or a function - set perm_lst [split [ad_parameter DefaultRootFolderPrivileges] " "] + set perm_lst [split [parameter::get -parameter DefaultRootFolderPrivileges] " "] foreach {party privilege} $perm_lst { # wtem@olywa.net, 2001-10-15 @@ -223,10 +223,10 @@ borrowed from 3.4 download code } { if { $check_base_path_p } { - set dir_path "[acs_root_dir]/[ad_parameter PhotoDir]/$dir_path" + set dir_path "[acs_root_dir]/[parameter::get -parameter PhotoDir]/$dir_path" set needed_dir "" } else { - set needed_dir "[acs_root_dir]/[ad_parameter PhotoDir]" + set needed_dir "[acs_root_dir]/[parameter::get -parameter PhotoDir]" } set dir_list [split $dir_path /] @@ -314,7 +314,7 @@ if {[empty_string_p $user_id]} { set user_id [ad_conn user_id] } - set grant_list [split [ad_parameter PrivilegeForCreator] ","] + set grant_list [split [parameter::get -parameter PrivilegeForCreator] ","] foreach privilege $grant_list { db_exec_plsql grant_privilege { begin @@ -340,7 +340,7 @@ I Use ImageMagick instead of aolserver function because it can handle more than just gifs and jpegs. } { - set identify_string [exec [ad_parameter ImageMagickPath]/identify $filename] + set identify_string [exec [parameter::get -parameter ImageMagickPath]/identify $filename] regexp {[ ]+([0-9]+)[x]([0-9]+)[\+]*} $identify_string x width height uplevel "set $width_var $width" uplevel "set $height_var $height" @@ -371,7 +371,7 @@ set geometry ${geometry}x${geometry} } ns_log debug "pa_make_new_image: Start convert, making $new_image geometry $geometry" - exec [ad_parameter ImageMagickPath]/convert -geometry $geometry -interlace None -sharpen 1x2 $base_image $new_image + exec [parameter::get -parameter ImageMagickPath]/convert -geometry $geometry -interlace None -sharpen 1x2 $base_image $new_image if {[catch {exec jhead -dt $new_image} errmsg]} { ns_log Warning "pa_make_new_image: jhead failed with error - $errmsg" } @@ -414,7 +414,7 @@ returns a list of the photo_ids on page page of album_id list is in ascending order } { - set images_per_page [ad_parameter ThumbnailsPerPage] + set images_per_page [parameter::get -parameter ThumbnailsPerPage] set start_index [expr $images_per_page * ($page-1)] set end_index [expr $start_index + ($images_per_page - 1)] return [lrange [pa_all_photos_in_album $album_id] $start_index $end_index] @@ -425,7 +425,7 @@ } { returns the number of pages in album_id } { - return [expr int(ceil([pa_count_photos_in_album $album_id] / [ad_parameter ThumbnailsPerPage].0))] + return [expr int(ceil([pa_count_photos_in_album $album_id] / [parameter::get -parameter ThumbnailsPerPage].0))] } ad_proc -public pa_page_of_photo_in_album { @@ -441,7 +441,7 @@ return -1 } - return [expr int(ceil(($photo_index + 1)/ [ad_parameter ThumbnailsPerPage].0))] + return [expr int(ceil(($photo_index + 1)/ [parameter::get -parameter ThumbnailsPerPage].0))] } ad_proc -public pa_flush_photo_in_album_cache { @@ -463,7 +463,7 @@ takes a query and returns a query that accounts for pagination } { - set rows_per_page [ad_parameter ThumbnailsPerPage] + set rows_per_page [parameter::get -parameter ThumbnailsPerPage] set start_row [expr $rows_per_page*[expr $page-1]+1] set query " @@ -489,7 +489,7 @@ uplevel { return [db_string get_total_pages " select - ceil(count(*) / [ad_parameter ThumbnailsPerPage]) + ceil(count(*) / [parameter::get -parameter ThumbnailsPerPage]) from ($sql) "] @@ -713,7 +713,7 @@ if { [catch {set size [file size $file]} errMsg] } { return -code error $errMsg } - if { [ catch {set out [exec [ad_parameter ImageMagickPath]/identify -format "%w %h %m %k %q %#" $file]} errMsg]} { + if { [ catch {set out [exec [parameter::get -parameter ImageMagickPath]/identify -format "%w %h %m %k %q %#" $file]} errMsg]} { return -code error $errMsg } @@ -840,7 +840,7 @@ set new_image [file join $tmp_path "tmp-[file rootname [file tail $image_file]]"] if {![empty_string_p $base_colors] && $base_colors < 257} { # convert it to a png - if {[catch {exec [ad_parameter ImageMagickPath]/convert $image_file PNG:$new_image.png} errMsg]} { + if {[catch {exec [parameter::get -parameter ImageMagickPath]/convert $image_file PNG:$new_image.png} errMsg]} { ns_log Warning "pa_load_images: Failed convert to PNG for $image_file (magicktype $base_type)" } if { $remove } { @@ -850,7 +850,7 @@ set remove 1 } elseif {![empty_string_p $base_colors] && $base_colors > 256} { # convert it to a jpg - if {[catch {exec [ad_parameter ImageMagickPath]/convert $image_file JPG:$new_image.jpg} errMsg]} { + if {[catch {exec [parameter::get -parameter ImageMagickPath]/convert $image_file JPG:$new_image.jpg} errMsg]} { ns_log Warning "pa_load_images: failed convert to JPG for $image_file (magicktype $base_type)" } if { $remove } { @@ -1147,7 +1147,7 @@ # get a list of files to handle sorted by size... db_foreach get_image_files {} { ns_log Debug "pa_rotate: rotate $id by $rotation [cr_fs_path] $filename $image_id $width $height" - if {[catch {exec [ad_parameter ImageMagickPath]/convert -rotate $rotation [cr_fs_path]$filename [cr_fs_path]${filename}.new } errMsg]} { + if {[catch {exec [parameter::get -parameter ImageMagickPath]/convert -rotate $rotation [cr_fs_path]$filename [cr_fs_path]${filename}.new } errMsg]} { ns_log Warning "pa_rotate: failed rotation of image $image_id -- $errMsg" } lappend flop $image_id Index: openacs-4/packages/photo-album/www/album-add.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/photo-album/www/album-add.tcl,v diff -u -r1.5 -r1.6 --- openacs-4/packages/photo-album/www/album-add.tcl 7 Oct 2007 22:37:03 -0000 1.5 +++ openacs-4/packages/photo-album/www/album-add.tcl 6 Sep 2013 17:17:43 -0000 1.6 @@ -19,7 +19,7 @@ context_list:onevalue } -ad_require_permission $parent_id "pa_create_album" +permission::require_permission -object_id $parent_id -privilege "pa_create_album" set context_list [pa_context_bar_list -final "[_ photo-album._Create]" $parent_id] Index: openacs-4/packages/photo-album/www/album-delete.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/photo-album/www/album-delete.tcl,v diff -u -r1.5 -r1.6 --- openacs-4/packages/photo-album/www/album-delete.tcl 18 Nov 2003 22:59:03 -0000 1.5 +++ openacs-4/packages/photo-album/www/album-delete.tcl 6 Sep 2013 17:17:43 -0000 1.6 @@ -31,8 +31,8 @@ # to delete a album must have delete permission on the album # and write on parent folder set parent_folder_id [db_string get_parent "select parent_id from cr_items where item_id = :album_id"] -ad_require_permission $album_id delete -ad_require_permission $parent_folder_id write +permission::require_permission -object_id $album_id -privilege delete +permission::require_permission -object_id $parent_folder_id -privilege write if { [string equal $confirmed_p "t"] } { # they have confirmed that they want to delete the album Index: openacs-4/packages/photo-album/www/album-edit.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/photo-album/www/album-edit.tcl,v diff -u -r1.5 -r1.6 --- openacs-4/packages/photo-album/www/album-edit.tcl 7 Oct 2007 22:37:03 -0000 1.5 +++ openacs-4/packages/photo-album/www/album-edit.tcl 6 Sep 2013 17:17:43 -0000 1.6 @@ -19,7 +19,7 @@ context_list:onevalue } -ad_require_permission $album_id "write" +permission::require_permission -object_id $album_id -privilege "write" set user_id [ad_conn user_id] set context_list [pa_context_bar_list -final "[_ photo-album._Edit]" $album_id] Index: openacs-4/packages/photo-album/www/album-move.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/photo-album/www/album-move.tcl,v diff -u -r1.4 -r1.5 --- openacs-4/packages/photo-album/www/album-move.tcl 18 Nov 2003 22:59:03 -0000 1.4 +++ openacs-4/packages/photo-album/www/album-move.tcl 6 Sep 2013 17:17:43 -0000 1.5 @@ -22,8 +22,8 @@ # and pa_create_album on new parent folder (which is check in the is_valid block) set old_folder_id [db_string get_parent_folder "select parent_id from cr_items where item_id = :album_id"] -ad_require_permission $album_id write -ad_require_permission $old_folder_id write +permission::require_permission -object_id $album_id -privilege write +permission::require_permission -object_id $old_folder_id -privilege write db_1row get_album_info {} @@ -59,7 +59,7 @@ if { [template::form is_valid move_album] } { set new_folder_id [template::element::get_value move_album new_folder_id] - ad_require_permission $new_folder_id "pa_create_album" + permission::require_permission -object_id $new_folder_id -privilege "pa_create_album" if [string equal [pa_is_folder_p $new_folder_id] "f"] { # may add some sort of error message Index: openacs-4/packages/photo-album/www/album.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/photo-album/www/album.tcl,v diff -u -r1.4 -r1.5 --- openacs-4/packages/photo-album/www/album.tcl 18 Nov 2003 22:59:03 -0000 1.4 +++ openacs-4/packages/photo-album/www/album.tcl 6 Sep 2013 17:17:43 -0000 1.5 @@ -37,7 +37,7 @@ set user_id [ad_conn user_id] # check for read permission on album -ad_require_permission $album_id read +permission::require_permission -object_id $album_id -privilege read # These lines are to uncache the image in Netscape, Mozilla. # IE6 & Safari (mac) have a bug with the images cache Index: openacs-4/packages/photo-album/www/base-photo.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/photo-album/www/base-photo.tcl,v diff -u -r1.5 -r1.6 --- openacs-4/packages/photo-album/www/base-photo.tcl 8 Aug 2006 21:27:09 -0000 1.5 +++ openacs-4/packages/photo-album/www/base-photo.tcl 6 Sep 2013 17:17:43 -0000 1.6 @@ -27,12 +27,12 @@ width:onevalue } -if {![string equal [ad_parameter AllowBasePhotoAccessP] "t"]} { +if {![string equal [parameter::get -parameter AllowBasePhotoAccessP] "t"]} { ad_return_forbidden "[_ photo-album._No]" ad_script_abort } -ad_require_permission $photo_id "read" +permission::require_permission -object_id $photo_id -privilege "read" set user_id [ad_conn user_id] set context [pa_context_bar_list -final "[_ photo-album._Full]" $photo_id] Index: openacs-4/packages/photo-album/www/folder-add.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/photo-album/www/folder-add.tcl,v diff -u -r1.4 -r1.5 --- openacs-4/packages/photo-album/www/folder-add.tcl 18 Nov 2003 22:59:03 -0000 1.4 +++ openacs-4/packages/photo-album/www/folder-add.tcl 6 Sep 2013 17:17:43 -0000 1.5 @@ -20,7 +20,7 @@ } # check for permission -ad_require_permission $parent_id pa_create_folder +permission::require_permission -object_id $parent_id -privilege pa_create_folder set context_list [pa_context_bar_list -final "[_ photo-album._Create_1]" $parent_id] Index: openacs-4/packages/photo-album/www/folder-delete.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/photo-album/www/folder-delete.tcl,v diff -u -r1.5 -r1.6 --- openacs-4/packages/photo-album/www/folder-delete.tcl 18 Nov 2003 22:59:03 -0000 1.5 +++ openacs-4/packages/photo-album/www/folder-delete.tcl 6 Sep 2013 17:17:44 -0000 1.6 @@ -39,8 +39,8 @@ # to delete a folder must have delete permission on the folder # and write on parent folder set parent_folder_id [db_string get_parent "select parent_id from cr_items where item_id = :folder_id"] -ad_require_permission $folder_id delete -ad_require_permission $parent_folder_id write +permission::require_permission -object_id $folder_id -privilege delete +permission::require_permission -object_id $parent_folder_id -privilege write if { [string equal $confirmed_p "t"] } { # they have confirmed that they want to delete the folder Index: openacs-4/packages/photo-album/www/folder-edit.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/photo-album/www/folder-edit.tcl,v diff -u -r1.6 -r1.7 --- openacs-4/packages/photo-album/www/folder-edit.tcl 1 Jun 2004 22:54:19 -0000 1.6 +++ openacs-4/packages/photo-album/www/folder-edit.tcl 6 Sep 2013 17:17:44 -0000 1.7 @@ -20,7 +20,7 @@ } # check for permission -ad_require_permission $folder_id write +permission::require_permission -object_id $folder_id -privilege write set context_list [pa_context_bar_list -final "[_ photo-album._Edit_1]" $folder_id] Index: openacs-4/packages/photo-album/www/folder-move.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/photo-album/www/folder-move.tcl,v diff -u -r1.4 -r1.5 --- openacs-4/packages/photo-album/www/folder-move.tcl 18 Nov 2003 22:59:03 -0000 1.4 +++ openacs-4/packages/photo-album/www/folder-move.tcl 6 Sep 2013 17:17:44 -0000 1.5 @@ -29,8 +29,8 @@ # and pa_create_folder on new parent folder (which is check in the is_valid block) set old_folder_id [db_string get_parent_folder "select parent_id from cr_items where item_id = :folder_id"] -ad_require_permission $folder_id write -ad_require_permission $old_folder_id write +permission::require_permission -object_id $folder_id -privilege write +permission::require_permission -object_id $old_folder_id -privilege write db_1row get_folder_info {select content_folder.get_label(:folder_id) as title from dual} @@ -67,7 +67,7 @@ if { [template::form is_valid move_folder] } { set new_folder_id [template::element::get_value move_folder new_folder_id] - ad_require_permission $new_folder_id "pa_create_folder" + permission::require_permission -object_id $new_folder_id -privilege "pa_create_folder" if [string equal [pa_is_folder_p $new_folder_id] "f"] { # may add some sort of error message Index: openacs-4/packages/photo-album/www/index.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/photo-album/www/index.tcl,v diff -u -r1.6 -r1.7 --- openacs-4/packages/photo-album/www/index.tcl 18 Nov 2003 22:59:03 -0000 1.6 +++ openacs-4/packages/photo-album/www/index.tcl 6 Sep 2013 17:17:44 -0000 1.7 @@ -31,7 +31,7 @@ # check for read permission on folder -ad_require_permission $folder_id read +permission::require_permission -object_id $folder_id -privilege read set user_id [ad_conn user_id] set context [pa_context_bar_list $folder_id] Index: openacs-4/packages/photo-album/www/photo-add-2.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/photo-album/www/photo-add-2.tcl,v diff -u -r1.7 -r1.8 --- openacs-4/packages/photo-album/www/photo-add-2.tcl 8 Aug 2006 21:27:09 -0000 1.7 +++ openacs-4/packages/photo-album/www/photo-add-2.tcl 6 Sep 2013 17:17:44 -0000 1.8 @@ -55,7 +55,7 @@ set user_id [ad_conn user_id] #check permission -ad_require_permission $album_id "pa_create_photo" +permission::require_permission -object_id $album_id -privilege "pa_create_photo" set new_photo_ids [pa_load_images \ -remove 1 \ Index: openacs-4/packages/photo-album/www/photo-add.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/photo-album/www/photo-add.tcl,v diff -u -r1.7 -r1.8 --- openacs-4/packages/photo-album/www/photo-add.tcl 7 Oct 2007 22:37:03 -0000 1.7 +++ openacs-4/packages/photo-album/www/photo-add.tcl 6 Sep 2013 17:17:44 -0000 1.8 @@ -21,7 +21,7 @@ } # check for read permission on folder -ad_require_permission $album_id pa_create_photo +permission::require_permission -object_id $album_id -privilege pa_create_photo set context_list [pa_context_bar_list -final "[_ photo-album._Upload]" $album_id] Index: openacs-4/packages/photo-album/www/photo-delete.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/photo-album/www/photo-delete.tcl,v diff -u -r1.5 -r1.6 --- openacs-4/packages/photo-album/www/photo-delete.tcl 18 Nov 2003 22:59:03 -0000 1.5 +++ openacs-4/packages/photo-album/www/photo-delete.tcl 6 Sep 2013 17:17:44 -0000 1.6 @@ -29,8 +29,8 @@ # to delete a photo need delete on photo and write on parent album set album_id [db_string get_parent_album "select parent_id from cr_items where item_id = :photo_id"] -ad_require_permission $photo_id delete -ad_require_permission $album_id write +permission::require_permission -object_id $photo_id -privilege delete +permission::require_permission -object_id $album_id -privilege write if { [string equal $confirmed_p "t"] } { # they have confirmed that they want to delete the photo Index: openacs-4/packages/photo-album/www/photo-edit.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/photo-album/www/photo-edit.tcl,v diff -u -r1.5 -r1.6 --- openacs-4/packages/photo-album/www/photo-edit.tcl 7 Oct 2007 22:37:03 -0000 1.5 +++ openacs-4/packages/photo-album/www/photo-edit.tcl 6 Sep 2013 17:17:44 -0000 1.6 @@ -25,7 +25,7 @@ # } # } -ad_require_permission $photo_id "write" +permission::require_permission -object_id $photo_id -privilege "write" set user_id [ad_conn user_id] set context_list [pa_context_bar_list -final "[_ photo-album._Edit_2]" $photo_id] Index: openacs-4/packages/photo-album/www/photo-iconic.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/photo-album/www/photo-iconic.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/photo-album/www/photo-iconic.tcl 20 Nov 2003 13:03:54 -0000 1.3 +++ openacs-4/packages/photo-album/www/photo-iconic.tcl 6 Sep 2013 17:17:44 -0000 1.4 @@ -24,7 +24,7 @@ ad_return_error "Photo Internal Error" "The photo is either not live or not in an album. Please inform the webmaster of the error" } -ad_require_permission $album_id "write" +permission::require_permission -object_id $album_id -privilege "write" db_dml photo_iconic {} Index: openacs-4/packages/photo-album/www/photo.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/photo-album/www/photo.tcl,v diff -u -r1.9 -r1.10 --- openacs-4/packages/photo-album/www/photo.tcl 8 Aug 2006 21:27:09 -0000 1.9 +++ openacs-4/packages/photo-album/www/photo.tcl 6 Sep 2013 17:17:44 -0000 1.10 @@ -39,7 +39,7 @@ } } -ad_require_permission $photo_id "read" +permission::require_permission -object_id $photo_id -privilege "read" set user_id [ad_conn user_id] set context [pa_context_bar_list $photo_id] set root_folder_id [pa_get_root_folder] @@ -76,7 +76,7 @@ # to shut down access to base photos an admin would need to search through # database and revoke all such permissions. -set show_base_link [ad_parameter AllowBasePhotoAccessP] +set show_base_link [parameter::get -parameter AllowBasePhotoAccessP] # query all the photo and permission info with a single trip to database if {![db_0or1row get_photo_info { *SQL* }]} { @@ -122,7 +122,7 @@ if { [template::form is_valid move_photo] } { set new_album_id [template::element::get_value move_photo new_album_id] - ad_require_permission $new_album_id "pa_create_photo" + permission::require_permission -object_id $new_album_id -privilege "pa_create_photo" if [string equal [pa_is_album_p $new_album_id] "f"] { # may add some sort of error message 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.8 -r1.9 --- openacs-4/packages/photo-album/www/photos-add-2.tcl 21 Mar 2005 15:37:43 -0000 1.8 +++ openacs-4/packages/photo-album/www/photos-add-2.tcl 6 Sep 2013 17:17:44 -0000 1.9 @@ -31,7 +31,7 @@ #check permission set user_id [ad_conn user_id] -ad_require_permission $album_id "pa_create_photo" +permission::require_permission -object_id $album_id -privilege "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] } { Index: openacs-4/packages/photo-album/www/photos-add.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/photo-album/www/photos-add.tcl,v diff -u -r1.7 -r1.8 --- openacs-4/packages/photo-album/www/photos-add.tcl 21 Mar 2005 15:36:50 -0000 1.7 +++ openacs-4/packages/photo-album/www/photos-add.tcl 6 Sep 2013 17:17:44 -0000 1.8 @@ -21,7 +21,7 @@ } # check for read permission on folder -ad_require_permission $album_id pa_create_photo +permission::require_permission -object_id $album_id -privilege pa_create_photo set context [pa_context_bar_list -final "[_ photo-album._Upload]" $album_id] Index: openacs-4/packages/photo-album/www/photos-edit.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/photo-album/www/photos-edit.tcl,v diff -u -r1.5 -r1.6 --- openacs-4/packages/photo-album/www/photos-edit.tcl 12 Dec 2003 23:03:01 -0000 1.5 +++ openacs-4/packages/photo-album/www/photos-edit.tcl 6 Sep 2013 17:17:44 -0000 1.6 @@ -39,7 +39,7 @@ set user_id [ad_conn user_id] # check for read permission on album -ad_require_permission $album_id read +permission::require_permission -object_id $album_id -privilege read set context_list [pa_context_bar_list -final "[_ photo-album.Edit_page] $page" $album_id]