-
Notifications
You must be signed in to change notification settings - Fork 87
/
resetpassword.html
90 lines (81 loc) · 2.96 KB
/
resetpassword.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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
<div class="resetpassword container">
<div class="span7">.
<div class="header"></div>
<div class="form">
<form class="loginForm form-horizontal">
<legend>Reset password</legend>
<div class="form-group">
<label class="col-lg-2 control-label" for="inputEmail">Username</label>
<div class="col-lg-4">
<div class="input-group">
<span class="input-group-addon">@</span>
<input type="email" class="form-control username" disabled="disabled" id="inputEmail" placeholder="Username (e-mail address)">
</div>
</div>
</div>
<div class="form-group">
<label class="col-lg-2 control-label" for="inputPassword">New password</label>
<div class="col-lg-4">
<div class="input-group">
<span class="input-group-addon"><i class="glyphicon glyphicon-lock"></i></span>
<input type="password" class="form-control password" id="inputPassword" placeholder="New password">
</div>
</div>
</div>
<div class="form-group">
<div class="col-lg-offset-2 col-lg-10">
<button type="button" class="btn resetButton btn-primary">Set password</button>
</div>
</div>
</form>
</div>
</div>
</div>
<script>
function ResetPassword(containerDiv, main) {
var othis = this;
this.show = function(){
$(".sidespan").empty();
Global.bimServerApi.logout(function(){
});
};
$(".header").load(Global.baseDir + "header.html");
containerDiv.find(".username").val(getParameterByName("username"));
this.continueWithAddress = function(address){
var username = getParameterByName("username");
var uoid = getParameterByName("uoid");
var validationtoken = getParameterByName("validationtoken");
var password = $(".password").val();
if (BimServerClient != null) {
Global.bimServerApi = new BimServerClient(address, Global.notifier);
Global.bimServerApi.init(function(api, serverInfo){
if (serverInfo.serverState == "NOT_SETUP") {
} else if (serverInfo.serverState == "UNDEFINED") {
} else if (serverInfo.serverState == "MIGRATION_REQUIRED") {
} else if (serverInfo.serverState == "MIGRATION_IMPOSSIBLE") {
} else if (serverInfo.serverState == "FATAL_ERROR") {
} else if (serverInfo.serverState == "RUNNING") {
Global.bimServerApi.callWithFullIndication("AuthInterface", "validateAccount", {uoid: uoid, token: validationtoken, password: password}, function(){
$(".indexcontainer").load(Global.baseDir + "login.html", function(){
new Login(address, username);
});
});
}
});
}
};
this.resetPassword = function() {
var address = getParameterByName("api_address");
if (address == null) {
Settings.getStaticServerAddress(function(address){
othis.continueWithAddress(address);
});
} else {
othis.continueWithAddress(address);
}
}
containerDiv.find(".resetButton").click(othis.resetPassword);
containerDiv.find(".password").enterpress(othis.resetPassword);
containerDiv.find(".password").focus();
}
</script>