Adds two-factor to users listing

This commit is contained in:
snipe 2016-10-29 07:21:34 -07:00
parent 32c439d979
commit fe041b66c6
2 changed files with 4 additions and 2 deletions

View file

@ -892,7 +892,7 @@ class UsersController extends Controller
$sort = e(Input::get('sort')); $sort = e(Input::get('sort'));
} }
$users = User::select(array('users.id','users.employee_num','users.jobtitle','users.email','users.username','users.location_id','users.manager_id','users.first_name','users.last_name','users.created_at','users.notes','users.company_id', 'users.deleted_at','users.activated')) $users = User::select(array('users.id','users.employee_num','users.two_factor_enrolled','users.jobtitle','users.email','users.username','users.location_id','users.manager_id','users.first_name','users.last_name','users.created_at','users.notes','users.company_id', 'users.deleted_at','users.activated'))
->with('assets', 'accessories', 'consumables', 'licenses', 'manager', 'groups', 'userloc', 'company','throttle'); ->with('assets', 'accessories', 'consumables', 'licenses', 'manager', 'groups', 'userloc', 'company','throttle');
$users = Company::scopeCompanyables($users); $users = Company::scopeCompanyables($users);
@ -919,7 +919,7 @@ class UsersController extends Controller
$allowed_columns = $allowed_columns =
[ [
'last_name','first_name','email','jobtitle','username','employee_num', 'last_name','first_name','email','jobtitle','username','employee_num',
'assets','accessories', 'consumables','licenses','groups','activated','created_at' 'assets','accessories', 'consumables','licenses','groups','activated','created_at','two_factor_enrolled'
]; ];
$sort = in_array($sort, $allowed_columns) ? $sort : 'first_name'; $sort = in_array($sort, $allowed_columns) ? $sort : 'first_name';
@ -994,6 +994,7 @@ class UsersController extends Controller
'consumables' => $user->consumables->count(), 'consumables' => $user->consumables->count(),
'groups' => $group_names, 'groups' => $group_names,
'notes' => e($user->notes), 'notes' => e($user->notes),
'two_factor_enrolled' => ($user->two_factor_enrolled=='1') ? '<i class="fa fa-check"></i>' : '<i class="fa fa-times"></i>',
'created_at' => ($user->created_at!='') ? e($user->created_at->format('F j, Y h:iA')) : '', 'created_at' => ($user->created_at!='') ? e($user->created_at->format('F j, Y h:iA')) : '',
'activated' => ($user->activated=='1') ? '<i class="fa fa-check"></i>' : '<i class="fa fa-times"></i>', 'activated' => ($user->activated=='1') ? '<i class="fa fa-check"></i>' : '<i class="fa fa-times"></i>',
'actions' => ($actions) ? $actions : '', 'actions' => ($actions) ? $actions : '',

View file

@ -108,6 +108,7 @@
</th> </th>
<th data-sortable="false" data-field="groups">{{ trans('general.groups') }}</th> <th data-sortable="false" data-field="groups">{{ trans('general.groups') }}</th>
<th data-sortable="true" data-field="notes">{{ trans('general.notes') }}</th> <th data-sortable="true" data-field="notes">{{ trans('general.notes') }}</th>
<th data-sortable="true" data-field="two_factor_enrolled" data-visible="false">{{ trans('admin/settings/general.two_factor') }}</th>
<th data-sortable="true" data-field="activated">{{ trans('general.activated') }}</th> <th data-sortable="true" data-field="activated">{{ trans('general.activated') }}</th>
<th data-sortable="true" data-field="created_at" data-searchable="true" data-visible="false">{{ trans('general.created_at') }}</th> <th data-sortable="true" data-field="created_at" data-searchable="true" data-visible="false">{{ trans('general.created_at') }}</th>
<th data-switchable="false" data-searchable="false" data-sortable="false" data-field="actions" >{{ trans('table.actions') }}</th> <th data-switchable="false" data-searchable="false" data-sortable="false" data-field="actions" >{{ trans('table.actions') }}</th>