- Timestamp:
- 03/11/16 15:14:08 (9 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/cgi-bin/IPDB.pm
r818 r820 28 28 $errstr 29 29 &initIPDBGlobals &connectDB &finish &checkDBSanity 30 &addVRF &getVRF & addMaster &touchMaster30 &addVRF &getVRF &deleteVRF &addMaster &touchMaster 31 31 &listVRF &listSummary &listSubs &listContainers &listAllocations &listForMerge &listFree &listPool 32 32 &getMasterList &getTypeList &getPoolSelect &findAllocateFrom … … 44 44 $errstr 45 45 &initIPDBGlobals &connectDB &finish &checkDBSanity 46 &addVRF &getVRF & addMaster &touchMaster46 &addVRF &getVRF &deleteVRF &addMaster &touchMaster 47 47 &listVRF &listSummary &listSubs &listContainers &listAllocations &listForMerge &listFree &listPool 48 48 &getMasterList &getTypeList &getPoolSelect &findAllocateFrom … … 688 688 return $dbh->selectrow_hashref("SELECT comment,location FROM vrfs WHERE vrf = ?", {Slice=>{}}, $vrf); 689 689 } # end getVRF() 690 691 692 ## IPDB::deleteVRF() 693 # 694 sub deleteVRF { 695 my $dbh = shift; 696 my $vrf = shift; 697 698 # Allow transactions, and raise an exception on errors so we can catch it later. 699 # Use local to make sure these get "reset" properly on exiting this block 700 local $dbh->{AutoCommit} = 0; 701 local $dbh->{RaiseError} = 1; 702 703 eval { 704 $dbh->do("DELETE FROM vrfs WHERE vrf = ?", undef, $vrf); 705 $dbh->commit; 706 }; 707 if ($@) { 708 my $msg = $@; # not much complexity here just yet. 709 return ('FAIL',$msg); 710 } 711 712 return ('OK','OK'); 713 } # end deleteVRF() 690 714 691 715 -
trunk/cgi-bin/main.cgi
r818 r820 148 148 149 149 } # ACL check 150 151 } elsif ($webvar{action} eq 'delvrf') { 152 if ($IPDBacl{$authuser} !~ /s/) { 153 $aclerr = 'delvrf'; 154 } 155 156 my $vrf = getVRF($ip_dbh, $webvar{vrf}); 157 158 $page->param(vrf => $webvar{vrf}); 159 $page->param(vrfcomment => $vrf->{comment}); 160 161 } elsif ($webvar{action} eq 'finaldelvrf') { 162 if ($IPDBacl{$authuser} !~ /s/) { 163 $aclerr = 'finaldelvrf'; 164 } 165 166 my $vrf = getVRF($ip_dbh, $webvar{vrf}); 167 $page->param(vrf => $webvar{vrf}); 168 $page->param(vrfcomment => $vrf->{comment}); 169 170 my ($code,$msg) = deleteVRF($ip_dbh, $webvar{vrf}, $authuser); 171 172 if ($code eq 'FAIL') { 173 $page->param(failmsg => $msg); 174 } 150 175 151 176 } elsif ($webvar{action} eq 'addmaster') { -
trunk/templates/showvrf.tmpl
r818 r820 29 29 <form action="<TMPL_VAR NAME=webpath>/cgi-bin/main.cgi" method=POST> 30 30 <fieldset><legend class="noshow"> </legend> 31 <input type=hidden name=action value="del ete">31 <input type=hidden name=action value="delvrf"> 32 32 <input type=hidden name=vrf value="<TMPL_VAR NAME=vrf>"> 33 33 <input type=submit value=" Remove this VRF ">
Note:
See TracChangeset
for help on using the changeset viewer.