Changeset 193 for trunk/dns.cgi


Ignore:
Timestamp:
12/09/11 17:56:27 (13 years ago)
Author:
Kris Deugau
Message:

/trunk

Hack _log() to dig up user data when (not if) it's missing. Better solution needed.
Clean up debugging statements in addDomain()
Add some ##fixme's to dns.cgi
Log distance, port, weight as needed for new MX, SRV records

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/dns.cgi

    r192 r193  
    347347
    348348  if ($code eq 'OK') {
    349     logaction($msg, $session->param("username"), $webvar{group}, "Added domain $webvar{domain}");
     349#    logaction($msg, $session->param("username"), $webvar{group}, "Added domain $webvar{domain}");
    350350    changepage(page => "reclist", id => $msg);
    351351  } else {
     
    519519    if ($code eq 'OK') {
    520520      if ($webvar{defrec} eq 'y') {
    521         my $restr = "Added default record '$webvar{name} $typemap{$webvar{type}} $webvar{address}', TTL $webvar{ttl}";
     521        my $restr = "Added default record '$webvar{name} $typemap{$webvar{type}}";
     522        $restr .= " [distance $dist]" if $typemap{$webvar{type}} eq 'MX';
     523        $restr .= " [priority $dist] [weight $weight] [port $port]" if $typemap{$webvar{type}} eq 'SRV';
     524        $restr .= " $webvar{address}', TTL $webvar{ttl}";
    522525        logaction(0, $session->param("username"), $webvar{parentid}, $restr);
    523526        changepage(page => "reclist", id => $webvar{parentid}, defrec => $webvar{defrec}, resultmsg => $restr);
    524527      } else {
    525         my $restr = "Added record '$webvar{name} $typemap{$webvar{type}} $webvar{address}', TTL $webvar{ttl}";
     528        my $restr = "Added record '$webvar{name} $typemap{$webvar{type}}".
     529        $restr .= " [distance $dist]" if $typemap{$webvar{type}} eq 'MX';
     530        $restr .= " [priority $dist] [weight $weight] [port $port]" if $typemap{$webvar{type}} eq 'SRV';
     531        $restr .= " $webvar{address}', TTL $webvar{ttl}";
    526532        logaction($webvar{parentid}, $session->param("username"), parentID($webvar{parentid}, 'dom', 'group'), $restr);
    527533        changepage(page => "reclist", id => $webvar{parentid}, defrec => $webvar{defrec}, resultmsg => $restr);
     
    582588
    583589    if ($code eq 'OK') {
     590##fixme: retrieve old record info for full logging of change
    584591      if ($webvar{defrec} eq 'y') {
    585592        my $restr = "Updated default record from '$oldrec->{host} $typemap{$oldrec->{type}} $oldrec->{val}', TTL $oldrec->{ttl}\n".
Note: See TracChangeset for help on using the changeset viewer.