-
Notifications
You must be signed in to change notification settings - Fork 87
/
adduser.html
70 lines (64 loc) · 1.89 KB
/
adduser.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
<div class="adduser">
<h2>Add user</h2>
<form class="form-horizontal" role="form">
<div class="form-group">
<label class="col-lg-3 control-label" for="inputUsername">Username</label>
<div class="controls">
<div class="input-group col-lg-5">
<span class="input-group-addon">@</span>
<input type="text" class="inputUsername form-control" placeholder="Username (e-mail address)">
</div>
</div>
</div>
<div class="form-group">
<label class="col-lg-3 control-label" for="inputName">Name</label>
<div class="controls col-lg-5">
<input type="text" class="inputName form-control" placeholder="Name">
</div>
</div>
<div class="form-group">
<label class="col-lg-3 control-label" for="inputName">Type</label>
<div class="controls col-lg-5">
<select class="selectType form-control">
<option value="ADMIN">Administrator</option>
<option value="USER">User</option>
<option value="READ_ONLY">Read only</option>
<option value="MONITOR">Monitor</option>
</select>
</div>
</div>
<div class="form-group">
<div class="controls buttonBar">
<button type="button" class="btn btn-primary addButton">Add</button>
</div>
</div>
</form>
</div>
<script>
function AddUser(main) {
var othis = this;
this.close = function(){
};
this.show = function(){
};
this.addUser = function() {
Global.bimServerApi.call("ServiceInterface", "addUser", {
username: $(".adduser .inputUsername").val(),
name: $(".adduser .inputName").val(),
type: $(".adduser .selectType").val(),
selfRegistration: false,
resetUrl: Global.baseDir + "?page=ResetPassword"
}, function(data){
main.showUser(data);
});
};
$(".adduser .addButton").click(othis.addUser);
$(".adduser .inputName").keypress(function(event){
if (event.which == 13) {
event.preventDefault();
othis.addUser();
}
});
$(".adduser .inputUsername").focus();
}
</script>