<section> <header> <h4>Bem-vindo, <?php echo "" . nameCheck($email) . ""; ?> </h4> </header> <div class="row"> <div class="6u 12u$(medium)"> <br/> <h5>Instituição</h5> <ul class="alt"> <li> <a href="instituteaccount.php"> <?php $name = nameCheck($email); $inst = instCheck($name, $email); echo "{$inst}"; ?> </a></li> <li><a href="#">Instituição 2.</a></li> <li><a href="#">Instituição 3.</a></li> </ul> </div> </div> </section> </div> </section> </article>
function ajax_getOutput($factor, $name, $ip) { $vpn_ip = substr($ip, 0, -3); $network_name = strtoupper($name); $vpn_parts = explode(".", $vpn_ip); $vpn_short = substr($vpn_ip, 0, -1); $cli_output = ''; if ($factor == 'remove') { $factor = 'single'; $network = explode(' ', $ip); $name = $network[0]; $ip = $network[1]; if (substr($ip, 0, 2) == '10') { $ip = substr($ip, 0, -3); if (substr($ip, 3, 2) == '11') { $factor = 'two'; } } $vpn_parts = explode(".", $ip); $vpn_short = substr($vpn_ip, 0, -1); if ($factor == 'single') { $cli_output = "no access-list VPN:Outside:810_nat0_outbound extended permit ip object-group " . $name . "-VPN object-group GLOBAL-NONAT\n" . "no access-list " . $name . "-NAT extended permit ip object-group " . $name . "-VPN any\n" . "no nat (VPN:Outside:810,VPN:Inside:811) source static " . $name . "-VPN " . $name . "-VPN destination static GLOBAL-NONAT GLOBAL-NONAT no-proxy-arp route-lookup\n" . "no nat (VPN:Outside:810,VPN:Inside:811) source dynamic " . $name . "-VPN obj-128.103.224." . $vpn_parts[2] . "\n" . "no ip local pool " . $name . " " . $vpn_short . "1-" . $vpn_short . "127 mask 255.255.255.0\n" . "no group-policy " . $name . " attributes\n" . "no group-policy " . $name . " internal\n" . "no object-group network " . $name . "-VPN\n" . "-------------------------------------------------------------\n" . "PLEASE REMEMBER:\n" . "Notify netmanager@harvard.edu and/or systems@harvard.edu\n" . "Cleanup ACL and Custdb"; } elseif ($factor == 'two') { $cli_output = "no access-list VPN:Outside:810_nat0_outbound extended permit ip object-group " . $name . "-VPN object-group GLOBAL-NONAT\n" . "no access-list " . $name . "-NAT extended permit ip object-group " . $name . "-VPN any\n" . "no nat (VPN:Outside:810,VPN:Inside:811) source static " . $name . "-VPN " . $name . "-VPN destination static GLOBAL-NONAT GLOBAL-NONAT no-proxy-arp route-lookup\n" . "no nat (VPN:Outside:810,VPN:Inside:811) source dynamic " . $name . "-VPN obj-128.103.150." . $vpn_parts[2] . "\n" . "no ip local pool " . $name . " " . $vpn_short . "1-" . $vpn_short . "127 mask 255.255.255.0\n" . "no group-policy " . $name . " attributes\n" . "no group-policy " . $name . " internal\n" . "no object-group network " . $name . "-VPN\n" . "-------------------------------------------------------------\n" . "PLEASE REMEMBER:\n" . "Notify netmanager@harvard.edu and/or systems@harvard.edu\n" . "Cleanup ACL and Custdb"; } } else { if (nameCheck($name, $factor) == '') { if ($factor == 'single') { $cli_output .= "object-group network " . $network_name . "-VPN\n" . "network-object " . $vpn_ip . " 255.255.255.0\n\n" . "object network obj-128.103.224." . $vpn_parts[2] . "\n" . "host 128.103.224." . $vpn_parts[2] . "\n\n" . "access-list VPN:Outside_810_nat0_outbound extended permit ip object-group " . $network_name . "-VPN object-group GLOBAL-NONAT\n" . "access-list " . $network_name . "-NAT extended permit ip object-group " . $network_name . "-VPN any\n" . "ip local pool " . $network_name . " " . $vpn_short . "1-" . $vpn_short . "127 mask 255.255.255.0\n" . "nat (VPN:Outside:810,VPN:Inside:811) source static " . $network_name . "-VPN " . $network_name . "-VPN destination static GLOBAL-NONAT GLOBAL-NONAT no-proxy-arp route-lookup\n" . "nat (VPN:Outside:810,VPN:Inside:811) source dynamic " . $network_name . "-VPN obj-128.103.224." . $vpn_parts[2] . "\n" . "group-policy " . $network_name . " internal\n" . "group-policy " . $network_name . " attributes\n" . "address-pools value " . $network_name . "\n\n\n-----------------------------------------------------------------------------------------------------------------------------------\n\n\n" . "object-group network " . $network_name . "-VPN\n" . "network-object " . $vpn_ip . " 255.255.255.0\n\n" . "object network obj-128.103.24." . $vpn_parts[2] . "\n" . "host 128.103.24." . $vpn_parts[2] . "\n\n" . "access-list NOC:970_nat0_outbound extended permit ip object-group " . $network_name . "-VPN object-group GLOBAL-NONAT\n" . "access-list " . $network_name . "-NAT extended permit ip object-group " . $network_name . "-VPN any\n" . "ip local pool " . $network_name . " " . $vpn_short . "129-" . $vpn_short . "255 mask 255.255.255.0\n" . "nat (NOC:970,NOC:374) source static " . $network_name . "-VPN " . $network_name . "-VPN destination static GLOBAL-NONAT GLOBAL-NONAT no-proxy-arp route-lookup\n" . "nat (NOC:970,NOC:374) source dynamic " . $network_name . "-VPN obj-128.103.24." . $vpn_parts[2] . "\n" . "group-policy " . $network_name . " internal\n" . "group-policy " . $network_name . " attributes\n" . "address-pools value " . $network_name . "\n\n"; } elseif ($factor == 'two') { $cli_output .= "object-group network " . $network_name . "-VPN\n" . "network-object " . $vpn_ip . " 255.255.255.0\n\n" . "object network obj-128.103.150." . $vpn_parts[2] . "\n" . "host 128.103.150." . $vpn_parts[2] . "\n\n" . "access-list VPN:Outside_810_nat0_outbound extended permit ip object-group " . $network_name . "-VPN object-group GLOBAL-NONAT\n" . "access-list " . $network_name . "-NAT extended permit ip object-group " . $network_name . "-VPN any\n" . "ip local pool " . $network_name . " " . $vpn_short . "1-" . $vpn_short . "127 mask 255.255.255.0\n" . "nat (VPN:Outside:810,VPN:Inside:811) source static " . $network_name . "-VPN " . $network_name . "-VPN destination static GLOBAL-NONAT GLOBAL-NONAT no-proxy-arp route-lookup\n" . "nat (VPN:Outside:810,VPN:Inside:811) source dynamic " . $network_name . "-VPN obj-128.103.150." . $vpn_parts[2] . "\n" . "group-policy " . $network_name . " internal\n" . "group-policy " . $network_name . " attributes\n" . "address-pools value " . $network_name . "\n\n\n-----------------------------------------------------------------------------------------------------------------------------------\n\n\n" . "object-group network " . $network_name . "-VPN\n" . "network-object " . $vpn_ip . " 255.255.255.0\n\n" . "object network obj-128.103.15." . $vpn_parts[2] . "\n" . "host 128.103.15." . $vpn_parts[2] . "\n\n" . "access-list NOC:970_nat0_outbound extended permit ip object-group " . $network_name . "-VPN object-group GLOBAL-NONAT\n" . "access-list " . $network_name . "-NAT extended permit ip object-group " . $network_name . "-VPN any\n" . "ip local pool " . $network_name . " " . $vpn_short . "129-" . $vpn_short . "255 mask 255.255.255.0\n" . "nat (NOC:970,NOC:374) source static " . $network_name . "-VPN " . $network_name . "-VPN destination static GLOBAL-NONAT GLOBAL-NONAT no-proxy-arp route-lookup\n" . "nat (NOC:970,NOC:374) source dynamic " . $network_name . "-VPN obj-128.103.15." . $vpn_parts[2] . "\n" . "group-policy " . $network_name . " internal\n" . "group-policy " . $network_name . " attributes\n" . "address-pools value " . $network_name . "\n\n"; } else { $cli_output .= "\n\n\nERROR\n\n\n"; } } else { $cli_output = nameCheck($name, $factor); } } echo json_encode(array($cli_output)); }