Changeset 242 for branches/stable
- Timestamp:
- 04/19/05 15:42:43 (20 years ago)
- Location:
- branches/stable
- Files:
-
- 1 deleted
- 8 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
branches/stable/cgi-bin/CommonWeb.pm
r112 r242 53 53 } 54 54 55 sub printHeader($) #(cgiurl) 56 { 57 my $cgiURL = $_[0]; 58 print "Content-type: text/html\n\n"; 59 open(FILE, "../header.inc") || die $!; 60 while (<FILE>) 61 { 62 $_ =~ s/\$\$CGIURL\$\$/$cgiURL/g; 63 print $_; 64 } 65 close(FILE); 55 56 sub printHeader { 57 my $title = shift; 58 print "Content-type: text/html\n\n"; 59 # This doesn't work well. Must investigate. 60 # my $realm = shift; 61 # print qq(WWW-Authenticate: Basic realm="$realm"\n) if $realm; 62 open FILE, "../header.inc" 63 or carp $!; 64 my $html = join('',<FILE>); 65 close FILE; 66 67 $html =~ s/\$\$TITLE\$\$/$title/; 68 # Necessary for mangling arbitrary bits of the header 69 my $i=0; 70 while (defined(my $param = shift)) { 71 $html =~ s/\$\$EXTRA$i\$\$/$param/g; 72 $i++; 73 } 74 print $html; 66 75 } 67 76 -
branches/stable/cgi-bin/IPDB.pm
r192 r242 23 23 @EXPORT_OK = qw( 24 24 %disp_alloctypes %list_alloctypes %def_custids @citylist @poplist @masterblocks 25 %allocated %free %routed %bigfree 25 %allocated %free %routed %bigfree %IPDBacl 26 26 &initIPDBGlobals &connectDB &finish &checkDBSanity &allocateBlock &deleteBlock 27 27 &mailNotify … … 31 31 %EXPORT_TAGS = ( ALL => [qw( 32 32 %disp_alloctypes %list_alloctypes %def_custids @citylist @poplist 33 @masterblocks %allocated %free %routed %bigfree 33 @masterblocks %allocated %free %routed %bigfree %IPDBacl 34 34 &initIPDBGlobals &connectDB &finish &checkDBSanity &allocateBlock 35 35 &deleteBlock &mailNotify … … 50 50 our %routed; 51 51 our %bigfree; 52 our %IPDBacl; 52 53 53 54 # Let's initialize the globals. … … 83 84 $sth = $dbh->prepare("select cidr from masterblocks order by cidr"); 84 85 $sth->execute; 86 return (undef,$sth->errstr) if $sth->err; 85 87 for (my $i=0; my @data = $sth->fetchrow_array(); $i++) { 86 88 $masterblocks[$i] = new NetAddr::IP $data[0]; … … 91 93 $routed{"$masterblocks[$i]"} = 0; 92 94 } 95 96 # Load ACL data. Specific username checks are done at a different level. 97 $sth = $dbh->prepare("select username,acl from users"); 98 $sth->execute; 93 99 return (undef,$sth->errstr) if $sth->err; 100 while (my @data = $sth->fetchrow_array) { 101 $IPDBacl{$data[0]} = $data[1]; 102 } 94 103 95 104 return (1,"OK"); -
branches/stable/cgi-bin/admin.cgi
r204 r242 34 34 } 35 35 36 if ($authuser !~ /^(kdeugau|jodyh|jipp)$/) {37 print "Content-Type: text/html\n\n".38 "<html><head><title>Access denied</title></head><body>\n".39 'Access to this tool is restricted. Contact <a href="mailto:kdeugau@vianet.ca">Kris</a> '.40 "for more information.</body></html>\n";41 exit;42 }43 44 36 syslog "debug", "$authuser active"; 45 37 … … 55 47 initIPDBGlobals($ip_dbh); 56 48 49 if ($IPDBacl{$authuser} !~ /A/) { 50 print "Content-Type: text/html\n\n". 51 "<html><head><title>Access denied</title></head><body>\n". 52 'Access to this tool is restricted. Contact <a href="mailto:kdeugau@vianet.ca">Kris</a> '. 53 "for more information.</body></html>\n"; 54 exit; 55 } 56 57 57 my %webvar = parse_post(); 58 58 cleanInput(\%webvar); 59 59 60 60 print "Content-type: text/html\n\n". 61 "<html>\n<head>\n\t<title> TEST [IPDB admin tools] TEST</title>\n".61 "<html>\n<head>\n\t<title>[IPDB admin tools]</title>\n". 62 62 qq(\t<link rel="stylesheet" type="text/css" href="/ip/ipdb.css">\n). 63 63 "</head>\n<body>\n". … … 91 91 </form> 92 92 <hr><a href="admin.cgi?action=showpools">List IP Pools</a> for manual tweaking and updates 93 <hr><a href="admin.cgi?action=showACL">Change ACLs</a> (change internal access controls - 94 note that this does NOT include IP-based limits) 93 95 ); 94 96 } else { … … 283 285 syslog "notice", "$authuser updated pool IP $webvar{ip}"; 284 286 } 285 # showPool("$data[0]"); 286 #} else { 287 # print "webvar{action} check failed: $webvar{action}"; 287 } elsif ($webvar{action} eq 'showACL') { 288 print "Notes:<br>\n". 289 "<li>Users must be added to .htpasswd from the shell, for the time being.\n". 290 "<li>New accounts will be added to the ACL here every time this page is loaded.\n". 291 "<li>Old accounts will NOT be automatically deleted; they must be removed via shell.\n". 292 "<li>Admin users automatically get all other priviledges.\n"; 293 # open .htpasswd, and snag the userlist. 294 $sth = $ip_dbh->prepare("select count (*) from users where username=?"); 295 open HTPASS, "<../../.htpasswd" or carp "BOO! No .htpasswd file!"; 296 while (<HTPASS>) { 297 chomp; 298 my ($username,$encpwd) = split /:/; 299 $sth->execute($username); 300 my @data = $sth->fetchrow_array; 301 if ($data[0] eq '0') { 302 my $sth2 = $ip_dbh->prepare("insert into users (username,password) values ('$username','$encpwd')"); 303 $sth2->execute; 304 print "$username added with read-only privs to ACL<br>\n"; 305 } 306 } 307 308 print "<hr>Users with access:\n<table border=1>\n"; 309 print "<tr><td>Username</td><td>Add new</td><td>Change</td>". 310 "<td>Delete</td><td>Admin user</td></tr>\n". 311 "<form action=admin.cgi method=POST>\n"; 312 $sth = $ip_dbh->prepare("select username,acl from users order by username"); 313 $sth->execute; 314 while (my @data = $sth->fetchrow_array) { 315 print "<form action=admin.cgi method=POST><input type=hidden name=action value=updacl>". 316 qq(<tr><td>$data[0]<input type=hidden name=username value="$data[0]"></td><td>). 317 # Now for the fun bit. We have to pull apart the ACL field and 318 # output a bunch of checkboxes. 319 "<input type=checkbox name=add".($data[1] =~ /a/ ? ' checked=y' : ''). 320 "></td><td><input type=checkbox name=change".($data[1] =~ /c/ ? ' checked=y' : ''). 321 "></td><td><input type=checkbox name=del".($data[1] =~ /d/ ? ' checked=y' : ''). 322 "></td><td><input type=checkbox name=admin".($data[1] =~ /A/ ? ' checked=y' : ''). 323 qq(></td><td><input type=submit value="Update"></td></tr></form>\n); 324 325 } 326 print "</table>\n"; 327 } elsif ($webvar{action} eq 'updacl') { 328 print "Updating ACL for $webvar{username}:<br>\n"; 329 my $acl = 'b'; 330 if ($webvar{admin} eq 'on') { 331 $acl .= "acdA"; 332 } else { 333 $acl .= ($webvar{add} eq 'on' ? 'a' : ''). 334 ($webvar{change} eq 'on' ? 'c' : ''). 335 ($webvar{del} eq 'on' ? 'd' : ''); 336 } 337 print "New ACL: $acl<br>\n"; 338 339 $sth = $ip_dbh->prepare("update users set acl='$acl' where username='$webvar{username}'"); 340 $sth->execute; 341 print "OK\n" if !$sth->err; 342 343 print qq(<hr><a href="admin.cgi?action=showACL">Back</a> to ACL listing\n); 344 345 } elsif ($webvar{action} ne '<NULL>') { 346 print "webvar{action} check failed: Don't know how to $webvar{action}"; 288 347 } 289 348 -
branches/stable/cgi-bin/ipdb.psql
r192 r242 182 182 pr Dynamic-route DSL netblock Dynamic-route DSL 203 183 183 \. 184 185 186 -- 187 -- User data table - required for proper ACLs 188 -- 189 190 CREATE TABLE "users" ( 191 "username" varchar(16) NOT NULL PRIMARY KEY, 192 "password" varchar(16) DEFAULT '', 193 "acl" varchar(16) DEFAULT 'b' 194 ); -
branches/stable/cgi-bin/main.cgi
r224 r242 23 23 openlog "IPDB","pid","local2"; 24 24 25 # Collect the username from HTTP auth. If undefined, we're in a test environment. 25 # Collect the username from HTTP auth. If undefined, we're in 26 # a test environment, or called without a username. 26 27 my $authuser; 27 28 if (!defined($ENV{'REMOTE_USER'})) { … … 40 41 ($ip_dbh,$errstr) = connectDB_My; 41 42 if (!$ip_dbh) { 42 printAndExit("Database error: $errstr\n");43 exitError("Database error: $errstr\n"); 43 44 } 44 45 initIPDBGlobals($ip_dbh); 46 47 # Headerize! Make sure we replace the $$EXTRA0$$ bit as needed. 48 printHeader('', ($IPDBacl{$authuser} =~ /a/ ? 49 '<a href="/ip/cgi-bin/main.cgi?action=assign">Add new assignment</a>' : '' 50 )); 51 45 52 46 53 #prototypes … … 65 72 if($webvar{action} eq 'index') { 66 73 showSummary(); 74 } elsif ($webvar{action} eq 'addmaster') { 75 if ($IPDBacl{$authuser} !~ /a/) { 76 printError("You shouldn't have been able to get here. Access denied."); 77 } else { 78 open HTML, "<../addmaster.html"; 79 print while <HTML>; 80 } 67 81 } elsif ($webvar{action} eq 'newmaster') { 68 printHeader(''); 69 70 my $cidr = new NetAddr::IP $webvar{cidr}; 71 72 print "<div type=heading align=center>Adding $cidr as master block....</div>\n"; 73 74 # Allow transactions, and raise an exception on errors so we can catch it later. 75 # Use local to make sure these get "reset" properly on exiting this block 76 local $ip_dbh->{AutoCommit} = 0; 77 local $ip_dbh->{RaiseError} = 1; 78 79 # Wrap the SQL in a transaction 80 eval { 81 $sth = $ip_dbh->prepare("insert into masterblocks values ('$webvar{cidr}')"); 82 $sth->execute; 82 83 if ($IPDBacl{$authuser} !~ /a/) { 84 printError("You shouldn't have been able to get here. Access denied."); 85 } else { 86 87 my $cidr = new NetAddr::IP $webvar{cidr}; 88 89 print "<div type=heading align=center>Adding $cidr as master block....</div>\n"; 90 91 # Allow transactions, and raise an exception on errors so we can catch it later. 92 # Use local to make sure these get "reset" properly on exiting this block 93 local $ip_dbh->{AutoCommit} = 0; 94 local $ip_dbh->{RaiseError} = 1; 95 96 # Wrap the SQL in a transaction 97 eval { 98 $sth = $ip_dbh->prepare("insert into masterblocks values ('$webvar{cidr}')"); 99 $sth->execute; 83 100 84 101 # Unrouted blocks aren't associated with a city (yet). We don't rely on this … … 86 103 # Thus the "routed" flag. 87 104 88 $sth = $ip_dbh->prepare("insert into freeblocks (cidr,maskbits,city,routed)".105 $sth = $ip_dbh->prepare("insert into freeblocks (cidr,maskbits,city,routed)". 89 106 " values ('$webvar{cidr}',".$cidr->masklen.",'<NULL>','n')"); 90 $sth->execute; 91 92 # If we get here, everything is happy. Commit changes. 93 $ip_dbh->commit; 94 }; # end eval 95 96 if ($@) { 97 carp "Transaction aborted because $@"; 98 eval { $ip_dbh->rollback; }; 99 syslog "err", "Could not add master block '$webvar{cidr}' to database: '$@'"; 100 printError("Could not add master block $webvar{cidr} to database: $@"); 101 } else { 102 print "<div type=heading align=center>Success!</div>\n"; 103 syslog "info", "$authuser added master block $webvar{cidr}"; 104 } 107 $sth->execute; 108 109 # If we get here, everything is happy. Commit changes. 110 $ip_dbh->commit; 111 }; # end eval 112 113 if ($@) { 114 carp "Transaction aborted because $@"; 115 eval { $ip_dbh->rollback; }; 116 syslog "err", "Could not add master block '$webvar{cidr}' to database: '$@'"; 117 printError("Could not add master block $webvar{cidr} to database: $@"); 118 } else { 119 print "<div type=heading align=center>Success!</div>\n"; 120 syslog "info", "$authuser added master block $webvar{cidr}"; 121 } 122 123 } # ACL check 105 124 106 125 } # end add new master … … 116 135 } 117 136 elsif($webvar{action} eq 'search') { 118 printHeader('');119 137 if (!$webvar{input}) { 120 138 # No search term. Display everything. … … 154 172 # which is not in any way guaranteed to provide anything useful. 155 173 else { 156 printHeader('');157 174 my $rnd = rand 500; 158 175 my $boing = sprintf("%.2f", rand 500); … … 172 189 print qq(<div align=right style="position: absolute; right: 30px;">). 173 190 qq(<a href="/ip/cgi-bin/admin.cgi">Admin tools</a></div><br>\n) 174 if $ authuser =~ /kdeugau|jodyh|jipp/;191 if $IPDBacl{$authuser} =~ /A/; 175 192 176 193 # We print the footer here, so we don't have to do it elsewhere. … … 393 410 # Initial display: Show master blocks with total allocated subnets, total free subnets 394 411 sub showSummary { 395 # this is horrible-ugly-bad and will Go Away real soon now(TM)396 print "Content-type: text/html\n\n";397 412 398 413 startTable('Master netblock', 'Routed netblocks', 'Allocated netblocks', … … 451 466 } 452 467 print "</table>\n"; 453 print qq(<a href="/ip/addmaster.shtml">Add new master block</a><br><br>\n); 468 if ($IPDBacl{$authuser} =~ /a/) { 469 print qq(<a href="/ip/cgi-bin/main.cgi?action=addmaster">Add new master block</a><br><br>\n); 470 } 454 471 print "Note: Free blocks noted here include both routed and unrouted blocks.\n"; 455 472 … … 463 480 # else should follow. YMMV.) 464 481 sub showMaster { 465 printHeader('');466 482 467 483 print qq(<center><div class="heading">Summarizing routed blocks for ). … … 539 555 print qq(<hr width="60%"><center><div class="heading">No allocations in ). 540 556 qq($master.</div>\n). 541 qq(<form action="/ip/cgi-bin/main.cgi" method=POST>\n). 542 qq(<input type=hidden name=action value="delete">\n). 543 qq(<input type=hidden name=block value="$master">\n). 544 qq(<input type=hidden name=alloctype value="mm">\n). 545 qq(<input type=submit value=" Remove this master ">\n). 546 qq(</form></center>\n); 557 ($IPDBacl{$authuser} =~ /d/ ? 558 qq(<form action="/ip/cgi-bin/main.cgi" method=POST>\n). 559 qq(<input type=hidden name=action value="delete">\n). 560 qq(<input type=hidden name=block value="$master">\n). 561 qq(<input type=hidden name=alloctype value="mm">\n). 562 qq(<input type=submit value=" Remove this master ">\n). 563 qq(</form></center>\n) : 564 ''); 547 565 548 566 } # end check for existence of routed blocks in master … … 578 596 # not have anything useful to spew. 579 597 sub showRBlock { 580 printHeader('');581 598 582 599 my $master = new NetAddr::IP $webvar{block}; … … 626 643 print qq(<hr width="60%"><center><div class="heading">No allocations in ). 627 644 qq($master.</div></center>\n). 628 qq(<form action="/ip/cgi-bin/main.cgi" method=POST>\n). 629 qq(<input type=hidden name=action value="delete">\n). 630 qq(<input type=hidden name=block value="$master">\n). 631 qq(<input type=hidden name=alloctype value="rm">\n). 632 qq(<input type=submit value=" Remove this block ">\n). 633 qq(</form>\n); 645 ($IPDBacl{$authuser} =~ /d/ ? 646 qq(<form action="/ip/cgi-bin/main.cgi" method=POST>\n). 647 qq(<input type=hidden name=action value="delete">\n). 648 qq(<input type=hidden name=block value="$master">\n). 649 qq(<input type=hidden name=alloctype value="rm">\n). 650 qq(<input type=submit value=" Remove this block ">\n). 651 qq(</form>\n) : 652 ''); 634 653 } 635 654 … … 650 669 # Include some HairyPerl(TM) to prefix subblocks with "Sub " 651 670 my @row = ((($data[1] ne 'y' && $data[1] ne 'n') ? 'Sub ' : ''). 652 qq(<a href="/ip/cgi-bin/main.cgi?action=assign&block=$cidr&fbtype=$data[1]">$cidr</a>),671 ($IPDBacl{$authuser} =~ /a/ ? qq(<a href="/ip/cgi-bin/main.cgi?action=assign&block=$cidr&fbtype=$data[1]">$cidr</a>) : $cidr), 653 672 $cidr->range); 654 673 printRow(\@row, 'color1') if ($count%2 == 0); … … 663 682 # List the IPs used in a pool 664 683 sub listPool { 665 printHeader('');666 684 667 685 my $cidr = new NetAddr::IP $webvar{pool}; … … 709 727 my @row = ( qq(<a href="/ip/cgi-bin/main.cgi?action=edit&block=$data[0]">$data[0]</a>), 710 728 $data[1],$data[2],$data[3], 711 ( ( $data[2] eq 'n') ?729 ( (($data[2] eq 'n') && ($IPDBacl{$authuser} =~ /d/)) ? 712 730 ("<a href=\"/ip/cgi-bin/main.cgi?action=delete&block=$data[0]&". 713 731 "alloctype=$data[4]\">Unassign this IP</a>") : … … 726 744 # be one of two templates, and the lists come from the database. 727 745 sub assignBlock { 728 printHeader(''); 746 747 if ($IPDBacl{$authuser} !~ /a/) { 748 printError("You shouldn't have been able to get here. Access denied."); 749 return; 750 } 729 751 730 752 my $html; … … 804 826 # Take info on requested IP assignment and see what we can provide. 805 827 sub confirmAssign { 806 printHeader(''); 828 if ($IPDBacl{$authuser} !~ /a/) { 829 printError("You shouldn't have been able to get here. Access denied."); 830 return; 831 } 807 832 808 833 my $cidr; … … 963 988 # Do the work of actually inserting a block in the database. 964 989 sub insertAssign { 990 if ($IPDBacl{$authuser} !~ /a/) { 991 printError("You shouldn't have been able to get here. Access denied."); 992 return; 993 } 965 994 # Some things are done more than once. 966 printHeader('');967 995 return if !validateInput(); 968 996 … … 1078 1106 # action=edit 1079 1107 sub edit { 1080 printHeader('');1081 1108 1082 1109 my $sql; … … 1098 1125 $data[2] =~ s/\s//; 1099 1126 1100 ##fixme LEGACY CODE1101 # Postfix "i" on pool IP types1102 if ($data[2] =~ /^[cdsmw]$/) {1103 $data[2] .= "i";1104 }1105 1106 1127 open (HTML, "../editDisplay.html") 1107 1128 or croak "Could not open editDisplay.html :$!"; … … 1114 1135 # Needs thinking. Have to allow changes to city to correct errors, no? 1115 1136 $html =~ s/\$\$BLOCK\$\$/$webvar{block}/g; 1116 $html =~ s/\$\$CITY\$\$/$data[3]/g; 1137 1138 if ($IPDBacl{$authuser} =~ /c/) { 1139 $html =~ s/\$\$CUSTID\$\$/<input type=text name=custid value="$data[1]" maxlength=15 class="regular">/; 1117 1140 1118 1141 # Screw it. Changing allocation types gets very ugly VERY quickly- especially … … 1123 1146 1124 1147 ##fixme The check here should be built from the database 1125 if ($data[2] =~ /^.[ne]$/) {1126 # Block that can be changed1127 my $blockoptions = "<select name=alloctype><option".1148 if ($data[2] =~ /^.[ne]$/) { 1149 # Block that can be changed 1150 my $blockoptions = "<select name=alloctype><option". 1128 1151 (($data[2] eq 'me') ? ' selected' : '') ." value='me'>Dialup netblock</option>\n<option". 1129 1152 (($data[2] eq 'de') ? ' selected' : '') ." value='de'>Dynamic DSL netblock</option>\n<option". … … 1134 1157 (($data[2] eq 'in') ? ' selected' : '') ." value='in'>Internal netblock</option>\n". 1135 1158 "</select>\n"; 1136 $html =~ s/\$\$TYPESELECT\$\$/$blockoptions/g; 1159 $html =~ s/\$\$TYPESELECT\$\$/$blockoptions/g; 1160 } else { 1161 $html =~ s/\$\$TYPESELECT\$\$/$disp_alloctypes{$data[2]}<input type=hidden name=alloctype value="$data[2]">/g; 1162 } 1163 $html =~ s/\$\$CITY\$\$/<input type=text name=city value="$data[3]">/g; 1164 $html =~ s/\$\$CIRCID\$\$/<input type="text" name="circid" value="$data[4]" maxlength=64 size=64 class="regular">/g; 1165 $html =~ s/\$\$DESC\$\$/<input type="text" name="desc" value="$data[5]" maxlength=64 size=64 class="regular">/g; 1166 $html =~ s|\$\$NOTES\$\$|<textarea rows="8" cols="64" name="notes" class="regular">$data[6]</textarea>|g; 1137 1167 } else { 1138 $html =~ s/\$\$TYPESELECT\$\$/$disp_alloctypes{$data[2]}<input type=hidden name=alloctype value="$data[2]">/g; 1139 } 1140 1141 # These can be modified, although CustID changes may get ignored. 1142 $html =~ s/\$\$CUSTID\$\$/$data[1]/g; 1143 $html =~ s/\$\$TYPE\$\$/$data[2]/g; 1144 $html =~ s/\$\$CIRCID\$\$/$data[4]/g; 1145 $html =~ s/\$\$DESC\$\$/$data[5]/g; 1146 $html =~ s/\$\$NOTES\$\$/$data[6]/g; 1168 $html =~ s/\$\$CUSTID\$\$/$data[1]/g; 1169 $html =~ s/\$\$TYPESELECT\$\$/$disp_alloctypes{$data[2]}/g; 1170 $html =~ s/\$\$CITY\$\$/$data[3]/g; 1171 $html =~ s/\$\$CIRCID\$\$/$data[4]/g; 1172 $html =~ s/\$\$DESC\$\$/$data[5]/g; 1173 $html =~ s/\$\$NOTES\$\$/$data[6]/g; 1174 } 1175 1176 # More ACL trickery - we can live with forms that don't submit, 1177 # but we can't leave the extra table rows there, and we *really* 1178 # can't leave the submit buttons there. 1179 my $updok = ''; 1180 my $i=2; 1181 if ($IPDBacl{$authuser} =~ /c/) { 1182 $updok = qq(<tr class="color$i"><td colspan=2 class=regular><div class="center">). 1183 qq(<input type="submit" value=" Update this block " class="regular">). 1184 "</div></td></tr></form>\n"; 1185 $i--; 1186 } 1187 $html =~ s/\$\$UPDOK\$\$/$updok/g; 1188 1189 my $delok = ''; 1190 if ($IPDBacl{$authuser} =~ /d/) { 1191 $delok = qq(<form method="POST" action="main.cgi"> 1192 <tr class="color$i"><td colspan=2 class="regular"><div class=center> 1193 <input type="hidden" name="action" value="delete"> 1194 <input type="hidden" name="block" value="$webvar{block}"> 1195 <input type="hidden" name="alloctype" value="$data[2]"> 1196 <input type=submit value=" Delete this block "> 1197 </div></td></tr>); 1198 } 1199 $html =~ s/\$\$DELOK\$\$/$delok/; 1147 1200 1148 1201 print $html; … … 1154 1207 # action=update 1155 1208 sub update { 1156 printHeader('');1157 1209 1158 1210 # Make sure incoming data is in correct format - custID among other things. … … 1213 1265 # Delete an allocation. 1214 1266 sub remove { 1215 printHeader(''); 1267 if ($IPDBacl{$authuser} !~ /d/) { 1268 printError("You shouldn't have been able to get here. Access denied."); 1269 return; 1270 } 1271 1216 1272 #show confirm screen. 1217 1273 open HTML, "../confirmRemove.html" … … 1303 1359 # Remove IPs from pool listing if necessary 1304 1360 sub finalDelete { 1305 printHeader(''); 1361 if ($IPDBacl{$authuser} !~ /d/) { 1362 printError("You shouldn't have been able to get here. Access denied."); 1363 return; 1364 } 1306 1365 1307 1366 my ($code,$msg) = deleteBlock($ip_dbh, $webvar{block}, $webvar{alloctype}); … … 1326 1385 1327 1386 1387 sub exitError { 1388 my $errStr = $_[0]; 1389 printHeader('',''); 1390 print qq(<center><p class="regular"> $errStr </p> 1391 <input type="button" value="Back" onclick="history.go(-1)"> 1392 </center> 1393 ); 1394 printFooter(); 1395 exit; 1396 } # errorExit 1397 1398 1328 1399 # Just in case we manage to get here. 1329 1400 exit 0; -
branches/stable/editDisplay.html
r75 r242 8 8 <tr class="color1"><td class=heading>IP block:</td><td class="regular">$$BLOCK$$</td></tr> 9 9 10 <tr class="color2"><td class=heading>City:</td><td class="regular"> 11 <input type=text name=city value="$$CITY$$"></td></tr> 10 <tr class="color2"><td class=heading>City:</td><td class="regular">$$CITY$$</td></tr> 12 11 13 12 <tr class="color1"><td class=heading>Type:</td><td class=regular>$$TYPESELECT$$</td></tr> 14 13 15 <tr class="color2"><td class=heading>CustID:</td><td class="regular"> 16 <input type=text name=custid value="$$CUSTID$$" maxlength=15 class="regular"></td></tr> 14 <tr class="color2"><td class=heading>CustID:</td><td class="regular">$$CUSTID$$</td></tr> 17 15 18 <tr class="color1"><td class="heading">Circuit ID:</td><td class="regular"> 19 <input type="text" name="circid" value="$$CIRCID$$" maxlength=64 size=64 class="regular"></td></tr> 16 <tr class="color1"><td class="heading">Circuit ID:</td><td class="regular">$$CIRCID$$</td></tr> 20 17 21 <tr class="color2"><td class="heading">Description/Name:</td><td class="regular"> 22 <input type="text" name="desc" value="$$DESC$$" maxlength=64 size=64 class="regular"></td></tr> 18 <tr class="color2"><td class="heading">Description/Name:</td><td class="regular">$$DESC$$</td></tr> 23 19 24 <tr class="color1"><td class="heading" valign="top">Notes:</td><td class="regular"> 25 <textarea rows="8" cols="64" name="notes" class="regular">$$NOTES$$</textarea></td></tr> 20 <tr class="color1"><td class="heading" valign="top">Notes:</td><td class="regular">$$NOTES$$</td></tr> 26 21 27 <tr class="color2"><td colspan=2 class=regular><div class="center"> 28 <input type="submit" value=" Update this block " class="regular"> 29 </div></td></tr></form> 30 <form method="POST" action="main.cgi"> 31 <tr class="color1"><td colspan=2 class="regular"><div class=center> 32 <input type="hidden" name="action" value="delete"> 33 <input type="hidden" name="block" value="$$BLOCK$$"> 34 <input type="hidden" name="alloctype" value="$$TYPE$$"> 35 <input type=submit value=" Delete this block "> 36 </div></td></tr> 22 $$UPDOK$$ 23 $$DELOK$$ 37 24 </form> 38 25 -
branches/stable/header.inc
r85 r242 1 1 <html> 2 2 <head> 3 <title> [IP Database v2]</title>3 <title>MERGE [IP Database v2] MERGE</title> 4 4 <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> 5 5 <link rel="stylesheet" type="text/css" href="/ip/ipdb.css"> … … 21 21 22 22 </head> 23 <body bgcolor="# ffffff" text="#000000" link="#000000" vlink="#000000" alink="#ff0000" leftmargin="0" topmargin="0" marginwidth="0" style="font-family: helvetica">23 <body bgcolor="#9999ff" text="#000000" link="#000000" vlink="#000000" alink="#ff0000" leftmargin="0" topmargin="0" marginwidth="0" style="font-family: helvetica"> 24 24 25 25 <table width="98%" border="0" cellspacing="0" cellpadding="0" height="0"> … … 29 29 <div align="right"><b><font face="Verdana, Arial, Helvetica, sans-serif" size="2"> 30 30 <a href="/ip/index.shtml"> 31 [IP Database v2 Home]</a></font></b></div>31 MERGE [IP Database v2 Home] MERGE</a></font></b></div> 32 32 </td> 33 33 </tr> … … 51 51 <input type="button" value=" Help? " onclick="openHelp()" class="regular"> 52 52 53 <a href="/ip/cgi-bin/main.cgi?action=assign">Add new assignment</a> 53 $$EXTRA0$$ 54 54 </td> 55 55 </form> -
branches/stable/index.shtml
r125 r242 1 <!--#include file="header.inc"-->2 1 <!--#include virtual="/ip/cgi-bin/main.cgi?action=index" -->
Note:
See TracChangeset
for help on using the changeset viewer.