Changeset 283
Legend:
- Unmodified
- Added
- Removed
-
trunk/DNSDB.pm
r282 r283 80 80 our $group = 1; 81 81 our $errstr = ''; 82 our $resultstr = ''; 82 83 83 84 # Halfway sane defaults for SOA, TTL, etc. … … 2847 2848 return undef if $id !~ /^\d+$/; 2848 2849 2849 # ooo, fun! let's see what we were passed for status 2850 # Allow transactions, and raise an exception on errors so we can catch it later. 2851 # Use local to make sure these get "reset" properly on exiting this block 2852 local $dbh->{AutoCommit} = 0; 2853 local $dbh->{RaiseError} = 1; 2854 2850 2855 if ($newstatus ne 'mu') { 2851 $newstatus = 0 if $newstatus eq 'domoff'; 2852 $newstatus = 1 if $newstatus eq 'domon'; 2853 $dbh->do("UPDATE ".($revrec eq 'n' ? 'domains' : 'revzones')." SET status=? WHERE ". 2856 # ooo, fun! let's see what we were passed for status 2857 eval { 2858 $newstatus = 0 if $newstatus eq 'domoff'; 2859 $newstatus = 1 if $newstatus eq 'domon'; 2860 $dbh->do("UPDATE ".($revrec eq 'n' ? 'domains' : 'revzones')." SET status=? WHERE ". 2854 2861 ($revrec eq 'n' ? 'domain_id' : 'rdns_id')."=?", undef, ($newstatus,$id) ); 2862 2863 ##fixme switch to more consise "Enabled <domain"/"Disabled <domain>" as with users? 2864 $resultstr = "Changed ".($revrec eq 'n' ? domainName($dbh, $id) : revName($dbh, $id)). 2865 " state to ".($newstatus ? 'active' : 'inactive'); 2866 2867 my %loghash; 2868 $loghash{domain_id} = $id if $revrec eq 'n'; 2869 $loghash{rdns_id} = $id if $revrec eq 'y'; 2870 $loghash{group_id} = parentID($dbh, 2871 (id => $id, type => ($revrec eq 'n' ? 'domain' : 'revzone'), revrec => $revrec) ); 2872 $loghash{entry} = $resultstr; 2873 _log($dbh, %loghash); 2874 2875 $dbh->commit; 2876 }; 2877 if ($@) { 2878 my $msg = $@; 2879 eval { $dbh->rollback; }; 2880 $resultstr = ''; 2881 $errstr = $msg; 2882 return; 2883 } 2855 2884 } 2856 2885 … … 3262 3291 3263 3292 ## DNSDB::mailNotify() 3264 # Sends notification mail to recipients regarding a n IPDB operation3293 # Sends notification mail to recipients regarding a DNSDB operation 3265 3294 sub mailNotify { 3266 3295 my $dbh = shift; -
trunk/dns.cgi
r280 r283 330 330 if ($flag && ($permissions{admin} || $permissions{domain_edit})) { 331 331 my $stat = zoneStatus($dbh,$webvar{id},'n',$webvar{zonestatus}); 332 ##fixme switch to more consise "Enabled <domain"/"Disabled <domain>" as with users? 333 logaction($webvar{id}, $session->param("username"), 334 parentID($dbh, (id => $webvar{id}, type => 'domain', revrec => $webvar{revrec})), 335 "Changed ".domainName($dbh, $webvar{id})." state to ".($stat ? 'active' : 'inactive')); 336 $page->param(resultmsg => "Changed ".domainName($dbh, $webvar{id})." state to ". 337 ($stat ? 'active' : 'inactive')); 332 $page->param(resultmsg => $DNSDB::resultstr); 338 333 } else { 339 334 $page->param(errmsg => "You are not permitted to view or change the requested domain"); … … 450 445 if ($flag && ($permissions{admin} || $permissions{domain_edit})) { 451 446 my $stat = zoneStatus($dbh,$webvar{id},'y',$webvar{zonestatus}); 452 ##fixme switch to more consise "Enabled <domain"/"Disabled <domain>" as with users? 453 logaction($webvar{id}, $session->param("username"), 454 parentID($dbh, (id => $webvar{id}, type => 'revzone', revrec => $webvar{revrec})), 455 "Changed ".revName($dbh, $webvar{id})." state to ".($stat ? 'active' : 'inactive')); 456 $page->param(resultmsg => "Changed ".revName($dbh, $webvar{id})." state to ". 457 ($stat ? 'active' : 'inactive')); 447 $page->param(resultmsg => $DNSDB::resultstr); 458 448 } else { 459 449 $page->param(errmsg => "You are not permitted to view or change the requested reverse zone");
Note:
See TracChangeset
for help on using the changeset viewer.