diff --git a/controllers/users.js b/controllers/users.js index c66131d..88137ed 100644 --- a/controllers/users.js +++ b/controllers/users.js @@ -357,19 +357,25 @@ router.get('/search', function (req, res, next) { $options: 'i', }, }, + { + ldapId: { + $regex: _.escapeRegExp(req.query.q), + $options: 'i', + }, + }, ], schoolId: req.query.schoolId ? req.query.schoolId : undefined, - $populate: ['roles', 'schoolId'], $limit: itemsPerPage, $skip: itemsPerPage * (currentPage - 1), $sort: req.query.sort, + $populate: ['roles', 'schoolId'], }, }) .then((data) => { api(req) .get('/roles') .then((role) => { - const head = ['Vorname', 'Nachname', 'E-Mail-Adresse', 'Rollen', 'Schule', '']; + const head = ['ID', 'Vorname', 'Nachname', 'E-Mail-Adresse', 'Rollen', 'Schule', 'External Id', '']; const body = data.data.map((item) => { let roles = item.roles @@ -378,11 +384,13 @@ router.get('/search', function (req, res, next) { }) .join(', '); return [ + item._id || '', item.firstName || '', item.lastName || '', item.email || '', roles || '', (item.schoolId || {}).name || '', + item.ldapId || '', getTableActions(item, '/users/'), ]; }); @@ -462,7 +470,7 @@ router.get('/', function (req, res, next) { }, }) .then((data) => { - const head = ['ID', 'Vorname', 'Nachname', 'E-Mail-Adresse', 'Rollen', '']; + const head = ['ID', 'Vorname', 'Nachname', 'E-Mail-Adresse', 'Rollen', 'External Id', '']; const body = data.data.map((item) => { if (!item.deletedAt) { @@ -477,6 +485,7 @@ router.get('/', function (req, res, next) { item.lastName || '', item.email || '', roles || '', + item.ldapId || '', getTableActions(item, '/users/'), ]; } diff --git a/static/scripts/schools.js b/static/scripts/schools.js index d9e1a39..ebf21a0 100644 --- a/static/scripts/schools.js +++ b/static/scripts/schools.js @@ -107,6 +107,7 @@ $(document).ready(function () { 'Migration abgeschlossen': 'userLoginMigration.closedAt', 'Migration final beendet': 'userLoginMigration.finishedAt', 'Login-System': 'systems', + 'External Id': 'ldapId', 'subject': 'Titel', 'firstName': 'Vorname', @@ -135,7 +136,8 @@ $(document).ready(function () { 'userLoginMigration.mandatorySince': 'Migration verpflichtend', 'userLoginMigration.closedAt': 'Migration abgeschlossen', 'userLoginMigration.finishedAt': 'Migration final beendet', - 'systems': 'Login-System' + 'systems': 'Login-System', + 'ldapId': 'External Id' }; $('tr th').each(function(i,j) { diff --git a/views/ctltools/ctltools.hbs b/views/ctltools/ctltools.hbs index aedfa86..f19e85c 100644 --- a/views/ctltools/ctltools.hbs +++ b/views/ctltools/ctltools.hbs @@ -29,7 +29,7 @@