summaryrefslogtreecommitdiff
path: root/fs_selfservice
diff options
context:
space:
mode:
authorivan <ivan>2011-10-31 02:33:28 +0000
committerivan <ivan>2011-10-31 02:33:28 +0000
commit588ac92d054671aa13cb61f76b5da472661cb1ac (patch)
tree5545fc810300409b70b16971f2ae49fd4b7d35ec /fs_selfservice
parent6e8323cf946ef3684a6846aa6afde7fe3692994e (diff)
fix fallout from fixing UTF-8 XML-RPC self-service issues, RT#13656
Diffstat (limited to 'fs_selfservice')
-rw-r--r--fs_selfservice/FS-SelfService/SelfService/XMLRPC.pm34
1 files changed, 33 insertions, 1 deletions
diff --git a/fs_selfservice/FS-SelfService/SelfService/XMLRPC.pm b/fs_selfservice/FS-SelfService/SelfService/XMLRPC.pm
index 4e0d3e909..59c8756f8 100644
--- a/fs_selfservice/FS-SelfService/SelfService/XMLRPC.pm
+++ b/fs_selfservice/FS-SelfService/SelfService/XMLRPC.pm
@@ -26,19 +26,51 @@ L<freeside-selfservice-clientd>, L<freeside-selfservice-server>,L<FS::SelfServic
use strict;
use vars qw($DEBUG $AUTOLOAD);
+use XMLRPC::Lite; # for XMLRPC::Data
use FS::SelfService;
$DEBUG = 0;
$FS::SelfService::DEBUG = $DEBUG;
+#false laziness w/FS::ClientAPI_XMLRPC.pm
+our %typefix = (
+ 'invoice_pdf' => { 'invoice_pdf' => 'base64', },
+ 'legacy_invoice_pdf' => { 'invoice_pdf' => 'base64', },
+ 'skin_info' => { 'logo' => 'base64',
+ 'title_left_image' => 'base64',
+ 'title_right_image' => 'base64',
+ 'menu_top_image' => 'base64',
+ 'menu_body_image' => 'base64',
+ 'menu_bottom_image' => 'base64',
+ },
+ 'invoice_logo' => { 'logo' => 'base64', },
+);
+
sub AUTOLOAD {
my $call = $AUTOLOAD;
$call =~ s/^FS::SelfService::XMLRPC:://;
+
if (exists($FS::SelfService::autoload{$call})) {
+
shift; #discard package name;
+
$call = "FS::SelfService::$call";
+
no strict 'refs';
- &{$call}(@_);
+
+ my $return = &{$call}(@_);
+
+ if ( exists($typefix{$call}) ) {
+ my $typefix = $typefix{$call};
+ foreach my $field ( grep exists($return->{$_}), keys %$typefix ) {
+ my $type = $typefix->{$field};
+ $return->{$field} = XMLRPC::Data->value($return->{$field})
+ ->type($type);
+ }
+ }
+
+ $return;
+
}else{
die "No such procedure: $call";
}