Ejemplo n.º 1
0
 /**
  * beforeSendPerformed
  * do this beforeSendPerformed aint that clear ? ;)
  * @param object &$e
  * @access public
  * @return void
  */
 function beforeSendPerformed(&$e)
 {
     $message = $e->getMessage();
     $recipients = $e->getRecipients();
     $to = $recipients->getTo();
     $to = array_pop($to);
     $to = ezmlm_hash($to->getAddress());
     $references = array();
     if (count($this->message_history)) {
         foreach ($this->message_history as $history) {
             if ($history['recipient_id'] != $to) {
                 continue;
             }
             array_push($references, $history['message_id']);
         }
         // if there is more than one then we have a conversation..
         if (count($references)) {
             //"The last identifier in References identifies the parent"
             $message->headers->set('References', implode(" ", array_reverse($references)));
         }
     }
     $this->thread_info[] = array($this->task_id, $to, $message->generateId('flyspray'));
 }
Ejemplo n.º 2
0
		) or die("<b>Ашыпко:</b> MySQL error: ".mysql_error());

		// а теперь вносим в список незаплативших
		// сперва проверим что там уже нет такого юзверя:
		$sth = mysql_query(
			"SELECT count(*) FROM wt{$year2digit}{$letter}_reg WHERE address = '$email'", $qmail_link
		) or die("<b>Ашыпко:</b> MySQL error: ".mysql_error());

		$already = mysql_fetch_array($sth);

		if ( $already[0] == 0 )
		{
			// нет еще такого - стало быть, внесём на!
			mysql_query(
				"INSERT INTO wt{$year2digit}{$letter}_reg (hash, address)
					VALUES  (".ezmlm_hash($email).",'$email')", $qmail_link
			) or die("<b>Ашыпко:</b> MySQL error: ".mysql_error());
		}
	}

	header("Location: admin.php?id=".$_GET["id"]."&mes=super");
	exit(0);
}


function GetFormData() {

	// Извчлечём данные из формы:

	$GLOBALS['f_payment_date_d'] = $_POST['f_payment_date_d'];
	$GLOBALS['f_payment_date_m'] = $_POST['f_payment_date_m'];
Ejemplo n.º 3
0
<?php

/* Prototype  : int ezmlm_hash  ( string $addr  )
 * Description: Calculate the hash value needed by EZMLM.
 * Source code: ext/standard/mail.c
 */
echo "*** Testing ezmlm_hash() : basic functionality ***\n";
var_dump(ezmlm_hash("*****@*****.**"));
var_dump(ezmlm_hash("*****@*****.**"));
?>
===Done===
Ejemplo n.º 4
0
<?php

/* Prototype  : int ezmlm_hash  ( string $addr  )
 * Description: Calculate the hash value needed by EZMLM.
 * Source code: ext/standard/mail.c
 */
echo "*** Testing ezmlm_hash() : error conditions ***\n";
echo "\n-- Testing ezmlm_hash() function with fewer than expected no. of arguments --\n";
var_dump(ezmlm_hash());
echo "\n-- Testing ezmlm_hash() function with more than expected no. of arguments --\n";
$extra_arg = 10;
var_dump(ezmlm_hash("*****@*****.**", $extra_arg));
echo "\n-- Testing ezmlm_hash() function with invalid input - ARRAY --\n";
$array_arg = array(1, 2, 3, 4);
$extra_arg = 10;
var_dump(ezmlm_hash($array_arg));
echo "\n-- Testing ezmlm_hash() function with invalid input - OBJECT without 'cast_object' method --\n";
class sample
{
}
$obj_arg = new sample();
var_dump(ezmlm_hash($obj_arg));
echo "\n-- Testing ezmlm_hash() function with invalid input - RESOURCE --\n";
$file_handle = fopen(__FILE__, "r");
$extra_arg = 10;
var_dump(ezmlm_hash($file_handle));
fclose($file_handle);
?>
===DONE===
Ejemplo n.º 5
0
function VS($x, $y)
{
    var_dump($x === $y);
    if ($x !== $y) {
        echo "Failed: {$y}\n";
        echo "Got: {$x}\n";
        var_dump(debug_backtrace());
    }
}
function VERIFY($x)
{
    VS($x != false, true);
}
//////////////////////////////////////////////////////////////////////
VS(ezmlm_hash("foo"), 40);
$files = array("mime", "phpcvs1", "qp", "uue");
foreach ($files as $file) {
    $testname = __DIR__ . "/test_ext_mailparse." . $file . ".txt";
    $mime = mailparse_msg_create();
    $input = fopen($testname, "r");
    while (!feof($input)) {
        $data = fread($input, 1024);
        if ($data) {
            mailparse_msg_parse($mime, $data);
        }
    }
    $arr = mailparse_msg_get_structure($mime);
    echo "Message: ";
    echo $file;
    echo "\n";