42 lines
957 B
PHP
42 lines
957 B
PHP
<?php
|
|
|
|
require_once("session_init.php");
|
|
require_once("config.inc.php");
|
|
require_once('fonctions.php');
|
|
|
|
$param = array(
|
|
"id:",
|
|
);
|
|
|
|
$opt = getopt( 'h::', $param );
|
|
|
|
if( array_key_exists("h", $opt) or array_key_exists("help", $opt))
|
|
{
|
|
// affiche l'aide de la commande
|
|
print "Aide de la commande bienvenue.php\n
|
|
bienvenue.php --id=<identifiant>\n
|
|
Envoie un courriel de bienvenue à l'adhérent";
|
|
}
|
|
if ( !empty($opt["id"]) )
|
|
{
|
|
require("entete_mail.php");
|
|
require_once("db.class.php");
|
|
require_once("log.php");
|
|
$db = new db( "dolibarr" );
|
|
$query = "SELECT * FROM llx_adherent WHERE rowid='" . $opt["id"] . "'";
|
|
$db->query($query);
|
|
$adherent = $db->result->fetch_array();
|
|
|
|
require("courriel_bienvenue.php");
|
|
require_once("send_mail.php");
|
|
echo $adherent["email"];
|
|
$adherent["email"] = "contact@librepc.com";
|
|
send_mail( "", $adherent["email"], $courriel_bienvenue );
|
|
}else
|
|
{
|
|
echo "La commande nécessite un argument --id non nul.\n";
|
|
}
|
|
|
|
|
|
?>
|