From 3be6ec7b86e199b892c684a11c881820de86e777 Mon Sep 17 00:00:00 2001
From: tworrall
Date: Tue, 12 Jul 2011 19:45:09 +0000
Subject: [PATCH] NIHVIVO-2848: changes to support the new externalAuthOnly
flag
---
webapp/web/css/account/account.css | 8 ++-
.../web/js/account/accountExternalAuthFlag.js | 26 ++++++++++
.../body/accounts/userAccounts-add.ftl | 35 +++++++------
.../body/accounts/userAccounts-edit.ftl | 51 +++++++++++--------
4 files changed, 82 insertions(+), 38 deletions(-)
create mode 100644 webapp/web/js/account/accountExternalAuthFlag.js
diff --git a/webapp/web/css/account/account.css b/webapp/web/css/account/account.css
index e62d9e6e2..440ab2c79 100644
--- a/webapp/web/css/account/account.css
+++ b/webapp/web/css/account/account.css
@@ -50,6 +50,12 @@ table#account td a {
table#account tr:nth-child(2n) {
background-color: rgba(200, 200, 180,.25);
}
+input#externalAuthChkBox {
+ height:18px;
+ width:18px;
+ margin-top:10px;
+ margin-bottom:10px;
+}
#filter-roles {
float: left;
padding-bottom: 20px;
@@ -246,4 +252,4 @@ padding-right: 5px;
-moz-border-radius-bottomright: 5px;
-webkit-border-bottom-left-radius: 5px;
-webkit-border-bottom-right-radius: 5px;
-}
\ No newline at end of file
+}
diff --git a/webapp/web/js/account/accountExternalAuthFlag.js b/webapp/web/js/account/accountExternalAuthFlag.js
new file mode 100644
index 000000000..e6b2890fb
--- /dev/null
+++ b/webapp/web/js/account/accountExternalAuthFlag.js
@@ -0,0 +1,26 @@
+/* $This file is distributed under the terms of the license in /doc/license.txt$ */
+
+// Change form actions in account main page
+
+$(document).ready(function(){
+
+ // The externalAuthOnly checkbox drives the display of the password and re-set
+ // password fields. When checked, the password fields are hidden
+ $('input:checkbox[name=externalAuthOnly]').click(function(){
+ if ( this.checked ) {
+ // If checked, hide those puppies
+ $('#passwordContainer').addClass('hidden');
+ $('#pwdResetContainer').addClass('hidden');
+ // And clear any values entered in the password fields
+ $('input[name=confirmPassword]').val("");
+ $('input[name=initialPassword]').val("");
+ $('input[name=newPassword]').val("");
+ }
+ else {
+ // if not checked, display them
+ $('#passwordContainer').removeClass('hidden');
+ $('#pwdResetContainer').removeClass('hidden');
+ }
+ });
+
+});
\ No newline at end of file
diff --git a/webapp/web/templates/freemarker/body/accounts/userAccounts-add.ftl b/webapp/web/templates/freemarker/body/accounts/userAccounts-add.ftl
index 7590d9f7c..8164f6bbc 100644
--- a/webapp/web/templates/freemarker/body/accounts/userAccounts-add.ftl
+++ b/webapp/web/templates/freemarker/body/accounts/userAccounts-add.ftl
@@ -64,6 +64,7 @@
<#include "userAccounts-associateProfilePanel.ftl">
+
checked#if> />Externally Authenticated Only
Roles *
<#list roles as role>
checked#if> />
@@ -78,21 +79,23 @@
It will include instructions for activating the account and creating a password.
<#else>
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
Minimum of ${minimumLength} characters in length.
+
Minimum of ${minimumLength} characters in length.
+
#if>
@@ -103,4 +106,6 @@
${stylesheets.add('')}
-${stylesheets.add('')}
\ No newline at end of file
+${stylesheets.add('')}
+
+${scripts.add('')}
\ No newline at end of file
diff --git a/webapp/web/templates/freemarker/body/accounts/userAccounts-edit.ftl b/webapp/web/templates/freemarker/body/accounts/userAccounts-edit.ftl
index 6e959ace8..59ef14edc 100644
--- a/webapp/web/templates/freemarker/body/accounts/userAccounts-edit.ftl
+++ b/webapp/web/templates/freemarker/body/accounts/userAccounts-edit.ftl
@@ -64,6 +64,7 @@
<#include "userAccounts-associateProfilePanel.ftl">
+
- Note: Instructions for resetting the password will
- be emailed to the address entered above. The password will not
- be reset until the user follows the link provided in this email.
-
+
+ Note: Instructions for resetting the password will
+ be emailed to the address entered above. The password will not
+ be reset until the user follows the link provided in this email.
+
+
<#else>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
Minimum of ${minimumLength} characters in length.
-
Leaving this blank means that the password will not be changed.
+
class="hidden"#if> >
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Minimum of ${minimumLength} characters in length.
+
Leaving this blank means that the password will not be changed.