[freeside-commits] freeside/FS/FS/ClientAPI MyAccount.pm, 1.53.2.9, 1.53.2.10 Signup.pm, 1.36.2.6, 1.36.2.7
Jeff Finucane,420,,
jeff at wavetail.420.am
Tue Dec 11 21:58:18 PST 2007
Update of /home/cvs/cvsroot/freeside/FS/FS/ClientAPI
In directory wavetail:/tmp/cvs-serv26846/FS/FS/ClientAPI
Modified Files:
Tag: FREESIDE_1_7_BRANCH
MyAccount.pm Signup.pm
Log Message:
self-service can select domain on provision (#2801)
Index: MyAccount.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/ClientAPI/MyAccount.pm,v
retrieving revision 1.53.2.9
retrieving revision 1.53.2.10
diff -u -d -r1.53.2.9 -r1.53.2.10
--- MyAccount.pm 4 Dec 2007 18:19:06 -0000 1.53.2.9
+++ MyAccount.pm 12 Dec 2007 05:58:16 -0000 1.53.2.10
@@ -982,10 +982,17 @@
if $p->{'_password'} ne $p->{'_password2'};
return { 'error' => gettext('empty_password') }
unless length($p->{'_password'});
+
+ if ($p->{'domsvc'}) {
+ my %domains = domain_select_hash FS::svc_acct(map { $_ => $p->{$_} }
+ qw ( svcpart pkgnum ) );
+ return { 'error' => gettext('invalid_domain') }
+ unless ($domains{$p->{'domsvc'}});
+ }
_provision( 'FS::svc_acct',
- [qw(username _password)],
- [qw(username _password)],
+ [qw(username _password domsvc)],
+ [qw(username _password domsvc)],
$p,
@_
);
Index: Signup.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/ClientAPI/Signup.pm,v
retrieving revision 1.36.2.6
retrieving revision 1.36.2.7
diff -u -d -r1.36.2.6 -r1.36.2.7
--- Signup.pm 4 Dec 2007 18:19:06 -0000 1.36.2.6
+++ Signup.pm 12 Dec 2007 05:58:16 -0000 1.36.2.7
@@ -287,6 +287,32 @@
}
+sub domain_select_hash {
+ my $packet = shift;
+
+ my $response = {};
+
+ if ($packet->{pkgpart}) {
+ my $part_pkg = qsearchs('part_pkg' => { 'pkgpart' => $packet->{pkgpart} } );
+ #$packet->{svcpart} = $part_pkg->svcpart('svc_acct')
+ $packet->{svcpart} = $part_pkg->svcpart
+ if $part_pkg;
+ }
+
+ if ($packet->{svcpart}) {
+ my $part_svc = qsearchs('part_svc' => { 'svcpart' => $packet->{svcpart} } );
+ $response->{'domsvc'} = $part_svc->part_svc_column('domsvc')->columnvalue
+ if ($part_svc && $part_svc->part_svc_column('domsvc')->columnflag eq 'D');
+ }
+
+ $response->{'domains'}
+ = { domain_select_hash FS::svc_acct( map { $_ => $packet->{$_} }
+ qw(svcpart pkgnum)
+ ) };
+
+ $response;
+}
+
sub new_customer {
my $packet = shift;
More information about the freeside-commits
mailing list