X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;ds=sidebyside;f=httemplate%2Fedit%2Fsvc_acct.cgi;h=f2b8e0c4a4adc8200daf4a25d97393a317a87d14;hb=e39f81dae87d882c0ea4f6f1918fa9cae6d2fc61;hp=58283ef54439815b9ff10ca0b36d94e1db1720be;hpb=5e05724a635a22776f1b973f5d7e77989da4e048;p=freeside.git
diff --git a/httemplate/edit/svc_acct.cgi b/httemplate/edit/svc_acct.cgi
index 58283ef54..f2b8e0c4a 100755
--- a/httemplate/edit/svc_acct.cgi
+++ b/httemplate/edit/svc_acct.cgi
@@ -9,6 +9,18 @@
% }
+
@@ -354,9 +385,11 @@ if ( $cgi->param('error') ) {
$part_svc=qsearchs('part_svc',{'svcpart'=>$svcpart});
die "No part_svc entry!" unless $part_svc;
- $svc_acct = new FS::svc_acct({svcpart => $svcpart});
+ $svc_acct = new FS::svc_acct({svcpart => $svcpart});
+
+ $svcnum='';
- $svcnum='';
+ $svc_acct->password_recover('Y'); #default. hmm.
} else { #editing
@@ -379,6 +412,9 @@ if ( $cgi->param('error') ) {
}
+my $communigate = scalar($part_svc->part_export('communigate_pro'));
+ # || scalar($part_svc->part_export('communigate_pro_singledomain'));
+
my( $cust_pkg, $cust_main ) = ( '', '' );
if ( $pkgnum ) {
$cust_pkg = qsearchs('cust_pkg', { 'pkgnum' => $pkgnum } );
@@ -427,15 +463,17 @@ my $svc = $part_svc->getfield('svc');
my $otaker = getotaker;
my $username = $svc_acct->username;
-my $password;
-if ( $svc_acct->_password ) {
- if ( $conf->exists('showpasswords') || ! $svcnum ) {
- $password = $svc_acct->_password;
- } else {
- $password = "*HIDDEN*";
+
+my $password = '';
+if ( $cgi->param('error') ) {
+ $password = $cgi->param('clear_password');
+} elsif ( $svcnum ) {
+ my $password_encryption = $svc_acct->_password_encryption;
+ if ( $password = $svc_acct->get_cleartext_password ) {
+ $password = '*HIDDEN*' unless $conf->exists('showpasswords');
+ } elsif( $svc_acct->_password and $password_encryption ne 'plain' ) {
+ $password = "(".uc($password_encryption)." encrypted)";
}
-} else {
- $password = '';
}
my $ulen =
@@ -444,9 +482,27 @@ my $ulen =
: dbdef->table('svc_acct')->column('username')->length;
my $ulen2 = $ulen+2;
-my $pmax = $conf->config('passwordmax') || 8;
+my $pmax = max($conf->config('passwordmax') || 13);
my $pmax2 = $pmax+2;
my $p1 = popurl(1);
+sub max {
+ (sort(@_))[-1]
+}
+
+my $captcha_url;
+my ($export_google) = $part_svc->part_export('acct_google');
+if ( $export_google ) {
+ my $error = $export_google->auth_error;
+ if ( $error ) {
+ if ( $error->{'captcha_url'} ) {
+ $captcha_url = $error->{'captcha_url'};
+ }
+ else {
+ $cgi->param('error', $error->{'message'});
+ }
+ } #if $error
+}
+
%init>