Ejemplo n.º 1
0
$waka['posts'] = json_decode('[]');
$newkey = generateRandomPwd();
$waka['users'][$newkey]['email'] = $_REQUEST['email'];
$waka['users'][$newkey]['type'] = 'editor';
$waka['users'][$newkey]['notificationCooldown'] = '3600';
$waka['users'][$newkey]['dateJoined'] = date("Y-m-d H:i:s");
$waka['dateUsersTouched'] = date("Y-m-d H:i:s");
$waka['drafts'][$newkey]['title'] = '';
$waka['drafts'][$newkey]['content'] = '';
$waka['drafts'][$newkey]['files'] = json_decode('[]');
$waka['drafts'][$newkey]['images'] = json_decode('[]');
$waka['drafts'][$newkey]['dateTouched'] = date("Y-m-d H:i:s");
$mail = new PHPMailer();
$mail->From = "*****@*****.**";
$mail->Sender = "*****@*****.**";
$mail->FromName = "Waka";
$mail->AddAddress($_REQUEST['email']);
$mail->WordWrap = 50;
// set word wrap to 50 characters
$mail->IsHTML(true);
// set email format to HTML
$mail->Subject = 'New waka created: ' . $_REQUEST['title'];
$mail->Body = nl2br("Use the following link to edit it make posts:\n\n\t\t\t\t\t\n\t\t\t\t\thttp://dasunwahrscheinliche.de/waka/?w=" . $wakakey . "&u=" . $newkey . "\n\n\t\t\t\t\t\n\t\t\t\t\tDo not share this link!");
if (!$mail->Send()) {
    //echo "Message could not be sent. <p>";
    //echo "Mailer Error: " . $mail->ErrorInfo."</p>";
    //exit;
}
//echo "Message has been sent to ".$_REQUEST['email']."<br>";
writeWaka($waka, $wakakey);
header('Location: http://dasunwahrscheinliche.de/waka/?w=' . $wakakey . '&u=' . $newkey);
Ejemplo n.º 2
0
            } else {
                $tlastntf = convert_datetime($user['lastNotification']);
            }
            echo time() - $tlastntf;
            if (time() - $tlastntf > $user['notificationCooldown']) {
                $mail = new PHPMailer();
                $mail->From = "*****@*****.**";
                $mail->Sender = "*****@*****.**";
                $mail->FromName = "Waka";
                $mail->AddAddress($user['email']);
                $mail->WordWrap = 50;
                // set word wrap to 50 characters
                //$mail->AddAttachment($file, "Aushang.pdf");    // optional name
                $mail->IsHTML(false);
                // set email format to HTML
                $mail->Subject = 'Activity on waka: ' . $waka['starter']['title'];
                $mail->Body = "There has been an activity on the waka you are subscribed to. Use the following link to read the latest version:\n\t\n\t\t\t\t\t\t\t\n\t\t\t\n\t\t\t\t\t\t\thttp://dasunwahrscheinliche.de/waka/?w=" . $_REQUEST['w'] . "&u=" . $key . "\n\n\t\t\t\t\t\t\t\n\n\t\t\t\t\t\t\tDo not share this link!";
                //$mail->AltBody = $message;
                if (!$mail->Send()) {
                    echo "Message could not be sent. <p>";
                    echo "Mailer Error: " . $mail->ErrorInfo . "</p>";
                    exit;
                }
                echo "Message has been sent to " . $user['email'] . "<br>";
                $waka['users'][$key]['lastNotification'] = date("Y-m-d H:i:s");
            }
        }
    }
    writeWaka($waka, $_REQUEST['w']);
    //echo $_REQUEST['action'];
}