Skip to content

Commit ceffe64

Browse files
committed
Allow to add external guest links
Signed-off-by: Julius Härtl <[email protected]>
1 parent 8cbe613 commit ceffe64

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

js/admin.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,9 @@
167167
_.each(this._sites.models, function(site) {
168168
var $el = $(self._renderSite(site.attributes));
169169
self._attachEvents($el);
170+
if (site.attributes.type === 'guest') {
171+
$el.find('.site-redirect-box').hide();
172+
}
170173
self.$list.append($el);
171174
});
172175
},
@@ -232,6 +235,11 @@
232235

233236
$site.removeClass('failure saved').addClass('saving');
234237
$site.find('.invalid-value').removeClass('invalid-value');
238+
if (data.type === 'guest') {
239+
$site.find('.site-redirect-box').hide();
240+
} else {
241+
$site.find('.site-redirect-box').show();
242+
}
235243

236244
if (!_.isUndefined(site)) {
237245
site.save(data, {

lib/SitesManager.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,10 @@ public function addSite($name, $url, $lang, $type, $device, $icon, array $groups
260260
throw new IconNotFoundException();
261261
}
262262

263+
if ($type === self::TYPE_LOGIN) {
264+
$redirect = true;
265+
}
266+
263267
$sites = $this->getSites();
264268
$sites[$id] = [
265269
'id' => $id,
@@ -349,6 +353,10 @@ public function updateSite($id, $name, $url, $lang, $type, $device, $icon, array
349353
throw new IconNotFoundException();
350354
}
351355

356+
if ($type === self::TYPE_LOGIN) {
357+
$redirect = true;
358+
}
359+
352360
$sites[$id] = [
353361
'id' => $id,
354362
'name' => $name,

0 commit comments

Comments
 (0)