Commit 49e8d85f authored by Frank Bergmann's avatar Frank Bergmann

- Changed ad_conn_user_id to ad_conn user_id

- Added workflow updates in order to eliminate
  "modify" as the first transition in a WF
parent 8c3584a6
set current_url [ns_conn url]
set current_user_id [ad_get_user_id]
set current_user_id [ad_conn user_id]
set super_project_id [im_project_super_project_id $project_id]
im_project_permissions $current_user_id $project_id view read write admin
if {!$read} { return "" }
......
......@@ -4,7 +4,7 @@ ad_page_contract {
- Implements project status filter for sub-projects
}
set current_user_id [ad_get_user_id]
set current_user_id [ad_conn user_id]
set super_project_id [im_project_super_project_id $project_id]
im_project_permissions $current_user_id $project_id view read write admin
if {!$read} { return "" }
......
......@@ -41,7 +41,7 @@ ad_proc -public im_send_alert {target_id frequency subject {message ""} } {
# Quick & Dirty implementation: just send out the mail immediately,
# until there is more time...
set current_user_id [ad_get_user_id]
set current_user_id [ad_conn user_id]
# Get the email of the target user
set user_email_sql "select email from parties where party_id = :target_id"
......@@ -198,7 +198,7 @@ ad_proc -public im_security_alert {
set url [ns_conn url]
# Get intersting info
set user_id [ad_get_user_id]
set user_id [ad_conn user_id]
set user_name [db_string uname "select im_name_from_user_id(:user_id)" -default "unknown"]
set client_ip [ns_set get $header_vars "Client-ip"]
set referer_url [ns_set get $header_vars "Referer"]
......@@ -247,7 +247,7 @@ peer_ip: $peer_ip
ad_proc -public im_send_alert_to_system_owner {subject message} {
set system_owner_email [ad_parameter -package_id [im_package_forum_id] ReportThisErrorEmail]
set current_user_id [ad_get_user_id]
set current_user_id [ad_conn user_id]
ns_sendmail $system_owner_email $system_owner_email $subject $message
}
......@@ -245,7 +245,7 @@ ad_proc -public im_biz_object_add_role {
set creation_user_id 0
catch {
set user_ip [ad_conn peeraddr]
set creation_user_id [ad_get_user_id]
set creation_user_id [ad_conn user_id]
}
}
......@@ -906,7 +906,7 @@ ad_proc im_biz_object_add_profile_component {
} {
# ------------------------------------------------
# Applicability, Defauls & Security
set current_user_id [ad_get_user_id]
set current_user_id [ad_conn user_id]
set object_type [util_memoize [list db_string acs_object_type "select object_type from acs_objects where object_id = $object_id" -default ""]]
set perm_cmd "${object_type}_permissions \$current_user_id \$object_id view_p read_p write_p admin_p"
eval $perm_cmd
......
......@@ -122,7 +122,7 @@ ad_proc im_category_select {
@param multiple_p You can select multiple categories
} {
if {"" == $locale} { set locale [lang::user::locale -user_id [ad_get_user_id]] }
if {"" == $locale} { set locale [lang::user::locale -user_id [ad_conn user_id]] }
if {$no_cache_p} {
return [im_category_select_helper -multiple_p $multiple_p -translate_p $translate_p -package_key $package_key -locale $locale -include_empty_p $include_empty_p -include_empty_name $include_empty_name -plain_p $plain_p -super_category_id $super_category_id $category_type $select_name $default]
......
......@@ -168,7 +168,7 @@ namespace eval im_company {
This procedure relies that changes to companies will be
reported to this module.
} {
if {"" == $user_id} { set user_id [ad_get_user_id] }
if {"" == $user_id} { set user_id [ad_conn user_id] }
# Check if we have calculated this result already
set key [list company_options $user_id $status_id $type_id $exclude_status_id $always_include_company_id $with_projects_p $with_active_projects_p]
......@@ -523,7 +523,7 @@ ad_proc -public im_company_options {
} {
Cost company options
} {
set user_id [ad_get_user_id]
set user_id [ad_conn user_id]
if {"" != $status} { set status_id [im_id_from_category $status "Intranet Company Status"] }
if {"" != $exclude_status} { set exclude_status_id [im_id_from_category $exclude_status "Intranet Company Status"] }
if {"" != $type} { set type_id [im_id_from_category $type "Intranet Company Type"] }
......@@ -597,11 +597,11 @@ ad_proc im_company_nuke {
} {
ns_log Notice "im_company_nuke company_id=$company_id"
# Use a predefined user_id to avoid a call to ad_get_user_id.
# ad_get_user_id's connection isn't defined during a DELETE REST request.
# Use a predefined user_id to avoid a call to ad_conn user_id.
# ad_conn user_id's connection isn't defined during a DELETE REST request.
if {0 == $current_user_id} {
ns_log Notice "im_company_nuke: No current_user_id specified - using ad_get_user_id"
set current_user_id [ad_get_user_id]
ns_log Notice "im_company_nuke: No current_user_id specified - using ad_conn user_id"
set current_user_id [ad_conn user_id]
}
# Log the action
......@@ -933,7 +933,7 @@ ad_proc -public im_menu_companies_admin_links {
Return a list of admin links to be added to the "companies" menu
} {
set result_list {}
set current_user_id [ad_get_user_id]
set current_user_id [ad_conn user_id]
set return_url [im_url_with_query]
# Add companies
......
......@@ -70,7 +70,7 @@ ad_proc -public im_component_box {
} {
if {"" == $body} { return "" }
set user_id [ad_get_user_id]
set user_id [ad_conn user_id]
set page_url [im_component_page_url]
set return_url [im_url_with_query]
set base_url "/intranet/components/component-action"
......@@ -138,7 +138,7 @@ ad_proc -public im_component_bay {
} {
Checks the database for Plug-ins for this page and component bay.
} {
set user_id [ad_get_user_id]
set user_id [ad_conn user_id]
im_security_alert_check_alphanum -location "im_component_bay: location" -value $location
im_security_alert_check_alphanum -location "im_component_bay: view_name" -value $view_name
......
......@@ -848,7 +848,7 @@ ad_proc im_select {
# Get out early as there's nothing to do
if { [llength $pairs] == 0 } { return "" }
if {"" == $locale} { set locale [lang::user::locale -user_id [ad_get_user_id]] }
if {"" == $locale} { set locale [lang::user::locale -user_id [ad_conn user_id]] }
set multiple ""
if {$multiple_p} {
......@@ -1891,7 +1891,7 @@ ad_proc im_require_login {
# --------------------------------------------------------
# Check for OpenACS authenticated session
#
set user_id [ad_get_user_id]
set user_id [ad_conn user_id]
if {0 != $user_id} {
ns_log Notice "im_require_login: Successful OpenACS authentication with user_id=$user_id"
return $user_id
......@@ -2193,7 +2193,7 @@ ad_proc im_performance_log {
set header_vars [ns_conn headers]
# Get intersting info
set user_id [ad_get_user_id]
set user_id [ad_conn user_id]
# IP Addresses
set client_ip [ns_set get $header_vars "Client-ip"]
......
......@@ -335,7 +335,7 @@ ad_proc -public im_user_navbar { default_letter base_url next_page_url prev_page
@param select_label Label of a menu item to highlight
} {
# -------- Defaults -----------------------------
set user_id [ad_get_user_id]
set user_id [ad_conn user_id]
set url_stub [ns_urldecode [im_url_with_query]]
# ns_log Notice "im_user_navbar: url_stub=$url_stub"
......@@ -383,7 +383,7 @@ ad_proc -public im_project_navbar {
search shortcuts, defaults to "projects".
} {
# -------- Defaults -----------------------------
set user_id [ad_get_user_id]
set user_id [ad_conn user_id]
set url_stub [ns_urldecode [im_url_with_query]]
set sel "<td class=tabsel>"
......@@ -432,7 +432,7 @@ ad_proc -public im_office_navbar { default_letter base_url next_page_url prev_pa
}
# --------------- Determine the calling page ------------------
set user_id [ad_get_user_id]
set user_id [ad_conn user_id]
set section ""
set url_stub [im_url_with_query]
......@@ -488,7 +488,7 @@ ad_proc -public im_company_navbar { default_letter base_url next_page_url prev_p
Default_letter==none marks a special behavious, hiding the alpha-bar.
} {
# -------- Defaults -----------------------------
set user_id [ad_get_user_id]
set user_id [ad_conn user_id]
set url_stub [ns_urldecode [im_url_with_query]]
set sel "<td class=tabsel>"
......@@ -643,7 +643,7 @@ ad_proc -public im_sub_navbar {
@title string to go into the line below the menu tabs
@title_class CSS class of the title line
} {
set user_id [ad_get_user_id]
set user_id [ad_conn user_id]
set admin_p [im_is_user_site_wide_or_intranet_admin $user_id]
set locale [lang::user::locale -user_id $user_id]
set url_stub [ns_conn url]
......@@ -842,7 +842,7 @@ ad_proc -public im_navbar {
if { [parameter::get -package_id [apm_package_id_from_key intranet-core] -parameter "LegacyFrameworkVersion4P" -default 1] } {
return [im_navbar_legacy_version_4 -loginpage $loginpage -show_context_help_p $show_context_help_p $main_navbar_label]
} else {
set user_id [ad_get_user_id]
set user_id [ad_conn user_id]
set admin_p [im_is_user_site_wide_or_intranet_admin $user_id]
set locale [lang::user::locale -user_id $user_id]
if {![info exists loginpage_p]} { set loginpage_p 0 }
......@@ -1057,7 +1057,7 @@ ad_proc -public im_navbar_legacy_version_4 {
# ns_log Notice "im_navbar: main_navbar_label=$main_navbar_label"
set user_id [ad_get_user_id]
set user_id [ad_conn user_id]
set admin_p [im_is_user_site_wide_or_intranet_admin $user_id]
set locale [lang::user::locale -user_id $user_id]
if {![info exists loginpage_p]} { set loginpage_p 0 }
......@@ -1163,7 +1163,7 @@ ad_proc -public im_navbar_legacy_version_4 {
set maintenance_message [ad_parameter -package_id [im_package_core_id] MaintenanceMessage "" ""]
set maintenance_message [string trim $maintenance_message]
set user_id [ad_get_user_id]
set user_id [ad_conn user_id]
set user_name [im_name_from_user_id $user_id]
set context_help_html ""
......@@ -1329,7 +1329,7 @@ ad_proc -public im_header_plugins {
Determines the contents for left & right header plugins.
Returns an array with keys "left" and "right"
} {
set user_id [ad_get_user_id]
set user_id [ad_conn user_id]
set locale [lang::user::locale -user_id $user_id]
return [util_memoize [list im_header_plugins_helper -locale $locale -user_id $user_id]]
......@@ -1342,7 +1342,7 @@ ad_proc -public im_header_plugins_helper {
Determines the contents for left & right header plugins.
Returns an array with keys "left" and "right"
} {
if {"" == $user_id} { set user_id [ad_get_user_id] }
if {"" == $user_id} { set user_id [ad_conn user_id] }
if {"" == $locale} { set locale [lang::user::locale -user_id $user_id] }
set plugin_left_html ""
......@@ -1498,7 +1498,7 @@ ad_proc -public im_header {
# --------------------------------------------------------------
# Defaults & Security
set untrusted_user_id [ad_conn untrusted_user_id]
set user_id [ad_get_user_id]
set user_id [ad_conn user_id]
if {0 != $user_id} { set untrusted_user_id $user_id }
set user_name [im_name_from_user_id $user_id]
set return_url [im_url_with_query]
......@@ -1776,7 +1776,7 @@ ad_proc -public im_header_legacy_version_4 {
# --------------------------------------------------------------
# Defaults & Security
set untrusted_user_id [ad_conn untrusted_user_id]
set user_id [ad_get_user_id]
set user_id [ad_conn user_id]
if {0 != $user_id} { set untrusted_user_id $user_id }
set user_name [im_name_from_user_id $user_id]
set return_url [im_url_with_query]
......@@ -2033,7 +2033,7 @@ ad_proc -private im_header_users_online_str { } {
ad_proc -private im_header_search_form { } {
Search form for header of page
} {
set user_id [ad_get_user_id]
set user_id [ad_conn user_id]
set search_installed_p [llength [info procs im_package_search_id]]
if {[im_permission $user_id "search_intranet"] && $user_id > 0 && $search_installed_p} {
......@@ -2129,7 +2129,7 @@ ad_proc -public im_footer {
ad_proc -public im_stylesheet {} {
Intranet CSS style sheet.
} {
set user_id [ad_get_user_id]
set user_id [ad_conn user_id]
set html ""
set openacs54_p [im_openacs54_p]
set css "/resources/acs-subsite/site-master.css"
......@@ -2181,7 +2181,7 @@ ad_proc -public im_logo {} {
set system_logo_link [ad_parameter -package_id [im_package_core_id] SystemLogoLink "" "http://www.project-open.com/"]
if {[string equal $system_logo ""]} {
set user_id [ad_get_user_id]
set user_id [ad_conn user_id]
set skin_name [im_user_skin $user_id]
if {[file exists "[acs_root_dir]/packages/intranet-core/www/images/logo.$skin_name.gif"]} {
......@@ -2190,7 +2190,7 @@ ad_proc -public im_logo {} {
set system_logo "$system_url/intranet/images/logo.default.gif"
}
}
# if { "0" != [ad_get_user_id] } {
# if { "0" != [ad_conn user_id] } {
return "\n<a href=\"$system_logo_link\"><img id='intranetlogo' src=\"$system_logo\" alt=\"logo\" border='0'></a>\n"
# } else {
# return "\n<a href=\"$system_logo_link\"><img id='intranetlogo' src=\"logo.gif\" alt=\"logo\" border='0'></a>\n"
......@@ -2201,7 +2201,7 @@ ad_proc -public im_logo {} {
ad_proc -public im_navbar_gif_url {} {
Path to access the Navigation Bar corner GIFs
} {
set user_id [ad_get_user_id]
set user_id [ad_conn user_id]
set locale [lang::user::locale -user_id $user_id]
return [util_memoize [list im_navbar_gif_url_helper -locale $locale -user_id $user_id] 60]
......@@ -2213,7 +2213,7 @@ ad_proc -public im_navbar_gif_url_helper {
} {
Path to access the Navigation Bar corner GIFs
} {
if {"" == $user_id} { set user_id [ad_get_user_id] }
if {"" == $user_id} { set user_id [ad_conn user_id] }
if {"" == $locale} { set locale [lang::user::locale -user_id $user_id] }
set navbar_gif_url "/intranet/images/[ad_parameter -package_id [im_package_core_id] SystemNavbarGifPath "" "/intranet/images/navbar_default"]"
......@@ -2403,7 +2403,7 @@ ad_proc im_report_error { message } {
set system_url [ad_parameter -package_id [ad_acs_kernel_id] SystemURL "" ""]
set publisher_name [ad_parameter -package_id [ad_acs_kernel_id] PublisherName "" ""]
set core_version "2.0"
set error_user_id [ad_get_user_id]
set error_user_id [ad_conn user_id]
set error_first_names ""
set error_last_name ""
set error_user_email ""
......
......@@ -139,7 +139,7 @@ ad_proc -public im_menu_ul_list {
if {!$enabled_p} { return "" }
}
set user_id [ad_get_user_id]
set user_id [ad_conn user_id]
set locale [lang::user::locale -user_id $user_id]
if {$no_cache_p} {
......@@ -163,7 +163,7 @@ ad_proc -public im_menu_ul_list_helper {
to be added to index screens (costs) etc.
} {
if {"" == $locale} { set locale [lang::user::locale -user_id $user_id] }
set admin_p [im_is_user_site_wide_or_intranet_admin [ad_get_user_id]]
set admin_p [im_is_user_site_wide_or_intranet_admin [ad_conn user_id]]
array set bind_vars_hash $bind_vars
set parent_menu_id [db_string parent_admin_menu "select menu_id from im_menus where label=:parent_menu_label" -default 0]
......@@ -299,7 +299,7 @@ ad_proc -public im_menu_li_helper {
} {
array set bind_vars_hash $bind_vars
if {"" == $user_id} { set user_id [ad_get_user_id] }
if {"" == $user_id} { set user_id [ad_conn user_id] }
if {"" == $locale} { set locale [lang::user::locale -user_id $user_id] }
set menu_id 0
......@@ -353,7 +353,7 @@ ad_proc -public im_menu_links {
} {
set result_list [list]
set result_list_admin [list]
set current_user_id [ad_get_user_id]
set current_user_id [ad_conn user_id]
set return_url [im_url_with_query]
# Create SubMenu "new FinDocs"
......
......@@ -53,7 +53,7 @@ ad_proc -public im_navbar_tree {
Creates an <ul> ...</ul> hierarchical list with all major
objects in the system.
} {
if {0 == $user_id} { set user_id [ad_get_user_id] }
if {0 == $user_id} { set user_id [ad_conn user_id] }
set locale [lang::user::locale -user_id $user_id]
set no_cache_p 1
......@@ -707,7 +707,7 @@ ad_proc -public im_navbar_write_tree {
} {
Starts writing out the menu tree from a particular location
} {
if {0 == $user_id} { set user_id [ad_get_user_id] }
if {0 == $user_id} { set user_id [ad_conn user_id] }
if {"" == $locale} { set locale [lang::user::locale -user_id $user_id] }
if {$no_cache_p} {
......@@ -794,7 +794,7 @@ ad_proc -public im_navbar_sub_tree {
Creates an <ul> ...</ul> hierarchical list for
the admin section
} {
set user_id [ad_get_user_id]
set user_id [ad_conn user_id]
set locale [lang::user::locale -user_id $user_id]
set menu_id [db_string main_menu "select menu_id from im_menus where label=:label" -default 0]
set menu_list_list [util_memoize [list im_sub_navbar_menu_helper -locale $locale $user_id $menu_id] 60]
......
......@@ -24,7 +24,7 @@ ad_proc -public im_notification_user_component {
Returns a formatted HTML showing the status of notifications
for the current user.
} {
if {0 == $user_id} { set user_id [ad_get_user_id] }
if {0 == $user_id} { set user_id [ad_conn user_id] }
set return_url [im_url_with_query]
set params [list \
......
......@@ -517,7 +517,7 @@ ad_proc im_office_nuke {
Nuke (complete delete from the database) a office
} {
ns_log Notice "im_office_nuke office_id=$office_id"
if {0 == $current_user_id || "" == $current_user_id} { set current_user_id [ad_get_user_id] }
if {0 == $current_user_id || "" == $current_user_id} { set current_user_id [ad_conn user_id] }
im_office_permissions $current_user_id $office_id view read write admin
if {!$admin} { return }
......
......@@ -193,7 +193,7 @@ ad_proc -public im_object_permission {
} {
Returns 1 (true) or 0 (false), depending whether the user has the permission on the specified object.
} {
if {"" == $user_id} { set user_id [ad_get_user_id] }
if {"" == $user_id} { set user_id [ad_conn user_id] }
set read_p [util_memoize [list db_string operm "select im_object_permission_p($object_id, $user_id, '$privilege')"]]
return [string equal $read_p "t"]
}
......@@ -222,7 +222,7 @@ ad_proc -public im_render_user_id { user_id user_name current_user_id group_id }
if the current user has no permissions at all, and it may contain
a name only for ???
} {
if {$current_user_id == ""} { set current_user_id [ad_get_user_id] }
if {$current_user_id == ""} { set current_user_id [ad_conn user_id] }
if {$user_id == ""} { return "" }
# How to display? -1=name only, 0=none, 1=Link
......@@ -248,7 +248,7 @@ ad_proc -public im_render_user_id2 {
if the current user has no permissions at all, and it may contain
a name only for ???
} {
set current_user_id [ad_get_user_id]
set current_user_id [ad_conn user_id]
if {$user_id == ""} { return "" }
# How to display? -1=name only, 0=none, 1=Link
......
......@@ -64,7 +64,7 @@ ad_proc -public im_random_employee_component { } {
return ""
# Get the current user id to not show the current user's portrait
set current_user_id [ad_get_user_id]
set current_user_id [ad_conn user_id]
set subsite_url [subsite::get_element -element url]
set export_vars [export_url_vars user_id return_url]
......@@ -302,7 +302,7 @@ ad_proc im_portrait_component { user_id return_url read write admin} {
} {
if {!$read} { return ""}
set current_user_id [ad_get_user_id]
set current_user_id [ad_conn user_id]
set subsite_url [subsite::get_element -element url]
set export_vars [export_url_vars user_id return_url]
......
......@@ -380,7 +380,7 @@ namespace eval im_profile {
Return a translated profile name for an ID.
} {
# Get the user's locale
if {0 == $current_user_id} { set current_user_id [ad_get_user_id] }
if {0 == $current_user_id} { set current_user_id [ad_conn user_id] }
if {"" == $locale} { set locale [lang::user::locale -user_id $current_user_id] }
if {!$translate_p} { set locale "en_US" }
......
......@@ -676,7 +676,7 @@ ad_proc -public im_project_options {
set current_project_id $project_id
set super_project_id $project_id
set current_user_id [ad_get_user_id]
set current_user_id [ad_conn user_id]
set max_project_name_len 50
# Make sure we don't get a syntax error in the query
......@@ -1089,7 +1089,7 @@ ad_proc -public im_project_personal_active_projects_component {
if there are no projects.
} {
set user_id [ad_get_user_id]
set user_id [ad_conn user_id]
if {"" == $order_by_clause} {
set order_by_clause [parameter::get_from_package_key -package_key "intranet-core" -parameter "HomeProjectListSortClause" -default "project_nr DESC"]
......@@ -1664,7 +1664,7 @@ ad_proc im_project_clone_base {
set new_project_name $project_name
set new_project_nr $project_nr
set current_user_id [ad_get_user_id]
set current_user_id [ad_conn user_id]
# --------------------------
# Prepare Project SQL Query
......@@ -1856,7 +1856,7 @@ ad_proc im_project_clone_members {
} {
if {$debug} { ns_log Notice "im_project_clone_members parent_project_id=$parent_project_id new_project_id=$new_project_id" }
set errors "<li>Starting to clone member information"
set current_user_id [ad_get_user_id]
set current_user_id [ad_conn user_id]
if {![db_0or1row project_info "
select p.*
......@@ -1952,7 +1952,7 @@ ad_proc im_project_clone_costs {
distributing it to a number of little piles...
} {
ns_log Notice "im_project_clone_costs parent_project_id=$parent_project_id new_project_id=$new_project_id"
set current_user_id [ad_get_user_id]
set current_user_id [ad_conn user_id]
# Extract all cost items related to the current (sub-) project.
# Don't descend to sub-projects, because this procedure is called for
......@@ -2422,12 +2422,12 @@ ad_proc im_project_nuke {
ns_log Notice "im_project_nuke: project_id=$project_id"
set detailed_explanation ""
# Use a predefined user_id to avoid a call to ad_get_user_id.
# ad_get_user_id's connection isn't defined during a DELETE REST request.
ns_log Notice "im_project_nuke: before ad_get_user_id"
# Use a predefined user_id to avoid a call to ad_conn user_id.
# ad_conn user_id's connection isn't defined during a DELETE REST request.
ns_log Notice "im_project_nuke: before ad_conn user_id"
if {0 == $current_user_id} {
ns_log Notice "im_project_nuke: No current_user_id specified - using ad_get_user_id"
set current_user_id [ad_get_user_id]
ns_log Notice "im_project_nuke: No current_user_id specified - using ad_conn user_id"
set current_user_id [ad_conn user_id]
}
# Check for permissions
......@@ -3071,7 +3071,7 @@ ad_proc -public im_personal_todo_component {
Returns a HTML table with the list of projects, tasks,
forum items etc. assigned to the current user.
} {
set current_user_id [ad_get_user_id]
set current_user_id [ad_conn user_id]
# ---------------------------------------------------------------
# Columns to show:
......@@ -3282,7 +3282,7 @@ ad_proc -public im_project_action_select {
projects that can be executedb by
/intranet-core/www/projects/project-action.tcl
} {
set current_user_id [ad_get_user_id]
set current_user_id [ad_conn user_id]
return " <select name=action>
<option name=empty></option>
......@@ -3366,7 +3366,7 @@ ad_proc -public im_menu_projects_admin_links {
Return a list of admin links to be added to the "projects" menu
} {
set result_list {}
set current_user_id [ad_get_user_id]
set current_user_id [ad_conn user_id]
set return_url [im_url_with_query]
if {[im_permission $current_user_id "add_projects"]} {
......
......@@ -32,7 +32,7 @@ ad_proc -public im_check_for_update_scripts {
} {
# ---------------------------------------------------------------------------
# Permissions - show only to Admin
set user_admin_p [im_is_user_site_wide_or_intranet_admin [ad_get_user_id]]
set user_admin_p [im_is_user_site_wide_or_intranet_admin [ad_conn user_id]]
if {!$user_admin_p} { return "" }
......
......@@ -730,7 +730,7 @@ ad_proc -public im_user_registration_component { current_user_id { max_rows 8} }
set user_view_page "/intranet/users/view"
set return_url [ad_conn url]?[ad_conn query]
set user_id [ad_get_user_id]
set user_id [ad_conn user_id]
if {![im_permission $user_id view_user_regs]} { return "" }
......@@ -797,7 +797,7 @@ ad_proc -public im_user_create_new_user {
} {
Create a new user from scratch
} {
set current_user_id [ad_get_user_id]
set current_user_id [ad_conn user_id]
set email [string trim $email]
set similar_user_id [db_string similar_user "select party_id from parties where lower(email) = lower(:email)" -default 0]
......@@ -873,7 +873,7 @@ ad_proc -public im_user_update_existing_user {
# ad_form sideeffects
set profile_org $profiles
set current_user_id [ad_get_user_id]
set current_user_id [ad_conn user_id]
# Make sure the "person" exists.
# This may be not the case when creating a user from a party.
......@@ -1236,11 +1236,11 @@ ad_proc -public im_user_nuke {
} {
ns_log Notice "im_user_nuke: user_id=$user_id"
# Use a predefined user_id to avoid a call to ad_get_user_id.
# ad_get_user_id's connection isn't defined during a DELETE REST request.
# Use a predefined user_id to avoid a call to ad_conn user_id.
# ad_conn user_id's connection isn't defined during a DELETE REST request.
if {0 == $current_user_id} {
ns_log Notice "im_user_nuke: No current_user_id specified - using ad_get_user_id"
set current_user_id [ad_get_user_id]
ns_log Notice "im_user_nuke: No current_user_id specified - using ad_conn user_id"
set current_user_id [ad_conn user_id]
}
# Check for permissions
......@@ -1794,7 +1794,7 @@ ad_proc -public im_menu_users_admin_links {
Return a list of admin links to be added to the "users" menu
} {
set result_list {}
set current_user_id [ad_get_user_id]
set current_user_id [ad_conn user_id]
set return_url [im_url_with_query]
if {[im_permission $current_user_id "add_users"]} {
......
......@@ -22,7 +22,7 @@ ad_page_contract {
}
if {0 == $user_id} {
set user_id [ad_get_user_id]
set user_id [ad_conn user_id]
}
set auto_login [im_generate_auto_login -user_id $user_id]
......
......@@ -21,7 +21,7 @@ ad_page_contract {
# Defaults & Security
# ------------------------------------------------------
set user_id [ad_get_user_id]
set user_id [ad_conn user_id]
set return_url "/intranet-filestorage/"
set find_cmd [parameter::get -package_id [im_package_core_id] -parameter "FindCmd" -default "/bin/find"]
......
......@@ -929,7 +929,7 @@ set user_ids [db_list users "
from persons
where person_id not in (
0,
[ad_get_user_id],
[ad_conn user_id],
(select min(person_id) from persons where person_id > 0)
)
"]
......
......@@ -47,7 +47,7 @@ ns_log Notice "auto-login: user_id=$user_id, email=$email, len(auto_login)=[stri
# Check if the user is already logged in.
# In this case we can just forward the user to the specified page
set previous_user_id [ad_get_user_id]
set previous_user_id [ad_conn user_id]
if {0 != $previous_user_id} {
ad_returnredirect $url
ad_script_abort
......
......@@ -40,7 +40,7 @@ ad_page_contract {
# Permissions
# --------------------------------------------------------------
set current_user_id [ad_get_user_id]
set current_user_id [ad_conn user_id]
if {"" == $user_id} { set user_id $current_user_id }
if {$user_id != $current_user_id} { ad_returnredirect $return_url }
......
......@@ -53,7 +53,7 @@ ad_page_contract {
# No permissions necessary, that's handled by the object's new page
# Here we just select an object_type_id for the given object.
set admin_p [im_is_user_site_wide_or_intranet_admin [ad_get_user_id]]
set admin_p [im_is_user_site_wide_or_intranet_admin [ad_conn user_id]]
if {[catch {db_1row otype_info "
select pretty_name as object_type_pretty
......
......@@ -55,7 +55,7 @@ switch $action {
if {"/intranet/projects/view" == $page_url && [db_table_exists im_gantt_ms_project_warning]} {
db_dml del_ms_project_warnings "
delete from im_gantt_ms_project_warning
where user_id = [ad_get_user_id]
where user_id = [ad_conn user_id]
"
}
......
......@@ -15,7 +15,7 @@ set show_navbar_p [parameter::get_from_package_key -package_key "intranet-core"
# Don't show navbar if explicitely disabled and for anonymous user (while logging in)
if {!$show_navbar_p && "" == [string trim $left_navbar]} { set show_left_navbar_p 0 }
if {0 == [ad_get_user_id]} { set show_left_navbar_p 0 }
if {0 == [ad_conn user_id]} { set show_left_navbar_p 0 }
# ----------------------------------------------------
# Admin Navbar
......
......@@ -22,8 +22,8 @@
# return_url
if {![info exists return_url] || "" == $return_url} { set return_url [im_url_with_query] }
if {0 == $user_id} { set user_id [ad_get_user_id] }
set current_user_id [ad_get_user_id]
if {0 == $user_id} { set user_id [ad_conn user_id] }
set current_user_id [ad_conn user_id]
if {$current_user_id != $user_id} { ad_return_template }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment