RADIUS group enhancements, overlimit_groups changes, etc. RT13432
[freeside.git] / httemplate / edit / svc_acct.cgi
index 33e5d04..66b58e2 100755 (executable)
@@ -45,9 +45,14 @@ function randomPass() {
 
 <TR>
   <TD ALIGN="right"><% mt('Username') |h %></TD>
-  <TD>
-    <INPUT TYPE="text" NAME="username" VALUE="<% $username %>" SIZE=<% $ulen2 %> MAXLENGTH=<% $ulen %>>
-  </TD>
+% if ( $svcnum && $conf->exists('svc_acct-no_edit_username') ) {
+    <TD BGCOLOR="#eeeeee"><% $svc_acct->username() %></TD>
+    <INPUT TYPE="hidden" NAME="username" VALUE="<% $username %>">
+% } else {
+    <TD>
+      <INPUT TYPE="text" NAME="username" VALUE="<% $username %>" SIZE=<% $ulen2 %> MAXLENGTH=<% $ulen %>>
+    </TD>
+% }
 </TR>
 
 %if ( $part_svc->part_svc_column('_password')->columnflag ne 'F' ) {
@@ -303,7 +308,7 @@ function randomPass() {
 <TR>
   <TD ALIGN="right"><% mt('RADIUS groups') |h %></TD>
 % if ( $part_svc_usergroup->columnflag eq 'F' ) { 
-    <TD BGCOLOR="#eeeeee"><% join('<BR>', @groups) %></TD>
+    <TD BGCOLOR="#eeeeee"><% join('<BR>', @groupnames) %></TD>
 % } else { 
 %   my $radius_group_selected = '';
 %   if ( $svc_acct->svcnum ) {
@@ -444,8 +449,13 @@ unless ( $svcnum || $cgi->param('error') ) { #adding
 
 my $part_svc_usergroup = $part_svc->part_svc_column('usergroup');
 #fixed radius groups always override & display
+my @groupnames; # only used for display of Fixed RADIUS groups
 if ( $part_svc_usergroup->columnflag eq 'F' ) {
-  @groups = split(',', $part_svc_usergroup->columnvalue);
+  @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';