diff options
Diffstat (limited to 'admin')
| -rw-r--r-- | admin/admin_newsletters_inc.php | 44 | ||||
| -rw-r--r-- | admin/index.php | 4 | ||||
| -rw-r--r-- | admin/schema_inc.php | 1 | ||||
| -rw-r--r-- | admin/tend_mail_queue.php | 37 |
4 files changed, 84 insertions, 2 deletions
diff --git a/admin/admin_newsletters_inc.php b/admin/admin_newsletters_inc.php new file mode 100644 index 0000000..56a52b1 --- /dev/null +++ b/admin/admin_newsletters_inc.php @@ -0,0 +1,44 @@ +<?php +// $Header: /cvsroot/bitweaver/_bit_newsletters/admin/admin_newsletters_inc.php,v 1.1 2005/12/16 06:34:55 spiderr Exp $ + +$formNewsletterFeatures = array( + "bitmailer_sender_email" => array( + 'label' => 'From Email', + 'note' => 'If empty, it will default to the site Sender Email', + 'default' => $gBitSystem->getPreference( 'sender_email', $_SERVER['SERVER_ADMIN'] ), + ), + "bitmailer_from" => array( + 'label' => 'From Name', + 'note' => '', + 'default' => $gBitSystem->getPreference( 'siteTitle' ), + ), + "bitmailer_servers" => array( + 'label' => 'Mail Servers', + 'note' => '', + 'default' => $gBitSystem->getPreference( 'feature_server_name', $_SERVER['HTTP_HOST'] ), + ), + "bitmailer_protocol" => array( + 'label' => 'Protocol', + 'note' => '', + 'default' => 'smtp', + ), + "bitmailer_word_wrap" => array( + 'label' => 'Word wrap', + 'note' => '', + 'default' => '75', + ), +); +$gBitSmarty->assign( 'formNewsletterFeatures',$formNewsletterFeatures ); + +$processForm = set_tab(); + +if( $processForm ) { + + foreach( array_keys( $formNewsletterFeatures ) as $key ) { + if( empty( $_REQUEST[$key] ) || $_REQUEST[$key] != $formNewsletterFeatures[$key]['default'] ) { + $gBitSystem->storePreference( $key, isset( $_REQUEST[$key] ) ? $_REQUEST[$key] : NULL ); + } + } +} + +?> diff --git a/admin/index.php b/admin/index.php index b4369ab..a8d1c3e 100644 --- a/admin/index.php +++ b/admin/index.php @@ -1,6 +1,6 @@ <?php -// $Header: /cvsroot/bitweaver/_bit_newsletters/admin/Attic/index.php,v 1.5 2005/12/09 19:15:50 spiderr Exp $ +// $Header: /cvsroot/bitweaver/_bit_newsletters/admin/Attic/index.php,v 1.6 2005/12/16 06:34:55 spiderr Exp $ // Copyright (c) 2002-2003, Luis Argerich, Garland Foster, Eduardo Polidor, et. al. // All Rights Reserved. See copyright.txt for details and a complete list of authors. @@ -64,6 +64,6 @@ include_once( CATEGORIES_PKG_PATH.'categorize_list_inc.php' ); */ // Display the template -$gBitSystem->display( 'bitpackage:newsletters/admin_newsletters.tpl'); +$gBitSystem->display( 'bitpackage:newsletters/edit_newsletters.tpl'); ?> diff --git a/admin/schema_inc.php b/admin/schema_inc.php index 7e42ce4..faafe42 100644 --- a/admin/schema_inc.php +++ b/admin/schema_inc.php @@ -46,6 +46,7 @@ $tables = array( email C(160) PRIMARY, user_id I4, queue_date I8 NOTNULL, + begin_date I8, sent_date I8 CONSTRAINTS ', CONSTRAINT `tiki_nl_mailq_ed_ref` FOREIGN KEY (`edition_id`) REFERENCES `".BIT_DB_PREFIX."tiki_newsletters_editions`( `edition_id` ), , CONSTRAINT `tiki_nl_mailq_user_ref` FOREIGN KEY (`users_id`) REFERENCES `".BIT_DB_PREFIX."users_users`( `users_id` )' diff --git a/admin/tend_mail_queue.php b/admin/tend_mail_queue.php new file mode 100644 index 0000000..7565ca7 --- /dev/null +++ b/admin/tend_mail_queue.php @@ -0,0 +1,37 @@ +<?php + + global $gBitSystem, $_SERVER; + + $_SERVER['SCRIPT_URL'] = ''; + $_SERVER['HTTP_HOST'] = ''; + $_SERVER['HTTP_HOST'] = ''; + $_SERVER['HTTP_HOST'] = ''; + $_SERVER['SERVER_NAME'] = ''; + $_SERVER['SERVER_ADMIN'] = ''; + $_SERVER['SERVER_SOFTWARE'] = 'command line'; + +/** + * required setup + */ + if( !empty( $argc ) ) { + // reduce feedback for command line to keep log noise way down +// define( 'BIT_PHP_ERROR_REPORTING', E_ERROR | E_PARSE ); + } + + require_once( '../../bit_setup_inc.php' ); + + // add some protection for arbitrary thumbail execution. + // if argc is present, we will trust it was exec'ed command line. + if( empty( $argc ) && !$gBitUser->isAdmin() ) { + $gBitSystem->fatalError( 'You cannot run the thumbnailer' ); + } + + if( $gBitSystem->isPackageActive( 'newsletters' ) ) { + require_once( NEWSLETTERS_PKG_PATH.'BitMailer.php' ); + global $gBitMailer; + $gBitMailer = new BitMailer(); + + $gBitMailer->tendQueue(); + } + +?>
\ No newline at end of file |
