summaryrefslogtreecommitdiffhomepage
path: root/modules/luci-mod-system/luasrc/view/admin_system
diff options
context:
space:
mode:
authorJo-Philipp Wich <jo@mein.io>2019-09-16 07:54:25 +0200
committerJo-Philipp Wich <jo@mein.io>2019-09-16 07:54:25 +0200
commit9ae9657a8585b794bc93b993d83e64b6d7f65b92 (patch)
tree123624bc665e5a72291e07663399962ae46fd5bb /modules/luci-mod-system/luasrc/view/admin_system
parenta31d1d10e09183a999ab9736e0625415bd87fe25 (diff)
luci-mod-system: remplement password change as client side view
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to 'modules/luci-mod-system/luasrc/view/admin_system')
-rw-r--r--modules/luci-mod-system/luasrc/view/admin_system/password.htm59
1 files changed, 0 insertions, 59 deletions
diff --git a/modules/luci-mod-system/luasrc/view/admin_system/password.htm b/modules/luci-mod-system/luasrc/view/admin_system/password.htm
deleted file mode 100644
index 6ca02a83c1..0000000000
--- a/modules/luci-mod-system/luasrc/view/admin_system/password.htm
+++ /dev/null
@@ -1,59 +0,0 @@
-<%+header%>
-
-<input type="password" aria-hidden="true" style="position:absolute; left:-10000px" />
-
-<script type="text/javascript">
-function checkPassword() {
- var pw1 = document.body.querySelector('[name="pw1"]');
- var view = document.getElementById("passstrength");
-
- var strongRegex = new RegExp("^(?=.{8,})(?=.*[A-Z])(?=.*[a-z])(?=.*[0-9])(?=.*\\W).*$", "g");
- var mediumRegex = new RegExp("^(?=.{7,})(((?=.*[A-Z])(?=.*[a-z]))|((?=.*[A-Z])(?=.*[0-9]))|((?=.*[a-z])(?=.*[0-9]))).*$", "g");
- var enoughRegex = new RegExp("(?=.{6,}).*", "g");
- if (false == enoughRegex.test(pw1.value)) {
- view.innerHTML = '<%:Password strength%>: <span style="color:red"><%:More Characters%></span>';
- } else if (strongRegex.test(pw1.value)) {
- view.innerHTML = '<%:Password strength%>: <span style="color:green"><%:Strong%></span>';
- } else if (mediumRegex.test(pw1.value)) {
- view.innerHTML = '<%:Password strength%>: <span style="color:orange"><%:Medium%></span>';
- } else {
- view.innerHTML = '<%:Password strength%>: <span style="color:red"><%:Weak%></span>';
- }
- return true;
-}
-</script>
-
-<div class="cbi-map">
- <h2><%:Router Password%></h2>
-
- <div class="cbi-section-descr">
- <%:Changes the administrator password for accessing the device%>
- </div>
-
- <div class="cbi-section-node">
- <div class="cbi-value">
- <label class="cbi-value-title" for="image"><%:Password%></label>
- <div class="cbi-value-field">
- <input type="password" name="pw1" onkeyup="checkPassword()"/><!--
- --><button class="cbi-button cbi-button-neutral" title="<%:Reveal/hide password%>" aria-label="<%:Reveal/hide password%>" onclick="var e = this.previousElementSibling; e.type = (e.type === 'password') ? 'text' : 'password'">∗</button>
- </div>
- </div>
-
- <div class="cbi-value">
- <label class="cbi-value-title" for="image"><%:Confirmation%></label>
- <div class="cbi-value-field">
- <input type="password" name="pw2" onkeydown="if (event.keyCode === 13) submitPassword(event)" /><!--
- --><button class="cbi-button cbi-button-neutral" title="<%:Reveal/hide password%>" aria-label="<%:Reveal/hide password%>" onclick="var e = this.previousElementSibling; e.type = (e.type === 'password') ? 'text' : 'password'">∗</button>
- <div id="passstrength" class="cbi-value-description"></div>
- </div>
- </div>
- </div>
-</div>
-
-<div class="cbi-page-actions">
- <button class="btn cbi-button-apply" onclick="submitPassword(event)"><%:Save%></button>
-</div>
-
-<script type="application/javascript" src="<%=resource%>/view/system/password.js"></script>
-
-<%+footer%>