make group id non configurable

Signed-off-by: Robin Appelman <robin@icewind.nl>
This commit is contained in:
Robin Appelman 2018-06-13 16:32:20 +02:00
Родитель 13a5d31833
Коммит 791fc01ea5
4 изменённых файлов: 1 добавлений и 18 удалений

Просмотреть файл

@ -23,7 +23,6 @@
// variables
var $section = $('#guests');
var $guestsByGroup = $section.find('#guestsByGroup');
var $guestGroup = $section.find('#guestGroup');
var $guestUseWhitelist = $section.find('#guestUseWhitelist');
var $guestWhitelist = $section.find('#guestWhitelist');
var $guestWhitelistContainer = $section.find('.whitelist');
@ -56,11 +55,6 @@
$guestUseWhitelist.prop('checked', false);
$guestWhitelistContainer.hide();
}
if (config.group) {
$guestGroup.val(config.group);
} else {
$guestGroup.val('');
}
if ($.isArray(config.whitelist)) {
$guestWhitelist.val(config.whitelist).trigger("change");
}
@ -113,10 +107,6 @@
saveConfig();
});
$guestGroup.on('change', function () {
config.group = $guestGroup.val();
saveConfig();
});
$guestUseWhitelist.on('change', function () {
config.useWhitelist = $guestUseWhitelist.prop('checked');
if(config.useWhitelist) {

Просмотреть файл

@ -104,12 +104,9 @@ class Application extends App {
}
);
$config = $server->getConfig();
$groupName = $config->getAppValue('guests', 'group', 'guest_app');
$server->getGroupManager()->addBackend(new GroupBackend(
$container->query(GuestManager::class),
$groupName
'guest_app'
));
/** @var Hooks $hooks */
$hooks = $container->query(Hooks::class);

Просмотреть файл

@ -66,7 +66,6 @@ class SettingsController extends Controller {
$whitelist = $this->config->getAppValue('guests', 'whitelist', AppWhitelist::DEFAULT_WHITELIST);
$whitelist = explode(',', $whitelist);
return new DataResponse([
'group' => $this->config->getAppValue('guests', 'group', 'guests'),
'useWhitelist' => $useWhitelist,
'whitelist' => $whitelist,
]);
@ -86,7 +85,6 @@ class SettingsController extends Controller {
$newWhitelist[] = trim($app);
}
$newWhitelist = join(',', $newWhitelist);
$this->config->setAppValue('guests', 'group', $group);
$this->config->setAppValue('guests', 'usewhitelist', $useWhitelist);
$this->config->setAppValue('guests', 'whitelist', $newWhitelist);
return new DataResponse();

Просмотреть файл

@ -29,8 +29,6 @@ style('guests', 'admin');
<div>
<p>
<span class="inlineblock user-info-label"><?php p($l->t('Guest users are grouped under a virtual group in the user manager')); ?></span><br/><br/>
<label for="guestGroup"><?php p($l->t('Group name')); ?>
</label><input type="text" id="guestGroup" value=""/>
</p>
<p class="whitelist-toggle">
<input type="checkbox" id="guestUseWhitelist" class="checkbox"