v1.18.x
barisusakli 9 years ago
parent 553a69c780
commit 3648d531fa

@ -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;
});

@ -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);
}

@ -139,8 +139,15 @@
<div class="panel panel-default">
<div class="panel-heading">Users Control Panel</div>
<div class="panel-body">
<button id="createUser" class="btn btn-primary">New User</button>
<a target="_blank" href="{config.relative_path}/api/admin/users/csv" class="btn btn-primary">Download CSV</a>
<button id="createUser" class="btn btn-primary form-control">New User</button>
<a target="_blank" href="{config.relative_path}/api/admin/users/csv" class="btn btn-primary form-control">Download CSV</a>
<!-- IF inviteOnly -->
<!-- IF loggedIn -->
<button component="user/invite" class="btn btn-success form-control"><i class="fa fa-users"></i> Invite</button>
<!-- ENDIF loggedIn -->
<!-- ENDIF inviteOnly -->
</div>
</div>
</div>

@ -128,6 +128,13 @@
<option value="admin-invite-only">Admin Invite Only</option>
<option value="disabled">No registration</option>
</select>
<p class="help-block">
Normal - Users can register from the /register page.<br/>
Admin Approval - User registrations are placed in an <a href="{config.relative_path}/admin/manage/registration">approval queue</a> for administrators.<br/>
Invite Only - Users can invite others from the <a href="{config.relative_path}/users" target="_blank">users</a> page.<br/>
Admin Invite Only - Only administrators can invite others from <a href="{config.relative_path}/users" target="_blank">users</a> and <a href="{config.relative_path}/admin/manage/users">admin/manage/users</a> pages.<br/>
No registration - No user registration.<br/>
</p>
</div>
<div class="form-group">
<label>Maximum Invitations per User</label>

Loading…
Cancel
Save