diff --git a/.gitignore b/.gitignore index fa45eca..ee8536d 100644 --- a/.gitignore +++ b/.gitignore @@ -22,4 +22,7 @@ build copy-test deploy-test deploy2coppa +dbupdate.sh /CloudSession-Templates.tar.gz +/copy-test +/deploy2coppa diff --git a/app/Email/services.py b/app/Email/services.py index 54d5df9..3cb6ca1 100644 --- a/app/Email/services.py +++ b/app/Email/services.py @@ -40,7 +40,7 @@ def send_email_template_for_user(id_user, template, server, **kwargs): params['sponsoremail'] = user.parent_email params['blocklyprop-host'] = app.config['CLOUD_SESSION_PROPERTIES']['response.host'] - #Default the recipient email address + # Default the recipient email address user_email = user.email coppa = Coppa() @@ -70,7 +70,13 @@ def send_email_template_for_user(id_user, template, server, **kwargs): send_email_template_to_address(user.parent_email, 'reset-coppa', server, user.locale, params) return else: - # Registration not subject to COPPA regulations + # Registration not subject to COPPA regulations. + # + # Evaluate user wanting to use an alternate email address to register + # the account. + if user.parent_email_source == SponsorType.INDIVIDUAL or user.parent_email: + user_email = user.parent_email + send_email_template_to_address(user_email, template, server, user.locale, params) return diff --git a/database/patches/0004-update-cs-default-char-col.sql b/database/patches/0004-update-cs-default-char-col.sql new file mode 100644 index 0000000..bcfd383 --- /dev/null +++ b/database/patches/0004-update-cs-default-char-col.sql @@ -0,0 +1,83 @@ +/* +Script: 0004-update-cs-default-char-col.sql + +This script corrects an issue in the cloud session database +where the default character set and collation were set to +'latin1' and 'latin1_swedish_ci'. These settings should be +'utf8' and 'utf8_general_ci'. + +This script updates the character set and collation settings +on the cloudsession database, all cloudsession tables and +affected columns within each of these tables. + */ + +# Select the target database +USE cloudsession; + +# Set the database defaults +# This also sets the collation for individual table columns +;ALTER DATABASE blocklyprop CHARACTER SET utf8 COLLATE utf8_general_ci; +ALTER DATABASE cloudsession CHARACTER SET utf8 COLLATE utf8_general_ci; + +# latin1_general_ci +# ALTER DATABASE cloudsession CHARACTER SET latin1 COLLATE latin1_general_ci; + +# Update the authentication_token table +SET foreign_key_checks = 0; +# Default table settings +ALTER TABLE cloudsession.authentication_token DEFAULT CHARACTER SET utf8; + +# Column settings +ALTER TABLE cloudsession.authentication_token MODIFY browser VARCHAR(200) CHARACTER SET utf8; +ALTER TABLE cloudsession.authentication_token MODIFY server VARCHAR(1000) CHARACTER SET utf8; +ALTER TABLE cloudsession.authentication_token MODIFY ip_address VARCHAR(200) CHARACTER SET utf8; +ALTER TABLE cloudsession.authentication_token MODIFY token VARCHAR(200) CHARACTER SET utf8; + +SET foreign_key_checks = 1; + + +# Update the bucket table +SET foreign_key_checks = 0; +ALTER TABLE cloudsession.bucket DEFAULT CHARACTER SET utf8; + +# Reset fields +ALTER TABLE cloudsession.bucket MODIFY type VARCHAR(200) CHARACTER SET utf8; + +SET foreign_key_checks = 1; + + +# Update the confirm_token table +SET foreign_key_checks = 0; +ALTER TABLE cloudsession.confirm_token DEFAULT CHARACTER SET utf8; + +# Reset fields +ALTER TABLE cloudsession.confirm_token MODIFY token VARCHAR(200) CHARACTER SET utf8; + +SET foreign_key_checks = 1; + + +# Update the reset_token table +SET foreign_key_checks = 0; +ALTER TABLE cloudsession.reset_token DEFAULT CHARACTER SET utf8; + +# Reset fields +ALTER TABLE cloudsession.reset_token MODIFY token VARCHAR(200) CHARACTER SET utf8; + +SET foreign_key_checks = 1; + + +# Update the user table +SET foreign_key_checks = 0; +ALTER TABLE cloudsession.user DEFAULT CHARACTER SET utf8; + +# Reset fields +ALTER TABLE cloudsession.user MODIFY email VARCHAR(250) CHARACTER SET utf8; +ALTER TABLE cloudsession.user MODIFY password VARCHAR(100) CHARACTER SET utf8; +ALTER TABLE cloudsession.user MODIFY salt VARCHAR(50) CHARACTER SET utf8; +ALTER TABLE cloudsession.user MODIFY auth_source VARCHAR(250) CHARACTER SET utf8; +ALTER TABLE cloudsession.user MODIFY locale VARCHAR(50) CHARACTER SET utf8; +ALTER TABLE cloudsession.user MODIFY screen_name VARCHAR(250) CHARACTER SET utf8; +ALTER TABLE cloudsession.user MODIFY parent_email VARCHAR(250) CHARACTER SET utf8; + +SET foreign_key_checks = 1; + diff --git a/database/tools/dumpdb.sh b/database/tools/dumpdb.sh new file mode 100755 index 0000000..cc2a24e --- /dev/null +++ b/database/tools/dumpdb.sh @@ -0,0 +1,8 @@ +#!/bin/bash +# +# Dump the local cloudsession database to a .sql file +# + +echo 'Enter the MySQL user account password below' +mysqldump --single-transaction -u blocklydb -p cloudsession > cs-backup.sql + diff --git a/templates/en/confirm-parent/blocklyprop/plain.mustache b/templates/en/confirm-parent/blocklyprop/plain.mustache index ff72128..8c7de6c 100644 --- a/templates/en/confirm-parent/blocklyprop/plain.mustache +++ b/templates/en/confirm-parent/blocklyprop/plain.mustache @@ -11,21 +11,48 @@ }} Hello, -A person under age 13 has requested a new account on the Parallax BlocklyProp web site http://{{blocklyprop-host}} under the screen name {{screenname}}. In the request, your email address was provided as the parent or guardian of the requester. - -BlocklyProp is a free, online programming tool designed for education. See Getting Started with BlocklyProp for more information. - -Why are we sending this? In the US, the federal Children's Online Privacy Protection Act (COPPA) requires that we communicate with a parent or guardian of any person under age 13 that requests a BlocklyProp account. A full copy of our Child Privacy Policy is available online at: http://{{blocklyprop-host}}/blockly/privacy-policy - -To complete your child's account registration, please copy and past this link into your browser to confirm your email address: - +Someone, perhaps your child, has requested a new account on the Parallax +BlocklyProp web site (http://blockly.parallax.com) under the screen name +{{screenname}}. When the account was created, your email address was +submitted as the parent or guardian of the registrant. If this is incorrect, +please accept our apologies. There is nothing more you need to do. The +request will automatically expire. + +Why are we sending this? In the US, the federal Children's Online Privacy +Protection Act, known as COPPA, requires that we communicate with a parent +or guardian if the person registering an BlocklyProp account is under the +age of 13. The Act allows you to decline the registration request. If you +choose this option, we will immediately remove the registration information +and the associated account. If you choose to confirm the the request and +activate the account, you may close the account at any time by clicking on +the link provided below. This action will close the account and remove any +projects that are associated with the account. + +A full copy of our Child Privacy Policy is available online at: +http://{{blocklyprop-host}}/blockly/child-privacy-policy + +BlocklyProp is a free, online programming tool designed for education. See +Getting Started with BlocklyProp for more information. + + +Confirm account registration: +Copy and paste into your browser http://{{blocklyprop-host}}/blockly/confirm?locale={{locale}}&email={{registrant-email}}&token={{token}} to confirm your email address. -If the above link is unable to complete the registration, please go to http://{{blocklyprop-host}}/blockly/confirm and enter your email address and the token: {{token}} +If the above link is unable to complete your registration, please go to +http://{{blocklyprop-host}}/blockly/confirm and enter your email address and the token: {{token}} + +If the above link is unable to complete the registration, please go to +http://{{blocklyprop-host}}/blockly/confirm and enter your email address and the token: {{token}} -If you do NOT want to complete your child's account registration, you need do nothing more; this confirmation request will automatically expire in 7 days and the account will not be created. +If you do NOT want to complete your child's account registration, you need do +nothing more; this confirmation request will automatically expire in 7 days and +the account will not be created. -If you do complete your child's account registration, you may close the account in the future. Email a request for closure and your child's screen name to blocklyadmin@parallax.com. We will confirm your request and then close the account and remove any projects that are associated with the account. +If you do complete your child's account registration, you may close the account +in the future. Email a request for closure and your child's screen name to +blocklyadmin@parallax.com. We will confirm your request and then close the account +and remove any projects that are associated with the account. Regards, diff --git a/templates/en/confirm/blocklyprop/plain.mustache b/templates/en/confirm/blocklyprop/plain.mustache index e39fe63..d414bf0 100644 --- a/templates/en/confirm/blocklyprop/plain.mustache +++ b/templates/en/confirm/blocklyprop/plain.mustache @@ -1,9 +1,9 @@ {{! This is the text body of the email}} Dear {{screenname}}, -Please go to http://{{blocklyprop-host}}/blockly/confirm?locale={{locale}}&email={{email}}&token={{token}} to confirm your email address. +Please go to http://{{blocklyprop-host}}//blockly/confirm?locale={{locale}}&email={{registrant-email}}&token={{token}} to confirm your email address. -If the url does not work, please go to http://{{blocklyprop-host}}/blockly/confirm and enter your email address and the token: {{token}} +If the url does not work, please go to http://{{blocklyprop-host}}//blockly/confirm, then enter your email address ({{email}}), and the token: {{token}} The Parallax team