$SIP = ""; $access_proto = ""; $access_port = ""; $RIJK = ""; $exec_result = ''; if (isset($_POST['submit'])) { $AIP = sanitize_ip($_POST['AIP']); $protocol = sanitize_protocol($_POST['protocol']); $port = sanitize_port($_POST['port']); $SIP = sanitize_ip($_POST['SIP']); $access_proto = sanitize_protocol($_POST['access_proto']); $access_port = sanitize_port($_POST['access_port']); $RIJK = sanitize_key($_POST['RIJK']); if ($resp->is_valid) { //captcha done if (all_set($_POST) == true) { //all inputs are set if (validate_all($_POST) == true) { //all inputs in valid form $res = execute($AIP, $SIP, $protocol, $port, $access_proto, $access_port, $RIJK); //All good, execute on inputs if ($res == true) { $exec_result = '<div class="msg" style="font-size:small"><br/>The SPA packet was sent successfully!</div>'; } else { $exec_result = '<div class="msg" style="font-size:small"><br/>Error: An error occurred during the execution.</div>'; } } else { //invalid input $exec_result = '<div class="msg" style="color:red"><br/>Error: One or more input fields contain invalid characters.</div>'; } } else {
public function getEntities($x, $y) { $entities = array(); foreach ($this->entities as $entity) { if (!all_set($entity, "x", "y")) { continue; } if ($entity->x == $x && $entity->y == $y) { $entities[] = $entity; } } return $entities; }