From ca1b5151cb9093fcb49de2ffd885754e1a5d5d48 Mon Sep 17 00:00:00 2001 From: ivan Date: Wed, 13 Apr 2005 12:31:30 +0000 Subject: [PATCH] get rid of some super ancient assumptions about slipip and uid meaning exporting to RADIUS and shell respectively --- httemplate/edit/part_svc.cgi | 6 +-- httemplate/view/svc_acct.cgi | 115 +++++++++++++++++++++++++++---------------- 2 files changed, 76 insertions(+), 45 deletions(-) diff --git a/httemplate/edit/part_svc.cgi b/httemplate/edit/part_svc.cgi index bc38c34bd..3540a421e 100755 --- a/httemplate/edit/part_svc.cgi +++ b/httemplate/edit/part_svc.cgi @@ -67,8 +67,8 @@ my $conf = new FS::Conf; my %defs = ( 'svc_acct' => { 'dir' => 'Home directory', - 'uid' => 'UID (set to fixed and blank for dial-only)', - 'slipip' => 'IP address (Set to fixed and blank to disable dialin, or, set a value to be exported to RADIUS Framed-IP-Address. Use the special value 0e0 [zero e zero] to enable export to RADIUS without a Framed-IP-Address.)', + 'uid' => 'UID (set to fixed and blank for no UIDs)', + 'slipip' => 'IP address', # 'popnum' => qq!POP number!, 'popnum' => { desc => 'Access number', @@ -85,7 +85,7 @@ my %defs = ( '_password' => 'Password', 'gid' => 'GID (when blank, defaults to UID)', 'shell' => { - desc =>'Shell (all service definitions should have a default or fixed shell that is present in the shells configuration file)', + desc =>'Shell (all service definitions should have a default or fixed shell that is present in the shells configuration file, set to blank for no shell tracking)', type =>'select', select_list => [ $conf->config('shells') ], }, diff --git a/httemplate/view/svc_acct.cgi b/httemplate/view/svc_acct.cgi index 6ca9bf071..246a7fbc8 100755 --- a/httemplate/view/svc_acct.cgi +++ b/httemplate/view/svc_acct.cgi @@ -204,49 +204,80 @@ print "Access number". "". $svc_acct_pop->text. '' if $svc_acct_pop; -if ($svc_acct->uid ne '') { - print "Uid". - "". $svc_acct->uid. "", - "Gid". - "". $svc_acct->gid. "", - "GECOS". - "". $svc_acct->finger. "", - "Home directory". - "". $svc_acct->dir. "", - "Shell". - "". $svc_acct->shell. "", - "Quota". - "". $svc_acct->quota. "" - ; -} else { - print "(No shell account)"; -} +%> -if ($svc_acct->slipip) { - print "IP address". - ( ( $svc_acct->slipip eq "0.0.0.0" || $svc_acct->slipip eq '0e0' ) - ? "(Dynamic)" - : $svc_acct->slipip - ). ""; - my($attribute); - foreach $attribute ( grep /^radius_/, $svc_acct->fields ) { - #warn $attribute; - $attribute =~ /^radius_(.*)$/; - my $pattribute = $FS::raddb::attrib{$1}; - print "Radius (reply) $pattribute". - "". $svc_acct->getfield($attribute). - ""; - } - foreach $attribute ( grep /^rc_/, $svc_acct->fields ) { - #warn $attribute; - $attribute =~ /^rc_(.*)$/; - my $pattribute = $FS::raddb::attrib{$1}; - print "Radius (check) $pattribute: ". - "". $svc_acct->getfield($attribute). - ""; - } -} else { - print "(No SLIP/PPP account)"; +<% if ($svc_acct->uid ne '') { %> + + UID + <%= $svc_acct->uid %> + +<% } %> + +<% if ($svc_acct->gid ne '') { %> + + GID + <%= $svc_acct->gid %> + +<% } %> + +<% if ($svc_acct->finger ne '') { %> + + GECOS + <%= $svc_acct->finger %> + +<% } %> + +<% if ($svc_acct->dir ne '') { %> + + Home directory + <%= $svc_acct->dir %> + +<% } %> + +<% if ($svc_acct->shell ne '') { %> + + Shell + <%= $svc_acct->shell %> + +<% } %> + +<% if ($svc_acct->quota ne '') { %> + + Quota + <%= $svc_acct->quota %> + +<% } %> + +<% if ($svc_acct->slipip) { %> + + IP address + + <%= ( $svc_acct->slipip eq "0.0.0.0" || $svc_acct->slipip eq '0e0' ) + ? "(Dynamic)" + : $svc_acct->slipip + %> + + +<% } %> + +<% + +my($attribute); +foreach $attribute ( grep /^radius_/, $svc_acct->fields ) { + #warn $attribute; + $attribute =~ /^radius_(.*)$/; + my $pattribute = $FS::raddb::attrib{$1}; + print "Radius (reply) $pattribute". + "". $svc_acct->getfield($attribute). + ""; +} +foreach $attribute ( grep /^rc_/, $svc_acct->fields ) { + #warn $attribute; + $attribute =~ /^rc_(.*)$/; + my $pattribute = $FS::raddb::attrib{$1}; + print "Radius (check) $pattribute: ". + "". $svc_acct->getfield($attribute). + ""; } print 'RADIUS groups'. -- 2.11.0