Update# check for 'none' group

This commit is contained in:
Pellaeon Lin 2015-05-20 17:56:43 +08:00
parent cc9258fc9a
commit aa97deb70a
1 changed files with 8 additions and 1 deletions

View File

@ -48,7 +48,14 @@ class SettingsController extends Controller {
foreach ( $groups as $group ) { foreach ( $groups as $group ) {
$group_id_list[] = $group->getGid(); $group_id_list[] = $group->getGid();
} }
if ( in_array($registered_user_group, $group_id_list) ) { if ( $registered_user_group === 'none' ) {
$this->config->deleteAppValue($this->appName, 'registered_user_group');
return new DataResponse(array(
'data' => array(
'message' => (string) $this->l10n->t('Your settings have been updated.'),
),
));
} else if ( in_array($registered_user_group, $group_id_list) ) {
$this->config->setAppValue($this->appName, 'registered_user_group', $registered_user_group); $this->config->setAppValue($this->appName, 'registered_user_group', $registered_user_group);
return new DataResponse(array( return new DataResponse(array(
'data' => array( 'data' => array(