Index: openacs-4/packages/cms/www/register.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/Attic/register.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/cms/www/register.tcl 25 May 2001 02:15:56 -0000 1.3 +++ openacs-4/packages/cms/www/register.tcl 27 May 2001 00:22:34 -0000 1.4 @@ -44,7 +44,6 @@ form get_values register_user user_id email first_name last_name \ password screen_name - set db [template::begin_db_transaction] db_transaction { set user_id [ad_user_new $email $first_name $last_name $password \ Index: openacs-4/packages/cms/www/signin.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/Attic/signin.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/cms/www/signin.tcl 20 Apr 2001 20:51:09 -0000 1.1 +++ openacs-4/packages/cms/www/signin.tcl 27 May 2001 00:22:34 -0000 1.2 @@ -21,34 +21,30 @@ form get_values sign_in_user screen_name password - set db [template::begin_db_transaction] + db_transaction { - set query "select user_id, salt, password from users + template::query get_info info onerow "select user_id, salt, password from users where screen_name = :screen_name" - query info onerow $query -db $db + set is_valid_login 0 - set is_valid_login 0 + if { [array exists info] } { - if { [array exists info] } { + set hashed_password [ns_sha1 "$password$info(salt)"] + set is_valid_login [string equal $info(password) $hashed_password] + } - set hashed_password [ns_sha1 "$password$info(salt)"] - set is_valid_login [string equal $info(password) $hashed_password] - } + if { ! $is_valid_login } { - if { ! $is_valid_login } { + element set_error sign_in_user screen_name \ + "The screen name and password combination is invalid." - element set_error sign_in_user screen_name \ - "The screen name and password combination is invalid." + } else { - } else { - - User::login $db $info(user_id) - template::end_db_transaction - template::forward index - return + User::login $db $info(user_id) + template::forward index + return + } } - - template::end_db_transaction } Index: openacs-4/packages/cms/www/modules/categories/keyword-assign.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/categories/keyword-assign.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/cms/www/modules/categories/keyword-assign.tcl 24 May 2001 01:30:52 -0000 1.2 +++ openacs-4/packages/cms/www/modules/categories/keyword-assign.tcl 27 May 2001 00:22:34 -0000 1.3 @@ -15,8 +15,6 @@ # Preserve the item_id since the clipboard::parse_cookie wil overwrite it set saved_item_id $item_id set clip [clipboard::parse_cookie] - -set db [template::begin_db_transaction] db_transaction { clipboard::map_code $clip categories { if { [catch { Index: openacs-4/packages/cms/www/modules/items/publish.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/items/publish.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/cms/www/modules/items/publish.tcl 24 May 2001 23:57:17 -0000 1.3 +++ openacs-4/packages/cms/www/modules/items/publish.tcl 27 May 2001 00:22:34 -0000 1.4 @@ -38,7 +38,7 @@ } else { - db_dml abort "abort transaction" + db_abort_transaction set msg "This item is not in a publishable state" set return_url "index?item_id=$item_id" Index: openacs-4/packages/cms/www/modules/items/relate-child-order.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/items/relate-child-order.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/cms/www/modules/items/relate-child-order.tcl 26 May 2001 18:40:14 -0000 1.3 +++ openacs-4/packages/cms/www/modules/items/relate-child-order.tcl 27 May 2001 00:22:34 -0000 1.4 @@ -14,7 +14,7 @@ where rel_id = :rel_id" if { ![info exists rel_info] } { - db_dml abort "abort transaction" + db_abort_transaction request::error no_such_rel "The relationship $rel_id does not exist." return } Index: openacs-4/packages/cms/www/modules/items/relate-order.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/items/relate-order.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/cms/www/modules/items/relate-order.tcl 24 May 2001 01:30:52 -0000 1.2 +++ openacs-4/packages/cms/www/modules/items/relate-order.tcl 27 May 2001 00:22:34 -0000 1.3 @@ -35,7 +35,7 @@ rel_id = :rel_id" if { [template::util::is_nil item_id] } { - db_dml abort "abort transaction" + db_abort_transaction request::error no_such_rel "The relationship $rel_id does not exist." return } Index: openacs-4/packages/cms/www/modules/items/rename.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/items/rename.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/cms/www/modules/items/rename.tcl 24 May 2001 01:30:52 -0000 1.2 +++ openacs-4/packages/cms/www/modules/items/rename.tcl 27 May 2001 00:22:34 -0000 1.3 @@ -48,7 +48,6 @@ form get_values rename_item \ mount_point item_id name - set db [template::begin_db_transaction] db_transaction { db_exec_plsql rename_item " begin Index: openacs-4/packages/cms/www/modules/items/status-edit.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/items/status-edit.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/cms/www/modules/items/status-edit.tcl 24 May 2001 23:57:17 -0000 1.3 +++ openacs-4/packages/cms/www/modules/items/status-edit.tcl 27 May 2001 00:22:34 -0000 1.4 @@ -113,7 +113,6 @@ form get_values publish_status publish_status start_when end_when item_id - set db [template::begin_db_transaction] db_transaction { publish::set_publish_status $db $item_id $publish_status Index: openacs-4/packages/cms/www/modules/items/unrelate-item.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/items/unrelate-item.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/cms/www/modules/items/unrelate-item.tcl 24 May 2001 01:30:52 -0000 1.2 +++ openacs-4/packages/cms/www/modules/items/unrelate-item.tcl 27 May 2001 00:22:34 -0000 1.3 @@ -12,7 +12,7 @@ select item_id from cr_item_rels where rel_id = :rel_id" if { [template::util::is_nil item_id] } { - db_dml abort "abort transaction" + db_abort_transaction request::error no_such_rel "The relationship $rel_id does not exist." return } Index: openacs-4/packages/cms/www/modules/items/custom/cr_demo_article_image/create-2.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/items/custom/cr_demo_article_image/create-2.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/cms/www/modules/items/custom/cr_demo_article_image/create-2.tcl 25 May 2001 02:15:56 -0000 1.2 +++ openacs-4/packages/cms/www/modules/items/custom/cr_demo_article_image/create-2.tcl 27 May 2001 00:22:34 -0000 1.3 @@ -147,7 +147,7 @@ item_id = :item_id " - db_dml abort "abort transaction" + db_abort_transaction if { $clicks > 0 } { # double click error - do nothing, forward to view the item Index: openacs-4/packages/cms/www/modules/items/custom/image/attributes-edit.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/items/custom/image/attributes-edit.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/cms/www/modules/items/custom/image/attributes-edit.tcl 26 May 2001 18:40:14 -0000 1.3 +++ openacs-4/packages/cms/www/modules/items/custom/image/attributes-edit.tcl 27 May 2001 00:22:34 -0000 1.4 @@ -82,7 +82,7 @@ revision_id = :revision_id " - db_dml abort "abort transaction" + db_abort_transaction if { $clicks > 0 } { # double click error - forward to view the item Index: openacs-4/packages/cms/www/modules/items/custom/image/create-1.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/items/custom/image/create-1.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/cms/www/modules/items/custom/image/create-1.tcl 25 May 2001 02:15:56 -0000 1.2 +++ openacs-4/packages/cms/www/modules/items/custom/image/create-1.tcl 27 May 2001 00:22:34 -0000 1.3 @@ -130,7 +130,7 @@ item_id = :item_id " - db_dml abort "abort transaction" + db_abort_transaction if { $clicks > 0 } { # double click error - do nothing, forward to view the item Index: openacs-4/packages/cms/www/modules/sitemap/create.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/sitemap/create.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/cms/www/modules/sitemap/create.tcl 25 May 2001 02:15:56 -0000 1.2 +++ openacs-4/packages/cms/www/modules/sitemap/create.tcl 27 May 2001 00:22:34 -0000 1.3 @@ -63,7 +63,6 @@ set user_id [User::getID] set ip [ns_conn peeraddr] - set db [template::begin_db_transaction] db_transaction { set folder_id [db_exec_plsql new_folder " Index: openacs-4/packages/cms/www/modules/sitemap/delete-items-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/sitemap/delete-items-oracle.xql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/cms/www/modules/sitemap/delete-items-oracle.xql 25 May 2001 23:49:05 -0000 1.1 +++ openacs-4/packages/cms/www/modules/sitemap/delete-items-oracle.xql 27 May 2001 00:22:34 -0000 1.2 @@ -14,5 +14,36 @@ - + + + + content_symlink.delete + + + + + + + + content_folder.delete + + + + + + + + content_template.delete + + + + + + + + content_item.delete + + + + Index: openacs-4/packages/cms/www/modules/sitemap/delete-items-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/sitemap/delete-items-postgresql.xql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/cms/www/modules/sitemap/delete-items-postgresql.xql 25 May 2001 23:49:05 -0000 1.1 +++ openacs-4/packages/cms/www/modules/sitemap/delete-items-postgresql.xql 27 May 2001 00:22:34 -0000 1.2 @@ -16,5 +16,37 @@ + + + + + content_symlink__delete + + + + + + + + content_folder__delete + + + + + + + + content_template__delete + + + + + + + + content_item__delete + + + Index: openacs-4/packages/cms/www/modules/sitemap/delete-items.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/sitemap/delete-items.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/cms/www/modules/sitemap/delete-items.tcl 24 May 2001 01:30:52 -0000 1.2 +++ openacs-4/packages/cms/www/modules/sitemap/delete-items.tcl 27 May 2001 00:22:34 -0000 1.3 @@ -109,16 +109,16 @@ # set up the call to the proper PL/SQL delete procedure if { [string equal $is_symlink "t"] } { - set delete_proc "content_symlink.delete" + set delete_proc [db_map symlink_delete] set delete_key "symlink_id" } elseif { [string equal $is_folder "t"] } { - set delete_proc "content_folder.delete" + set delete_proc [db_map folder_delete] set delete_key "folder_id" } elseif { [string equal $is_template "t"] } { - set delete_proc "content_template.delete" + set delete_proc [db_map template_delete] set delete_key "template_id" } else { - set delete_proc "content_item.delete" + set delete_proc [db_map item_delete] set delete_key "item_id" } Index: openacs-4/packages/cms/www/modules/sitemap/type-unregister.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/sitemap/type-unregister.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/cms/www/modules/sitemap/type-unregister.tcl 25 May 2001 02:15:56 -0000 1.2 +++ openacs-4/packages/cms/www/modules/sitemap/type-unregister.tcl 27 May 2001 00:22:34 -0000 1.3 @@ -6,7 +6,6 @@ -set db [template::begin_db_transaction] db_transaction { db_exec_plsql unregister " begin Index: openacs-4/packages/cms/www/modules/templates/new-template.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/templates/new-template.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/cms/www/modules/templates/new-template.tcl 25 May 2001 02:15:56 -0000 1.2 +++ openacs-4/packages/cms/www/modules/templates/new-template.tcl 27 May 2001 00:22:34 -0000 1.3 @@ -45,7 +45,6 @@ set creation_ip [ns_conn peeraddr] set creation_user [User::getID] - set db [template::begin_db_transaction] db_transaction { Index: openacs-4/packages/cms/www/modules/types/content-method-unset-default.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/types/content-method-unset-default.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/cms/www/modules/types/content-method-unset-default.tcl 24 May 2001 23:57:17 -0000 1.2 +++ openacs-4/packages/cms/www/modules/types/content-method-unset-default.tcl 27 May 2001 00:22:34 -0000 1.3 @@ -13,7 +13,6 @@ } -set db [template::begin_db_transaction] db_transaction { db_exec_plsql unset_content_method_default " begin Index: openacs-4/packages/cms/www/modules/users/edit-user.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/users/edit-user.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/cms/www/modules/users/edit-user.tcl 24 May 2001 23:57:17 -0000 1.2 +++ openacs-4/packages/cms/www/modules/users/edit-user.tcl 27 May 2001 00:22:34 -0000 1.3 @@ -88,7 +88,6 @@ append users_update ", password=:hashed_password, salt=:salt" } - set db [template::begin_db_transaction] db_transaction { db_dml edit_user_1 " update users $users_update where user_id = :item_id Index: openacs-4/packages/cms/www/modules/users/edit.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/users/edit.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/cms/www/modules/users/edit.tcl 24 May 2001 23:57:17 -0000 1.2 +++ openacs-4/packages/cms/www/modules/users/edit.tcl 27 May 2001 00:22:34 -0000 1.3 @@ -52,7 +52,6 @@ template::form get_values edit_group group_id user_id group_name \ email url mount_point - set db [template::begin_db_transaction] db_transaction { db_dml edit_group_1 " update groups Index: openacs-4/packages/cms/www/modules/workflow/case-create.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/workflow/case-create.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/cms/www/modules/workflow/case-create.tcl 26 May 2001 18:40:15 -0000 1.3 +++ openacs-4/packages/cms/www/modules/workflow/case-create.tcl 27 May 2001 00:22:34 -0000 1.4 @@ -145,7 +145,6 @@ form get_values case_create item_id case_id is_edit transitions msg set creation_ip [ns_conn peeraddr] - set db [template::begin_db_transaction] db_transaction { if { ![string equal $is_edit t] } { Index: openacs-4/packages/cms/www/modules/workflow/task-checkin.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/workflow/task-checkin.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/cms/www/modules/workflow/task-checkin.tcl 25 May 2001 02:15:56 -0000 1.3 +++ openacs-4/packages/cms/www/modules/workflow/task-checkin.tcl 27 May 2001 00:22:34 -0000 1.4 @@ -105,7 +105,7 @@ " if { [string equal $is_valid_task f] } { - db_dml abort "abort transaction" + db_abort_transaction template::request::error invalid_task \ "task-checkin.tcl - invalid task - $task_id" return Index: openacs-4/packages/cms/www/modules/workflow/task-finish.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/workflow/task-finish.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/cms/www/modules/workflow/task-finish.tcl 25 May 2001 02:15:56 -0000 1.3 +++ openacs-4/packages/cms/www/modules/workflow/task-finish.tcl 27 May 2001 00:22:34 -0000 1.4 @@ -91,7 +91,7 @@ select content_workflow.can_approve( :task_id, :user_id ) from dual" if { [string equal $is_valid_task f] } { - db_dml abort "abort transaction" + db_abort_transaction template::request::error invalid_task \ "task-finish.tcl - This task is no longer valid - $task_id" return Index: openacs-4/packages/cms/www/modules/workflow/task-reject.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/workflow/task-reject.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/cms/www/modules/workflow/task-reject.tcl 24 May 2001 23:57:17 -0000 1.2 +++ openacs-4/packages/cms/www/modules/workflow/task-reject.tcl 27 May 2001 00:22:34 -0000 1.3 @@ -127,7 +127,7 @@ select content_workflow.can_reject( :task_id, :user_id ) from dual" if { [string equal $is_valid_task f] } { - db_dml abort "abort transaction" + db_abort_transaction template::request::error invalid_task \ "task-reject.tcl - invalid task - $task_id" return Index: openacs-4/packages/cms/www/modules/workflow/task-start.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/modules/workflow/task-start.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/cms/www/modules/workflow/task-start.tcl 24 May 2001 23:57:17 -0000 1.2 +++ openacs-4/packages/cms/www/modules/workflow/task-start.tcl 27 May 2001 00:22:34 -0000 1.3 @@ -112,14 +112,13 @@ set ip_address [ns_conn peeraddr] set user_id [User::getID] - set db [template::begin_db_transaction] db_transaction { # check that task has not expired, if it has display error msg template::query get_status is_valid_task onevalue " select content_workflow.can_start( :task_id, :user_id ) from dual" if { [string equal $is_valid_task f] } { - db_dml abort "abort transaction" + db_abort_transaction template::request::error invalid_task \ "task-start.tcl - invalid task - $task_id" return