[freeside-commits] branch FREESIDE_2_3_BRANCH updated. 80bca2a25e82138ee74329721a534d849e408ecd

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


The branch, FREESIDE_2_3_BRANCH has been updated
       via  80bca2a25e82138ee74329721a534d849e408ecd (commit)
      from  4ec5b193c5234d54b7c676e21927d7de934258e5 (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 80bca2a25e82138ee74329721a534d849e408ecd
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Tue Apr 10 01:07:24 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 a984db8..67e2a72 100644
--- a/FS/FS/Conf.pm
+++ b/FS/FS/Conf.pm
@@ -4152,6 +4152,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