Hide user account actions for external ldap users

This commit is contained in:
Johannes Zellner
2019-08-30 13:36:52 +02:00
parent ea5e0b28da
commit 4576e93deb
2 changed files with 8 additions and 6 deletions
+4 -2
View File
@@ -150,7 +150,8 @@ angular.module('Application').service('Client', ['$http', '$interval', 'md5', 'N
id: null,
username: null,
email: null,
twoFactorAuthenticationEnabled: false
twoFactorAuthenticationEnabled: false,
source: null
};
this._config = {
apiServerOrigin: null,
@@ -259,6 +260,7 @@ angular.module('Application').service('Client', ['$http', '$interval', 'md5', 'N
this._userInfo.displayName = userInfo.displayName;
this._userInfo.twoFactorAuthenticationEnabled = userInfo.twoFactorAuthenticationEnabled;
this._userInfo.admin = userInfo.admin;
this._userInfo.source = userInfo.source;
this._userInfo.gravatar = 'https://www.gravatar.com/avatar/' + md5.createHash(userInfo.email) + '.jpg?s=24&d=mm';
this._userInfo.gravatarHuge = 'https://www.gravatar.com/avatar/' + md5.createHash(userInfo.email) + '.jpg?s=128&d=mm';
};
@@ -1098,7 +1100,7 @@ angular.module('Application').service('Client', ['$http', '$interval', 'md5', 'N
if (status !== 201) return callback(new ClientError(status, data));
that.setToken(data.token);
that.setUserInfo({ username: username, email: email, admin: true, twoFactorAuthenticationEnabled: false });
that.setUserInfo({ username: username, email: email, admin: true, twoFactorAuthenticationEnabled: false, source: '' });
callback(null, data.activated);
});
+4 -4
View File
@@ -259,26 +259,26 @@
<tr>
<td class="text-muted" style="vertical-align: top;">Display name</td>
<td class="text-right" style="vertical-align: top; white-space: nowrap;">
{{ user.displayName }} <a href="" ng-click="displayNameChange.show()"><i class="fa fa-edit text-small"></i></a>
{{ user.displayName }} <a href="" ng-click="displayNameChange.show()" ng-hide="user.source"><i class="fa fa-edit text-small"></i></a>
</td>
</tr>
<tr>
<td class="text-muted" style="vertical-align: top;">Primary email</td>
<td class="text-right" style="vertical-align: top; white-space: nowrap;">
{{ user.email }} <a href="" ng-click="emailchange.show()"><i class="fa fa-edit text-small"></i></a>
{{ user.email }} <a href="" ng-click="emailchange.show()" ng-hide="user.source"><i class="fa fa-edit text-small"></i></a>
</td>
</tr>
<tr>
<td class="text-muted" style="vertical-align: top;">Password recovery email</td>
<td class="text-right" style="vertical-align: top; white-space: nowrap;">
{{ user.fallbackEmail }} <a href="" ng-click="fallbackEmailChange.show()"><i class="fa fa-edit text-small"></i></a>
{{ user.fallbackEmail }} <a href="" ng-click="fallbackEmailChange.show()" ng-hide="user.source"><i class="fa fa-edit text-small"></i></a>
</td>
</tr>
<tr>
<td class="text-right" colspan="2" style="vertical-align: top;">
<br/>
<button class="btn btn-outline btn-xs btn-danger" ng-click="twoFactorAuthentication.show()">{{ user.twoFactorAuthenticationEnabled ? 'Disable' : 'Enable' }} 2FA</button>
<button class="btn btn-outline btn-xs btn-danger" ng-click="passwordchange.show()">Change Password</button>
<button class="btn btn-outline btn-xs btn-danger" ng-click="passwordchange.show()" ng-hide="user.source">Change Password</button>
</td>
</tr>
</table>