summaryrefslogtreecommitdiff
path: root/httemplate/edit
diff options
context:
space:
mode:
authorlevinse <levinse>2011-06-21 01:08:07 +0000
committerlevinse <levinse>2011-06-21 01:08:07 +0000
commit9f2280fbce022ab9bcfc46fe94483730b0aeb0f8 (patch)
tree15865cb482bc3995d423f95f1d45ca13b90c4905 /httemplate/edit
parent44ce5ab2e8edd012154d3bb7e5711341e8c6cf35 (diff)
re-write RADIUS groups, RT13274
Diffstat (limited to 'httemplate/edit')
-rwxr-xr-xhttemplate/edit/part_svc.cgi21
-rw-r--r--httemplate/edit/process/radius_group.html10
-rw-r--r--httemplate/edit/radius_group.html16
-rwxr-xr-xhttemplate/edit/svc_acct.cgi22
4 files changed, 44 insertions, 25 deletions
diff --git a/httemplate/edit/part_svc.cgi b/httemplate/edit/part_svc.cgi
index 97e2d9694..8ca019649 100755
--- a/httemplate/edit/part_svc.cgi
+++ b/httemplate/edit/part_svc.cgi
@@ -314,32 +314,15 @@ Service <INPUT TYPE="text" NAME="svc" VALUE="<% $hashref->{svc} %>"><BR>
% qq!<TEXTAREA NAME="${layer}__${field}">!. encode_entities($value).
% '</TEXTAREA>';
%
-% } elsif ( $def->{type} eq 'select-svc_pbx.html' ) {
+% } elsif ( $def->{type} =~ /select-(.*?).html/ ) {
%
-% $html .= include('/elements/select-svc_pbx.html',
+% $html .= include("/elements/".$def->{type},
% 'curr_value' => $value,
% 'element_name' => "${layer}__${field}",
% 'element_etc' => $disabled,
% 'multiple' => ($flag eq 'S'),
% );
%
-% } elsif ( $def->{type} eq 'select-lnp_status.html' ) {
-%
-% $html .= include('/elements/select-lnp_status.html',
-% 'curr_value' => $value,
-% 'element_name' => "${layer}__${field}",
-% 'element_etc' => $disabled,
-% 'multiple' => ($flag eq 'S'),
-% );
-%
-% } elsif ( $def->{type} eq 'radius_usergroup_selector' ) {
-%
-% #XXX disable the RADIUS usergroup selector? ugh it sure does need
-% #an overhaul, people have dum group problems because of it
-%
-% $html .= FS::svc_acct::radius_usergroup_selector(
-% [ split(',', $value) ], "${layer}__${field}" );
-%
% } elsif ( $def->{type} eq 'communigate_pro-accessmodes' ) {
%
% $html .= include('/elements/communigate_pro-accessmodes.html',
diff --git a/httemplate/edit/process/radius_group.html b/httemplate/edit/process/radius_group.html
new file mode 100644
index 000000000..706813f2a
--- /dev/null
+++ b/httemplate/edit/process/radius_group.html
@@ -0,0 +1,10 @@
+<& elements/process.html,
+ 'table' => 'radius_group',
+ 'viewall_dir' => 'browse',
+&>
+<%init>
+
+die "access denied"
+ unless $FS::CurrentUser::CurrentUser->access_right('Configuration');
+
+</%init>
diff --git a/httemplate/edit/radius_group.html b/httemplate/edit/radius_group.html
new file mode 100644
index 000000000..80e17ed83
--- /dev/null
+++ b/httemplate/edit/radius_group.html
@@ -0,0 +1,16 @@
+<& elements/edit.html,
+ 'name' => 'RADIUS Group',
+ 'table' => 'radius_group',
+ 'labels' => {
+ 'groupnum' => 'Group',
+ 'groupname' => 'RADIUS Group',
+ 'description' => 'Description',
+ },
+ 'viewall_dir' => 'browse',
+&>
+<%init>
+
+die "access denied"
+ unless $FS::CurrentUser::CurrentUser->access_right('Configuration');
+
+</%init>
diff --git a/httemplate/edit/svc_acct.cgi b/httemplate/edit/svc_acct.cgi
index e6cd7d86c..33e5d0414 100755
--- a/httemplate/edit/svc_acct.cgi
+++ b/httemplate/edit/svc_acct.cgi
@@ -302,12 +302,21 @@ function randomPass() {
<TR>
<TD ALIGN="right"><% mt('RADIUS groups') |h %></TD>
-% if ( $part_svc->part_svc_column('usergroup')->columnflag eq 'F' ) {
-
+% if ( $part_svc_usergroup->columnflag eq 'F' ) {
<TD BGCOLOR="#eeeeee"><% join('<BR>', @groups) %></TD>
% } else {
-
- <TD><% FS::svc_acct::radius_usergroup_selector( \@groups ) %></TD>
+% my $radius_group_selected = '';
+% if ( $svc_acct->svcnum ) {
+% $radius_group_selected = join(',',$svc_acct->radius_groups('NUMBERS'));
+% }
+% elsif ( !$svc_acct->svcnum && $part_svc_usergroup->columnflag eq 'D' ) {
+% $radius_group_selected = $part_svc_usergroup->columnvalue;
+% }
+ <TD><& /elements/select-radius_group.html,
+ curr_value => $radius_group_selected,
+ element_name => 'radius_usergroup',
+ &>
+ </TD>
% }
</TR>
@@ -433,9 +442,10 @@ 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);
+if ( $part_svc_usergroup->columnflag eq 'F' ) {
+ @groups = split(',', $part_svc_usergroup->columnvalue);
}
my $action = $svcnum ? 'Edit' : 'Add';