Changeset 284


Ignore:
Timestamp:
03/22/12 16:38:06 (13 years ago)
Author:
Kris Deugau
Message:

/trunk

Clean up dangling failure logging in the UI layer for add domain.
Also clean up interim userdata-passing that's no longer necessary.
See #35

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/DNSDB.pm

    r283 r284  
    12931293    ($dom_id) = $dbh->selectrow_array("SELECT domain_id FROM domains WHERE domain=?", undef, ($domain));
    12941294
    1295     _log($dbh, (domain_id => $dom_id, user_id => $userinfo{id}, group_id => $group, username => $userinfo{username},
     1295    _log($dbh, (domain_id => $dom_id, group_id => $group,
    12961296        entry => "Added ".($state ? 'active' : 'inactive')." domain $domain"));
    12971297
     
    13081308        my @tmp1 = split /:/, $host;
    13091309        my @tmp2 = split /:/, $val;
    1310         _log($dbh, (domain_id => $dom_id, user_id => $userinfo{id}, group_id => $group,
    1311                 username => $userinfo{username}, entry =>
    1312                 "[new $domain] Added SOA record [contact $tmp1[0]] [master $tmp1[1]] ".
     1310        _log($dbh, (domain_id => $dom_id, group_id => $group,
     1311                entry => "[new $domain] Added SOA record [contact $tmp1[0]] [master $tmp1[1]] ".
    13131312                "[refresh $tmp2[0]] [retry $tmp2[1]] [expire $tmp2[2]] [minttl $tmp2[3]], TTL $ttl"));
    13141313      } else {
     
    13161315        $logentry .= " [distance $dist]" if $typemap{$type} eq 'MX';
    13171316        $logentry .= " [priority $dist] [weight $weight] [port $port]" if $typemap{$type} eq 'SRV';
    1318         _log($dbh, (domain_id => $dom_id, user_id => $userinfo{id}, group_id => $group,
    1319                 username => $userinfo{username}, entry =>
    1320                 $logentry." $val', TTL $ttl"));
     1317        _log($dbh, (domain_id => $dom_id, group_id => $group,
     1318                entry => $logentry." $val', TTL $ttl"));
    13211319      }
    13221320    }
     
    13291327    my $msg = $@;
    13301328    eval { $dbh->rollback; };
     1329    _log($dbh, (domain_id => $dom_id, group_id => $group, entry => "Failed adding domain $domain ($msg)"))
     1330        if $config{log_failures};
     1331    $dbh->commit;       # since we enabled transactions earlier
    13311332    return ('FAIL',$msg);
    13321333  } else {
  • trunk/dns.cgi

    r283 r284  
    389389    changepage(page => "reclist", id => $msg);
    390390  } else {
    391     logaction(0, $session->param("username"), $webvar{group}, "Failed adding domain $webvar{domain} ($msg)")
    392         if $config{log_failures};
    393391    $session->param('add_failed', 1);
    394392##fixme:  domain a security risk for XSS?
Note: See TracChangeset for help on using the changeset viewer.