[open-ils-commits] r13442 - trunk/Open-ILS/src/perlmods/OpenILS/Application (erickson)
svn at svn.open-ils.org
svn at svn.open-ils.org
Tue Jun 23 10:02:33 EDT 2009
Author: erickson
Date: 2009-06-23 10:02:31 -0400 (Tue, 23 Jun 2009)
New Revision: 13442
Modified:
trunk/Open-ILS/src/perlmods/OpenILS/Application/Actor.pm
Log:
added initial staged user creation api (for patron self-registration)
Modified: trunk/Open-ILS/src/perlmods/OpenILS/Application/Actor.pm
===================================================================
--- trunk/Open-ILS/src/perlmods/OpenILS/Application/Actor.pm 2009-06-23 14:02:01 UTC (rev 13441)
+++ trunk/Open-ILS/src/perlmods/OpenILS/Application/Actor.pm 2009-06-23 14:02:31 UTC (rev 13442)
@@ -3315,5 +3315,42 @@
}
+
+__PACKAGE__->register_method (
+ method => 'create_user_stage',
+ api_name => 'open-ils.actor.user.stage.create',
+);
+
+sub create_user_stage {
+ my($self, $conn, $user, $mail_addr, $bill_addr) = @_; # more?
+
+ return 0 unless $U->ou_ancestor_setting_value('opac.allow_pending_user');
+ return OpenILS::Event->new('BAD_PARAMS') unless $user;
+
+ my $e = new_editor(xact => 1);
+
+ my $uname = $U->create_uuid_string;
+ $user->usrname($uname);
+
+ $e->create_staging_user_stage($user) or return $e->die_event;
+
+ if($mail_addr) {
+ $mail_addr->usrname($uname);
+ $e->create_staging_mailing_address_stage($mail_addr) or return $e->die_event;
+ }
+
+ if($bill_addr) {
+ $bill_addr->usrname($uname);
+ $e->create_staging_billing_address_stage($bill_addr) or return $e->die_event;
+ }
+
+ $e->commit;
+ $conn->respond_complete($uname);
+
+ $U->create_trigger_event('stgu.create', $user, $user->home_ou);
+ return undef;
+}
+
+
1;
More information about the open-ils-commits
mailing list