struct callback_list *cbl;
struct map_download *download;
int redirect;
+ long download_enabled;
};
struct map_rect_priv {
struct attr persistent={attr_persistent};
struct attr *attrs[4];
+ if(!download->m->download_enabled)
+ {
+ dbg(0,"Tried downloading while it's not allowed\n");
+ return 0;
+ }
attrs[0]=&url;
persistent.u.num=1;
attrs[1]=&persistent;
{
struct map_download *download;
+ if(!m->download_enabled)
+ return NULL;
+
if (async == 2) {
download=m->download;
} else {
return 0;
}
+static int
+binmap_set_attr(struct map_priv *map, struct attr *attr)
+{
+ switch (attr->type) {
+ case attr_update:
+ map->download_enabled = attr->u.num;
+ return 1;
+ default:
+ return 0;
+ }
+
+}
+
static struct map_methods map_methods_binfile = {
projection_mg,
"utf-8",
binmap_search_get_item,
NULL,
binmap_get_attr,
+ binmap_set_attr,
};
static int
{
struct map_priv *m;
struct attr *data=attr_search(attrs, NULL, attr_data);
- struct attr *check_version,*map_pass,*flags,*url;
+ struct attr *check_version,*map_pass,*flags,*url,*download_enabled;
struct file_wordexp *wexp;
char **wexp_data;
if (! data)
url=attr_search(attrs, NULL, attr_url);
if (url)
m->url=g_strdup(url->u.str);
+ download_enabled = attr_search(attrs, NULL, attr_update);
+ if (download_enabled)
+ m->download_enabled=download_enabled->u.num;
+
if (!map_binfile_open(m) && !m->check_version && !m->url) {
map_binfile_destroy(m);
m=NULL;