diff --git a/ui/src/main/resources/XWiki/AccountRejectionTemplate.xml b/ui/src/main/resources/XWiki/AccountRejectionTemplate.xml
new file mode 100644
index 00000000..d6fea385
--- /dev/null
+++ b/ui/src/main/resources/XWiki/AccountRejectionTemplate.xml
@@ -0,0 +1,130 @@
+
+
+
+
+
+ XWiki
+ AccountRejectionTemplate
+
+
+ 0
+ xwiki:XWiki.Admin
+ 1447440844000
+ XWiki.WebHome
+ xwiki:XWiki.Admin
+ xwiki:XWiki.Admin
+ 1447443328000
+ 1447440844000
+ 1.1
+
+
+ false
+ xwiki/2.1
+ false
+
+
+
diff --git a/ui/src/main/resources/XWiki/ManualAccountValidation.xml b/ui/src/main/resources/XWiki/ManualAccountValidation.xml
index ebcab05d..a018f27c 100644
--- a/ui/src/main/resources/XWiki/ManualAccountValidation.xml
+++ b/ui/src/main/resources/XWiki/ManualAccountValidation.xml
@@ -38,23 +38,68 @@
xwiki/2.0true{{velocity}}
-#if ("$!{request.xwikiname}" != '')
-$response.setContentType("application/json")
+#if ("$!{request.xwikiname}" != '' && "$!{request.action}" != '')
+ $response.setContentType("application/json")
#set ($userDoc = $xwiki.getDocument(${request.xwikiname}))
#set ($user = $userDoc.getObject('XWiki.XWikiUsers'))
- $user.set('active', 1)
+ #set ($firstName = $user.getValue('first_name'))
+ #set ($lastName = $user.getValue('last_name'))
+ #set ($realName = "$!{firstName} $!{lastName}")
#set ($email = $user.getProperty('email').getValue())
#if ("$!{email}" != '')
- #set ($emailStatus = $xwiki.mailsender.sendMessageFromTemplate('PhenomeCentral <noreply@phenomecentral.org>', $email, $NULL, $NULL, '', 'XWiki.ManualAccountValidation', {
- "userName": $xwiki.getDocument($request.xwikiname).name,
+
+ #set ($adminGroupName = 'XWiki.SignUpAdmins')
+ #set ($adminsGroupDoc = $xwiki.getDocument($adminGroupName))
+ #set ($adminObjects = $adminsGroupDoc.getObjects('XWiki.XWikiGroups'))
+ #set($cc = '')
+ #set($mainAdminEmail = '')
+ #set($mainAdminName = '')
+ #set($first = true)
+ #foreach ($adminObj in $adminObjects)
+ #set($v = $adminObj.getValue('member'))
+ #if ($!v != '')
+ #set($adminDoc = $xwiki.getDocument($v))
+ #set($adminUser = $adminDoc.getObject('XWiki.XWikiUsers'))
+ #set($adminEmail = $adminUser.getValue('email'))
+ #if($first)
+ #set($first = $adminUser.getValue('first_name'))
+ #set($last = $adminUser.getValue('last_name'))
+ #set($mainAdminName = "$first $last")
+ #set($mainAdminEmail = $adminEmail)
+ #set($first = false)
+ #set($cc = $mainAdminEmail)
+ #else
+ #set($cc = "${cc}, ${adminEmail}")
+ #end
+ #end
+ #end
+
+ #if ("$!{request.action}" == 'accept')
+ #set($emailTemplate = 'XWiki.ManualAccountValidation')
+ #elseif("$!{request.action}" == 'reject')
+ #set($emailTemplate = 'XWiki.AccountRejectionTemplate')
+ #end
+
+ #set ($emailStatus = $xwiki.mailsender.sendMessageFromTemplate('PhenomeCentral <noreply@phenomecentral.org>', $email, $cc, $NULL, '', $emailTemplate, {
+ "userRealName": $realName.trim(),
+ "userName": $userDoc.name,
+ "adminName": $mainAdminName,
+ "adminEmail": $mainAdminEmail,
"platformName": "PhenomeCentral",
"loginURL": $xwiki.getDocument($services.model.resolveDocument('', 'default', $doc.documentReference.extractReference('WIKI'))).getExternalURL()}))
+
#else
#set ($emailStatus = 0)
#end
+
#if ($emailStatus == 0)
- $userDoc.save()
+ #if ("$!{request.action}" == 'accept')
+ $user.set('active', 1)
+ $userDoc.save()
+ #elseif("$!{request.action}" == 'reject')
+ $userDoc.delete()
+ #end
true
#else
false
@@ -116,26 +161,71 @@ false
- <p>Hello,</p>
-<p>Your account ${userName} has been activated.</p>
-<p>You can now log in at <a href="${loginURL}">${platformName}</a>.</p>
-
-<p>Best wishes,<br>
-The ${platformName} team</p>
+ <p>Dear ${userRealName},</p>
+<p>An account has been created for you on ${platformName}. If you forgot your password, please visit <a href="https://phenomecentral.org/XWiki/ResetPassword">https://phenomecentral.org/XWiki/ResetPassword</a> and enter your username ${userName}. Please do not hesitate to contact us if you experience any difficulties with your account.</p>
+<p>You can view your closest matches immediately after entering your patient into ${platformName}! Simply create the patient record, click Save and View Summary and scroll down to Similar Cases Available in the Database. You will be able to find similar cases in ${platformName}, DECIPHER and GeneMatcher based on phenotype and candidate genes.</p>
+<p>For more detailed instructions, please visit: <a href="http://monarch-initiative.blogspot.ca/2015/01/how-to-annotate-patients-phenotypic.html">http://monarch-initiative.blogspot.ca/2015/01/how-to-annotate-patients-phenotypic.html</a>. You can contact me at ${adminEmail} if you want tips on how to effectively enter your patients into the database.</p>
+<p>If you are submitting a case for the Clinical Genetics journal, please follow the instructions listed at <a href="https://phenomecentral.org/PhenomeCentral/Instructions+for+Submitting+to+Clinical+Genetics">https://phenomecentral.org/PhenomeCentral/Instructions+for+Submitting+to+Clinical+Genetics</a></p>
+<p>We look forward to collaborating with you through ${platformName}.</p>
+<p>Sincerely,<br>
+${adminName}<br>
+${platformName} Team</p>
+<br>
+<span style="color: darkgray; font-size: small">
+<p style="display: none">====================================</p>
+<p><b>TERMS AND CONDITIONS OF REGISTRATION</b></p>
+<p>1. I confirm that I am a doctor, clinical geneticist or scientist working with patients affected by rare disorders.</p>
+<p>2. ${platformName} provides data in good faith as a research tool, but without verifying the accuracy, clinical validity or utility of the data. ${platformName} makes no warranty, express or implied, nor assumes any legal liability or responsibility for any purpose for which the data are used.</p>
+<p>3. The user certifies that no attempt to identify individual patients will be undertaken.</p>
+<p>4. Prior to using ${platformName} data in a publication, the user will contact the owner of the matching dataset to assess the integrity of the match and if validated will offer appropriate agreed recognition of their contribution, which may include co-authorhship if the magnitude of the contribution warrants it to at least on representative from the project/participating centre (possibly the member who submitted the patient data).</p>
+<p>5. If ${platformName} enables a research publication, the authors must acknowledge ${platformName} using the following wording: “This study makes use of data shared the ${platformName} repository. Funding for ${platformName} provided by Genome Canada and the Canadian Institute of Health Research (CIHR).</p>
+</span>
- Your account at PhenomeCentral has been approved
+ Your account at ${platformName} has been approved
- Hello,
-Your account ${userName} has been activated.
-You can now log in at ${loginURL}.
+ Dear ${userRealName},
+
+An account has been created for you on ${platformName}. If you forgot your password, please visit https://phenomecentral.org/XWiki/ResetPassword and enter your username ${userName}. Please do not hesitate to contact us if you experience any difficulties with your account.
+
+You can view your closest matches immediately after entering your patient into ${platformName}! Simply create the patient record, click Save and View Summary and scroll down to Similar Cases Available in the Database. You will be able to find similar cases in ${platformName}, DECIPHER and GeneMatcher based on phenotype and candidate genes.
+
+For more detailed instructions, please visit: http://monarch-initiative.blogspot.ca/2015/01/how-to-annotate-patients-phenotypic.html. You can contact me at ${adminEmail} if you want tips on how to effectively enter your patients into the database.
+
+If you are submitting a case for the Clinical Genetics journal, please follow the instructions listed at https://phenomecentral.org/PhenomeCentral/Instructions+for+Submitting+to+Clinical+Genetics
+
+We look forward to collaborating with you through ${platformName}.
+
+Sincerely,
+
+${adminName}
+${platformName} Team
+
+
+====================================
+
+TERMS AND CONDITIONS OF REGISTRATION
-Best wishes,
-The ${platformName} team
+1. I confirm that I am a doctor, clinical geneticist or scientist working with patients affected
+by rare disorders.
+2. ${platformName} provides data in good faith as a research tool, but without verifying the
+accuracy, clinical validity or utility of the data. ${platformName} makes no warranty,
+express or implied, nor assumes any legal liability or responsibility for any purpose for
+which the data are used.
+3. The user certifies that no attempt to identify individual patients will be undertaken.
+4. Prior to using ${platformName} data in a publication, the user will contact the owner of
+the matching dataset to assess the integrity of the match and if validated will offer
+appropriate agreed recognition of their contribution, which may include co-authorhship if
+the magnitude of the contribution warrants it to at least on representative from the
+project/participating centre (possibly the member who submitted the patient data).
+5. If ${platformName} enables a research publication, the authors must acknowledge
+${platformName} using the following wording: “This study makes use of data shared
+though the ${platformName} repository. Funding for ${platformName} was provided by
+Genome Canada and the Canadian Institute of Health Research (CIHR).
diff --git a/ui/src/main/resources/XWiki/SignUpAdmins.xml b/ui/src/main/resources/XWiki/SignUpAdmins.xml
new file mode 100644
index 00000000..0210847d
--- /dev/null
+++ b/ui/src/main/resources/XWiki/SignUpAdmins.xml
@@ -0,0 +1,97 @@
+
+
+
+
+
+ XWiki
+ SignUpAdmins
+
+
+ 0
+ xwiki:XWiki.Admin
+ 1447088977000
+ XWiki.XWikiGroups
+ xwiki:XWiki.Admin
+ xwiki:XWiki.Admin
+ 1447441170000
+ 1447441170000
+ 1.1
+
+
+ false
+ xwiki/2.0
+ false
+
+
+
+
diff --git a/war/src/main/webapp/resources/js/xwiki/usersandgroups/nonactiveusers.js b/war/src/main/webapp/resources/js/xwiki/usersandgroups/nonactiveusers.js
index ab7d2342..45df164c 100644
--- a/war/src/main/webapp/resources/js/xwiki/usersandgroups/nonactiveusers.js
+++ b/war/src/main/webapp/resources/js/xwiki/usersandgroups/nonactiveusers.js
@@ -439,7 +439,8 @@ function displayUsersAndGroups(row, i, table, idx, form_token)
function approveUserOrGroup(rowNumber, table, docname, uorg, form_token)
{
return function () {
- var url = "$xwiki.getURL('XWiki.ManualAccountValidation', 'get', 'outputSyntax=plain')&xwikiname=" + docname;
+ var url =
+ "$xwiki.getURL('XWiki.ManualAccountValidation', 'get', 'outputSyntax=plain')&action=accept&xwikiname=" + docname;
if (confirm("Are you use you want to approve this user __name__?".replace("__name__", docname))) {
new Ajax.Request(url, {
method: "get",
@@ -464,20 +465,19 @@ function editUserOrGroup(userinlineurl, usersaveurl, userredirecturl)
function deleteUserOrGroup(i, table, docname, uorg, form_token)
{
return function() {
+ var url =
+ "$xwiki.getURL('XWiki.ManualAccountValidation', 'get', 'outputSyntax=plain')&action=reject&xwikiname=" + docname;
var message = "$escapetool.javascript($services.localization.render('rightsmanager.confirmdeletegroup'))";
if (uorg == "user") {
message = "$escapetool.javascript($services.localization.render('rightsmanager.confirmdeleteuser'))";
}
if (confirm(message.replace('__name__', docname))) {
- new Ajax.Request('', {
+ new Ajax.Request(url, {
method: 'get',
- parameters: {
- xpage: 'deleteuorg',
- docname: docname,
- form_token: form_token
- },
onSuccess: function(transport) {
- table.deleteRow(i);
+ if (transport.responseText == "true") {
+ table.deleteRow(i)
+ }
}
});
}