forked from 0x2620/pandora
move sendReferrer into site, fixes #2505
This commit is contained in:
parent
5a57af8dd1
commit
dd2fca85a4
6 changed files with 7 additions and 5 deletions
|
@ -62,6 +62,8 @@ def load_config():
|
||||||
config['site']['dontValidateUser'] = not settings.AUTH_CHECK_USERNAME
|
config['site']['dontValidateUser'] = not settings.AUTH_CHECK_USERNAME
|
||||||
if not 'folderdepth' in config['site']:
|
if not 'folderdepth' in config['site']:
|
||||||
config['site']['folderdepth'] = settings.USE_IMDB and 4 or 3
|
config['site']['folderdepth'] = settings.USE_IMDB and 4 or 3
|
||||||
|
if 'sendReferrer' in config and not 'sendReferrer' in config['site']:
|
||||||
|
config['site']['sendReferrer'] = config.pop('sendReferrer')
|
||||||
|
|
||||||
# enable default filters if needed
|
# enable default filters if needed
|
||||||
default_filters = [f['id'] for f in config['user']['ui']['filters']]
|
default_filters = [f['id'] for f in config['user']['ui']['filters']]
|
||||||
|
|
|
@ -55,7 +55,7 @@ def redirect_url(request, url):
|
||||||
if request.META['QUERY_STRING']:
|
if request.META['QUERY_STRING']:
|
||||||
url += "?" + request.META['QUERY_STRING']
|
url += "?" + request.META['QUERY_STRING']
|
||||||
|
|
||||||
if settings.CONFIG.get('sendReferrer', False):
|
if settings.CONFIG['site'].get('sendReferrer', False):
|
||||||
return redirect(url)
|
return redirect(url)
|
||||||
else:
|
else:
|
||||||
return HttpResponse('<script>document.location.href=%s;</script>'%json.dumps(url))
|
return HttpResponse('<script>document.location.href=%s;</script>'%json.dumps(url))
|
||||||
|
|
|
@ -704,7 +704,6 @@
|
||||||
{"name": "Restricted", "color": [255, 192, 128]},
|
{"name": "Restricted", "color": [255, 192, 128]},
|
||||||
{"name": "Private", "color": [255, 128, 128]}
|
{"name": "Private", "color": [255, 128, 128]}
|
||||||
],
|
],
|
||||||
"sendReferrer": false,
|
|
||||||
"site": {
|
"site": {
|
||||||
"description": "0xDB is an experimental - and to some degree imaginary - movie database. It is intended to help us rethink the future of cinema on the Internet, just as it tries to push the boundaries of what we understand as \"web applications\". What 0xDB proposes is an entirely new approach to visualizing and navigating moving images, and we hope that it can serve as a point of reference for individuals and institutions who are dealing with large collections of films.",
|
"description": "0xDB is an experimental - and to some degree imaginary - movie database. It is intended to help us rethink the future of cinema on the Internet, just as it tries to push the boundaries of what we understand as \"web applications\". What 0xDB proposes is an entirely new approach to visualizing and navigating moving images, and we hope that it can serve as a point of reference for individuals and institutions who are dealing with large collections of films.",
|
||||||
// FIXME: "from" and "to" would be more intuitive as keys here
|
// FIXME: "from" and "to" would be more intuitive as keys here
|
||||||
|
@ -719,6 +718,7 @@
|
||||||
"https": true,
|
"https": true,
|
||||||
"id": "0xdb",
|
"id": "0xdb",
|
||||||
"name": "0xDB",
|
"name": "0xDB",
|
||||||
|
"sendReferrer": false,
|
||||||
"url": "0xDB.org",
|
"url": "0xDB.org",
|
||||||
"videoprefix": ""
|
"videoprefix": ""
|
||||||
},
|
},
|
||||||
|
|
|
@ -717,7 +717,6 @@
|
||||||
{"name": "Under Copyright", "color": [255, 212, 128]},
|
{"name": "Under Copyright", "color": [255, 212, 128]},
|
||||||
{"name": "Private", "color": [255, 128, 128]}
|
{"name": "Private", "color": [255, 128, 128]}
|
||||||
],
|
],
|
||||||
"sendReferrer": true,
|
|
||||||
"site": {
|
"site": {
|
||||||
"description": "Indiancine.ma is an annotated online archive of Indian film. It is intended to serve as a shared resource for film scholars and enthusiasts in India and beyond.",
|
"description": "Indiancine.ma is an annotated online archive of Indian film. It is intended to serve as a shared resource for film scholars and enthusiasts in India and beyond.",
|
||||||
// FIXME: "from" and "to" would be more intuitive as keys here
|
// FIXME: "from" and "to" would be more intuitive as keys here
|
||||||
|
@ -733,6 +732,7 @@
|
||||||
"https": true,
|
"https": true,
|
||||||
"id": "indiancinema",
|
"id": "indiancinema",
|
||||||
"name": "Indiancine.ma",
|
"name": "Indiancine.ma",
|
||||||
|
"sendReferrer": true,
|
||||||
"url": "indiancine.ma",
|
"url": "indiancine.ma",
|
||||||
"videoprefix": ""
|
"videoprefix": ""
|
||||||
},
|
},
|
||||||
|
|
|
@ -601,7 +601,6 @@
|
||||||
{"name": "Restricted", "color": [255, 192, 128]},
|
{"name": "Restricted", "color": [255, 192, 128]},
|
||||||
{"name": "Private", "color": [255, 128, 128]}
|
{"name": "Private", "color": [255, 128, 128]}
|
||||||
],
|
],
|
||||||
"sendReferrer": true,
|
|
||||||
"site": {
|
"site": {
|
||||||
"description": "Pad.ma is an online archive of densely text-annotated video material, primarily footage and not finished films. The entire collection is searchable and viewable online, and is free to download for non-commercial use.",
|
"description": "Pad.ma is an online archive of densely text-annotated video material, primarily footage and not finished films. The entire collection is searchable and viewable online, and is free to download for non-commercial use.",
|
||||||
"email": {
|
"email": {
|
||||||
|
@ -615,6 +614,7 @@
|
||||||
"https": true,
|
"https": true,
|
||||||
"id": "padma",
|
"id": "padma",
|
||||||
"name": "Pad.ma",
|
"name": "Pad.ma",
|
||||||
|
"sendReferrer": true,
|
||||||
"url": "pad.ma",
|
"url": "pad.ma",
|
||||||
"videoprefix": ""
|
"videoprefix": ""
|
||||||
},
|
},
|
||||||
|
|
|
@ -516,7 +516,6 @@
|
||||||
{"name": "Restricted", "color": [255, 192, 128]},
|
{"name": "Restricted", "color": [255, 192, 128]},
|
||||||
{"name": "Private", "color": [255, 128, 128]}
|
{"name": "Private", "color": [255, 128, 128]}
|
||||||
],
|
],
|
||||||
"sendReferrer": true,
|
|
||||||
"site": {
|
"site": {
|
||||||
"description": "This is a demo of pan.do/ra - a free, open source media archive. It allows you to manage large, decentralized collections of video, to collaboratively create metadata and time-based annotations, and to serve your archive as a cutting-edge web application.",
|
"description": "This is a demo of pan.do/ra - a free, open source media archive. It allows you to manage large, decentralized collections of video, to collaboratively create metadata and time-based annotations, and to serve your archive as a cutting-edge web application.",
|
||||||
"email": {
|
"email": {
|
||||||
|
@ -530,6 +529,7 @@
|
||||||
"https": false,
|
"https": false,
|
||||||
"id": "pandora",
|
"id": "pandora",
|
||||||
"name": "Demo",
|
"name": "Demo",
|
||||||
|
"sendReferrer": true,
|
||||||
"url": "pandora.local",
|
"url": "pandora.local",
|
||||||
"videoprefix": ""
|
"videoprefix": ""
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in a new issue