Changeset 503 for branches/htmlform
- Timestamp:
- 09/26/11 18:05:01 (13 years ago)
- Location:
- branches/htmlform
- Files:
-
- 1 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/htmlform/cgi-bin/CustIDCK.pm
r417 r503 31 31 # the local admin on installation 32 32 sub custid_exist { 33 my $self = shift; 33 34 my $custid = shift; 34 35 -
branches/htmlform/cgi-bin/IPDB.pm
r479 r503 24 24 @EXPORT_OK = qw( 25 25 %disp_alloctypes %list_alloctypes %def_custids @citylist @poplist @masterblocks 26 %allocated %free %routed %bigfree %IPDBacl 26 %allocated %free %routed %bigfree %IPDBacl %aclmsg 27 27 &initIPDBGlobals &connectDB &finish &checkDBSanity &allocateBlock &addMaster 28 28 &deleteBlock &getBlockData &mailNotify … … 32 32 %EXPORT_TAGS = ( ALL => [qw( 33 33 %disp_alloctypes %list_alloctypes %def_custids @citylist @poplist 34 @masterblocks %allocated %free %routed %bigfree %IPDBacl 34 @masterblocks %allocated %free %routed %bigfree %IPDBacl %aclmsg 35 35 &initIPDBGlobals &connectDB &finish &checkDBSanity &allocateBlock 36 36 &addMaster &deleteBlock &getBlockData &mailNotify … … 52 52 our %bigfree; 53 53 our %IPDBacl; 54 55 # mapping table for functional-area => error message 56 our %aclmsg = ( 57 addmaster => 'add a master block', 58 addblock => 'add an allocation', 59 updateblock => 'update a block', 60 delblock => 'delete an allocation', 61 ); 54 62 55 63 our $org_name = 'Example Corp'; -
branches/htmlform/cgi-bin/main.cgi
r497 r503 82 82 83 83 #main() 84 my $aclerr; 84 85 85 86 if(!defined($webvar{action})) { … … 98 99 } elsif ($webvar{action} eq 'addmaster') { 99 100 if ($IPDBacl{$authuser} !~ /a/) { 100 printError("You shouldn't have been able to get here. Access denied.");101 $aclerr = 'addmaster'; 101 102 } 102 103 } elsif ($webvar{action} eq 'newmaster') { 103 104 104 105 if ($IPDBacl{$authuser} !~ /a/) { 105 printError("You shouldn't have been able to get here. Access denied.");106 $aclerr = 'addmaster'; 106 107 } else { 107 108 my $cidr = new NetAddr::IP $webvar{cidr}; … … 191 192 192 193 194 # Switch to a different template if we've tripped on an ACL error. 195 # Note that this should only be exercised in development, when 196 # deeplinked, or when being attacked; normal ACL handling should 197 # remove the links a user is not allowed to click on. 198 if ($aclerr) { 199 $page = HTML::Template->new(filename => "aclerror.tmpl"); 200 $page->param(ipdbfunc => $aclmsg{$aclerr}); 201 } 202 193 203 194 204 # Clean up IPDB globals, DB handle, etc. … … 502 512 503 513 if ($IPDBacl{$authuser} !~ /a/) { 504 printError("You shouldn't have been able to get here. Access denied.");514 $aclerr = 'addblock'; 505 515 return; 506 516 } … … 605 615 sub confirmAssign { 606 616 if ($IPDBacl{$authuser} !~ /a/) { 607 printError("You shouldn't have been able to get here. Access denied.");617 $aclerr = 'addblock'; 608 618 return; 609 619 } … … 777 787 sub insertAssign { 778 788 if ($IPDBacl{$authuser} !~ /a/) { 779 printError("You shouldn't have been able to get here. Access denied.");789 $aclerr = 'addblock'; 780 790 return; 781 791 } … … 1021 1031 sub update { 1022 1032 if ($IPDBacl{$authuser} !~ /c/) { 1023 printError("You shouldn't have been able to get here. Access denied.");1033 $aclerr = 'updateblock'; 1024 1034 return; 1025 1035 } … … 1125 1135 sub remove { 1126 1136 if ($IPDBacl{$authuser} !~ /d/) { 1127 printError("You shouldn't have been able to get here. Access denied.");1137 $aclerr = 'delblock'; 1128 1138 return; 1129 1139 } … … 1210 1220 sub finalDelete { 1211 1221 if ($IPDBacl{$authuser} !~ /d/) { 1212 $ page->param(aclerr => 1);1222 $aclerr = 'delblock'; 1213 1223 return; 1214 1224 } -
branches/htmlform/ipdb.css
r499 r503 188 188 .err { 189 189 text-align: center; 190 font-size: 1 00%;190 font-size: 1em; 191 191 } 192 192 -
branches/htmlform/templates/confirm.tmpl
r463 r503 1 1 <TMPL_IF err> 2 <div class=" err">2 <div class="regular err"> 3 3 <p><TMPL_VAR NAME=err></p> 4 4 <input type="button" value="Back" onclick="history.go(-1)"> -
branches/htmlform/templates/finaldelete.tmpl
r476 r503 1 1 <div class="center"> 2 <TMPL_IF aclerr>3 <p>You shouldn't have been able to get here. Access denied.</p>4 <input type="button" value="Back" onclick="history.go(-1)">5 <TMPL_ELSE>6 2 <TMPL_IF failmsg> 7 3 <p>Could not deallocate <TMPL_IF netblock>netblock<TMPL_ELSE>static IP</TMPL_IF> <TMPL_VAR NAME=block>: <TMPL_VAR NAME=failmsg></p> … … 10 6 <div class="heading">Success! <TMPL_VAR NAME=block> deallocated.</div> 11 7 </TMPL_IF> 12 </TMPL_IF>13 8 </div> 14 9
Note:
See TracChangeset
for help on using the changeset viewer.