Beispiel #1
0
function insert_engine($conn, $data)
{
    $server = $data['server'];
    $name = $data['name'];
    ossim_valid($server, OSS_HEX, 'illegal:' . _('Engine ID'));
    ossim_valid($name, OSS_ALPHA, OSS_PUNC_EXT, 'illegal:' . _('Engine Name'));
    if (ossim_error()) {
        $info_error = _('Error') . ': ' . ossim_get_error();
        ossim_clean_error();
        $return['error'] = TRUE;
        $return['msg'] = $info_error;
        return $return;
    }
    $id = Acl::insert_entities($conn, 'engine', 'admin', $name, '', array(), array(), array(), '', '', $server);
    Alarm::clone_taxonomy($conn, $id);
    $id = Util::uuid_format($id);
    if (!is_dir(_MAIN_PATH . "/{$id}")) {
        Directive_editor::init_engine($id);
    }
    Web_indicator::set_on('Reload_servers');
    $return['error'] = FALSE;
    $return['data'] = '';
    return $return;
}