Index: modules/massmailer/engines/phplist/config.php
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/massmailer/engines/phplist/config.php,v
retrieving revision 1.12
diff -u -r1.12 config.php
--- modules/massmailer/engines/phplist/config.php	11 Nov 2005 02:23:40 -0000	1.12
+++ modules/massmailer/engines/phplist/config.php	30 Mar 2006 00:11:08 -0000
@@ -74,18 +74,19 @@
 // set this to 1 to only simulate message sending, will not actually send emails.
 define ("TEST",0);
 
+# set this to 1 if you want PHPlist to deal with login for the administrative
+# section of the system
+# you will be able to add administrators who control their own lists
+# default login is "admin" with password "phplist"
+#
+$require_login = 1;
+
 // increase reporting verbosity, apparently this can crash some browsers with large email batches
 define ("VERBOSE",0);
 
-// Drupal sends mails in 8bit mode
-define('TEXTEMAIL_ENCODING','8bit');
-
-// We use PHPmailer for sending.
-define("PHPMAILER",1);
-
 // these are relative to the document root as you can see, if changed nothing will work. Enjoy!
-$pageroot = '/modules/massmailer/engines/phplist/phplist/lists';
-$adminpages = '/modules/massmailer/engines/phplist/phplist/lists/admin';
+$pageroot = '/modules/massmailer/engines/phplist/phplist/';
+$adminpages = '/modules/massmailer/engines/phplist/phplist/admin';
 
 # select the language module to use
 # Look for <country>.inc files in the texts directory
@@ -109,7 +110,7 @@
 # have to make sure that you run the queue from the commandline
 # check README.commandline how to do this
 // not sure if this is necessarry, but I suppose it can't hurt
-define ("MANUALLY_PROCESS_QUEUE",0);
+define ("MANUALLY_PROCESS_QUEUE",1);
 
 # if you want to use \r\n for formatting messages set the 0 to 1
 # see also http://www.securityfocus.com/archive/1/255910
Index: modules/massmailer/engines/phplist/phplist.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/massmailer/engines/phplist/phplist.module,v
retrieving revision 1.32
diff -u -r1.32 phplist.module
--- modules/massmailer/engines/phplist/phplist.module	24 Mar 2006 01:33:53 -0000	1.32
+++ modules/massmailer/engines/phplist/phplist.module	30 Mar 2006 00:11:38 -0000
@@ -799,7 +799,9 @@
  */
 function phplist_process_queue() {
 
-  if (module_exist('civicrm')) {
+	global $base_url;
+
+	if (module_exist('civicrm')) {
     civicrm_initialize(TRUE);
     $messages = db_query("SELECT m.id as mid FROM {phplist_message} m WHERE m.status = 'submitted' AND m.embargo <= '%s' ORDER BY m.embargo", date('Y-m-d H:i:s'));
 
@@ -844,9 +846,31 @@
     }
   }
 
-  return '<pre>'.shell_exec('env -i modules/massmailer/engines/phplist/bin/phplist -p processqueue -c ../../config.php -d '. $_SERVER['PHP_SELF'] .' -h '. $_SERVER['HTTP_HOST']).'</pre>';
+	if(!isset($_GET['confirm'])) {
+
+		$output .= t('<a href="%url-sendconfirm">Click here to continue to send</a>.',array('url-status', 'admin/massmailer/message','%url-sendconfirm'=>'admin/massmailer/queue?confirm=1'));
+
+		return $output;
+	}
+
+	$phplist_admin = db_fetch_object(db_query("SELECT password FROM {phplist_admin} WHERE loginname='admin'"));
+	if($phplist_admin->password) $postdata = array( 'login' => 'admin', 'password' => $phplist_admin->password );
+	else {
+		drupal_set_message('Process queue authentication failure');
+		return;
+	}
+   
+	$ch = curl_init();
+	curl_setopt($ch, CURLOPT_URL, $base_url.'/modules/massmailer/engines/phplist/phplist/admin/?page=processqueue' );
+	curl_setopt($ch, CURLOPT_POST, 1 );
+	curl_setopt($ch, CURLOPT_POSTFIELDS, $postdata);
+	curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
+	echo str_replace('<head>',"<head><base href=\"$base_url/modules/massmailer/engines/phplist/phplist/admin/\">",curl_exec($ch));
+	exit;
+
 }
 
+
 /**
 * Returns contact emails from a CiviCRM group.
 *
