X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=htdocs%2Fedit%2Fpart_svc.cgi;h=8a9018a2525be99238d146bae70761f978386285;hb=b6d1aed30d51bdae49ca22e5aa5baab635969097;hp=58a1e048e9b3f138bb5d813e38ac18f6cb3fedc7;hpb=c116ce940c33dcd7e37a87a8eb2936e17cc68b11;p=freeside.git diff --git a/htdocs/edit/part_svc.cgi b/htdocs/edit/part_svc.cgi index 58a1e048e..8a9018a25 100755 --- a/htdocs/edit/part_svc.cgi +++ b/htdocs/edit/part_svc.cgi @@ -1,6 +1,6 @@ #!/usr/bin/perl -Tw # -# $Id: part_svc.cgi,v 1.7 1999-01-19 05:13:42 ivan Exp $ +# $Id: part_svc.cgi,v 1.11 1999-04-09 03:52:55 ivan Exp $ # # ivan@sisd.com 97-nov-14 # @@ -10,7 +10,20 @@ # use FS::CGI, added inline documentation ivan@sisd.com 98-jul-12 # # $Log: part_svc.cgi,v $ -# Revision 1.7 1999-01-19 05:13:42 ivan +# Revision 1.11 1999-04-09 03:52:55 ivan +# explicit & for table/itable/ntable +# +# Revision 1.10 1999/04/08 13:01:50 ivan +# [ AND DOCUMENT! ] all svc_acct services should have a default +# or fixed shell +# +# Revision 1.9 1999/02/23 08:09:21 ivan +# beginnings of one-screen new customer entry and some other miscellania +# +# Revision 1.8 1999/02/07 09:59:21 ivan +# more mod_perl fixes, and bugfixes Peter Wemm sent via email +# +# Revision 1.7 1999/01/19 05:13:42 ivan # for mod_perl: no more top-level my() variables; use vars instead # also the last s/create/new/; # @@ -41,21 +54,31 @@ $cgi = new CGI; &cgisuidsetup($cgi); -($query) = $cgi->keywords; -if ( $query && $query =~ /^(\d+)$/ ) { #editing +if ( $cgi->param('error') ) { + $part_svc = new FS::part_svc ( { + map { $_, scalar($cgi->param($_)) } fields('part_svc') + } ); +} elsif ( $cgi->keywords ) { + my ($query) = $cgi->keywords; + $query =~ /^(\d+)$/; $part_svc=qsearchs('part_svc',{'svcpart'=>$1}); - $action='Edit'; } else { #adding $part_svc = new FS::part_svc {}; - $action='Add'; } +$action = $part_svc->svcpart ? 'Edit' : 'Add'; $hashref = $part_svc->hashref; $p = popurl(2); print $cgi->header( '-expires' => 'now' ), header("$action Service Definition", menubar( 'Main Menu' => $p, 'View all services' => "${p}browse/part_svc.cgi", -)), '
'; +)); + +print qq!Error: !, $cgi->param('error'), + "" + if $cgi->param('error'); + +print ''; print qq!!, "Service Part #", $hashref->{svcpart} ? $hashref->{svcpart} : "(NEW)"; @@ -80,7 +103,7 @@ blank slipip as well as a fixed shell something like /bin/true or /usr/bin/passwd.

END -print table, 'Table', map '{svcdb}). ">$_\n", qw( svc_acct svc_domain svc_acct_sm ); @@ -104,7 +127,7 @@ END 'quota' => '(unimplemented)', '_password' => 'Password', 'gid' => 'GID (when blank, defaults to UID)', - 'shell' => 'Shell', + 'shell' => 'Shell (all service definitions should have a default or fixed shell that is present in the shells configuration file)', 'finger' => 'GECOS', }, 'svc_domain' => { @@ -138,9 +161,12 @@ foreach $svcdb ( qw( my($ptmp)="$svcdb"; my($row); foreach $row (@rows) { - my($value)=$part_svc->getfield($svcdb.'__'.$row); - my($flag)=$part_svc->getfield($svcdb.'__'.$row.'_flag'); - print "$ptmp$row - $defs{$svcdb}{$row}"; + my $value = $part_svc->getfield($svcdb. '__'. $row); + my $flag = $part_svc->getfield($svcdb. '__'. $row. '_flag'); + print "$ptmp$row"; + print "- $defs{$svcdb}{$row}" + if defined $defs{$svcdb}{$row}; + print ""; print qq!Off"; print qq!