Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PC-77 Improvements to sign up & review process. #73

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
130 changes: 130 additions & 0 deletions ui/src/main/resources/XWiki/AccountRejectionTemplate.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
<?xml version="1.0" encoding="UTF-8"?>

<!--
* See the NOTICE file distributed with this work for additional
* information regarding copyright ownership.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see http://www.gnu.org/licenses/
-->

<xwikidoc version="1.1">
<web>XWiki</web>
<name>AccountRejectionTemplate</name>
<language/>
<defaultLanguage/>
<translation>0</translation>
<creator>xwiki:XWiki.Admin</creator>
<creationDate>1447440844000</creationDate>
<parent>XWiki.WebHome</parent>
<author>xwiki:XWiki.Admin</author>
<contentAuthor>xwiki:XWiki.Admin</contentAuthor>
<date>1447443328000</date>
<contentUpdateDate>1447440844000</contentUpdateDate>
<version>1.1</version>
<title/>
<comment/>
<minorEdit>false</minorEdit>
<syntaxId>xwiki/2.1</syntaxId>
<hidden>false</hidden>
<content/>
<object>
<name>XWiki.AccountRejectionTemplate</name>
<number>0</number>
<className>XWiki.Mail</className>
<guid>2f7675be-7afc-4b1b-991f-b2758022c2b2</guid>
<class>
<name>XWiki.Mail</name>
<customClass/>
<customMapping/>
<defaultViewSheet/>
<defaultEditSheet/>
<defaultWeb/>
<nameField/>
<validationScript/>
<html>
<disabled>0</disabled>
<name>html</name>
<number>4</number>
<prettyName>HTML</prettyName>
<rows>15</rows>
<size>80</size>
<unmodifiable>0</unmodifiable>
<classType>com.xpn.xwiki.objects.classes.TextAreaClass</classType>
</html>
<language>
<disabled>0</disabled>
<name>language</name>
<number>2</number>
<prettyName>Language</prettyName>
<size>5</size>
<unmodifiable>0</unmodifiable>
<classType>com.xpn.xwiki.objects.classes.StringClass</classType>
</language>
<subject>
<disabled>0</disabled>
<name>subject</name>
<number>1</number>
<prettyName>Subject</prettyName>
<size>40</size>
<unmodifiable>0</unmodifiable>
<classType>com.xpn.xwiki.objects.classes.StringClass</classType>
</subject>
<text>
<disabled>0</disabled>
<name>text</name>
<number>3</number>
<prettyName>Text</prettyName>
<rows>15</rows>
<size>80</size>
<unmodifiable>0</unmodifiable>
<classType>com.xpn.xwiki.objects.classes.TextAreaClass</classType>
</text>
</class>
<property>
<html>&lt;p&gt;Dear ${userRealName},&lt;/p&gt;
&lt;p&gt;Thank you for your interest in a ${platformName} account. Based on the information you provided, we do not have sufficient grounds to provide you with an account.&lt;/p&gt;
&lt;p&gt;${platformName} is a repository for secure data sharing that encourages global scientific collaboration within the rare disease community while respecting the privacy of patients profiled. Accounts are appropriate for clinicians and scientists who can contribute phenotype and genotype information about patients with genetic disorders in their care. When an account holder enters a patient's data, this information is used to query the data entered in the repository by other contributors to find similar patients based on phenotype and genotype information. Without entering patient data, ${platformName} will have limited utility for you. We encourage you to browse through the information provided on &lt;a href="https://phenomecentral.org/PhenomeCentral/About"&gt;https://phenomecentral.org/PhenomeCentral/About&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;We would like to bring to your attention that the phenotyping software embedded in ${platformName} is based on PhenoTips, a freely available software tool for collecting and analyzing phenotypic information for patients with genetic disorders. You can learn more about PhenoTips, demo the software and download it at &lt;a href="http://phenotips.org/"&gt;http://phenotips.org/&lt;/a&gt;. PhenoTips may be appropriate for users who have private patient data and wish to establish a personal/local phenotyping database.&lt;/p&gt;
&lt;p&gt;If you believe you do meet the conditions for a ${platformName} account, please do not hesitate to contact us with additional information.&lt;/p&gt;
&lt;p&gt;Sincerely,&lt;br&gt;
${adminName}&lt;br&gt;
${platformName} Support Team&lt;/p&gt;
</html>
</property>
<parent>XWiki.WebHome</parent>
<property>
<language/>
</property>
<property>
<subject>PhenomeCentral account status</subject>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

${platformName} account status?

</property>
<property>
<text>Dear ${userRealName},

Thank you for your interest in a ${platformName} account. Based on the information you provided, we do not have sufficient grounds to provide you with an account.

${platformName} is a repository for secure data sharing that encourages global scientific collaboration within the rare disease community while respecting the privacy of patients profiled. Accounts are appropriate for clinicians and scientists who can contribute phenotype and genotype information about patients with genetic disorders in their care. When an account holder enters a patient's data, this information is used to query the data entered in the repository by other contributors to find similar patients based on phenotype and genotype information. Without entering patient data, ${platformName} will have limited utility for you. We encourage you to browse through the information provided on https://phenomecentral.org/PhenomeCentral/About.

We would like to bring to your attention that the phenotyping software embedded in ${platformName} is based on PhenoTips, a freely available software tool for collecting and analyzing phenotypic information for patients with genetic disorders. You can learn more about PhenoTips, demo the software and download it at http://phenotips.org/. PhenoTips may be appropriate for users who have private patient data and wish to establish a personal/local phenotyping database.

If you believe you do meet the conditions for a ${platformName} account, please do not hesitate to contact us with additional information.

Sincerely,

${adminName}
${platformName} Support Team
</text>
</property>
</object>
</xwikidoc>
127 changes: 110 additions & 17 deletions ui/src/main/resources/XWiki/ManualAccountValidation.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,23 +38,71 @@
<syntaxId>xwiki/2.0</syntaxId>
<hidden>true</hidden>
<content>{{velocity}}
#if ("$!{request.xwikiname}" != '')
$response.setContentType("application/json")
#if ("$!{request.xwikiname}" != '' &amp;&amp; "$!{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 &lt;[email protected]&gt;', $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 &lt;[email protected]&gt;', $email, $cc, $NULL, '', $emailTemplate, {
"userRealName": $realName.trim(),
"userName": $userDoc.name,
"adminName": $mainAdminName,
"adminEmail": $mainAdminEmail,
"platformName": "PhenomeCentral",
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we include platformName as a variable in the email template, if we use "PhenomeCentral" without referencing the variable?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's how it's been. Plus, if it ever changes, we don't have to edit the template.

"loginURL": $xwiki.getDocument($services.model.resolveDocument('', 'default', $doc.documentReference.extractReference('WIKI'))).getExternalURL()}))

#else
#set ($emailStatus = 0)
#end

#if ("$!{request.action}" == 'accept')
$user.set('active', 1)
#elseif("$!{request.action}" == 'reject')
$userDoc.delete()
#end

#if ($emailStatus == 0)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this logic is very unclear, and this entire block should go inside #if ("$!{request.action}" == 'accept') block above. If email failed/no email, do nothing, don't even set $user.set('active', 1) (no point if there is no save() later anyway, if I get it right?).

At the same time #elseif("$!{request.action}" == 'reject') should always return true since we do it regardless of email status

$userDoc.save()
#if ("$!{request.action}" == 'accept')
$userDoc.save()
#end
true
#else
false
Expand Down Expand Up @@ -116,12 +164,25 @@ false
</text>
</class>
<property>
<html>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;Your account ${userName} has been activated.&lt;/p&gt;
&lt;p&gt;You can now log in at &lt;a href="${loginURL}"&gt;${platformName}&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Best wishes,&lt;br&gt;
The ${platformName} team&lt;/p&gt;</html>
<html>&lt;p&gt;Dear ${userRealName},&lt;/p&gt;
&lt;p&gt;An account has been created for you on ${platformName}. If you forgot your password, please visit &lt;a href="https://phenomecentral.org/XWiki/ResetPassword"&gt;https://phenomecentral.org/XWiki/ResetPassword&lt;/a&gt; and enter your username ${userName}. Please do not hesitate to contact us if you experience any difficulties with your account.&lt;/p&gt;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any URL pointing to phenomecentral.org should be parametrized.

&lt;p&gt;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.&lt;/p&gt;
&lt;p&gt;For more detailed instructions, please visit: &lt;a href="http://monarch-initiative.blogspot.ca/2015/01/how-to-annotate-patients-phenotypic.html"&gt;http://monarch-initiative.blogspot.ca/2015/01/how-to-annotate-patients-phenotypic.html&lt;/a&gt;. You can contact me at ${adminEmail} if you want tips on how to effectively enter your patients into the database.&lt;/p&gt;
&lt;p&gt;If you are submitting a case for the Clinical Genetics journal, please follow the instructions listed at &lt;a href="https://phenomecentral.org/PhenomeCentral/Instructions+for+Submitting+to+Clinical+Genetics"&gt;https://phenomecentral.org/PhenomeCentral/Instructions+for+Submitting+to+Clinical+Genetics&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;We look forward to collaborating with you through ${platformName}.&lt;/p&gt;
&lt;p&gt;Sincerely,&lt;br&gt;
${adminName}&lt;br&gt;
${platformName} Team&lt;/p&gt;
&lt;br&gt;
&lt;span style="color: darkgray; font-size: small"&gt;
&lt;p style="display: none"&gt;====================================&lt;/p&gt;
&lt;p&gt;&lt;b&gt;TERMS AND CONDITIONS OF REGISTRATION&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;1. I confirm that I am a doctor, clinical geneticist or scientist working with patients affected by rare disorders.&lt;/p&gt;
&lt;p&gt;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.&lt;/p&gt;
&lt;p&gt;3. The user certifies that no attempt to identify individual patients will be undertaken.&lt;/p&gt;
&lt;p&gt;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).&lt;/p&gt;
&lt;p&gt;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).&lt;/p&gt;
&lt;/span&gt;</html>
</property>
<property>
<language/>
Expand All @@ -130,12 +191,44 @@ The ${platformName} team&lt;/p&gt;</html>
<subject>Your account at PhenomeCentral has been approved</subject>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we use platformName here as well?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting question. My gut tells me no, though.

</property>
<property>
<text>Hello,
Your account ${userName} has been activated.
You can now log in at ${loginURL}.
<text>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</text>
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).</text>
</property>
</object>
</xwikidoc>
97 changes: 97 additions & 0 deletions ui/src/main/resources/XWiki/SignUpAdmins.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
<?xml version="1.0" encoding="UTF-8"?>

<!--
* See the NOTICE file distributed with this work for additional
* information regarding copyright ownership.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see http://www.gnu.org/licenses/
-->

<xwikidoc version="1.1">
<web>XWiki</web>
<name>SignUpAdmins</name>
<language/>
<defaultLanguage/>
<translation>0</translation>
<creator>xwiki:XWiki.Admin</creator>
<creationDate>1447088977000</creationDate>
<parent>XWiki.XWikiGroups</parent>
<author>xwiki:XWiki.Admin</author>
<contentAuthor>xwiki:XWiki.Admin</contentAuthor>
<date>1447441170000</date>
<contentUpdateDate>1447441170000</contentUpdateDate>
<version>1.1</version>
<title/>
<comment/>
<minorEdit>false</minorEdit>
<syntaxId>xwiki/2.0</syntaxId>
<hidden>false</hidden>
<content/>
<object>
<name>XWiki.SignUpAdmins</name>
<number>0</number>
<className>XWiki.XWikiGroups</className>
<guid>dba8599a-7c23-4e91-9a1d-bf4f4f92090c</guid>
<class>
<name>XWiki.XWikiGroups</name>
<customClass/>
<customMapping/>
<defaultViewSheet/>
<defaultEditSheet/>
<defaultWeb/>
<nameField/>
<validationScript/>
<member>
<disabled>0</disabled>
<name>member</name>
<number>1</number>
<prettyName>Member</prettyName>
<size>30</size>
<unmodifiable>0</unmodifiable>
<classType>com.xpn.xwiki.objects.classes.StringClass</classType>
</member>
</class>
<property>
<member/>
</property>
</object>
<object>
<name>XWiki.SignUpAdmins</name>
<number>1</number>
<className>XWiki.XWikiGroups</className>
<guid>76ea1b31-924a-4673-b013-845a7d24686f</guid>
<class>
<name>XWiki.XWikiGroups</name>
<customClass/>
<customMapping/>
<defaultViewSheet/>
<defaultEditSheet/>
<defaultWeb/>
<nameField/>
<validationScript/>
<member>
<disabled>0</disabled>
<name>member</name>
<number>1</number>
<prettyName>Member</prettyName>
<size>30</size>
<unmodifiable>0</unmodifiable>
<classType>com.xpn.xwiki.objects.classes.StringClass</classType>
</member>
</class>
<property>
<member>XWiki.Admin</member>
</property>
</object>
</xwikidoc>
Loading