freeside/httemplate/edit svc_www.cgi,1.2.4.5,1.2.4.6
ivan
ivan at pouncequick.420.am
Tue May 11 04:52:06 PDT 2004
Update of /home/cvs/cvsroot/freeside/httemplate/edit
In directory pouncequick:/tmp/cvs-serv18862
Modified Files:
Tag: FREESIDE_1_4_BRANCH
svc_www.cgi
Log Message:
clean this up a bit, fix svc_www-usersvc_svcpart and hopefully simplified zone select too
Index: svc_www.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/edit/svc_www.cgi,v
retrieving revision 1.2.4.5
retrieving revision 1.2.4.6
diff -u -d -r1.2.4.5 -r1.2.4.6
--- svc_www.cgi 11 May 2004 11:22:09 -0000 1.2.4.5
+++ svc_www.cgi 11 May 2004 11:52:04 -0000 1.2.4.6
@@ -63,7 +63,8 @@
map { $_->svcpart } qsearch( 'part_svc', { 'svcdb' => 'svc_acct' } )
) {
next if $conf->exists('svc_www-usersvc_svcpart')
- && grep { $svcpart == $_ } $conf->config('svc_www-usersvc_svcpart');
+ && ! grep { $svcpart == $_ }
+ $conf->config('svc_www-usersvc_svcpart');
push @u_acct_svcparts, $svcpart;
}
@@ -91,31 +92,61 @@
push @d_acct_svcparts,$d_part_svc->getfield('svcpart');
}
- foreach $i_cust_pkg ( qsearch('cust_pkg',{'custnum'=>$custnum}) ) {
- my($cust_pkgnum)=$i_cust_pkg->getfield('pkgnum');
- my($acct_svcpart);
- foreach $acct_svcpart (@d_acct_svcparts) {
- my($i_cust_svc);
- foreach $i_cust_svc ( qsearch('cust_svc',{'pkgnum'=>$cust_pkgnum,'svcpart'=>$acct_svcpart}) ) {
- my($svc_domain)=qsearchs('svc_domain',{'svcnum'=>$i_cust_svc->getfield('svcnum')});
+ foreach $i_cust_pkg ( qsearch( 'cust_pkg', { 'custnum' => $custnum } ) ) {
+ my $cust_pkgnum = $i_cust_pkg->pkgnum;
+
+ foreach my $acct_svcpart (@d_acct_svcparts) {
+
+ foreach my $i_cust_svc (
+ qsearch( 'cust_svc', { 'pkgnum' => $cust_pkgnum,
+ 'svcpart' => $acct_svcpart } )
+ ) {
+ my $svc_domain =
+ qsearchs( 'svc_domain', { 'svcnum' => $i_cust_svc->svcnum } );
+
+ my $extra_sql = "AND ( rectype = 'A' OR rectype = 'CNAME' )";
+ if ( $conf->exists('svc_www-enable_subdomains') ) {
+ my $domain = $
+ $extra_sql .= " AND ( reczone = '@' OR reczone = '".
+ $svc_domain->domain. ".' )";
+ }
+
+ foreach my $domain_rec (
+ qsearch( 'domain_record',
+ {
+ 'svcnum' => $svc_domain->svcnum,
+ },
+ '',
+ $extra_sql,
+ )
+ ) {
+ $arec{$domain_rec->recnum} = $domain_rec->zone;
+ }
+
if ( $conf->exists('svc_www-enable_subdomains') ) {
- foreach my $domain_rec ( qsearch('domain_record',{
- 'svcnum' => $svc_domain->svcnum,
- 'rectype' => 'A' } ),
- qsearch('domain_record',{
- 'svcnum' => $svc_domain->svcnum,
- 'rectype' => 'CNAME'
- } ) ) {
- $arec{$domain_rec->recnum} = $domain_rec->zone;
- }
$arec{'www.'. $svc_domain->domain} = 'www.'. $svc_domain->domain
- unless qsearchs('domain_record', { svcnum => $svc_domain->svcnum,
- reczone => 'www', } );
+ unless qsearchs( 'domain_record', {
+ svcnum => $svc_domain->svcnum,
+ reczone => 'www',
+ } )
+ || qsearchs( 'domain_record', {
+ svcnum => $svc_domain->svcnum,
+ reczone => 'www.'.$svc-domain->domain.'.',
+ } );
}
+
$arec{'@.'. $svc_domain->domain} = $svc_domain->domain
- unless qsearchs('domain_record', { svcnum => $svc_domain->svcnum,
- reczone => '@', } );
+ unless qsearchs('domain_record', {
+ svcnum => $svc_domain->svcnum,
+ reczone => '@',
+ } )
+ || qsearchs('domain_record', {
+ svcnum => $svc_domain->svcnum,
+ reczone => $svc_domain->domain.'.',
+ } );
+
}
+
}
}
More information about the freeside-commits
mailing list