Index: openacs-4/packages/acs-tcl/tcl/community-core-procs-oracle.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/community-core-procs-oracle.xql,v
diff -u -r1.3 -r1.4
--- openacs-4/packages/acs-tcl/tcl/community-core-procs-oracle.xql 22 Aug 2003 15:06:30 -0000 1.3
+++ openacs-4/packages/acs-tcl/tcl/community-core-procs-oracle.xql 25 Aug 2003 13:46:41 -0000 1.4
@@ -26,10 +26,20 @@
+
+
+ begin
+ acs_user.delete(
+ user_id => :user_id
+ );
+ end;
+
+
+
- select person.delete(:person_id);
+ select person.delete(:person_id) from dual;
Index: openacs-4/packages/acs-tcl/tcl/community-core-procs-postgresql.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/community-core-procs-postgresql.xql,v
diff -u -r1.8 -r1.9
--- openacs-4/packages/acs-tcl/tcl/community-core-procs-postgresql.xql 22 Aug 2003 15:06:30 -0000 1.8
+++ openacs-4/packages/acs-tcl/tcl/community-core-procs-postgresql.xql 25 Aug 2003 13:46:41 -0000 1.9
@@ -28,6 +28,12 @@
+
+
+ select acs_user__delete(:user_id);
+
+
+
Index: openacs-4/packages/acs-tcl/tcl/community-core-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/community-core-procs.tcl,v
diff -u -r1.16 -r1.17
--- openacs-4/packages/acs-tcl/tcl/community-core-procs.tcl 22 Aug 2003 15:06:30 -0000 1.16
+++ openacs-4/packages/acs-tcl/tcl/community-core-procs.tcl 25 Aug 2003 13:46:41 -0000 1.17
@@ -271,10 +271,19 @@
ad_proc -public delete {
{-user_id:required}
+ {-permanent:boolean}
} {
Delete a user
+
+ @param permanent If provided the user will be deleted permanently
+ from the database. Otherwise the user
+ state will merely be set to "deleted".
} {
- change_state -user_id $user_id -state "deleted"
+ if { ! $permanent_p } {
+ change_state -user_id $user_id -state "deleted"
+ } else {
+ db_exec_plsql permanent_delete {}
+ }
}
ad_proc -public unapprove {
@@ -285,4 +294,28 @@
change_state -user_id $user_id -state "needs approval"
}
+ ad_proc -public get_by_username {
+ {-authority_id ""}
+ {-username:required}
+ } {
+ Returns user_id from authority and username.
+
+ @param authority_id The authority. Defaults to local authority.
+
+ @param username The username of the user you're trying to find.
+
+ @return user_id of the user, or the empty string if no user found.
+ } {
+ # Default to local authority
+ if { [empty_string_p $authority_id] } {
+ set authority_id [auth::authority::local]
+ }
+
+ return [db_string user_id_from_name {
+ select user_id
+ from users
+ where username = :username
+ and authority_id =:authority_id
+ } -default ""]
+ }
}