Beispiel #1
0
    Session::update_user_light($conn, AV_DEFAULT_ADMIN, 'pass', $fullname, $email, $company, '', 'en_GB', 0, 1, $local_tz);
    if ($company != '') {
        Session::update_default_entity_name($conn, $company);
    }
    Session::change_pass($conn, AV_DEFAULT_ADMIN, $pass);
    // Insert new location
    if ($location != '' && $lat != '' && $lng != '') {
        $default_ctx_id = str_replace('-', '', strtoupper($conf->get_conf('default_context_id')));
        if (empty($default_ctx_id)) {
            $default_ctx = '00000000000000000000000000000000';
        }
        $location_name = $company != '' ? $company . ' ' . _('Location') : $title . ' ' . _('Location');
        $new_location_id = Locations::insert($conn, $default_ctx_id, $location_name, '', $location, $lat, $lng, $country);
        $sensors = Av_sensor::get_basic_list($conn);
        foreach ($sensors as $sensor) {
            Locations::insert_related_sensor($conn, $new_location_id, $sensor['id']);
        }
    }
    // Save Track Usage Information
    if ($track_usage_information == 1) {
        $tui_status = $track_usage_information > 0 ? 1 : 0;
        $config = new Config();
        $config->update('track_usage_information', $tui_status);
        $client = new Alienvault_client();
        $tui_status = $track_usage_information > 0 ? TRUE : FALSE;
        $client->system()->set_telemetry($tui_status);
    }
    $config->update('first_login', 'no');
    $db->close();
    $default_user = AV_DEFAULT_ADMIN;
}
Beispiel #2
0
    $new_id = Util::uuid();
    try {
        $new = new Av_Sensor($new_id);
        $new->set_properties(array('version' => '', 'has_nagios' => 0, 'has_ntop' => 1, 'has_vuln_scanner' => 1, 'has_kismet' => 0));
        $new->set_name($sname);
        $new->set_ip($ip);
        $new->set_priority($priority);
        $new->set_port($port);
        $new->set_tzone($tzone);
        $new->set_descr($descr);
        foreach ($entities as $ctx) {
            $new->add_new_ctx($ctx, $ctx);
        }
        $new->save_in_db($conn);
        if ($location != '') {
            Locations::insert_related_sensor($conn, $location, $new_id);
        }
    } catch (Exception $e) {
        $config_nt = array('content' => $e->getMessage(), 'options' => array('type' => 'nf_error', 'cancel_button' => false), 'style' => 'width: 80%; margin: 20px auto; text-align:center;');
        $nt = new Notification('nt_1', $config_nt);
        $nt->show();
        $db->close();
        exit;
    }
    $db->close();
    unset($_SESSION['_sensor_list']);
}
?>
    
    <script type='text/javascript'>
        if (!top.is_lightbox_loaded(window.name))
        die(ossim_error());
    }
    if ($locations_list = Locations::get_list($conn, " AND id = UNHEX('{$locations_id}')")) {
        $location = $locations_list[0];
        $ctx = $location->get_ctx();
        $name = $location->get_name();
        $desc = $location->get_desc();
        $latitude = str_replace(',', '.', floatval($location->get_lat()));
        $longitude = str_replace(',', '.', floatval($location->get_lon()));
        $zoom = 4;
        $cou = strtolower($location->get_country());
        $location = $location->get_location();
    }
    // Insert related sensor
    if ($sensor_id != '') {
        Locations::insert_related_sensor($conn, $locations_id, $sensor_id);
        Util::memcacheFlush();
    }
    // Delete related sensor
    if ($delete_id != '') {
        Locations::delete_related_sensor($conn, $locations_id, $delete_id);
        Util::memcacheFlush();
    }
}
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
	<title> <?php 
echo _("OSSIM Framework");