diff --git a/controller/settingscontroller.php b/controller/settingscontroller.php index 9450573..14df7fc 100644 --- a/controller/settingscontroller.php +++ b/controller/settingscontroller.php @@ -37,13 +37,17 @@ class SettingsController extends Controller { parent::__construct($appName, $request); } + + /** * @AdminRequired * * @param string $registered_user_group all newly registered user will be put in this group + * @param string $allowed_domains Registrations are only allowed for E-Mailadresses with these domains * @return DataResponse */ - public function admin($registered_user_group) { + public function admin($registered_user_group, $allowed_domains) { + $this->config->setAppValue($this->appName, 'allowed_domains', $allowed_domains); $groups = $this->groupmanager->search(''); foreach ( $groups as $group ) { $group_id_list[] = $group->getGid(); @@ -82,9 +86,11 @@ class SettingsController extends Controller { } // TODO selected $current_value = $this->config->getAppValue($this->appName, 'registered_user_group', 'none'); + $allowed_domains = $this->config->getAppValue($this->appName, 'allowed_domains', ''); return new TemplateResponse('registration', 'admin', [ 'groups' => $group_id_list, - 'current' => $current_value + 'current' => $current_value, + 'allowed' => $allowed_domains ], ''); } } diff --git a/templates/admin.php b/templates/admin.php index 6664c01..eed1fca 100644 --- a/templates/admin.php +++ b/templates/admin.php @@ -15,4 +15,9 @@ foreach ( $_['groups'] as $group ) { ?>
++ + t('allowed'));?> + +