Skip to content

Commit

Permalink
Merge branch 'Reminder_Emails'
Browse files Browse the repository at this point in the history
  • Loading branch information
adamfranco committed Mar 14, 2012
2 parents ff8ddef + 4cb13a8 commit 7ac2c9c
Show file tree
Hide file tree
Showing 5 changed files with 494 additions and 2 deletions.
85 changes: 85 additions & 0 deletions cli/index_cli.php
@@ -0,0 +1,85 @@
<?php
/**
* This is a command-line entry point to concerto that allows execution of actions
*
* @package segue
*
* @copyright Copyright &copy; 2007, Middlebury College
* @license http://www.gnu.org/copyleft/gpl.html GNU General Public License (GPL)
*/

/*********************************************************
* Define a Constant reference to this application directory.
*********************************************************/

if (!defined('MYDIR'))
define("MYDIR",realpath(dirname(__FILE__)."/../"));

if (!defined('MYPATH'))
define("MYPATH", MYDIR);

if (!defined('MYURL'))
define("MYURL", MYPATH."/bin/index_cli.php");

if (!defined('LOAD_GUI'))
define("LOAD_GUI", true);

if (!defined('HELP_TEXT'))
define("HELP_TEXT", "
This is a command line entry point to Segue. You must specify a module and
action. Additional parameters can be specified using the following format:
--<parameter_name>='<parameter_value>'
Usage:
".$_SERVER['argv'][0]." --module=<module_name> --action=<action_name> [parameters]
");

/*********************************************************
* Include our libraries
*********************************************************/
require_once(MYDIR."/main/include/libraries.inc.php");

/*********************************************************
* Include our configuration and setup scripts
*********************************************************/
require_once(MYDIR."/main/include/setup.inc.php");

/*********************************************************
* Execute our actions
*********************************************************/
if (defined('ENABLE_TIMERS') && ENABLE_TIMERS) {
require_once(HARMONI."/utilities/Timer.class.php");
$execTimer = new Timer;
$execTimer->start();
}

require_once(HARMONI."architecture/output/CommandLineOutputHandler.class.php");
$harmoni->attachOutputHandler(new CommandLineOutputHandler);

require_once(HARMONI."architecture/request/CommandLineRequestHandler.class.php");
$harmoni->request->assignRequestHandler(new CommandLineRequestHandler($_SERVER['argv']));

try {
$harmoni->execute();
} catch (UnknownActionException $e) {
print HELP_TEXT;
} catch (HelpRequestedException $e) {
print $e->getMessage();
}

if (defined('ENABLE_TIMERS') && ENABLE_TIMERS) {
$execTimer->end();
print "\n<table>\n<tr><th align='right'>Execution Time:</th>\n<td align='right'><pre>";
printf("%1.6f", $execTimer->printTime());
print "</pre></td></tr>\n</table>";

$dbhandler = Services::getService("DBHandler");
printpre("NumQueries: ".$dbhandler->getTotalNumberOfQueries());

// printpreArrayExcept($_SESSION, array('__temporarySets'));
// debug::output(session_id());
// Debug::printAll();
}
?>
26 changes: 26 additions & 0 deletions cli/send_reminder_emails.php
@@ -0,0 +1,26 @@
<?php
/**
* This is a command line script that will send migration reminder emails.
* It takes no arguments or parameters.
*
* @package segue.dataport
*
* @copyright Copyright &copy; 2012, Middlebury College
* @license http://www.gnu.org/copyleft/gpl.html GNU General Public License (GPL)
*
* @version $Id$
*/

if (!defined('HELP_TEXT'))
define("HELP_TEXT",
"This is a command line script that will clean up old OAI resumption tokens.
It takes no arguments or parameters.
");

if (!defined("OAI_UPDATE_OUTPUT_HTML"))
define("OAI_UPDATE_OUTPUT_HTML", false);

$_SERVER['argv'][] = '--module=dataport';
$_SERVER['argv'][] = '--action=send_migration_reminders';

require(dirname(__FILE__)."/index_cli.php");
39 changes: 38 additions & 1 deletion config/dataport_default.conf.php
Expand Up @@ -123,4 +123,41 @@
// $isAuthorizedCache = $authZ->getIsAuthorizedCache();
// $isAuthorizedCache->dirtyUser();
// }
// }
// }

/*********************************************************
* Migration Reminder Emails
*********************************************************/
// define('MIGRATION_REMINDER_EMAIL_FROM_NAME', 'Middlebury College Webmaster');
// define('MIGRATION_REMINDER_EMAIL_FROM_MAIL', 'webmaster@middlebury.edu');
// define('MIGRATION_REMINDER_EMAIL_SUBJECT', 'Segue Migration Reminder for [[USER]]');
// define('MIGRATION_REMINDER_EMAIL_MESSAGE', '<html>
// <head>
// <title>Segue Migration Reminder for [[USER]]</title>
// </head>
// <body>
// <p>Greetings [[USER]],</p>
//
// <p>Segue will be shut down on August 31st, 2012. You are listed as an administrator
// of the following Segue sites whose migration status is "Incomplete".</p>
//
// [[SITE_LIST]]
//
// <p>If you would like to preserve these sites please migrate or archive them.
// <a href="http://mediawiki.middlebury.edu/wiki/LIS/Migrate_From_Segue">Instructions on
// migrating and archiving sites</a> can be found in the LIS Wiki. If you have
// questions about the migration process, please contact your LIS Liason
// (<a href="http://go.middlebury.edu/liasons">go/liaisons</a>).</p>
//
// <p>After you have migrated or archived each site, please log into Segue and
// update its status to stop receiving these reminders for that site. If you
// simply no longer need a site you can log into Segue and mark it as
// "No Longer Needed" to stop receiving these reminders for that site.</p>
//
//
// </body>
// </html>');
//
// define('MIGRATION_REMINDER_EMAIL_TEST_ONLY', true);
// define('MIGRATION_REMINDER_EMAIL_TEST_MAX', 2);
// define('MIGRATION_REMINDER_EMAIL_TEST_RECIPIENT', 'afranco@middlebury.edu');
2 changes: 1 addition & 1 deletion main/harmoni

0 comments on commit 7ac2c9c

Please sign in to comment.