Example #1
0
	public function send_mail() {
		$tmpl = Template::mail('example.php');
		$tmpl->replace(array(
			'name' => 'John Smith'
		));
	
		Sendmail::send(array(
			'to' 		=> '*****@*****.**',
			'subject' 	=> 'Hello new user!',
			'body'		=> 	$tmpl->render()
		));
	}
Example #2
0
<h3>Add example</h3>
<?php 
if ($_POST) {
    $channel = isset($_POST['channel']) ? htmlspecialchars($_POST['channel']) : '';
    $url = isset($_POST['url']) ? htmlspecialchars($_POST['url']) : '';
    $network = isset($_POST['network']) ? htmlspecialchars($_POST['network']) : '';
    $maintainer = isset($_POST['maintainer']) ? htmlspecialchars($_POST['maintainer']) : '';
    $email = isset($_POST['email']) ? $db->quote($_POST['email']) : '';
    $sql = sprintf("INSERT INTO examples (channel, url, network, maintainer) VALUES (%s, %s, %s, %s)", $db->quote($channel), $db->quote($url), $db->quote($network), $db->quote($maintainer));
    $db->exec($sql);
    include 'sendmail.php';
    $mail = new Sendmail();
    $to = '*****@*****.**';
    $subject = 'Example addition';
    $message = "Example to be added:\n\n        Channel: {$channel}\n\n        URL: {$url}\n\n        Network: {$network}\n\n        Maintainer: {$maintainer}";
    $mail->send($to, $subject, $message, $email);
    ?>

<p>Thank you for the submission. The URL and the data you submitted will be
reviewed within the next couple of days, and then your page will appear on
the 'examples' page.</p> 

<?php 
} else {
    ?>
<p>Here you can add a statistics page. The page will only be added to the
examples if you enter sane input.</p>

<form method="POST" action="">
<table width="100%" cellpadding="2" cellspacing="0" border="0">
 <tr>
Example #3
0
Suivez ce lien pour activer le changement ou ignorer ce message si vous n'êtes pas l'auteur de cette demande.
Ce lien ne sera actif que 12 heures.
   
   
   https://{$_SERVER['SERVER_NAME']}{$_SERVER['SCRIPT_NAME']}?recover&id=req&req={$request_id}
   
   Merci d'utiliser NOALYSS
   
Cordialement,

Noalyss team
      
EOF;
        $mail->set_message($message);
        $mail->compose();
        $mail->send();
        echo '<p style="position:absolute;z-index:2;top:25px;left: 50px; background-color:whitesmoke;">
L\'email a été envoyé avec un lien et le nouveau mot de passe, vérifiez vos spams</p>';
    }
} elseif ($action == "req") {
    $request_id = HtmlInput::default_value_request("req", "");
    if (strlen(trim($request_id)) == SIZE_REQUEST) {
        require_once NOALYSS_INCLUDE . '/class_database.php';
        $cn = new Database(0);
        $value = $cn->get_value("select password from recover_pass where request=\$1 and created_on > now() - interval '12 hours' and recover_on is null", array($request_id));
        if ($cn->get_affected() > 0) {
            $cn->exec_sql("update ac_users set use_pass=md5(rp.password) from recover_pass as rp where rp.use_id=ac_users.use_id and request=\$1", array($request_id));
            $cn->exec_sql("update recover_pass set recover_by=\$1 , recover_on=now() where request=\$2", array($_SERVER['REMOTE_ADDR'], $request_id));
            ?>
    <p style="position:absolute;z-index:2;top:25px;left: 50px; background-color:whitesmoke;">
            Opération réussie , vous pouvez vous connecter avec votre nouveau mot de passe