Index: openacs-4/packages/acs-authentication/tcl/authentication-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-authentication/tcl/authentication-procs.tcl,v diff -u -r1.27 -r1.28 --- openacs-4/packages/acs-authentication/tcl/authentication-procs.tcl 11 Sep 2003 08:04:00 -0000 1.27 +++ openacs-4/packages/acs-authentication/tcl/authentication-procs.tcl 11 Sep 2003 09:20:37 -0000 1.28 @@ -1038,6 +1038,32 @@ -email_verified_p "t" } +ad_proc -private auth::can_admin_system_without_authority_p { + {-authority_id:required} +} { + Before disabling or deleting an authority we need to check + that there is at least one site-wide admin in a different + authority that can administer the system. This proc returns + 1 if there is such an admin and 0 otherwise. + + @author Peter Marklund +} { + set number_of_admins_left [db_string count_admins_left { + select count(*) + from cc_users u, + acs_object_party_privilege_map pm, + acs_magic_objects mo + where authority_id <> :authority_id + and pm.privilege = 'admin' + and pm.object_id = mo.object_id + and mo.name = 'security_context_root' + and pm.party_id = u.user_id + and u.member_state = 'approved' + }] + + return [ad_decode $number_of_admins_left "0" "0" "1"] +} + ##### # # auth namespace private procs Index: openacs-4/packages/acs-authentication/tcl/authority-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-authentication/tcl/authority-procs.tcl,v diff -u -r1.11 -r1.12 --- openacs-4/packages/acs-authentication/tcl/authority-procs.tcl 10 Sep 2003 09:09:47 -0000 1.11 +++ openacs-4/packages/acs-authentication/tcl/authority-procs.tcl 11 Sep 2003 09:20:37 -0000 1.12 @@ -115,6 +115,13 @@ set creation_ip [ad_conn peeraddr] } + # Auto generate short name if not provided + if { [empty_string_p $short_name] } { + set short_name [string tolower $pretty_name] + regsub -all {\s|-} $short_name {_} short_name + set short_name [string_truncate -len 255 $short_name] + } + set authority_id [db_exec_plsql create_authority {}] # Set the arguments not taken by the new function with an update statement @@ -372,6 +379,7 @@ short_name "" pretty_name "" help_contact_text "" + help_contact_text_format "text/enhanced" enabled_p "f" sort_order "" auth_impl_id "" Index: openacs-4/packages/acs-authentication/tcl/local-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-authentication/tcl/local-procs.tcl,v diff -u -r1.11 -r1.12 --- openacs-4/packages/acs-authentication/tcl/local-procs.tcl 10 Sep 2003 14:57:24 -0000 1.11 +++ openacs-4/packages/acs-authentication/tcl/local-procs.tcl 11 Sep 2003 09:20:37 -0000 1.12 @@ -81,7 +81,7 @@ contract_name "auth_authentication" owner "acs-authentication" name "local" - pretty_name "Local Authentication Driver" + pretty_name "Local Authentication" aliases { Authenticate auth::local::authentication::Authenticate GetParameters auth::local::authentication::GetParameters @@ -162,7 +162,7 @@ contract_name "auth_password" owner "acs-authentication" name "local" - pretty_name "Local Password Driver" + pretty_name "Local Password" aliases { CanChangePassword auth::local::password::CanChangePassword ChangePassword auth::local::password::ChangePassword @@ -321,7 +321,7 @@ contract_name "auth_registration" owner "acs-authentication" name "local" - pretty_name "Local Registration Driver" + pretty_name "Local Registration" aliases { GetElements auth::local::registration::GetElements Register auth::local::registration::Register