Beispiel #1
0
    $ip_2 = new IP_Database($id);
    $ip_2->set_title($title);
    $ip_2->set_description($desc);
    $ip_2->set_location_id($location);
    $ip_2->set_owner_id($owner);
    $ip_2->set_assigned_to_id($assigned);
    if (isset($_POST['status'])) {
        if ($status != 'undefined') {
            $ip_2->set_status($status);
        }
    }
    if (isset($_POST['stub'])) {
        $stub = $_POST['stub'];
        $ip_2->set_stub($stub);
    }
    $ip_2->set_tags($tags);
    if (!$ip_2->update()) {
        return false;
    }
}
if (isset($_GET['stub'])) {
    $stub_id = explode("@", $_GET['stub']);
    $ip_db = new IP_Database($stub_id[1]);
    $ip_db->set_stub($stub_id[0]);
    $ip_manager = new Netblock();
    $ip_manager->set_IP($ip_db->get_address_int() . "/" . $ip_db->get_subnet_size(), $ip_db->get_family());
    if ($ip_db->update()) {
        if ($ip_db->is_stub() == 0) {
            if ($ip_manager->get_family() == 4) {
                if ($ip_db->get_subnet_size() != 32) {
                    echo "Split <select name='split'>";
Beispiel #2
0
         }
         if ($_POST['inh_owner'] == "on") {
             $host->set_owner_id($ip_info->get_owner_id());
         }
         if ($_POST['inh_assigned'] == "on") {
             $host->set_assigned_to_id($ip_info->get_assigned_to_id());
         }
         if ($_POST['inh_status'] == "on") {
             if ($ip_info->get_status() == 'PARENT') {
                 $host->set_status('FREE');
             } else {
                 $host->set_status($ip_info->get_status());
             }
         }
         if ($_POST['inh_tags'] == "on") {
             $host->set_tags($ip_info->get_tags());
         }
         //if insert fails, show why
         if (!$host->insert("host")) {
             echo Form::error("CANNOT ADD HOST! Details: " . $host->get_error());
         } else {
             //update status to parent
             $ip_info->set_status("PARENT");
             $ip_info->update();
         }
     } else {
         //if all checks fail, show that.
         echo Form::warning("INVALID HOST");
     }
 } else {
     //if checks fail, show that