[freeside-commits] branch master updated. 85ae8035888f10fd8075be3234f8e981f5004557

Ivan ivan at 420.am
Tue Apr 10 01:07:24 PDT 2012


The branch, master has been updated
       via  85ae8035888f10fd8075be3234f8e981f5004557 (commit)
      from  23b0288f93882b3de9e6531b33c76517e47353c5 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 85ae8035888f10fd8075be3234f8e981f5004557
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Tue Apr 10 01:07:20 2012 -0700

    add ability to configure the myaccount.ca.inter.net login banner ad and URL from configuration settings, RT#16301

diff --git a/FS/FS/ClientAPI/MyAccount.pm b/FS/FS/ClientAPI/MyAccount.pm
index acd0c6e..7bc3011 100644
--- a/FS/FS/ClientAPI/MyAccount.pm
+++ b/FS/FS/ClientAPI/MyAccount.pm
@@ -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;
diff --git a/FS/FS/ClientAPI_XMLRPC.pm b/FS/FS/ClientAPI_XMLRPC.pm
index 1e068f4..98e1910 100644
--- a/FS/FS/ClientAPI_XMLRPC.pm
+++ b/FS/FS/ClientAPI_XMLRPC.pm
@@ -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',
diff --git a/FS/FS/Conf.pm b/FS/FS/Conf.pm
index b0f85cf..2a76a15 100644
--- a/FS/FS/Conf.pm
+++ b/FS/FS/Conf.pm
@@ -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',
diff --git a/fs_selfservice/FS-SelfService/SelfService.pm b/fs_selfservice/FS-SelfService/SelfService.pm
index 0686c3d..af04fcc 100644
--- a/fs_selfservice/FS-SelfService/SelfService.pm
+++ b/fs_selfservice/FS-SelfService/SelfService.pm
@@ -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',
diff --git a/fs_selfservice/FS-SelfService/SelfService/XMLRPC.pm b/fs_selfservice/FS-SelfService/SelfService/XMLRPC.pm
index 59c8756..14f8a0c 100644
--- a/fs_selfservice/FS-SelfService/SelfService/XMLRPC.pm
+++ b/fs_selfservice/FS-SelfService/SelfService/XMLRPC.pm
@@ -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 {

-----------------------------------------------------------------------

Summary of changes:
 FS/FS/ClientAPI/MyAccount.pm                       |   13 +++++++++++++
 FS/FS/ClientAPI_XMLRPC.pm                          |   19 ++++++++++++-------
 FS/FS/Conf.pm                                      |   14 ++++++++++++++
 fs_selfservice/FS-SelfService/SelfService.pm       |    1 +
 .../FS-SelfService/SelfService/XMLRPC.pm           |   20 ++++++++++++--------
 5 files changed, 52 insertions(+), 15 deletions(-)




More information about the freeside-commits mailing list