Index: openacs-4/packages/contacts-lite/www/add-edit.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/contacts-lite/www/add-edit.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/contacts-lite/www/add-edit.tcl 20 Jan 2021 21:17:08 -0000 1.2 +++ openacs-4/packages/contacts-lite/www/add-edit.tcl 20 Jan 2021 21:21:07 -0000 1.3 @@ -44,11 +44,11 @@ set categories [db_list_of_lists get_categories ""] if { ![ad_form_new_p -key contact_id]} { -# ad_require_permission $contact_id write +# permission::require_permission -object_id $contact_id -privilege write set page_title "Edit Contact" set context_bar [ad_context_bar [list "." "Contact Info"] [list "one?contact_id=$contact_id" "Contact Info"] $page_title] } else { -# ad_require_permission $package_id create +# permission::require_permission -object_id $package_id -privilege create set page_title "New Contact" set context_bar [ad_context_bar [list "." "Contacts"] $page_title ] } Index: openacs-4/packages/contacts-lite/www/delete-2.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/contacts-lite/www/delete-2.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/contacts-lite/www/delete-2.tcl 20 Jan 2021 18:35:37 -0000 1.1 +++ openacs-4/packages/contacts-lite/www/delete-2.tcl 20 Jan 2021 21:21:08 -0000 1.2 @@ -7,7 +7,7 @@ contact_id:integer,notnull } -ad_require_permission $contact_id delete +permission::require_permission -object_id $contact_id -privilege delete db_exec_plsql contact_delete { Index: openacs-4/packages/contacts-lite/www/delete.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/contacts-lite/www/delete.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/contacts-lite/www/delete.tcl 20 Jan 2021 21:17:08 -0000 1.2 +++ openacs-4/packages/contacts-lite/www/delete.tcl 20 Jan 2021 21:21:08 -0000 1.3 @@ -29,7 +29,7 @@ set user_id [ad_conn user_id] # make sure they don't perform URL surgery -ad_require_permission $contact_id delete +permission::require_permission -object_id $contact_id -privilege delete db_1row contact_select { select contact_id, Index: openacs-4/packages/contacts-lite/www/index.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/contacts-lite/www/index.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/contacts-lite/www/index.tcl 20 Jan 2021 21:17:08 -0000 1.2 +++ openacs-4/packages/contacts-lite/www/index.tcl 20 Jan 2021 21:21:08 -0000 1.3 @@ -22,13 +22,13 @@ set context_bar [ad_context_bar "Contacts"] -set user_id [ad_verify_and_get_user_id] +set user_id [ad_conn user_id] set package_id [ad_conn package_id] set title "Contacts" -set contacts_create_p [ad_permission_p $package_id create] -set admin_p [ad_permission_p $package_id admin] +set contacts_create_p [permission::permission_p -object_id $package_id -privilege create] +set admin_p [permission::permission_p -object_id $package_id -privilege admin] db_multirow first_letter get_first_letters { *SQL* } @@ -68,7 +68,7 @@ } -set max_dspl [ad_parameter MaxContactsShow contacts 10] +set max_dspl [parameter::get -parameter MaxContactsShow -default 10] set count 0 db_multirow contacts contacts_select " select contact_id, Index: openacs-4/packages/contacts-lite/www/one.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/contacts-lite/www/one.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/contacts-lite/www/one.tcl 20 Jan 2021 21:17:08 -0000 1.2 +++ openacs-4/packages/contacts-lite/www/one.tcl 20 Jan 2021 21:21:08 -0000 1.3 @@ -23,13 +23,13 @@ } set context_bar [ad_context_bar "Contact Info"] -set user_id [ad_verify_and_get_user_id] +set user_id [ad_conn user_id] set contact_admin_p [group::member_p -group_name "Employees"] set admin $contact_admin_p if { $admin ne "1" } { - set contact_write_p [ad_permission_p $contact_id "write"] + set contact_write_p [permission::permission_p -object_id $contact_id -privilege "write"] } else { set contact_write_p 1 } Index: openacs-4/packages/contacts-lite/www/addresses/add-edit.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/contacts-lite/www/addresses/add-edit.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/contacts-lite/www/addresses/add-edit.tcl 20 Jan 2021 18:35:37 -0000 1.1 +++ openacs-4/packages/contacts-lite/www/addresses/add-edit.tcl 20 Jan 2021 21:21:08 -0000 1.2 @@ -34,10 +34,10 @@ db_1row get_contact { } if {![ad_form_new_p -key address_id]} { -# ad_require_permission $contact_id write +# permission::require_permission -object_id $contact_id -privilege write set context_bar [ad_context_bar [list "./?contact_id=$contact_id" "Addresses"] "Edit Address"] } else { -# ad_require_permission $package_id create +# permission::require_permission -object_id $package_id -privilege create set context_bar [ad_context_bar [list "./?contact_id=$contact_id" "Addresses"] "New Address"] } Index: openacs-4/packages/contacts-lite/www/addresses/address-delete-2.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/contacts-lite/www/addresses/address-delete-2.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/contacts-lite/www/addresses/address-delete-2.tcl 20 Jan 2021 18:35:37 -0000 1.1 +++ openacs-4/packages/contacts-lite/www/addresses/address-delete-2.tcl 20 Jan 2021 21:21:08 -0000 1.2 @@ -8,7 +8,7 @@ contact_id:integer,notnull } -ad_require_permission $address_id delete +permission::require_permission -object_id $address_id -privilege delete db_1row get_contact "select contact_id from cn_addresses where address_id=:address_id" Index: openacs-4/packages/contacts-lite/www/addresses/address-delete.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/contacts-lite/www/addresses/address-delete.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/contacts-lite/www/addresses/address-delete.tcl 20 Jan 2021 21:17:08 -0000 1.2 +++ openacs-4/packages/contacts-lite/www/addresses/address-delete.tcl 20 Jan 2021 21:21:08 -0000 1.3 @@ -30,7 +30,7 @@ set user_id [ad_conn user_id] # make sure they don't perform URL surgery -ad_require_permission $address_id delete +permission::require_permission -object_id $address_id -privilege delete db_1row address_select { select address_id, Index: openacs-4/packages/contacts-lite/www/addresses/delete-2.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/contacts-lite/www/addresses/delete-2.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/contacts-lite/www/addresses/delete-2.tcl 20 Jan 2021 18:35:37 -0000 1.1 +++ openacs-4/packages/contacts-lite/www/addresses/delete-2.tcl 20 Jan 2021 21:21:08 -0000 1.2 @@ -7,7 +7,7 @@ address_id:integer,notnull } -ad_require_permission $address_id delete +permission::require_permission -object_id $address_id -privilege delete db_1row get_contact { } Index: openacs-4/packages/contacts-lite/www/addresses/delete.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/contacts-lite/www/addresses/delete.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/contacts-lite/www/addresses/delete.tcl 20 Jan 2021 21:17:08 -0000 1.2 +++ openacs-4/packages/contacts-lite/www/addresses/delete.tcl 20 Jan 2021 21:21:08 -0000 1.3 @@ -27,7 +27,7 @@ set user_id [ad_conn user_id] # make sure they don't perform URL surgery -ad_require_permission $address_id delete +permission::require_permission -object_id $address_id -privilege delete db_1row address_select { } -column_array one_address Index: openacs-4/packages/contacts-lite/www/addresses/index.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/contacts-lite/www/addresses/index.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/contacts-lite/www/addresses/index.tcl 20 Jan 2021 18:35:37 -0000 1.1 +++ openacs-4/packages/contacts-lite/www/addresses/index.tcl 20 Jan 2021 21:21:08 -0000 1.2 @@ -21,10 +21,10 @@ set context_bar [ad_context_bar "Address"] set title "Addresses" -set user_id [ad_verify_and_get_user_id] +set user_id [ad_conn user_id] -set addresses_create_p [ad_permission_p $package_id create] -set admin_p [ad_permission_p $package_id admin] +set addresses_create_p [permission::permission_p -object_id $package_id -privilege create] +set admin_p [permission::permission_p -object_id $package_id -privilege admin] db_multirow addresses addresses_select { } Index: openacs-4/packages/contacts-lite/www/addresses/one.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/contacts-lite/www/addresses/one.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/contacts-lite/www/addresses/one.tcl 20 Jan 2021 21:17:08 -0000 1.2 +++ openacs-4/packages/contacts-lite/www/addresses/one.tcl 20 Jan 2021 21:21:08 -0000 1.3 @@ -21,9 +21,9 @@ } set context_bar [ad_context_bar [list ".?contact_id=$contact_id" "Address Info"] "One Address"] -set user_id [ad_verify_and_get_user_id] +set user_id [ad_conn user_id] -set contact_write_p [ad_permission_p $contact_id "write"] +set contact_write_p [permission::permission_p -object_id $contact_id -privilege "write"] db_1row address_select { } -column_array addresses Index: openacs-4/packages/contacts-lite/www/admin/index.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/contacts-lite/www/admin/index.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/contacts-lite/www/admin/index.tcl 20 Jan 2021 18:35:37 -0000 1.1 +++ openacs-4/packages/contacts-lite/www/admin/index.tcl 20 Jan 2021 21:21:08 -0000 1.2 @@ -18,7 +18,7 @@ set title "Contacts Admin" -set user_id [ad_verify_and_get_user_id] +set user_id [ad_conn user_id] set context_bar "" Index: openacs-4/packages/contacts-lite/www/admin/address-type/index.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/contacts-lite/www/admin/address-type/index.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/contacts-lite/www/admin/address-type/index.tcl 20 Jan 2021 18:35:37 -0000 1.1 +++ openacs-4/packages/contacts-lite/www/admin/address-type/index.tcl 20 Jan 2021 21:21:08 -0000 1.2 @@ -19,7 +19,7 @@ set title "Address Types Admin" set context_bar [ad_context_bar $title] -set user_id [ad_verify_and_get_user_id] +set user_id [ad_conn user_id] ## setup a status bar Index: openacs-4/packages/contacts-lite/www/admin/categories/add-edit.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/contacts-lite/www/admin/categories/add-edit.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/contacts-lite/www/admin/categories/add-edit.tcl 20 Jan 2021 21:17:08 -0000 1.2 +++ openacs-4/packages/contacts-lite/www/admin/categories/add-edit.tcl 20 Jan 2021 21:21:08 -0000 1.3 @@ -17,10 +17,10 @@ # note make sure this is subsite aware. if {[info exists category_id]} { - ad_require_permission $category_id write + permission::require_permission -object_id $category_id -privilege write set page_title "Edit Category" } else { - ad_require_permission $package_id create + permission::require_permission -object_id $package_id -privilege create set page_title "New Category" } Index: openacs-4/packages/contacts-lite/www/admin/categories/index.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/contacts-lite/www/admin/categories/index.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/contacts-lite/www/admin/categories/index.tcl 20 Jan 2021 18:35:37 -0000 1.1 +++ openacs-4/packages/contacts-lite/www/admin/categories/index.tcl 20 Jan 2021 21:21:08 -0000 1.2 @@ -17,7 +17,7 @@ set package_id [ad_conn package_id] set title "Categories Admin" -set user_id [ad_verify_and_get_user_id] +set user_id [ad_conn user_id] set context_bar [list $title] ## setup a status bar Index: openacs-4/packages/contacts-lite/www/admin/company-type/index.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/contacts-lite/www/admin/company-type/index.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/contacts-lite/www/admin/company-type/index.tcl 20 Jan 2021 18:35:37 -0000 1.1 +++ openacs-4/packages/contacts-lite/www/admin/company-type/index.tcl 20 Jan 2021 21:21:08 -0000 1.2 @@ -17,7 +17,7 @@ set package_id [ad_conn package_id] set title "Contacts Admin" -set user_id [ad_verify_and_get_user_id] +set user_id [ad_conn user_id] set context_bar [list "Admin Company Type"] ## setup a status bar Index: openacs-4/packages/contacts-lite/www/admin/phone-type/index.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/contacts-lite/www/admin/phone-type/index.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/contacts-lite/www/admin/phone-type/index.tcl 20 Jan 2021 18:35:37 -0000 1.1 +++ openacs-4/packages/contacts-lite/www/admin/phone-type/index.tcl 20 Jan 2021 21:21:08 -0000 1.2 @@ -18,7 +18,7 @@ set context_bar [ad_context_bar "Admin Phone Types"] set title "Phone Types Admin" -set user_id [ad_verify_and_get_user_id] +set user_id [ad_conn user_id] ## setup a status bar Index: openacs-4/packages/contacts-lite/www/phones/add-edit.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/contacts-lite/www/phones/add-edit.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/contacts-lite/www/phones/add-edit.tcl 20 Jan 2021 18:35:37 -0000 1.1 +++ openacs-4/packages/contacts-lite/www/phones/add-edit.tcl 20 Jan 2021 21:21:08 -0000 1.2 @@ -20,10 +20,10 @@ set contact_name [db_1row get_contact_name ""] if { [ad_form_new_p -key phone_id]} { -# ad_require_permission $contact_id write +# permission::require_permission -object_id $contact_id -privilege write set context_bar [ad_context_bar [list "." "Contacts"] [list "one?contact_id=$contact_id" "Contact Info"] "Edit Phone"] } else { -# ad_require_permission $package_id create +# permission::require_permission -object_id $package_id -privilege create set context_bar [ad_context_bar [list "." "Contacts"] [list "one?contact_id=$contact_id" "Contact Info"] "New Phone"] } Index: openacs-4/packages/contacts-lite/www/phones/delete-2.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/contacts-lite/www/phones/delete-2.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/contacts-lite/www/phones/delete-2.tcl 20 Jan 2021 18:35:37 -0000 1.1 +++ openacs-4/packages/contacts-lite/www/phones/delete-2.tcl 20 Jan 2021 21:21:08 -0000 1.2 @@ -8,7 +8,7 @@ contact_id:integer,notnull } -#ad_require_permission $contact_id delete +#permission::require_permission -object_id $contact_id -privilege delete db_exec_plsql phone_delete { } Index: openacs-4/packages/contacts-lite/www/phones/delete.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/contacts-lite/www/phones/delete.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/contacts-lite/www/phones/delete.tcl 20 Jan 2021 21:17:08 -0000 1.2 +++ openacs-4/packages/contacts-lite/www/phones/delete.tcl 20 Jan 2021 21:21:08 -0000 1.3 @@ -30,7 +30,7 @@ set user_id [ad_conn user_id] # make sure they don't perform URL surgery -#ad_require_permission $phone_number_id delete +#permission::require_permission -object_id $phone_number_id -privilege delete db_1row phone_select { select phone_number_id, Index: openacs-4/packages/contacts-lite/www/phones/index.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/contacts-lite/www/phones/index.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/contacts-lite/www/phones/index.tcl 20 Jan 2021 18:35:37 -0000 1.1 +++ openacs-4/packages/contacts-lite/www/phones/index.tcl 20 Jan 2021 21:21:08 -0000 1.2 @@ -21,10 +21,10 @@ set context_bar [ad_context_bar "Phone Info"] set title "Phone Numbers" -set user_id [ad_verify_and_get_user_id] +set user_id [ad_conn user_id] -set phones_create_p [ad_permission_p $package_id create] -set admin_p [ad_permission_p $package_id admin] +set phones_create_p [permission::permission_p -object_id $package_id -privilege create] +set admin_p [permission::permission_p -object_id $package_id -privilege admin] db_multirow phones phones_select { select contact_id,phone_number_id,phone_number,