[freeside-commits] branch master updated. ec02246ea0218838def2b12b0b987f71662d1761
Ivan
ivan at 420.am
Sun Dec 1 17:25:42 PST 2013
The branch, master has been updated
via ec02246ea0218838def2b12b0b987f71662d1761 (commit)
via 281d78519501a96934a500270810d4af5b4aaa73 (commit)
from b02c42c401382cdf35bfb81abd4ffabbbacfd5c9 (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 ec02246ea0218838def2b12b0b987f71662d1761
Merge: 281d785 b02c42c
Author: Ivan Kohler <ivan at freeside.biz>
Date: Sun Dec 1 17:25:30 2013 -0800
Merge branch 'master' of git.freeside.biz:/home/git/freeside
commit 281d78519501a96934a500270810d4af5b4aaa73
Author: Ivan Kohler <ivan at freeside.biz>
Date: Sun Dec 1 17:25:22 2013 -0800
new customer_short opens a session, RT#24968
diff --git a/FS/FS/ClientAPI/Signup.pm b/FS/FS/ClientAPI/Signup.pm
index 593c426..957945c 100644
--- a/FS/FS/ClientAPI/Signup.pm
+++ b/FS/FS/ClientAPI/Signup.pm
@@ -4,6 +4,7 @@ use strict;
use vars qw( $DEBUG $me );
use Data::Dumper;
use Tie::RefHash;
+use Digest::SHA qw(sha512_hex);
use FS::Conf;
use FS::Record qw(qsearch qsearchs dbdef);
use FS::CGI qw(popurl);
@@ -996,9 +997,19 @@ sub new_customer_minimal {
);
return { 'error' => $error } if $error;
+ my $session = { 'custnum' => $cust_main->custnum };
+
+ my $session_id;
+ do {
+ $session_id = sha1_hex(time(). {}. rand(). $$)
+ } until ( ! defined _myaccount_cache->get($session_id) ); #just in case
+
+ _cache->set( $session_id, $session, '1 hour' ); # 1 hour?
+
my %return = ( 'error' => '',
'signup_service' => $svc_x,
'custnum' => $cust_main->custnum,
+ 'session_id' => $session_id,
);
if ( $svc[0] ) {
@@ -1023,6 +1034,13 @@ sub new_customer_minimal {
}
+use vars qw( $myaccount_cache );
+sub _myaccount_cache {
+ $myaccount_cache ||= new FS::ClientAPI_SessionCache( {
+ 'namespace' => 'FS::ClientAPI::MyAccount',
+ } );
+}
+
sub capture_payment {
my $packet = shift;
-----------------------------------------------------------------------
Summary of changes:
FS/FS/ClientAPI/Signup.pm | 18 ++++++++++++++++++
1 files changed, 18 insertions(+), 0 deletions(-)
More information about the freeside-commits
mailing list