[freeside-commits] freeside/FS/FS/ClientAPI Signup.pm, 1.44, 1.45 MasonComponent.pm, NONE, 1.1
Ivan,,,
ivan at wavetail.420.am
Mon Jul 21 12:09:37 PDT 2008
Update of /home/cvs/cvsroot/freeside/FS/FS/ClientAPI
In directory wavetail.420.am:/tmp/cvs-serv26500/FS/FS/ClientAPI
Modified Files:
Signup.pm
Added Files:
MasonComponent.pm
Log Message:
signup w/globalpops DID selection via mason components pass-through
Index: Signup.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/ClientAPI/Signup.pm,v
retrieving revision 1.44
retrieving revision 1.45
diff -u -d -r1.44 -r1.45
--- Signup.pm 27 Jun 2008 08:53:12 -0000 1.44
+++ Signup.pm 21 Jul 2008 19:09:35 -0000 1.45
@@ -121,6 +121,7 @@
'default_pkgpart' => scalar($conf->config('signup_server-default_pkgpart')),
'signup_service' => $svc_x,
+ 'default_svcpart' => scalar($conf->config('signup_server-default_svcpart')),
};
--- NEW FILE: MasonComponent.pm ---
package FS::ClientAPI::MasonComponent;
use strict;
use vars qw($DEBUG $me);
use FS::Mason qw( mason_interps );
use FS::Conf;
$DEBUG = 0;
$me = '[FS::ClientAPI::MasonComponent]';
my %allowed_comps = map { $_=>1 } qw(
/elements/select-did.html
/misc/areacodes.cgi
/misc/exchanges.cgi
/misc/phonenums.cgi
);
my $outbuf;
my( $fs_interp, $rt_interp ) = mason_interps('standalone', 'outbuf'=>\$outbuf);
sub mason_comp {
my $packet = shift;
warn "$me mason_comp called on $packet\n" if $DEBUG;
my $comp = $packet->{'comp'};
unless ( $allowed_comps{$comp} ) {
return { 'error' => 'Illegal component' };
}
my @args = $packet->{'args'} ? @{ $packet->{'args'} } : ();
my $conf = new FS::Conf;
$FS::Mason::Request::FSURL = $conf->config('selfservice_server-base_url');
$FS::Mason::Request::QUERY_STRING = $packet->{'query_string'} || '';
$outbuf = '';
$fs_interp->exec($comp, @args); #only FS for now alas...
#errors? (turn off in-line error reporting?)
return { 'output' => $outbuf };
}
1;
More information about the freeside-commits
mailing list