0001-tiles-url-can-be-specified-in-SP-params.patch
usr/local/univnautes/sp/sp/pfconfigxml.py | ||
---|---|---|
113 | 113 |
cps.sort(cps, key=itemgetter('name')) |
114 | 114 |
return cps |
115 | 115 | |
116 |
def get_tilesurl(): |
|
117 |
sp = root().find('univnautes/sp') |
|
118 |
tilesurl = sp.find('tilesurl') |
|
119 |
if tilesurl is not None: |
|
120 |
tilesurl = tilesurl.text |
|
121 |
return tilesurl |
|
122 | ||
116 | 123 |
def get_sp(): |
117 | 124 |
sp = root().find('univnautes/sp') |
118 | 125 |
if sp is None: |
usr/local/univnautes/sp/sp/views.py | ||
---|---|---|
24 | 24 |
from django.shortcuts import redirect |
25 | 25 |
import subprocess |
26 | 26 | |
27 |
from .pfconfigxml import get_tilesurl |
|
28 | ||
27 | 29 | |
28 | 30 |
class Homepage(TemplateView): |
29 | 31 |
'''Homepage View, displays a welcome message''' |
... | ... | |
32 | 34 | |
33 | 35 | |
34 | 36 |
def proxymap(request, z, x, y): |
35 |
url = settings.PROXYMAP_URL % { 'z': int(z), 'x': int(x), 'y': int(y) } |
|
37 |
tiles_url = get_tilesurl() or settings.PROXYMAP_URL |
|
38 |
url = tiles_url % { 'z': int(z), 'x': int(x), 'y': int(y) } |
|
36 | 39 |
downstream_request = urllib2.Request(url) |
37 | 40 |
page = urllib2.urlopen(downstream_request) |
38 | 41 |
return HttpResponse(page, page.info().getheader('Content-Type')) |
usr/local/www/services_captiveportal_saml_sp.php | ||
---|---|---|
63 | 63 |
$pconfig['defaultidps'] = base64_decode($a_sp['defaultidps']); |
64 | 64 |
$pconfig['geolocations'] = base64_decode($a_sp['geolocations']); |
65 | 65 |
$pconfig['geoinitialbounds'] = $a_sp['geoinitialbounds']; |
66 |
$pconfig['tilesurl'] = $a_sp['tilesurl']; |
|
66 | 67 | |
67 | 68 |
$pgtitle = array(gettext("Services"),gettext("Captive portal"), "SAML 2.0 Service provider"); |
68 | 69 |
$shortcut_section = "captiveportal"; |
... | ... | |
89 | 90 |
$a_sp['defaultidps'] = base64_encode($pconfig['defaultidps']); |
90 | 91 |
$a_sp['geolocations'] = base64_encode($pconfig['geolocations']); |
91 | 92 |
$a_sp['geoinitialbounds'] = $pconfig['geoinitialbounds']; |
93 |
$a_sp['tilesurl'] = $pconfig['tilesurl']; |
|
92 | 94 |
/* write config.xml */ |
93 | 95 |
write_config(); |
94 | 96 | |
... | ... | |
189 | 191 |
<?=gettext("Format : [[left,top],[right,bottom]]. Example: [[41.1,-5.53],[51.5,9.91]]"); ?> |
190 | 192 |
</td> |
191 | 193 |
</tr> |
192 | ||
194 |
<tr> |
|
195 |
<td valign="top" class="vncell"><?=gettext("Tiles url"); ?> </td> |
|
196 |
<td class="vtable"> |
|
197 |
<input name="tilesurl" type="text" class="formfld url" id="tilesurl" size="60" value="<?=htmlspecialchars($pconfig['tilesurl']);?>"><br> |
|
198 |
<?php printf(gettext("URL like "));?>: <i>http://maps.yourdomain.org//map/%(z)d/%(x)d/%(y)d.png</i> |
|
199 |
</td> |
|
200 |
</tr> |
|
193 | 201 |
<tr> |
194 | 202 |
<td width="22%" valign="top"> </td> |
195 | 203 |
<td width="78%"> |
196 |
- |