File tree Expand file tree Collapse file tree 5 files changed +40
-0
lines changed
Expand file tree Collapse file tree 5 files changed +40
-0
lines changed Original file line number Diff line number Diff line change 33- [ push] Fixed bug where IOS credentials get mixed up while sending messages from different apps at the same time
44- [ push] Fixed bug where it crashes in connection pool growth because of a type mismatch in an if condition
55
6+ Features:
7+ - [ user-management] Global admins can now disable 2FA for individual users
8+
69Dependencies:
710- Bump express from 4.21.1 to 4.21.2
811- Bump mocha from 10.2.0 to 10.8.2
Original file line number Diff line number Diff line change 215215 callback ( err . responseJSON . result ) ;
216216 } ) ;
217217 } ;
218+ countlyUserManagement . disableTwoFactorAuth = function ( id , callback ) {
219+ return $ . ajax ( {
220+ type : "GET" ,
221+ url : countlyGlobal . path + "/i/two-factor-auth" ,
222+ data : {
223+ method : "admin_disable" ,
224+ uid : id
225+ } ,
226+ success : function ( ) {
227+ callback ( ) ;
228+ } ,
229+ error : function ( err ) {
230+ callback ( err . responseJSON . result ) ;
231+ }
232+ } ) ;
233+ } ;
218234
219235} ) ( ( window . countlyUserManagement = window . countlyUserManagement || { } ) ) ;
Original file line number Diff line number Diff line change 6565 } ,
6666 roleMap : roleMap ,
6767 showLogs : countlyGlobal . plugins . indexOf ( 'systemlogs' ) > - 1 ,
68+ twoFactorAuth : countlyGlobal . plugins . indexOf ( 'two-factor-auth' ) > - 1 ,
6869 tableDynamicCols : tableDynamicCols ,
6970 userManagementPersistKey : 'userManagement_table_' + countlyCommon . ACTIVE_APP_ID ,
7071 isGroupPluginEnabled : isGroupPluginEnabled
114115 }
115116 } ,
116117 methods : {
118+ is2faEnabled : function ( row ) {
119+ return countlyGlobal . member . global_admin && this . twoFactorAuth && row . two_factor_auth && row . two_factor_auth . enabled ;
120+ } ,
117121 handleCommand : function ( command , index ) {
118122 switch ( command ) {
119123 case "delete-user" :
157161 } ) ;
158162 } ) ;
159163 break ;
164+ case 'disable-2fa' :
165+ countlyUserManagement . disableTwoFactorAuth ( index , function ( err ) {
166+ if ( err ) {
167+ CountlyHelpers . notify ( {
168+ message : CV . i18n ( 'two-factor-auth.faildisable_title' ) ,
169+ type : 'error'
170+ } ) ;
171+ return ;
172+ }
173+ CountlyHelpers . notify ( {
174+ message : CV . i18n ( 'two-factor-auth.disable_title' ) ,
175+ type : 'success'
176+ } ) ;
177+ } ) ;
178+ break ;
160179 }
161180 } ,
162181 handleSubmitFilter : function ( newFilter ) {
Original file line number Diff line number Diff line change @@ -131,6 +131,7 @@ <h4>{{i18n('management-users.view-title')}}</h4>
131131 < el-dropdown-item v-if ="showLogs " command ="show-logs " :data-test-id ="'datatable-users-more-button-view-logs-select-' + rowScope.$index "> {{ i18n('management-users.view-user-logs') }}</ el-dropdown-item >
132132 < el-dropdown-item command ="reset-logins " :data-test-id ="'datatable-users-more-button-reset-logins-select-' + rowScope.$index "> {{ i18n('management-users.reset-failed-logins') }}</ el-dropdown-item >
133133 < el-dropdown-item command ="delete-user " :data-test-id ="'datatable-users-more-button-delete-user-select-' + rowScope.$index "> {{ i18n('management-users.delete-user') }}</ el-dropdown-item >
134+ < el-dropdown-item v-if ="is2faEnabled(rowScope.row) " command ="disable-2fa " :data-test-id ="'datatable-users-more-button-disable-2fa-select-' + rowScope.$index "> {{ i18n('management-users.disable-2fa-user') }}</ el-dropdown-item >
134135 </ cly-more-options >
135136 </ template >
136137 </ el-table-column >
Original file line number Diff line number Diff line change @@ -908,6 +908,7 @@ management-users.no-role = No role
908908management-users.create-user = Create User
909909management-users.delete-user = Delete User
910910management-users.edit = Click to edit
911+ management-users.disable-2fa-user = Disable 2FA
911912management-users.all-roles = All roles
912913management-users.not-logged-in-yet = Not logged in yet
913914management-users.close = Click to close
You can’t perform that action at this time.
0 commit comments