- Timestamp:
- 11/08/12 17:56:36 (12 years ago)
- Location:
- trunk/cgi-bin
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/cgi-bin/IPDB.pm
r545 r547 26 26 %IPDBacl %aclmsg 27 27 &initIPDBGlobals &connectDB &finish &checkDBSanity 28 &addMaster 28 &addMaster &touchMaster 29 29 &listSummary &listMaster &listRBlock &listFree &listPool 30 30 &getMasterList &getTypeList &getPoolSelect &findAllocateFrom … … 40 40 %IPDBacl %aclmsg 41 41 &initIPDBGlobals &connectDB &finish &checkDBSanity 42 &addMaster 42 &addMaster &touchMaster 43 43 &listSummary &listMaster &listRBlock &listFree &listPool 44 44 &getMasterList &getTypeList &getPoolSelect &findAllocateFrom … … 301 301 } 302 302 } # end addMaster 303 304 305 ## IPDB::touchMaster() 306 # Update last-changed timestamp on a master block. 307 sub touchMaster { 308 my $dbh = shift; 309 my $master = shift; 310 311 local $dbh->{AutoCommit} = 0; 312 local $dbh->{RaiseError} = 1; 313 314 eval { 315 $dbh->do("UPDATE masterblocks SET mtime=now() WHERE cidr = ?", undef, ($master)); 316 $dbh->commit; 317 }; 318 319 if ($@) { 320 my $msg = $@; 321 eval { $dbh->rollback; }; 322 return ('FAIL',$msg); 323 } 324 return ('OK','OK'); 325 } # end touchMaster() 303 326 304 327 -
trunk/cgi-bin/admin.cgi
r546 r547 229 229 } elsif ($webvar{action} eq 'touch') { 230 230 231 $page->param(master => $webvar{whichmaster}); 232 $sth = $ip_dbh->prepare("update masterblocks set mtime=now() where cidr='$webvar{whichmaster}'"); 233 $sth->execute; 234 if ($sth->err) { 235 $page->param(errmsg => $sth->errstr); 236 } 231 my ($code,$msg) = touchMaster($ip_dbh, $webvar{whichmaster}); 232 $page->param(errmsg => $msg) if $code eq 'FAIL'; 237 233 238 234 } elsif ($webvar{action} eq 'listcust') {
Note:
See TracChangeset
for help on using the changeset viewer.