Index: openacs-4/packages/acs-tcl/tcl/acs-kernel-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/acs-kernel-procs.tcl,v diff -u -r1.12 -r1.13 --- openacs-4/packages/acs-tcl/tcl/acs-kernel-procs.tcl 4 Dec 2018 22:03:35 -0000 1.12 +++ openacs-4/packages/acs-tcl/tcl/acs-kernel-procs.tcl 4 Dec 2018 22:12:06 -0000 1.13 @@ -6,26 +6,26 @@ } ad_proc -public ad_acs_administrator_exists_p {} { - + @return 1 if a user with admin privileges exists, 0 otherwise. } { ad_acs_require_basic_schemata - + return [db_string admin_exists_p { select 1 as admin_exists_p from dual where exists ( - select 1 - from acs_permissions p, - party_approved_member_map m, - users u, - acs_magic_objects amo - where amo.name = 'security_context_root' - and p.object_id = amo.object_id - and p.grantee_id = m.party_id - and u.user_id = m.member_id - and acs_permission.permission_p(amo.object_id, u.user_id, 'admin') + select 1 + from acs_permissions p, + party_approved_member_map m, + users u, + acs_magic_objects amo + where amo.name = 'security_context_root' + and p.object_id = amo.object_id + and p.grantee_id = m.party_id + and u.user_id = m.member_id + and acs_permission.permission_p(amo.object_id, u.user_id, 'admin') ) } -default 0] } @@ -62,33 +62,33 @@ # that's ummm...portable! return [db_string acs_admin_node_p { - select case when count(object_id) = 0 then 0 else 1 end - from site_nodes - where object_id = (select package_id - from apm_packages - where package_key = 'acs-admin') + select case when count(object_id) = 0 then 0 else 1 end + from site_nodes + where object_id = (select package_id + from apm_packages + where package_key = 'acs-admin') } -default 0] } ad_proc -public ad_verify_install {} { - Returns 1 if the acs is properly installed, 0 otherwise. + Returns 1 if the acs is properly installed, 0 otherwise. } { - # Define util_memoize with proc here to avoid error messages about multiple + # Define util_memoize with proc here to avoid error messages about multiple # defines. if { ![db_table_exists apm_packages] || ![db_table_exists site_nodes] } { ns_log warning "ad_verify_install: apm_packages [db_table_exists apm_packages] site_nodes [db_table_exists site_nodes]" - proc util_memoize {script {max_age ""}} {{*}$script} - return 0 + proc util_memoize {script {max_age ""}} {{*}$script} + return 0 } - set kernel_install_p [apm_package_installed_p acs-kernel] + set kernel_install_p [apm_package_installed_p acs-kernel] set admin_exists_p [ad_acs_administrator_exists_p] - + if { $kernel_install_p && $admin_exists_p} { - return 1 + return 1 } else { ns_log warning "ad_verify_install: kernel_install_p $kernel_install_p admin_exists_p $admin_exists_p" - proc util_memoize {script {max_age ""}} {{*}$script} - return 0 + proc util_memoize {script {max_age ""}} {{*}$script} + return 0 } }