Skip to content

Commit

Permalink
Added LDAP flag in users API for #8741
Browse files Browse the repository at this point in the history
  • Loading branch information
snipe committed Dec 2, 2020
1 parent bec2b17 commit b27aeb1
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/Http/Controllers/Api/UsersController.php
Expand Up @@ -60,6 +60,7 @@ public function index(Request $request)
'users.updated_at',
'users.username',
'users.zip',
'users.ldap_import',

])->with('manager', 'groups', 'userloc', 'company', 'department','assets','licenses','accessories','consumables')
->withCount('assets as assets_count','licenses as licenses_count','accessories as accessories_count','consumables as consumables_count');
Expand Down Expand Up @@ -131,7 +132,7 @@ public function index(Request $request)
'assets','accessories', 'consumables','licenses','groups','activated','created_at',
'two_factor_enrolled','two_factor_optin','last_login', 'assets_count', 'licenses_count',
'consumables_count', 'accessories_count', 'phone', 'address', 'city', 'state',
'country', 'zip', 'id'
'country', 'zip', 'id', 'ldap_import'
];

$sort = in_array($request->get('sort'), $allowed_columns) ? $request->get('sort') : 'first_name';
Expand Down
1 change: 1 addition & 0 deletions app/Http/Transformers/UsersTransformer.php
Expand Up @@ -52,6 +52,7 @@ public function transformUser (User $user)
'notes'=> e($user->notes),
'permissions' => $user->decodePermissions(),
'activated' => ($user->activated =='1') ? true : false,
'ldap_import' => ($user->ldap_import =='1') ? true : false,
'two_factor_activated' => ($user->two_factor_active()) ? true : false,
'two_factor_enrolled' => ($user->two_factor_active_and_enrolled()) ? true : false,
'assets_count' => (int) $user->assets_count,
Expand Down
9 changes: 9 additions & 0 deletions app/Presenters/UserPresenter.php
Expand Up @@ -225,6 +225,15 @@ public static function dataTableLayout()
"visible" => true,
'formatter' => 'groupsFormatter'
],
[
"field" => "ldap_import",
"searchable" => false,
"sortable" => true,
"switchable" => true,
"title" => trans('admin/settings/general.ldap_enabled'),
"visible" => false,
'formatter' => 'trueFalseFormatter'
],
[
"field" => "two_factor_enrolled",
"searchable" => false,
Expand Down

0 comments on commit b27aeb1

Please sign in to comment.