Beispiel #1
0
$current = array('about', 'contact');
if (!file_exists('header.php')) {
    define('PATH', dirname(dirname(__FILE__)));
} else {
    define('PATH', dirname(__FILE__));
}
include PATH . '/header.php';
//ryanmccue.info keys
$publickey = '6LexVQgAAAAAACdW7JHE58XblgeWgYhJXtWMoXx2';
$privatekey = '6LexVQgAAAAAAG-1OGmS4rli-7BvpqFjag53cOtE';
require_once PATH . '/resources/recaptchalib.php';
$messages = array();
$error = null;
if (!empty($_POST['submit'])) {
    try {
        $messages = process_email($privatekey);
    } catch (Exception $e) {
        $error = $e->getMessage();
    }
}
function process_email($privatekey)
{
    # the response from reCAPTCHA
    $resp = null;
    # the error code from reCAPTCHA, if any
    $error = null;
    # was there a reCAPTCHA response?
    if ($_POST["recaptcha_response_field"]) {
        $resp = recaptcha_check_answer($privatekey, $_SERVER["REMOTE_ADDR"], $_POST["recaptcha_challenge_field"], $_POST["recaptcha_response_field"]);
        if (!$resp->is_valid) {
            # set the error code so that we can display it
Beispiel #2
0
 if ($count) {
     $old_degre = null;
     foreach ($eleves as $eleve) {
         extract($eleve, EXTR_PREFIX_ALL, 'eleve');
         array_shift($eleve);
         if ($multi_degres && $eleve_degre != $old_degre) {
             // Classe multi-degrés: changement de degré
             $range = 'A' . ++$row;
             $xlWS->setCellValue($range, "Elèves de {$eleve_degre}")->getStyle($range)->getFont()->setBold(true);
             $old_degre = $eleve_degre;
             $row++;
         }
         $xlWS->fromArray($eleve, null, 'A' . $row);
         // Formatting: left-align NPA column
         $xlWS->getStyle(COL_NPA . $row)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_LEFT);
         process_email(COL_EMAIL . $row++);
     }
 } else {
     $range = 'A' . ++$row;
     $xlWS->setCellValue($range, "Aucun élève n'est enregistré dans cette classe")->mergeCells($range . ':' . $last_col . $row)->getStyle($range)->getFont()->setItalic(true)->setBold(true);
     $row++;
 }
 // Disclaimer
 $range = 'A' . ($row += 2);
 $style = array('font' => array('italic' => true));
 $xlWS->setCellValue($range, "NOTE: Cette liste inclut uniquement les enfants dont " . "les parents se sont inscrits et ont autorisé le partage de " . "leurs données personnelles.")->mergeCells($range . ':' . $last_col . $row)->getStyle($range)->applyFromArray($style);
 //	$xlWS->getRowDimension($row)->setRowHeight(45);
 $range = 'A' . ++$row;
 $xlWS->setCellValue($range, "Si vous souhaitez que votre enfant figure sur cette liste, " . "inscrivez-vous sur le site de l'APECOVE.")->mergeCells($range . ':' . $last_col . $row)->getStyle($range)->applyFromArray($style);
 $xlWS->getCell($range)->getHyperlink()->setUrl('http://apecove.ch/listes-classe/');
 // Autosize columns. The autosize method will only be set when saving the file
Beispiel #3
0
/**
 * Check an imap mailbox for new mailbounces
 */
function check_imap_for_bounces()
{
    $imapserver = get_config('imapserver');
    if (!$imapserver) {
        return;
    }
    if (!extension_loaded('imap')) {
        log_debug('php imap extension not loaded, can\'t continue');
        return;
    }
    $imapport = get_config('imapport');
    $imap = imap_open("{" . $imapserver . ($imapport ? ':' . $imapport : '') . get_config('imapflags') . '}' . get_config('imapmailbox'), get_config('imapuser'), get_config('imappass'));
    $check = imap_check($imap);
    if ($check->Nmsgs == 0) {
        imap_close($imap);
        return;
    }
    $emails = imap_fetch_overview($imap, "1:" . $check->Nmsgs);
    foreach ($emails as $email) {
        if ($email->deleted) {
            continue;
        }
        $address = $email->to;
        log_debug('---------- started  processing email at ' . date('r', time()) . ' ----------');
        log_debug('-- mail from ' . $address . ' -- delivered ' . $email->date);
        $ret = process_email($address);
        log_debug('---------- finished processing email at ' . date('r', time()) . ' ----------');
        imap_delete($imap, $email->msgno);
    }
    imap_expunge($imap);
    imap_close($imap);
}
<?php

/**
 *
 * @package    mahara
 * @subpackage core
 * @author     Andrew Nicols <*****@*****.**>
 * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL version 3 or later
 * @copyright  For copyright information on Mahara, please see the README file distributed with this software.
 * @copyright  (C) 2009 Lancaster University Network Services Limited
 *                      http://www.luns.net.uk
 */
define('INTERNAL', 1);
define('PUBLIC', 1);
define('TITLE', '');
require dirname(dirname(__FILE__)) . '/init.php';
$address = getenv('RECIPIENT');
log_debug('---------- started  processing email at ' . date('r', time()) . ' ----------');
log_debug('-- mail from ' . $address);
$email = process_email($address);
log_debug('---------- finished processing email at ' . date('r', time()) . ' ----------');