$ipcnt = countAllSlaveIPAddresses($_POST['subnetId']); print "<strong>" . _("Warning") . "</strong>: " . _("I will delete") . ":<ul>"; print "\t<li>{$foldercnt} " . _("folders") . "</li>"; if ($subnetcnt > 0) { print "\t<li>{$subnetcnt} " . _("subnets") . "</li>"; } if ($ipcnt > 0) { print "\t<li>{$ipcnt} " . _("IP addresses") . "</li>"; } print "</ul>"; print "<hr><div style='text-align:right'>"; print _("Are you sure you want to delete above items?") . " "; print "<div class='btn-group'>"; print "\t<a class='btn btn-sm btn-danger editFolderSubmitDelete' id='editFolderSubmitDelete' data-subnetId='" . $_POST['subnetId'] . "'>" . _("Confirm") . "</a>"; print "</div>"; print "</div>"; print "</div>"; } else { if (!modifySubnetDetails($_POST)) { print '<div class="alert alert alert-danger">' . _('Error adding new folder') . '!</div>'; } else { /* @mail functions ------------------- */ include_once '../../functions/functions-mail.php'; sendObjectUpdateMails("folder", $_POST['action'], $old, $new); if ($_POST['action'] == "delete") { print '<div class="alert alert-success">' . _('Folder, IP addresses and all belonging subnets deleted successfully') . '!</div>'; } else { print '<div class="alert alert-success">' . _("Folder {$_POST['action']} successfull") . '!</div>'; } } }
print "<div class='btn-group'>"; print "\t<a class='btn btn-sm btn-danger editIPSubmitDelete' id='editIPSubmitDelete'>" . _("Confirm") . "</a>"; print "</div>"; print "</div>"; print "</div>"; } else { # modify if (!modifyIpAddress($ip)) { print '<div class="alert alert-danger">' . _('Error inserting IP address') . '!</div>'; updateLogTable('Error ' . $ip['action'] . ' IP address ' . $ip['ip_addr'], 'Error ' . $ip['action'] . ' IP address ' . $ip['ip_addr'] . '<br>SubnetId: ' . $ip['subnetId'], 2); } else { //set arrays if ($ip['action'] == "add") { $old = array(); $new = $ip; } elseif ($ip['action'] == "delete") { $old = $ipold; $new = array(); } else { $old = $ipold; $new = $ip; } /* @mail functions ------------------- */ include_once '../../functions/functions-mail.php'; sendObjectUpdateMails("ip", $ip['action'], $old, $new); print '<div class="alert alert-success">' . _("IP {$ip['action']} successful") . '!</div>'; updateLogTable($ip['action'] . ' of IP address ' . $ip['ip_addr'] . ' succesfull!', $ip['action'] . ' of IP address ' . $ip['ip_addr'] . ' succesfull!<br>SubnetId: ' . $ip['subnetId'], 0); } } } }
getAllSlaves($_POST['subnetId'], false); $subcnt = sizeof(array_unique($removeSlaves)); $ipcnt = countAllSlaveIPAddresses($_POST['subnetId']); print "<strong>" . _("Warning") . "</strong>: " . _("I will delete") . ":<ul>"; print "\t<li>{$subcnt} " . _("subnets") . "</li>"; if ($ipcnt > 0) { print "\t<li>{$ipcnt} " . _("IP addresses") . "</li>"; } print "</ul>"; print "<hr><div style='text-align:right'>"; print _("Are you sure you want to delete above items?") . " "; print "<div class='btn-group'>"; print "\t<a class='btn btn-sm btn-danger editSubnetSubmitDelete' id='editSubnetSubmitDelete'>" . _("Confirm") . "</a>"; print "</div>"; print "</div>"; print "</div>"; } else { # failed if (!modifySubnetDetails($_POST)) { print '<div class="alert alert-danger">' . _('Error adding new subnet') . '!</div>'; } else { /* @mail functions ------------------- */ include_once '../../functions/functions-mail.php'; sendObjectUpdateMails("subnet", $_POST['action'], $old, $new); if ($_POST['action'] == "delete") { print '<div class="alert alert-success">' . _('Subnet, IP addresses and all belonging subnets deleted successfully') . '!</div>'; } else { print '<div class="alert alert-success">' . _("Subnet {$_POST['action']} successfull") . '!</div>'; } } }