diff --git a/public/src/admin/manage/users.js b/public/src/admin/manage/users.js index 09c9e3a01e..63b2d0fdd2 100644 --- a/public/src/admin/manage/users.js +++ b/public/src/admin/manage/users.js @@ -268,7 +268,27 @@ define('admin/manage/users', ['admin/modules/selectable'], function(selectable) handleUserCreate(); + handleInvite(); + }; + function handleInvite() { + $('[component="user/invite"]').on('click', function() { + bootbox.prompt('Email: ', function(email) { + if (!email) { + return; + } + + socket.emit('user.invite', email, function(err) { + if (err) { + return app.alertError(err.message); + } + app.alertSuccess('An invitation email has been sent to ' + email); + }); + }); + }); + } + + return Users; }); diff --git a/src/controllers/admin/users.js b/src/controllers/admin/users.js index 7e5bd530d6..1b833c2709 100644 --- a/src/controllers/admin/users.js +++ b/src/controllers/admin/users.js @@ -166,6 +166,12 @@ function render(req, res, data) { data.search_display = 'hidden'; data.pagination = pagination.create(data.page, data.pageCount, req.query); data.requireEmailConfirmation = parseInt(meta.config.requireEmailConfirmation, 10) === 1; + + var registrationType = meta.config.registrationType; + + data.inviteOnly = registrationType === 'invite-only' || registrationType === 'admin-invite-only'; + data.adminInviteOnly = registrationType === 'admin-invite-only'; + res.render('admin/manage/users', data); } diff --git a/src/views/admin/manage/users.tpl b/src/views/admin/manage/users.tpl index cfdc7bb72c..644bde38f6 100644 --- a/src/views/admin/manage/users.tpl +++ b/src/views/admin/manage/users.tpl @@ -139,8 +139,15 @@
+ Normal - Users can register from the /register page.
+ Admin Approval - User registrations are placed in an approval queue for administrators.
+ Invite Only - Users can invite others from the users page.
+ Admin Invite Only - Only administrators can invite others from users and admin/manage/users pages.
+ No registration - No user registration.
+