makes users management page aware of the introduced options
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
This commit is contained in:
parent
660fbd64e3
commit
bbe2f2535a
|
@ -237,7 +237,7 @@ class UsersController extends AUserData {
|
|||
$isAdmin = $this->groupManager->isAdmin($user->getUID());
|
||||
$subAdminManager = $this->groupManager->getSubAdmin();
|
||||
|
||||
if(empty($userid) && (bool)$this->config->getAppValue('settings', 'newUser.generateUserID', false)) {
|
||||
if(empty($userid) && $this->config->getAppValue('settings', 'newUser.generateUserID', '0') === '1') {
|
||||
$userid = $this->createNewUserId();
|
||||
}
|
||||
|
||||
|
@ -293,7 +293,7 @@ class UsersController extends AUserData {
|
|||
$generatePasswordResetToken = true;
|
||||
}
|
||||
|
||||
if ($email === '' && (bool)$this->config->getAppValue('settings', 'newUser.requireEmail', false)) {
|
||||
if ($email === '' && $this->config->getAppValue('settings', 'newUser.requireEmail', '0') === '1') {
|
||||
throw new OCSException('Required email address was not provided', 110);
|
||||
}
|
||||
|
||||
|
|
|
@ -483,7 +483,7 @@ class UsersControllerTest extends TestCase {
|
|||
->method('getAppValue')
|
||||
->willReturnCallback(function($appid, $key, $default) {
|
||||
if($key === 'newUser.generateUserID') {
|
||||
return true;
|
||||
return '1';
|
||||
}
|
||||
return null;
|
||||
});
|
||||
|
@ -526,7 +526,7 @@ class UsersControllerTest extends TestCase {
|
|||
->method('getAppValue')
|
||||
->willReturnCallback(function($appid, $key, $default) {
|
||||
if($key === 'newUser.requireEmail') {
|
||||
return true;
|
||||
return '1';
|
||||
}
|
||||
return null;
|
||||
});
|
||||
|
|
|
@ -246,6 +246,8 @@ class UsersController extends Controller {
|
|||
// Settings
|
||||
$serverData['defaultQuota'] = $defaultQuota;
|
||||
$serverData['canChangePassword'] = $canChangePassword;
|
||||
$serverData['newUserGenerateUserID'] = $this->config->getAppValue('settings', 'newUser.generateUserID', '0') === '1';
|
||||
$serverData['newUserRequireEmail'] = $this->config->getAppValue('settings', 'newUser.requireEmail', '0') === '1';
|
||||
|
||||
return new TemplateResponse('settings', 'settings-vue', ['serverData' => $serverData]);
|
||||
}
|
||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -49,9 +49,12 @@
|
|||
<div :class="loading.all?'icon-loading-small':'icon-add'"></div>
|
||||
<div class="name">
|
||||
<input id="newusername" type="text" required v-model="newUser.id"
|
||||
:placeholder="t('settings', 'Username')" name="username"
|
||||
autocomplete="off" autocapitalize="none" autocorrect="off"
|
||||
ref="newusername" pattern="[a-zA-Z0-9 _\.@\-']+">
|
||||
:placeholder="this.settings.newUserGenerateUserID
|
||||
? t('settings', 'Will be autogenerated')
|
||||
: t('settings', 'Username')"
|
||||
name="username" autocomplete="off" autocapitalize="none"
|
||||
autocorrect="off" ref="newusername" pattern="[a-zA-Z0-9 _\.@\-']+"
|
||||
:disabled="this.settings.newUserGenerateUserID">
|
||||
</div>
|
||||
<div class="displayName">
|
||||
<input id="newdisplayname" type="text" v-model="newUser.displayName"
|
||||
|
@ -67,7 +70,7 @@
|
|||
</div>
|
||||
<div class="mailAddress">
|
||||
<input id="newemail" type="email" v-model="newUser.mailAddress"
|
||||
:required="newUser.password===''"
|
||||
:required="newUser.password==='' || this.settings.newUserRequireEmail"
|
||||
:placeholder="t('settings', 'Email')" name="email"
|
||||
autocomplete="off" autocapitalize="none" autocorrect="off">
|
||||
</div>
|
||||
|
|
|
@ -429,7 +429,7 @@ const actions = {
|
|||
addUser({commit, dispatch}, { userid, password, displayName, email, groups, subadmin, quota, language }) {
|
||||
return api.requireAdmin().then((response) => {
|
||||
return api.post(OC.linkToOCS(`cloud/users`, 2), { userid, password, displayName, email, groups, subadmin, quota, language })
|
||||
.then((response) => dispatch('addUserData', userid))
|
||||
.then((response) => dispatch('addUserData', userid || response.data.ocs.data.UserID))
|
||||
.catch((error) => {throw error;});
|
||||
}).catch((error) => {
|
||||
commit('API_FAILURE', { userid, error });
|
||||
|
|
Loading…
Reference in New Issue