[open-ils-commits] r11832 - trunk/Open-ILS/src/perlmods/OpenILS/Application
svn at svn.open-ils.org
svn at svn.open-ils.org
Wed Jan 14 17:18:59 EST 2009
Author: erickson
Date: 2009-01-14 17:18:54 -0500 (Wed, 14 Jan 2009)
New Revision: 11832
Modified:
trunk/Open-ILS/src/perlmods/OpenILS/Application/Actor.pm
Log:
added API call for approving a pending address
Modified: trunk/Open-ILS/src/perlmods/OpenILS/Application/Actor.pm
===================================================================
--- trunk/Open-ILS/src/perlmods/OpenILS/Application/Actor.pm 2009-01-14 22:13:57 UTC (rev 11831)
+++ trunk/Open-ILS/src/perlmods/OpenILS/Application/Actor.pm 2009-01-14 22:18:54 UTC (rev 11832)
@@ -2866,6 +2866,8 @@
if( grep { $_ eq 'addresses' } @$fields ) {
$user->addresses([]) unless @{$user->addresses};
+ # don't expose "replaced" addresses by default
+ $user->addresses([grep {$_->id >= 0} @{$user->addresses}]);
if( ref $user->billing_address ) {
unless( grep { $user->billing_address->id == $_->id } @{$user->addresses} ) {
@@ -3125,7 +3127,30 @@
}
+__PACKAGE__->register_method (
+ method => 'approve_user_address',
+ api_name => 'open-ils.actor.user.pending_address.approve',
+ signature => {
+ desc => q/
+ /
+ }
+);
+sub approve_user_address {
+ my($self, $conn, $auth, $addr_id) = @_;
+ my $e = new_editor(xact => 1, authtoken => $auth);
+ return $e->die_event unless $e->checkauth;
+ my $addr = $e->retrieve_actor_user_address($addr_id)
+ or return $e->die_event;
+ my $user = $e->retrieve_actor_user($addr->usr);
+ return $e->die_event unless $e->allowed('UPDATE_USER', $user->home_ou);
+ my $result = $e->json_query({from => ['actor.approve_pending_address', $addr_id]})->[0]
+ or return $e->die_event;
+ $e->commit;
+ return [values %$result]->[0];
+}
+
+
__PACKAGE__->register_method (
method => 'retrieve_friends',
api_name => 'open-ils.actor.friends.retrieve',
More information about the open-ils-commits
mailing list