Skip to content
Snippets Groups Projects
Commit 14aed06e authored by Marcelo Schmidt's avatar Marcelo Schmidt
Browse files

Enable editing via admin / users

parent 134ed423
No related merge requests found
......@@ -23,6 +23,10 @@ Meteor.methods
Meteor.runAsUser userData._id, ->
Meteor.call 'setUsername', userData.username
if userData.email
Meteor.runAsUser userData._id, ->
Meteor.call 'setEmail', userData.email
canEditUserPassword = RocketChat.authz.hasPermission( user._id, 'edit-other-user-password')
if canEditUserPassword and userData.password.trim()
Accounts.setPassword userData._id, userData.password.trim()
......
......@@ -23,6 +23,7 @@ Template.adminUserEdit.onCreated ->
userData = { _id: Template.currentData()._id }
userData.name = $("#name", ".edit-form").val()
userData.username = $("#username", ".edit-form").val()
userData.email = $("#email", ".edit-form").val()
userData.password = $("#password", ".edit-form").val()
unless userData._id and userData.name
......
......@@ -13,6 +13,10 @@
<label for="username">{{_ "Username"}}</label>
<input type="text" id="username" autocomplete="off" value="{{username}}">
</div>
<div class="input-line">
<label for="email">{{_ "E-mail"}}</label>
<input type="text" id="email" autocomplete="off" value="{{email}}">
</div>
{{#if hasPermission 'edit-other-user-password'}}
<div class="input-line">
<label for="password">{{_ "Password"}}</label>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment