From 4718063a7890b5c8ff94e7bf71bcfae837a43e9b Mon Sep 17 00:00:00 2001 From: Zach Copley Date: Mon, 16 May 2011 13:25:26 -0700 Subject: [PATCH] Script to cancel an email registration --- .../scripts/cancelemailregistration.php | 55 +++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 plugins/EmailRegistration/scripts/cancelemailregistration.php diff --git a/plugins/EmailRegistration/scripts/cancelemailregistration.php b/plugins/EmailRegistration/scripts/cancelemailregistration.php new file mode 100644 index 0000000000..e6430e850f --- /dev/null +++ b/plugins/EmailRegistration/scripts/cancelemailregistration.php @@ -0,0 +1,55 @@ +#!/usr/bin/env php +. + */ + +define('INSTALLDIR', realpath(dirname(__FILE__) . '/../../..')); + +$shortoptions = 'd'; +$longoptions = array('dryrun'); + +$helptext = << + +Options: +-d --dryrun Don't actually delete the email registration and confirmation code + +Cancel an email registration code + +END_OF_REGISTEREMAILUSER_HELP; + +require_once INSTALLDIR.'/scripts/commandline.inc'; + +if (count($args) == 0) { + show_help(); +} + +$email = $args[0]; + +$confirm = Confirm_address::getAddress($email, EmailRegistrationPlugin::CONFIRMTYPE); + +if (!empty($confirm)) { + if (have_option('d', 'dryrun')) { + print "[Dry run mode] Deleted confirmation code {$confirm->code} for {$confirm->address}.\n"; + } else { + $confirm->delete(); + print "Deleted confirmation code {$confirm->code} for {$confirm->address}.\n"; + } +} else { + print "Couldn't find an email registration code for {$email}.\n"; +} -- 2.39.5