/usr/share/glewlwyd/webapp/reset.html is in glewlwyd-common 1.3.1-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 | <!--
*
* Glewlwyd OAuth2 Authorization Server
*
* Reset password page
*
* Copyright 2017 Nicolas Mora <mail@babelouest.org>
*
* The front-end application is under MIT Licence (MIT)
*
* The MIT License (MIT)
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
-->
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Glewlwyd reset password</title>
<link href="favicon.ico" rel="icon" type="image/x-icon" />
<meta name="description" content="Glewlwyd OAuth2 Authorization Server">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="css/bootstrap.min.css">
<script src="js/jquery-3.1.1.min.js"></script>
<script src="js/bootstrap.min.js"></script>
<style>
body {
padding-top: 40px;
padding-bottom: 40px;
background-color: #eee;
}
.form-signin {
max-width: 330px;
padding: 15px;
margin: 0 auto;
}
.form-signin .form-signin-heading,
.form-signin .checkbox {
margin-bottom: 10px;
}
.form-signin .checkbox {
font-weight: normal;
}
.form-signin .form-control {
position: relative;
height: auto;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
padding: 10px;
font-size: 16px;
}
.form-signin .form-control:focus {
z-index: 2;
}
.form-signin input[type="email"] {
margin-bottom: -1px;
border-bottom-right-radius: 0;
border-bottom-left-radius: 0;
}
.form-signin input[type="password"] {
margin-bottom: 10px;
border-top-left-radius: 0;
border-top-right-radius: 0;
}
label {
white-space: normal !important;
}
</style>
</head>
<body>
<div class="container form-signin" id="sendResetDiv" style="display: none;">
<form action="#" id="forgotPasswordForm">
<center><h2 class="form-signin-heading">Forgot password</h2></center>
<h3 class="form-signin-heading">Please enter your login</h3>
<label class="sr-only" for="inputLogin">Login</label>
<div class="input-group">
<span class="input-group-addon">
<i class="glyphicon glyphicon-user color-blue"></i>
</span>
<input type="text" class="form-control" name="username" id="username" autofocus="" required="" placeholder="user name">
</div>
<button type="submit" name="sendresetbut" id="sendresetbut" class="btn btn-lg btn-primary btn-block">Send reset password email</button>
<center><strong><a href="login.html" class="">Go to log in page</a></strong></center>
<center><h4><label class="label label-info" id="emailSentOk" style="display: none;">Email sent</label></h4></center>
<center><h4><label class="label label-warning" id="emailSentError" style="display: none;">Error while sending reset email</label></h4></center>
</form>
</div>
<div class="container form-signin" id="resetDiv" style="display: none;">
<form action="#" id="resetPasswordForm">
<h2 class="form-signin-heading">Please enter your new password</h2>
<input type="hidden" name="code" id="code" value="">
<input type="hidden" name="user" id="user" value="">
<input type="password" class="form-control" name="new_password" id="new_password" value="" placeholder="New password">
<input type="password" class="form-control" name="confirm_password" id="confirm_password" value="" placeholder="Confirm new password">
<button type="submit" name="resetbut" id="resetbut" class="btn btn-lg btn-primary btn-block">Reset password</button>
<center><h4><label class="label label-info" id="resetOk" style="display: none;">Password changed, you can now <a href="login.html">log in</a></label></h4></center>
<center><h4><label class="label label-warning" id="resetError" style="display: none;"></label></h4></center>
</form>
</div>
</body>
</html>
<script>
var params;
var api_prefix;
function getQueryParams(qs) {
qs = qs.split('+').join(' ');
var params = {},
tokens,
re = /[?&]?([^=]+)=([^&]*)/g;
while (tokens = re.exec(qs)) {
params[decodeURIComponent(tokens[1])] = decodeURIComponent(tokens[2]);
}
return params;
}
window.onload = function () {
params = getQueryParams(location.search);
if (params.code) {
$("#sendResetDiv").hide();
$("#resetDiv").show();
$("#code").val(params.code);
$("#user").val(params.user);
} else {
$("#sendResetDiv").show();
$("#resetDiv").hide();
}
$.get("../config/", function (result) {
api_prefix = result.api_prefix;
});
}
$("#forgotPasswordForm").submit(function(event) {
event.preventDefault();
sendReset();
});
$("#resetPasswordForm").submit(function(event) {
event.preventDefault();
resetPassword();
});
function sendReset () {
if ($("#username").val()) {
$.post("../" + api_prefix + "/profile/reset_password/" + $("#username").val(), null,
function (result, status, request) {
$("#emailSentOk").show();
$("#emailSentError").hide();
})
.fail(function (error) {
$("#emailSentOk").hide();
$("#emailSentError").show();
});
}
}
function resetPassword () {;
$("#resetOk").hide();
$("#resetError").hide();
if ($("#new_password").text() === $("#confirm_password").val()) {
$("#resetError").show();
$("#resetError").text("Error, password don't match");
} else if ($("#new_password").val().length < 8) {
$("#resetError").show();
$("#resetError").text("Error, password must be at least 8 characters");
} else {
$.ajax
({
type: "PUT",
url: "../" + api_prefix + "/profile/reset_password/" + $("#user").val(),
async: false,
data: {token: $("#code").val(), password: $("#new_password").val()},
success: function (result, status, request) {
$("#resetOk").show();
},
error: function (error) {
$("#resetError").show();
$("#resetError").text("Error while changing password");
}
});
}
}
</script>
|