add ability to configure the myaccount.ca.inter.net login banner ad and URL from...
authorIvan Kohler <ivan@freeside.biz>
Tue, 10 Apr 2012 08:07:20 +0000 (01:07 -0700)
committerIvan Kohler <ivan@freeside.biz>
Tue, 10 Apr 2012 08:07:20 +0000 (01:07 -0700)
FS/FS/ClientAPI/MyAccount.pm
FS/FS/ClientAPI_XMLRPC.pm
FS/FS/Conf.pm
fs_selfservice/FS-SelfService/SelfService.pm
fs_selfservice/FS-SelfService/SelfService/XMLRPC.pm

index acd0c6e..7bc3011 100644 (file)
@@ -151,12 +151,25 @@ sub login_info {
     %{ skin_info($p) },
     'phone_login'  => $conf->exists('selfservice_server-phone_login'),
     'single_domain'=> scalar($conf->config('selfservice_server-single_domain')),
+    'banner_url'       => scalar($conf->config('selfservice-login_banner_url')),
+    'banner_image_md5' => 
+      md5_hex($conf->config_binary('selfservice-login_banner_image')),
   );
 
   return \%info;
 
 }
 
+sub login_banner_image {
+  my $p = shift;
+  my $conf = new FS::Conf;
+  my $image = $conf->config_binary('selfservice-login_banner_image');
+  return { 
+    'md5'   => md5_hex($image),
+    'image' => $image,
+  };
+}
+
 #false laziness w/FS::ClientAPI::passwd::passwd
 sub login {
   my $p = shift;
index 1e068f4..98e1910 100644 (file)
@@ -37,17 +37,21 @@ $DEBUG = 0;
 $FS::ClientAPI::DEBUG = $DEBUG;
 
 #false laziness w/FS::SelfService/XMLRPC.pm, same problem as below but worse
+our %typefix_skin_info = (
+  'logo'              => 'base64',
+  'title_left_image'  => 'base64',
+  'title_right_image' => 'base64',
+  'menu_top_image'    => 'base64',
+  'menu_body_image'   => 'base64',
+  'menu_bottom_image' => 'base64',
+);
 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',
-                          },
+  'skin_info'          => \%typefix_skin_info,
+  'login_info'         => \%typefix_skin_info,
   'invoice_logo'       => { 'logo' => 'base64', },
+  'login_banner_image' => { 'image' => 'base64', },
 );
 
 sub AUTOLOAD {
@@ -94,6 +98,7 @@ sub ss2clientapi {
   'chfn'                      => 'passwd/passwd',
   'chsh'                      => 'passwd/passwd',
   'login_info'                => 'MyAccount/login_info',
+  'login_banner_image'        => 'MyAccount/login_banner_image',
   'login'                     => 'MyAccount/login',
   'logout'                    => 'MyAccount/logout',
   'switch_acct'               => 'MyAccount/switch_acct',
index b0f85cf..2a76a15 100644 (file)
@@ -4147,6 +4147,20 @@ and customer address. Include units.',
   },
 
   {
+    'key'         => 'selfservice-login_banner_image',
+    'section'     => 'self-service',
+    'description' => 'Banner image shown on the login page, in PNG format.',
+    'type'        => 'image',
+  },
+
+  {
+    'key'         => 'selfservice-login_banner_url',
+    'section'     => 'self-service',
+    'description' => 'Link for the login banner.',
+    'type'        => 'text',
+  },
+
+  {
     'key'         => 'selfservice-bulk_format',
     'section'     => 'deprecated',
     'description' => 'Parameter arrangement for selfservice bulk features',
index 0686c3d..af04fcc 100644 (file)
@@ -26,6 +26,7 @@ $socket .= '.'.$tag if defined $tag && length($tag);
   'chfn'                      => 'passwd/passwd',
   'chsh'                      => 'passwd/passwd',
   'login_info'                => 'MyAccount/login_info',
+  'login_banner_image'        => 'MyAccount/login_banner_image',
   'login'                     => 'MyAccount/login',
   'logout'                    => 'MyAccount/logout',
   'switch_acct'               => 'MyAccount/switch_acct',
index 59c8756..14f8a0c 100644 (file)
@@ -33,17 +33,21 @@ $DEBUG = 0;
 $FS::SelfService::DEBUG = $DEBUG;
 
 #false laziness w/FS::ClientAPI_XMLRPC.pm
+our %typefix_skin_info = (
+  'logo'              => 'base64',
+  'title_left_image'  => 'base64',
+  'title_right_image' => 'base64',
+  'menu_top_image'    => 'base64',
+  'menu_body_image'   => 'base64',
+  'menu_bottom_image' => 'base64',
+);
 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', },
+  'skin_info'          => \%typefix_skin_info,
+  'login_info'         => \%typefix_skin_info,
+  'invoice_logo'       => { 'logo'  => 'base64', },
+  'login_banner_image' => { 'image' => 'base64', },
 );
 
 sub AUTOLOAD {