X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=httemplate%2Fedit%2Fsvc_acct.cgi;h=574fb51ebd70a427803193a0787d205414356bcf;hp=5c2d5f4952ebcfdbc8c7a7f4459f295d721bad89;hb=9d35792778885932c09102bd011b518eb47c5131;hpb=7a8c7b6f64ac14d555d866f93300e64c47b74a98 diff --git a/httemplate/edit/svc_acct.cgi b/httemplate/edit/svc_acct.cgi index 5c2d5f495..574fb51eb 100755 --- a/httemplate/edit/svc_acct.cgi +++ b/httemplate/edit/svc_acct.cgi @@ -1,54 +1,54 @@ -<% include('/elements/header.html', "$action $svc account") %> +<& /elements/header.html, mt("$action [_1] account",$svc) &> -<% include('/elements/error.html') %> +<& /elements/error.html &> % if ( $cust_main ) { - <% include( '/elements/small_custview.html', $cust_main, '', 1, - popurl(2) . "view/cust_main.cgi") %> + <& /elements/small_custview.html, $cust_main, '', 1, + popurl(2) . "view/cust_main.cgi" &>
% } - -
-Service # <% $svcnum ? "$svcnum" : " (NEW)" %>
+% if ( $svcnum ) { +% my $svclabel = emt("Service #[_1]",$svcnum); +% $svclabel =~ s/$svcnum/$svcnum<\/B>/; +<% $svclabel %> +% } else { +<% mt("Service # (NEW)") |h %> +% } +
<% ntable("#cccccc",2) %> - Service + <% mt('Service') |h %> <% $part_svc->svc %> - Username - - MAXLENGTH=<% $ulen %>> - + <% mt('Username') |h %> +% if ( $svcnum && $conf->exists('svc_acct-no_edit_username') ) { + <% $svc_acct->username() %> + +% } else { + + MAXLENGTH=<% $ulen %>> + +% } %if ( $part_svc->part_svc_column('_password')->columnflag ne 'F' ) { - Password +% #XXX eventually should require "Edit Password" ACL + <% mt('Password') |h %> - MAXLENGTH=<% $pmax %>> - + MAXLENGTH=<% $pmax %>> + <& /elements/random_pass.html, 'clear_password' &> %}else{ @@ -59,19 +59,16 @@ Service # <% $svcnum ? "$svcnum" : " (NEW)" %>
%my $sec_phrase = $svc_acct->sec_phrase; %if ( $conf->exists('security_phrase') % && $part_svc->part_svc_column('sec_phrase')->columnflag ne 'F' ) { -% - - Security phrase + <% mt('Security phrase') |h %> - (for forgotten passwords) + (<% mt('for forgotten passwords') |h %>) % } else { - % } % @@ -80,7 +77,6 @@ Service # <% $svcnum ? "$svcnum" : " (NEW)" %>
%if ( $part_svc->part_svc_column('domsvc')->columnflag eq 'F' ) { % - % } else { % @@ -89,7 +85,7 @@ Service # <% $svcnum ? "$svcnum" : " (NEW)" %>
% if ( $domsvc ) { % my $svc_domain = qsearchs('svc_domain', { 'svcnum' => $domsvc, } ); % if ( $svc_domain ) { -% $svc_domain{$svc_domain->svcnum} = $svc_domain; +% $svc_domain{$svc_domain->svcnum} = $svc_domain->domain; % } else { % warn "unknown svc_domain.svcnum for svc_acct.domsvc: $domsvc"; % } @@ -100,11 +96,9 @@ Service # <% $svcnum ? "$svcnum" : " (NEW)" %>
% 'pkgnum' => $pkgnum, % ) % ); -% - - Domain + <% mt('Domain') |h %> @@ -136,28 +129,44 @@ Service # <% $svcnum ? "$svcnum" : " (NEW)" %>
% } -<% include('/elements/tr-select-svc_pbx.html', +<& /elements/tr-select-svc_pbx.html, 'curr_value' => $svc_acct->pbxsvc, 'part_svc' => $part_svc, 'cust_pkg' => $cust_pkg, - ) -%> +&> %#pop %my $popnum = $svc_acct->popnum || 0; %if ( $part_svc->part_svc_column('popnum')->columnflag eq 'F' ) { % - % } else { - - Access number + <% mt('Access number') |h %> <% FS::svc_acct_pop::popselector($popnum) %> % } + +%#tower (huh) +%if ( $conf->exists('svc_acct-tower_sector') +% && $part_svc->part_svc_column('sectornum')->columnflag ne 'F' ) { + <& /elements/tr-select-tower_sector.html, + 'curr_value' => $svc_acct->sectornum, + #'part_svc' => $part_svc, + #'cust_pkg' => $cust_pkg, + &> +%} else { + +%} + +<& /elements/tr-svc_export_machine.html, + 'svc' => $svc_acct, + 'part_svc' => $part_svc, + 'cgi' => $cgi, +&> + % #uid/gid % foreach my $xid (qw( uid gid )) { % @@ -167,7 +176,6 @@ Service # <% $svcnum ? "$svcnum" : " (NEW)" %>
% % if ( length($svc_acct->$xid()) ) { - <% uc($xid) %> <% $svc_acct->$xid() %> @@ -175,11 +183,9 @@ Service # <% $svcnum ? "$svcnum" : " (NEW)" %>
% } - % } else { - <% uc($xid) %> @@ -195,13 +201,12 @@ Service # <% $svcnum ? "$svcnum" : " (NEW)" %>
% && ! $svc_acct->finger ) { % - % } else { - Real Name + <% mt('Real Name') |h %> @@ -219,7 +224,7 @@ Service # <% $svcnum ? "$svcnum" : " (NEW)" %>
- Home directory + <% mt('Home directory') |h %> % } @@ -231,13 +236,12 @@ Service # <% $svcnum ? "$svcnum" : " (NEW)" %>
% ) { % - % } else { - Shell + <% mt('Shell') |h %> -% foreach my $option (qw( MultiMailbox TextMailbox MailDirMailbox -% AGrade BGrade CGrade )) { - -<% include('/elements/footer.html') %> +<& /elements/footer.html &> <%init> @@ -711,17 +467,21 @@ unless ( $svcnum || $cgi->param('error') ) { #adding } +my $part_svc_usergroup = $part_svc->part_svc_column('usergroup'); #fixed radius groups always override & display -if ( $part_svc->part_svc_column('usergroup')->columnflag eq 'F' ) { - @groups = split(',', $part_svc->part_svc_column('usergroup')->columnvalue); +my @groupnames; # only used for display of Fixed RADIUS groups +if ( $part_svc_usergroup->columnflag eq 'F' ) { + @groups = split(',',$part_svc_usergroup->columnvalue); + @groupnames = map { $_->long_description } + qsearch({ 'table' => 'radius_group', + 'extra_sql' => "where groupnum in (".$part_svc_usergroup->columnvalue.")", + }) if length($part_svc_usergroup->columnvalue); } my $action = $svcnum ? 'Edit' : 'Add'; my $svc = $part_svc->getfield('svc'); -my $otaker = getotaker; - my $username = $svc_acct->username; my $password = ''; @@ -751,4 +511,18 @@ 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 +} +