From: ivan Date: Mon, 25 Nov 2002 10:46:57 +0000 (+0000) Subject: fix disappearing radius group bug, whew X-Git-Tag: freeside_1_4_1beta6~34 X-Git-Url: http://git.freeside.biz/gitweb/?a=commitdiff_plain;h=30214462ef9e25f84c329fc33aa76dbafb1594db;p=freeside.git fix disappearing radius group bug, whew --- diff --git a/FS/FS/svc_acct.pm b/FS/FS/svc_acct.pm index a099cf172..da3278940 100644 --- a/FS/FS/svc_acct.pm +++ b/FS/FS/svc_acct.pm @@ -1,7 +1,7 @@ package FS::svc_acct; use strict; -use vars qw( @ISA $noexport_hack $conf +use vars qw( @ISA $DEBUG $me $noexport_hack $conf $dir_prefix @shells $usernamemin $usernamemax $passwordmin $passwordmax $username_ampersand $username_letter $username_letterfirst @@ -35,6 +35,9 @@ use FS::Msgcat qw(gettext); @ISA = qw( FS::svc_Common ); +$DEBUG = 0; +$me = '[FS::svc_acct]'; + #ask FS::UID to run this stuff for us later $FS::UID::callback{'FS::svc_acct'} = sub { $conf = new FS::Conf; @@ -505,6 +508,7 @@ sqlradius export only) sub replace { my ( $new, $old ) = ( shift, shift ); my $error; + warn "$me replacing $old with $new\n" if $DEBUG; return "Username in use" if $old->username ne $new->username && @@ -531,7 +535,13 @@ sub replace { local $FS::UID::AutoCommit = 0; my $dbh = dbh; + # redundant, but so $new->usergroup gets set + my $error = $new->check; + return $error if $error; + $old->usergroup( [ $old->radius_groups ] ); + warn "old groups: ". join(' ',@{$old->usergroup}). "\n" if $DEBUG; + warn "new groups: ". join(' ',@{$new->usergroup}). "\n" if $DEBUG; if ( $new->usergroup ) { #(sorta) false laziness with FS::part_export::sqlradius::_export_replace my @newgroups = @{$new->usergroup}; diff --git a/httemplate/edit/svc_acct.cgi b/httemplate/edit/svc_acct.cgi index c27bab88a..d4c9a738d 100755 --- a/httemplate/edit/svc_acct.cgi +++ b/httemplate/edit/svc_acct.cgi @@ -72,6 +72,12 @@ if ( $cgi->param('error') ) { } } + +#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 $action = $svcnum ? 'Edit' : 'Add'; my $svc = $part_svc->getfield('svc');