diff options
author | ivan <ivan> | 2002-02-11 19:38:58 +0000 |
---|---|---|
committer | ivan <ivan> | 2002-02-11 19:38:58 +0000 |
commit | f255042296a645e7d90c19ee6740796250cfb9f3 (patch) | |
tree | 3864e6e2edb214bc389a70434a51345496225566 /httemplate | |
parent | 505345d25040f78a9fdffa5666cd6b9f41a117a5 (diff) |
svc_www is working!
also auto-create and add A records if necessary using apacheip config file.
and show all domain_records on view/svc_domain.cgi page
Diffstat (limited to 'httemplate')
-rw-r--r-- | httemplate/edit/process/svc_www.cgi | 36 | ||||
-rwxr-xr-x | httemplate/edit/svc_acct.cgi | 1 | ||||
-rwxr-xr-x | httemplate/view/svc_domain.cgi | 13 | ||||
-rw-r--r-- | httemplate/view/svc_www.cgi | 8 |
4 files changed, 54 insertions, 4 deletions
diff --git a/httemplate/edit/process/svc_www.cgi b/httemplate/edit/process/svc_www.cgi new file mode 100644 index 000000000..38d5e1c79 --- /dev/null +++ b/httemplate/edit/process/svc_www.cgi @@ -0,0 +1,36 @@ +<% + +$cgi->param('svcnum') =~ /^(\d*)$/ or die "Illegal svcnum!"; +my $svcnum = $1; + +my $old; +if ( $svcnum ) { + $old = qsearchs('svc_acct', { 'svcnum' => $svcnum } ) + or die "fatal: can't find account (svcnum $svcnum)!"; +} else { + $old = ''; +} + +my $new = new FS::svc_www ( { + map { + ($_, scalar($cgi->param($_))); + #} qw(svcnum pkgnum svcpart recnum usersvc) + } ( fields('svc_www'), qw( pkgnum svcpart ) ) +} ); + +my $error; +if ( $svcnum ) { + $error = $new->replace($old); +} else { + $error = $new->insert; + $svcnum = $new->svcnum; +} + +if ( $error ) { + $cgi->param('error', $error); + print $cgi->redirect(popurl(2). "svc_www.cgi?". $cgi->query_string ); +} else { + print $cgi->redirect(popurl(3). "view/svc_www.cgi?" . $svcnum ); +} + +%> diff --git a/httemplate/edit/svc_acct.cgi b/httemplate/edit/svc_acct.cgi index e42745cf7..3fa7019eb 100755 --- a/httemplate/edit/svc_acct.cgi +++ b/httemplate/edit/svc_acct.cgi @@ -105,7 +105,6 @@ print 'Service # '. ( $svcnum ? "<B>$svcnum</B>" : " (NEW)" ). '<BR>'. END print &ntable("#cccccc",2), <<END; -<TR><TD> <TR><TD ALIGN="right">Username</TD> <TD><INPUT TYPE="text" NAME="username" VALUE="$username" SIZE=$ulen2 MAXLENGTH=$ulen></TD></TR> <TR><TD ALIGN="right">Password</TD> diff --git a/httemplate/view/svc_domain.cgi b/httemplate/view/svc_domain.cgi index f30211098..f086cda1a 100755 --- a/httemplate/view/svc_domain.cgi +++ b/httemplate/view/svc_domain.cgi @@ -46,6 +46,17 @@ print header('Domain View', menubar( qq!<BR>Catch all email <A HREF="${p}misc/catchall.cgi?$svcnum">(change)</A>:!, $email ? "<B>$email</B>." : "<I>(none)<I>", qq!<BR><BR><A HREF="http://www.geektools.com/cgi-bin/proxy.cgi?query=$domain;targetnic=auto">View whois information.</A>!, - '</BODY></HTML>', + '<BR><BR>', ntable("",2), + '<tr><th>Zone</th><th>Type</th><th>Data</th></tr>', ; + +foreach my $domain_record ( qsearch('domain_record', { svcnum => $svcnum } ) ) { + print '<tr><td>'. $domain_record->reczone. '</td>'. + '<td>'. $domain_record->recaf. ' '. $domain_record->rectype. '</td>'. + '<td>'. $domain_record->recdata. '</td></tr>'; +} +print '</table>'; + +print '</BODY></HTML>'; + %> diff --git a/httemplate/view/svc_www.cgi b/httemplate/view/svc_www.cgi index bd8ae36a6..a82921f1b 100644 --- a/httemplate/view/svc_www.cgi +++ b/httemplate/view/svc_www.cgi @@ -10,7 +10,7 @@ my $svc_www = qsearchs( 'svc_www', { 'svcnum' => $svcnum } ) #false laziness w/all svc_*.cgi my $cust_svc = qsearchs( 'cust_svc', { 'svcnum' => $svcnum } ); my $pkgnum = $cust_svc->getfield('pkgnum'); -my($cust_pkg, custnum); +my($cust_pkg, $custnum); if ($pkgnum) { $cust_pkg = qsearchs( 'cust_pkg', { 'pkgnum' => $pkgnum } ); $custnum = $cust_pkg->custnum; @@ -24,6 +24,10 @@ my $domain_record = qsearchs('domain_record', { 'recnum' => $svc_www->recnum } ) or die "svc_www: Unknown recnum". $svc_www->recnum; my $www = $domain_record->reczone; +unless ( $www =~ /\.$/ ) { + my $svc_domain = qsearchs('svc_domain', { svcnum=>$domain_record->svcnum } ); + $www .= '.'. $svc_domain->domain; +} print header('Website View', menubar( ( ( $custnum ) @@ -36,7 +40,7 @@ print header('Website View', menubar( "Main menu" => $p, )), "Service #$svcnum", - "<BR>Website name: <B>$www</B>.", + qq!<BR>Website name: <B><A HREF="http://$www">$www</A></B>!, '</BODY></HTML>', ; %> |