Permalink
Browse files

debug

  • Loading branch information...
1 parent d2bba84 commit 60cfd0aa5bd471e67d23ea34f9137d8ecf5e5209 MattiasWiesner committed Feb 15, 2012
Showing with 7 additions and 12 deletions.
  1. +1 −2 config.php
  2. +4 −8 incomingMail.php
  3. +2 −2 readMail.php
View
@@ -18,5 +18,4 @@
'CLOUDMAILIN_USERNAME' => $creds['CLOUDMAILIN']['CLOUDMAILIN_USERNAME'],
'CLOUDMAILIN_PASSWORD' => $creds['CLOUDMAILIN']['CLOUDMAILIN_PASSWORD'],
'CLOUDMAILIN_FORWARD_ADDRESS' => $creds['CLOUDMAILIN']['CLOUDMAILIN_FORWARD_ADDRESS']
-);
-?>
+);
View
@@ -1,6 +1,5 @@
<?php
require 'config.php';
-
header("Content-type: text/plain");
function myerror($msg) {
@@ -18,13 +17,13 @@ function verifySignature(){
ksort($params);
$str = implode('', array_values($params));
$signature = md5($str . $config['CLOUDMAILIN_SECRET']);
-
+
return $provided == $signature;
}
function storeMail() {
global $config;
-
+
$from = $_POST['from'];
$to = $_POST['to'];
$subject = $_POST['subject'];
@@ -57,13 +56,10 @@ function storeMail() {
if(!isset($_POST['from']) || !isset($_POST['to']) || !isset($_POST['plain'])) {
myerror("missing data");
}
-
if (!verifySignature()) {
myerror('verification error');
}
-
-if(storeMail()){
- header("HTTP/1.0 200 OK");
-} else {
+if(!storeMail()){
myerror('database error');
}
+header("HTTP/1.0 200 OK");
View
@@ -1,7 +1,7 @@
<?php
require 'config.php';
-class MailDto {
+class MailData {
public $date;
public $from;
public $to;
@@ -26,7 +26,7 @@ class MailDto {
$pdo->beginTransaction();
$selectStmt = $pdo->prepare($select);
if ($selectStmt->execute()) {
- $result = $selectStmt->fetchAll(PDO::FETCH_CLASS, 'MailDto');
+ $result = $selectStmt->fetchAll(PDO::FETCH_CLASS, 'MailData');
$selectStmt->closeCursor();
}
$pdo->commit();

0 comments on commit 60cfd0a

Please sign in to comment.