Add workflow activity for expiry of users with unvalidated email addresses.

This commit is contained in:
Drake 2006-12-06 12:37:19 +00:00
parent 631d8cb0e6
commit 133cac4f77
5 changed files with 139 additions and 1 deletions

View file

@ -40,6 +40,9 @@
- WebGUI::TabForm->addTab now returns the WebGUI::HTMLForm created.
- WebGUI::AssetLineage::getLineage can now limit the number of records returned
- fix: IP addresses for adminModeSubnets not using X-Forwarded-For properly
- add: workflow activity for expiry of email-unvalidated users. This is not
enabled by default; add an instance of it to an appropriate workflow if you
want it to run.
- The Events Calendar is now the new Calendar with some fun new features.
All your existing Events Calendars will be migrated automatically.
- Major change: password recovery is now based on profile fields rather than

View file

@ -24,6 +24,7 @@ deleteOldFiles($session);
addFileFieldsToDataForm($session);
makeRSSFromParentAlwaysHidden($session);
addProfileFieldsOnPasswordRecovery($session);
addEmailValidationExpiry($session);
addNewCalendar($session);
migrateCalendars($session);
removeOldCalendar($session);
@ -294,6 +295,26 @@ EOT
$session->setting->set('webguiPasswordRecoveryTemplate', 'PBtmpl0000000000000014');
}
#-------------------------------------------------
sub addEmailValidationExpiry {
my $session = shift;
print "\tAdding email validation expiry.\n" unless $quiet;
# Remove email activation keys for active users so that if they deactivate themselves
# in the future the workflow activity doesn't treat them as deleted.
$session->db->write($_) for (<<'EOT',
DELETE FROM authentication
WHERE fieldName = 'emailValidationKey' AND
(SELECT status FROM users AS u WHERE u.userId = userId) = 'Active'
EOT
);
my $activities = $session->config->get('workflowActivities');
my $class = 'WebGUI::Workflow::Activity::ExpireUnvalidatedEmailUsers';
@{$$activities{None}} = ((grep{$_ ne $class} @{$$activities{None}}), $class);
$session->config->set('workflowActivities', $activities);
}
# ---- DO NOT EDIT BELOW THIS LINE ----
#-------------------------------------------------