Index: openacs-4/packages/acs-admin/www/auth/authority-set-enabled-p.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-admin/www/auth/authority-set-enabled-p.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/acs-admin/www/auth/authority-set-enabled-p.tcl 10 Sep 2003 14:32:47 -0000 1.1 +++ openacs-4/packages/acs-admin/www/auth/authority-set-enabled-p.tcl 11 Sep 2003 09:21:27 -0000 1.2 @@ -10,7 +10,17 @@ enabled_p:boolean } -db_dml set_enabled_p { update auth_authorities set enabled_p = :enabled_p where authority_id = :authority_id } +# Make sure we are not shutting out all site-wide-admins from the system +set allowed_p 1 +if { [string equal $enabled_p "f"] && ![auth::can_admin_system_without_authority_p -authority_id $authority_id]} { + set allowed_p 0 +} -ad_returnredirect . -ad_script_abort +if { $allowed_p } { + db_dml set_enabled_p { update auth_authorities set enabled_p = :enabled_p where authority_id = :authority_id } + + ad_returnredirect . + ad_script_abort +} else { + ad_return_error "Cannot disable authority" "Disabling this authority would mean that all site-wide administrator users are shut out from the system, meaning the system could no longer be adminstered." +}