Wikini

NotificationEmailLight

PagePrincipale :: DerniersChangements :: DerniersCommentaires :: ParametresUtilisateur :: Vous êtes ec2-174-129-59-198.compute-1.amazonaws.com
Un email est envoyé a toutes les personnes inscrites sur le Wiki.
Attention, convient uniquement pour un nombre d'utilisateurs réduits
Ne pas mettre ce handler sur un wiki avec de nombreux inscrits sous peine
d'envoyer une quantité inimaginable de mail à tous le monde.


Usage : (avec rewrite activé): http://mondomain/MaPage/mail

Copier coller ce code dans un fichier mail.php, que vous metterez dans le répertoire action/


<?php
/*
mail.php

Auteur FranckExeprod
Revision: 0.9

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
*/

//vérification de sécurité
if (!eregi("wakka.php"$_SERVER['PHP_SELF'])) {
    die (
"acc&egrave;s direct interdit");
}

echo 
$this->Header();

if (
$this->HasAccess("read")) {
  if (!
$this->page) {
    return;
  } else {
    
$page_name=$this->page['tag'];
    
$url_page="http://".$_SERVER['SERVER_NAME'].'/'.$page_name;
    
$users=$this->LoadAll("SELECT email FROM ".$this->config["table_prefix"]."users");
    
$subject="[WIKI] Changement de $url_page";
    
$message="La page $url_page a ete modifiee par ".$this->UserName();
    echo 
"Sujet: $subject<br>";
    echo 
"Texte : $message<br>";
    echo 
"<br>";
    foreach (
$users as $user) {
      
mail($user["email"],$subject,$message);
      echo 
"Email envoye a ".$this->Format("//".$user['email']."//")."<br>";
    }
  }
} else{
  return;
}

echo 
"<br>";
echo 
$this->Footer();
?>

Il n'y a pas de commentaire sur cette page. [Afficher commentaires/formulaire]