Пример #1
0
function add_mbr($pseudo, $password, $email, $identifier = '', $valide = 0)
{
    $bf_token = 'jJ_=éZAç1l';
    $ft_token = 'ù%*àè1ç0°dezf';
    $key_alea_code_activate = md5(uniqid(mt_rand()));
    // Enregistrement de l'utilisateur dans la base de données
    Nw::$DB->query('INSERT INTO ' . Nw::$prefix_table . 'members (u_pseudo, u_alias, u_identifier, u_password, u_email, u_group, u_date_register, u_active, u_code_act, u_ip)
    VALUES(\'' . insertBD(trim($pseudo)) . '\', \'' . rewrite(trim($pseudo)) . '\', \'' . insertBD(trim($identifier)) . '\', \'' . insertBD(sha1($bf_token . trim($password) . $ft_token)) . '\', \'' . insertBD(trim($email)) . '\',
    4, NOW(), ' . intval($valide) . ', \'' . insertBD($key_alea_code_activate) . '\', \'' . get_ip() . '\')') or Nw::$DB->trigger(__LINE__, __FILE__);
    $id_new_membre = Nw::$DB->insert_id;
    $identifiant_unique = md5($id_new_membre . uniqid(rand(), true));
    $lien_activation = Nw::$site_url . 'users-32.html?mid=' . $id_new_membre . '&ca=' . $key_alea_code_activate;
    Nw::$DB->query('UPDATE ' . Nw::$prefix_table . 'members SET u_ident_unique = \'' . Nw::$DB->real_escape_string($identifiant_unique) . '\' WHERE u_id = ' . intval($id_new_membre)) or Nw::$DB->trigger(__LINE__, __FILE__);
    Nw::$DB->query('INSERT INTO ' . Nw::$prefix_table . 'members_stats (s_id_membre) VALUES(' . intval($id_new_membre) . ')') or Nw::$DB->trigger(__LINE__, __FILE__);
    inc_lib('users/mail2gd');
    mail2gd($identifiant_unique, trim($email));
    inc_lib('newsletter/add_abonnement');
    add_abonnement(trim($email), $id_new_membre);
    // Envoie d'email de validation
    if ($valide == 0) {
        $txt_mail = sprintf(Nw::$lang['users']['mail_confirm_insc'], $pseudo, Nw::$site_url, Nw::$site_name, $lien_activation, $lien_activation, $lien_activation);
        @envoi_mail(trim($email), sprintf(Nw::$lang['users']['confirm_inscription'], Nw::$site_name), $txt_mail);
    } else {
        // Le compte est confirmé, on met à jour le nbr de membres
        inc_lib('admin/gen_cachefile_nb_members');
        gen_cachefile_nb_members();
        generate_members_sitemap();
    }
    return $id_new_membre;
}
Пример #2
0
 /**
  *  Mot de passe oublié (partie 1)
  *  @author Cam
  *  @return tpl
  */
 protected function main()
 {
     // Si le membre est déjà connecté
     if (is_logged_in()) {
         redir(Nw::$lang['common']['already_connected'], false, './');
     }
     $this->set_title(Nw::$lang['users']['title_lost_pwd']);
     $this->set_tpl('membres/oubli_mdp.html');
     $this->add_css('forms.css');
     // Fil ariane
     $this->set_filAriane(Nw::$lang['users']['title_lost_pwd']);
     //Si le formulaire a été validé
     if (isset($_POST['submit'])) {
         // Cette adresse email existe bien sur le site
         inc_lib('users/email_exists');
         if (email_exists($_POST['mail'])) {
             //On récupère les infos du membre
             inc_lib('users/get_info_mbr');
             $membre_mail = get_info_mbr($_POST['mail'], 'mail');
             $lien_password = Nw::$site_url . 'users-13.html?idm=' . $membre_mail['u_id'] . '&ca=' . $membre_mail['u_code_act'];
             //On prépare le texte de l'email
             $txt_mail = sprintf(Nw::$lang['users']['mail_oubli_pwd'], $membre_mail['u_pseudo'], $lien_password, $lien_password, $lien_password);
             @envoi_mail(trim($_POST['mail']), sprintf(Nw::$lang['users']['title_mail_lost_pwd'], Nw::$site_name), $txt_mail);
             redir(Nw::$lang['users']['send_mail_lost'], true, './');
         } else {
             redir(Nw::$lang['users']['email_aucun_mbr'], false, 'users-12.html');
         }
     }
 }
Пример #3
0
function validate($type, $id)
{
    $params1 = false;
    $params2 = false;
    switch ($type) {
        case "valider":
            $message = ["message" => "Inscription valide"];
            $params1 = ['valid' => 1];
            $params2 = "validation";
            break;
        case "refuser":
            $message = ["message" => "Inscription refuse"];
            $params1 = ['valid' => 2];
            $params2 = "refus";
            break;
        case "supprimer":
            $message = ["message" => "Inscription supprimee"];
            break;
        case "toutsupprimer":
            $params2 = "suppression";
            break;
    }
    if ($params1) {
        $upd = Config::QueryBuilder()->update('exposants', ['id' => $id], $params1)->execute();
        envoi_mail($params2, $id);
    } elseif ($params2) {
        $upd = Config::QueryBuilder()->deleteAll('exposants')->execute();
    } else {
        $upd = Config::QueryBuilder()->delete('exposants')->where(['id' => $id])->execute();
    }
    if ($upd) {
        if (!$message) {
            $message = ["message" => "Une erreur est survenue merci de contacter un administrateur"];
        }
    }
    $response = json_encode($message);
    return $response;
}
Пример #4
0
					if((getSettingValue('mode_email_ele')=='mon_compte')) {
						$sql="UPDATE eleves SET email='$reg_email' WHERE login='******'login']."';";
						$update_eleve=mysqli_query($GLOBALS["mysqli"], $sql);
						if(!$update_eleve) {$msg.="<br />Erreur lors de la mise à jour de la table 'eleves'.";}

						if((getSettingValue('envoi_mail_actif')!='n')&&(getSettingValue('informer_scolarite_modif_mail')!='n')) {
							$sujet_mail=remplace_accents("Mise à jour mail ".$_SESSION['nom']." ".$_SESSION['prenom'],'all');
							$message_mail="L'adresse email de l'élève ";
							$message_mail.=remplace_accents($_SESSION['nom']." ".$_SESSION['prenom'],'all')." est passée à '$reg_email'. Vous devriez mettre à jour Sconet en conséquence.";
							$destinataire_mail=getSettingValue('email_dest_info_modif_mail');
							if($destinataire_mail=="") {
								$destinataire_mail=getSettingValue('gepiSchoolEmail');
							}
							$tab_param_mail['destinataire']=$destinataire_mail;
							if(($destinataire_mail!='')&&(check_mail($destinataire_mail))) {
								envoi_mail($sujet_mail, $message_mail, $destinataire_mail, "", "plain", $tab_param_mail);
							}
						}
					}
				}
			}
		}
	}


	if ($_SESSION['statut'] == "scolarite" OR $_SESSION['statut'] == "professeur" OR $_SESSION['statut'] == "cpe")
	if ($user_show_email != $reg_show_email) {
	if ($reg_show_email != "no" and $reg_show_email != "yes") $reg_show_email = "no";
		$reg = mysqli_query($GLOBALS["mysqli"], "UPDATE utilisateurs SET show_email = '$reg_show_email' WHERE login = '******'login'] . "'");
		if ($reg) {
			if($msg!="") {$msg.="<br />";}
Пример #5
0
                            if ($destinataires != "") {
                                $texte_mail = $texte_mail . "\n\n" . "Message: " . preg_replace('#<br />#', "\n", $msg);
                                $subject = "[GEPI][" . ucfirst($mod_disc_terme_incident) . " n°{$id_incident}]" . $info_classe_prot . $liste_protagonistes_responsables;
                                $headers = "";
                                if (isset($_SESSION['email']) && check_mail($_SESSION['email'])) {
                                    $headers .= "Reply-to:" . $_SESSION['email'] . "\r\n";
                                    $tab_param_mail['replyto'] = $_SESSION['email'];
                                }
                                if (isset($message_id)) {
                                    $headers .= "Message-id: {$message_id}\r\n";
                                }
                                if (isset($references_mail)) {
                                    $headers .= "References: {$references_mail}\r\n";
                                }
                                // On envoie le mail
                                $envoi = envoi_mail($subject, $texte_mail, $destinataires, $headers, "plain", $tab_param_mail);
                            }
                        }
                    }
                }
            }
        }
    }
}
//$utilisation_scriptaculous="y";
//$utilisation_jsdivdrag='non';
//$javascript_specifique[]="lib/prototype";
$javascript_specifique[] = "lib/scriptaculous";
$javascript_specifique[] = "lib/unittest";
$javascript_specifique[] = "lib/effects";
$javascript_specifique[] = "lib/controls";
            }
            print "Unpaid invoice " . $obj->facnumber . ", price " . price2num($obj->total_ttc) . ", due date " . dol_print_date($db->jdate($obj->due_date), 'day') . " (linked to company " . $obj->name . ", sale representative " . dolGetFirstLastname($obj->firstname, $obj->lastname) . ", email " . $obj->email . ", lang " . $outputlangs->defaultlang . "): ";
            if (dol_strlen($obj->email)) {
                print "qualified.";
            } else {
                print "disqualified (no email).";
            }
            print "\n";
            unset($outputlangs);
            $total += $obj->total_ttc;
            $i++;
        }
        // Si il reste des envois en buffer
        if ($foundtoprocess) {
            if (dol_strlen($oldemail) && $oldemail != 'none') {
                envoi_mail($mode, $oldemail, $message, $total, $oldlang, $oldsalerepresentative);
            } else {
                if ($oldemail != 'none') {
                    print "- No email sent for " . $oldsalerepresentative . ", total: " . $total . "\n";
                }
            }
        }
    } else {
        print "No unpaid invoices (for companies linked to a particular commercial dolibarr user) found\n";
    }
    exit(0);
} else {
    dol_print_error($db);
    dol_syslog("email_unpaid_invoices_to_representatives.php: Error");
    exit(-1);
}
Пример #7
0
                $result = pg_query($db, $query) or die("Erreur pgSQL : " . pg_result_error($result));
                $row = pg_fetch_array($result);
                $message_html = msg_pw($row);
                envoi_mail($row['email'], $sujet, $message_html, "");
            } elseif (strlen($select) > 0) {
                $pairs = explode("&", $select);
                foreach ($pairs as $key => $value) {
                    $id = ltrim($value, "id=");
                    $where .= "a.id_user='******' OR ";
                }
                $where = rtrim($where, "OR ");
                $query = "SELECT a.id_user, lib_cbn, nom, prenom, login, pw, tel_bur, tel_port, email, web, descr, aze.lr,qsd.eee,wxc.refnat,zer.catnat,sdf.lsi,xcv.fsd,ref_lr, ref_eee, ref_lsi, ref_catnat, ref_refnat,ref_fsd\n\t\t\tFROM applications.utilisateur a\n\t\t\tJOIN referentiels.cbn z ON a.id_cbn = z.id_cbn\n\t\t\tJOIN (SELECT id_user, lib as lr FROM applications.utilisateur a JOIN referentiels.user_ref z ON niveau_lr = cd) as aze ON aze.id_user = a.id_user\n\t\t\tJOIN (SELECT id_user, lib as eee FROM applications.utilisateur a JOIN referentiels.user_ref z ON niveau_eee = cd) as qsd ON qsd.id_user = a.id_user\n\t\t\tJOIN (SELECT id_user, lib as refnat FROM applications.utilisateur a JOIN referentiels.user_ref z ON niveau_refnat = cd) as wxc ON wxc.id_user = a.id_user\n\t\t\tJOIN (SELECT id_user, lib as catnat FROM applications.utilisateur a JOIN referentiels.user_ref z ON niveau_catnat = cd) as zer ON zer.id_user = a.id_user\n\t\t\tJOIN (SELECT id_user, lib as lsi FROM applications.utilisateur a JOIN referentiels.user_ref z ON niveau_lsi = cd) as sdf ON sdf.id_user = a.id_user\n\t\t\tJOIN (SELECT id_user, lib as fsd FROM applications.utilisateur a JOIN referentiels.user_ref z ON niveau_fsd = cd) as xcv ON xcv.id_user = a.id_user\n\t\t\tWHERE {$where};\n\t\t\t";
                $result = pg_query($db, $query) or die("Erreur pgSQL : " . pg_result_error($result));
                while ($row = pg_fetch_array($result)) {
                    $message_html = msg_pw($row);
                    envoi_mail($row['email'], $sujet, $message_html, "");
                }
            }
            break;
    }
    echo "</div>";
    //------------------------------------------------------------------------------
    echo "</div>";
    echo "</div>";
    echo "<br /></div>";
    echo "<div></body></html>";
    pg_close($db);
    //------------------------------------------------------------------------------ SI PAS ACCES
} else {
    require "../commun/access_denied.php";
}
Пример #8
0
/**
 * Actions en cas d'attaque CSRF
 *
 * Construit un message à envoyé à l'administrateur et à enregistrer dans les logs
 *
 * @param bool $envoyer_mail Un courriel est envoyé à l'administrateur si TRUE
 * @see getSettingValue()
 * @see envoi_mail()
 */
function action_alea_invalide($envoyer_mail=TRUE) {
	
	// NE pas donner dans le mail les valeurs du token pour éviter des problèmes lors d'une éventuelle capture du mail.

	$details="La personne victime de l'attaque était ".$_SESSION['login'].".\n";
	$details.="La page cible était ".$_SERVER['PHP_SELF']." avec les variables suivantes:\n";
	$details.="Variables en \$_POST:\n";
	foreach($_POST as $key => $value) {
      $details.="   \$_POST[$key]=$value\n";
	}

	$details.="Variables en \$_GET:\n";
	foreach($_GET as $key => $value) {
		$details.="   \$_GET[$key]=$value\n";
	}

	if($envoyer_mail) {
		// Envoyer un mail à l'admin
		$envoi_mail_actif=getSettingValue('envoi_mail_actif');
		if($envoi_mail_actif!="n") {
			$destinataire=getSettingValue('gepiAdminAdress');
			if($destinataire!='') {
				$sujet="Attaque CSRF";
				$message="La variable csrf_alea ne coincide pas avec le gepi_alea en SESSION.\n";
				$message.=$details;
				envoi_mail($sujet, $message,$destinataire);
			}
		}
	}

	if(getSettingValue('csrf_log')=='y') {
		$csrf_log_chemin=getSettingValue('csrf_log_chemin');
		if($csrf_log_chemin=='') {$csrf_log_chemin="/home/root/csrf";}
		$f=fopen("$csrf_log_chemin/csrf_".$_SESSION['login'].".log","a+");
		fwrite($f,"Alerte CSRF ".strftime("%a %d/%m/%Y %H:%M:%S")." avec\n");
		fwrite($f,"\$_SESSION['gepi_alea']=".$_SESSION['gepi_alea']."\n");
		fwrite($f,$details."\n");
		fwrite($f,"================================================\n");
		fclose($f);
	}
}
Пример #9
0
<?php

require $_SERVER['DOCUMENT_ROOT'] . '/BiellesMeusiennes/BiellesMeusiennes/vendor/autoload.php';
include_once $_SERVER['DOCUMENT_ROOT'] . '/BiellesMeusiennes/BiellesMeusiennes/includes/common/functions.php';
include_once $_SERVER['DOCUMENT_ROOT'] . '/BiellesMeusiennes/BiellesMeusiennes/includes/common/mailing.php';
use Core\Mailer\Mail;
use Core\Configure\Config;
use Core\Export\DataExporter;
envoi_mail("inscription", "*****@*****.**", 83);
envoi_mail("nouvel_inscrit", "*****@*****.**", 83);
envoi_mail("validation", "*****@*****.**", 83);
envoi_mail("refus", "*****@*****.**", 83);
Пример #10
0
 $ajout_headers = "";
 $email_utilisateur = retourne_email($_SESSION['login']);
 if ($email_utilisateur != '') {
     $ajout_headers = "Reply-to: {$email_utilisateur}";
     $tab_param_mail['replyto'] = $email_utilisateur;
 }
 // On considère que le signalement est un succès, si le mail est envoyé pour au moins un destinataire
 $temoin = false;
 $temoin2 = true;
 while ($lig = mysqli_fetch_object($res)) {
     if ($envoi_mail_actif != 'n' && check_mail($lig->email)) {
         $destinataire = $lig->email;
         $tab_param_mail['destinataire'] = $destinataire;
         $sujet = "[GEPI]: Signalement par " . casse_mot($_SESSION['prenom'], 'majf2') . " " . $_SESSION['nom'];
         //if(envoi_mail($sujet, nl2br($signalement_message), $destinataire, $ajout_headers)) {$temoin=true;}
         if (envoi_mail($sujet, $signalement_message, $destinataire, $ajout_headers, "plain", $tab_param_mail)) {
             $temoin = true;
         }
     }
     // On dépose un message en page d'accueil:
     $statuts_destinataires = "_";
     // Deux semaines d'affichage
     $date_debut = time();
     $date_fin = $date_debut + 2 * 7 * 24 * 3600;
     $date_decompte = $date_fin;
     $contenu_cor = "<strong>Signalement par " . casse_mot($_SESSION['prenom'], 'majf2') . " " . $_SESSION['nom'] . "</strong><br />" . mysqli_real_escape_string($GLOBALS['mysqli'], nl2br($signalement_message));
     if (!set_message($contenu_cor, $date_debut, $date_fin, $date_decompte, $statuts_destinataires, $lig->login)) {
         $temoin2 = false;
     }
 }
 if ($temoin && $temoin2) {
Пример #11
0
         }
     }
 }
 $saut = 1;
 $nb_fiches = getSettingValue("ImpressionNombreParent");
 $tab_envoi_reussi = array();
 foreach ($tab_classe_parent as $classe => $tab_parent) {
     /*
     echo "<pre>";
     print_r($tab_parent);
     echo "</pre>";
     */
     for ($loop = 0; $loop < count($tab_parent); $loop++) {
         $chaine = "<table>\n\t<tr>\n\t\t<th style='text-align:left;'>A l'attention de </th>\n\t\t<th>: </th>\n\t\t<td>" . $tab_parent[$loop]['nom_prenom'] . "</td>\n\t</tr>\n\t<tr>\n\t\t<th style='text-align:left;'>Login ENT</th>\n\t\t<th>: </th>\n\t\t<td>" . $tab_parent[$loop]['login_ent'] . "</td>\n\t</tr>\n\t<tr>\n\t\t<th style='text-align:left;'>Mot de passe ENT</th>\n\t\t<th>: </th>\n\t\t<td>" . $tab_parent[$loop]['mdp_ent'] . "</td>\n\t</tr>\n\t<tr>\n\t\t<th style='text-align:left;'>Email ENT</th>\n\t\t<th>: </th>\n\t\t<td>" . $tab_parent[$loop]['email_ent'] . "</td>\n\t</tr>\n\t<tr>\n\t\t<th style='text-align:left; vertical-align:top;'>Adresse</th>\n\t\t<th style='vertical-align:top;'>: </th>\n\t\t<td>" . $tab_parent[$loop]['adresse'] . "</td>\n\t</tr>\n\t<tr>\n\t\t<th style='text-align:left;'>Responsable notamment de</th>\n\t\t<th>: </th>\n\t\t<td>" . $tab_parent[$loop]['resp_de'] . "</td>\n\t</tr>\n</table>\n{$impression}";
         $tab_param_mail['destinataire'] = $tab_parent[$loop]['email_gepi'];
         if (isset($tab_parent[$loop]['email_gepi']) && ($envoi = envoi_mail("Compte Gepi", "Bonjour(soir),\n" . $chaine, $tab_parent[$loop]['email_gepi'], "", "html", $tab_param_mail))) {
             $tab_envoi_reussi[] = $tab_parent[$loop]['nom_prenom'] . " (" . $tab_parent[$loop]['email_gepi'] . ") parent de " . $tab_parent[$loop]['resp_de'];
         } else {
             echo $chaine . "";
             // Saut de page toutes les $nb_fiches fiches
             if ($saut == $nb_fiches) {
                 echo "<p class='saut'>&nbsp;</p>\n";
                 $saut = 1;
             } else {
                 $saut++;
             }
             echo "<hr class='noprint'/>";
         }
         flush();
     }
 }
         }
         print "Unpaid invoice " . $obj->facnumber . ", price " . price2num($obj->total_ttc) . ", due date " . dol_print_date($db->jdate($obj->due_date), 'day') . ", customer id " . $obj->sid . " " . $obj->name . ", " . ($obj->cid ? "contact id " . $obj->cid . " " . $obj->clastname . " " . $obj->cfirstname . ", " : "") . "email " . $newemail . ", lang " . $outputlangs->defaultlang . ": ";
         if (dol_strlen($newemail)) {
             print "qualified.";
         } else {
             print "disqualified (no email).";
         }
         print "\n";
         unset($outputlangs);
         $total += $obj->total_ttc;
         $i++;
     }
     // Si il reste des envois en buffer
     if ($foundtoprocess) {
         if (dol_strlen($oldemail) && $oldemail != 'none' && empty($trackthirdpartiessent[$oldsid . '|' . $oldemail])) {
             envoi_mail($mode, $oldemail, $message, $total, $oldlang, $oldtarget);
             $trackthirdpartiessent[$oldsid . '|' . $oldemail] = 'contact id ' . $oldcid;
         } else {
             if ($oldemail != 'none') {
                 if (empty($trackthirdpartiessent[$oldsid . '|' . $oldemail])) {
                     print "- No email sent for '" . $oldtarget . "', total: " . $total . "\n";
                 } else {
                     print "- No email sent for '" . $oldtarget . "', total: " . $total . " (already sent to " . $trackthirdpartiessent[$oldsid . '|' . $oldemail] . ")\n";
                 }
             }
         }
     }
 } else {
     print "No unpaid invoices found\n";
 }
 exit(0);
         }
         print "Service to expire " . $obj->ref . ", label " . dol_concatdesc($obj->plabel, $obj->description) . ", due date " . dol_print_date($db->jdate($obj->date_fin_validite), 'day') . ", customer id " . $obj->sid . " " . $obj->name . ", " . ($obj->cid ? "contact id " . $obj->cid . " " . $obj->clastname . " " . $obj->cfirstname . ", " : "") . "email " . $newemail . ", lang " . $outputlangs->defaultlang . ": ";
         if (dol_strlen($newemail)) {
             print "qualified.";
         } else {
             print "disqualified (no email).";
         }
         print "\n";
         unset($outputlangs);
         $total += $obj->total_ttc;
         $i++;
     }
     // Si il reste des envois en buffer
     if ($foundtoprocess) {
         if (dol_strlen($oldemail) && $oldemail != 'none' && empty($trackthirdpartiessent[$oldsid . '|' . $oldemail])) {
             envoi_mail($mode, $oldemail, $message, $total, $oldlang, $oldtarget, $duration_value);
             $trackthirdpartiessent[$oldsid . '|' . $oldemail] = 'contact id ' . $oldcid;
         } else {
             if ($oldemail != 'none') {
                 if (empty($trackthirdpartiessent[$oldsid . '|' . $oldemail])) {
                     print "- No email sent for '" . $oldtarget . "', total: " . $total . "\n";
                 } else {
                     print "- No email sent for '" . $oldtarget . "', total: " . $total . " (already sent to " . $trackthirdpartiessent[$oldsid . '|' . $oldemail] . ")\n";
                 }
             }
         }
     }
 } else {
     print "No services to expire found\n";
 }
 exit(0);
Пример #14
0
     $client_id = $db->lastInsertId();
     $info_analyse2 = json_decode($info_analyse);
     $info_radio2 = json_decode($info_radio);
     $filename = '../sauvegarde/animaux/' . $_POST['animal_id'];
     $info_acte2 = json_decode($info_acte, TRUE);
     $info_medic2 = json_decode($info_medic, TRUE);
     if ($_POST['veto_ref_mail'] != '') {
         if (count($info_analyse2) > 0 && count($info_radio2) > 0) {
             //	envoi_mail2($_POST['veto_ref_mail'], $_POST['veto_ref'], $info_client[0]['nom'], $info_animal[0]['nom_a'], $info_formulaire['date_consultation'], $info_formulaire['barre_resume'], $clinique, $info_acte2, $info_medic2,$_POST['consultation_id'],1,1, $nom_serveur_mail, $mail_serveur, $filename,$db);
             envoi_mail2($_POST['veto_ref_mail'], $_POST['veto_ref'], $info_client[0], $info_animal[0]['nom_a'], $info_formulaire['date_consultation'], $info_formulaire['barre_resume'], $clinique, $info_acte2, $info_medic2, $_POST['consultation_id'], 1, 1, $nom_serveur_mail, $mail_serveur, $filename, $db);
         } elseif (count($info_analyse2) == 0 && count($info_radio2) > 0) {
             envoi_mail2($_POST['veto_ref_mail'], $_POST['veto_ref'], $info_client[0], $info_animal[0]['nom_a'], $info_formulaire['date_consultation'], $info_formulaire['barre_resume'], $clinique, $info_acte2, $info_medic2, $_POST['consultation_id'], 0, 1, $nom_serveur_mail, $mail_serveur, $filename, $db);
         } elseif (count($info_analyse2) > 0 && count($info_radio2) == 0) {
             envoi_mail2($_POST['veto_ref_mail'], $_POST['veto_ref'], $info_client[0], $info_animal[0]['nom_a'], $info_formulaire['date_consultation'], $info_formulaire['barre_resume'], $clinique, $info_acte2, $info_medic2, $_POST['consultation_id'], 1, 0, $nom_serveur_mail, $mail_serveur, $filename, $db);
         } else {
             envoi_mail($_POST['veto_ref_mail'], $_POST['veto_ref'], $info_client[0], $info_animal[0]['nom_a'], $info_formulaire['date_consultation'], $info_formulaire['barre_resume'], $clinique, $info_acte2, $info_medic2, $_POST['consultation_id'], $nom_serveur_mail, $mail_serveur, $db);
         }
     }
     echo json_encode($client_id);
 } elseif ($_GET['action'] == 'mur') {
     $nom_client = $_POST['client'];
     $nom_animal = $_POST['animal'];
     $importance = $_POST['importance'];
     $ma_var = $_POST['client'] . ' ' . $_POST['animal'];
     $st = $db->prepare("INSERT INTO  `aerogard2`.`liste_mur` (`id` ,`texte` ,`importance` ,`permission`) VALUES ('' , ?, ?, ?);");
     $st->bindParam(1, $ma_var);
     $st->bindParam(2, $importance);
     $st->bindParam(3, $_SESSION['login']);
     $st->execute();
     $id_liste_mur = $db->lastInsertId();
     echo json_encode($id_liste_mur);
Пример #15
0
						if((isset($_POST['envoi_mail']))&&(check_mail($user_email))) {
							$tab_param_mail['destinataire']=$user_email;
							$texte_email="A l'attention de $user_prenom $user_nom<br />\n";
							$texte_email.="Identifiant  : $user_login<br />\n";
							if(isset($new_password)) {
								$texte_email.="Mot de passe : $new_password<br />\n";
							}

							$texte_email.=$impression;

							$sujet_mail = "[GEPI] Compte Gepi";

							$headers = "";

							// On envoie le mail
							$envoi = envoi_mail($sujet_mail, $texte_email, $user_email, $headers, "html", $tab_param_mail);
							if($envoi) {
								echo "<div style='float:right; width:5em; text-align:center; color:green;' class='fieldset_opacite50 noprint'>Mail envoyé</div>";
							}
							else {
								echo "<div style='float:right; width:5em; text-align:center; color:red;' class='fieldset_opacite50 noprint'>Echec de l'envoi du mail</div>";
							}
						}
					}

					/*
					// Bloc adresse responsable
					$addressblock_padding_right,
					$addressblock_padding_top,
					$addressblock_padding_text,
					$addressblock_length,
Пример #16
0
        echo "<span style='color:red' title='Erreur lors du signalement de faute'> KO</span>";
        return false;
        die;
    }
    $ajout_headers = "";
    $email_utilisateur = retourne_email($_SESSION['login']);
    if ($email_utilisateur != '') {
        $ajout_headers = "Reply-to: {$email_utilisateur}";
    }
    // On considère que le signalement est un succès, si le mail est envoyé pour au moins un destinataire
    $temoin = false;
    while ($lig = mysqli_fetch_object($res)) {
        $destinataire = $lig->email;
        // On met
        $sujet = "[GEPI]: Signalement par " . casse_mot($_SESSION['prenom'], 'majf2') . " " . $_SESSION['nom'];
        //if(envoi_mail($sujet, nl2br($signalement_message), $destinataire, $ajout_headers)) {$temoin=true;}
        if (envoi_mail($sujet, $signalement_message, $destinataire, $ajout_headers)) {
            $temoin = true;
        }
    }
    echo "<span style='color:green' title='Signalement de faute effectué'> OK</span>";
    $tab_champs = array('periodes');
    $current_group = get_group($signalement_id_groupe, $tab_champs);
    if ($current_group["classe"]["ver_periode"][$signalement_id_classe][$signalement_num_periode] == 'P' && ($_SESSION['statut'] == 'administrateur' || $_SESSION['statut'] == 'scolarite')) {
        echo " <a href='../bulletin/autorisation_exceptionnelle_saisie_app.php?id_classe={$signalement_id_classe}&periode={$signalement_num_periode}&id_groupe={$signalement_id_groupe}&refermer_page=y' target='_blank' alt='Autorisation exceptionnelle de correction' title='Autorisation exceptionnelle de correction'><img src='../images/icons/wizard.png' width='16' height='16' alt='Autorisation exceptionnelle de correction' title='Autorisation exceptionnelle de correction' /></a>";
    }
    return $temoin;
} else {
    echo "<span style='color:red' title='Erreur lors du signalement de faute: Envoi de mail non actif'> KO</span>";
    return false;
}
                $titre = "Demande de compte et mot de passe : {$nom} {$prenom}";
                //$texte=nl2br("La demande suivante a été formulée par $nom $prenom ($email) (statut déclaré lors de la demande : ".$statut_demandeur.")\nDescription de la demande:\n".preg_replace("/[\\\]{1,}n/","\n",$description));
                $description_nettoyee = preg_replace('/(\\\\n)+/', "\n", $description);
                $texte = "La demande suivante a été formulée par {$nom} {$prenom} ({$email}) (statut déclaré lors de la demande : " . $statut_demandeur . ")\nDescription de la demande:\n" . $description_nettoyee;
                $destinataire = getSettingValue('gepiDemandeCompteMdpAdress');
                if ($destinataire == "") {
                    $destinataire = getSettingValue('gepiAdminAdress');
                }
                $tab_param_mail['destinataire'] = $destinataire;
                $ajout_headers = "";
                if (check_mail($email)) {
                    $ajout_headers = "Reply-To: {$email}\r\n";
                    $tab_param_mail['replyto'] = $email;
                }
                if ($destinataire != "") {
                    envoi_mail($titre, $texte, $destinataire, $ajout_headers, "plain", $tab_param_mail);
                }
            }
            $suite = "y";
        } else {
            $msg .= "Le captcha n'est pas bon.<br />";
            unset($_SESSION['captcha']);
        }
    }
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html lang="fr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<META HTTP-EQUIV="Pragma" CONTENT="no-cache" />
Пример #18
0
/** Fonction destinée à envoyer un mail suite à une proposition de correction d'appréciation
 *
 * @param string $corriger_app_login_eleve Login de l'élève
 * @param integer $corriger_app_id_groupe Identifiant du groupe
 * @param integer $corriger_app_num_periode Numéro de période
 * $texte_mail string l'explication à envoyer
 *
 * @return $string Chaine pour $msg
 */
function envoi_mail_proposition_correction($corriger_app_login_eleve, $corriger_app_id_groupe, $corriger_app_num_periode, $texte_mail)
{
    global $mysqli;
    global $prefixe_debug;
    if ($prefixe_debug == "") {
        $prefixe_debug = strftime("%Y%m%d %H%M%S") . " : " . $_SESSION['login'];
    }
    $msg = "";
    if ($texte_mail != "") {
        $envoi_mail_actif = getSettingValue('envoi_mail_actif');
        if ($envoi_mail_actif != 'n' && $envoi_mail_actif != 'y') {
            $envoi_mail_actif = 'y';
            // Passer à 'n' pour faire des tests hors ligne... la phase d'envoi de mail peut sinon ensabler.
        }
        if ($envoi_mail_actif == 'y') {
            $email_destinataires = "";
            $sql = "SELECT id_classe FROM j_eleves_classes WHERE (login='******' AND periode='{$corriger_app_num_periode}');";
            $req = mysqli_query($mysqli, $sql);
            if (mysqli_num_rows($req) > 0) {
                //$correction_id_classe=mysql_result($req,0,"id_classe");
                $obj_classe = $req->fetch_object();
                $correction_id_classe = $obj_classe->id_classe;
                $sql = "(SELECT DISTINCT email FROM utilisateurs WHERE statut='secours' AND email!='')\n\t\t\t\tUNION (SELECT DISTINCT email FROM utilisateurs u, j_scol_classes jsc WHERE u.login=jsc.login AND id_classe='{$correction_id_classe}');";
            } else {
                //$sql="select email from utilisateurs where statut='secours' AND email!='';";
                $sql = "select email from utilisateurs where (statut='secours' OR statut='scolarite') AND email!='';";
            }
            //echo "$sql<br />";
            fich_debug_proposition_correction_app($prefixe_debug . " : {$sql}\n");
            $req = mysqli_query($mysqli, $sql);
            if (mysqli_num_rows($req) > 0) {
                $lig_u = mysqli_fetch_object($req);
                $email_destinataires = $lig_u->email;
                while ($lig_u = mysqli_fetch_object($req)) {
                    $email_destinataires .= ", " . $lig_u->email;
                    $tab_param_mail['destinataire'][] = $lig_u->email;
                }
                $email_declarant = "";
                $nom_declarant = "";
                $sql = "select nom, prenom, civilite, email from utilisateurs where login = '******'login'] . "';";
                fich_debug_proposition_correction_app($prefixe_debug . " : {$sql}\n");
                $req = mysqli_query($mysqli, $sql);
                if (mysqli_num_rows($req) > 0) {
                    $lig_u = mysqli_fetch_object($req);
                    $nom_declarant = $lig_u->civilite . " " . casse_mot($lig_u->nom, 'maj') . " " . casse_mot($lig_u->prenom, 'majf');
                    $email_declarant = $lig_u->email;
                    $tab_param_mail['from'] = $lig_u->email;
                    $tab_param_mail['from_name'] = $nom_declarant;
                }
                $email_autres_profs_grp = "";
                // Recherche des autres profs du groupe
                $sql = "SELECT DISTINCT u.email FROM utilisateurs u, j_groupes_professeurs jgp WHERE jgp.id_groupe='{$corriger_app_id_groupe}' AND jgp.login=u.login AND u.login!='" . $_SESSION['login'] . "' AND u.email!='';";
                fich_debug_proposition_correction_app($prefixe_debug . " : {$sql}\n");
                //echo "$sql<br />";
                $req = mysqli_query($mysqli, $sql);
                if (mysqli_num_rows($req) > 0) {
                    $lig_u = mysqli_fetch_object($req);
                    $email_autres_profs_grp .= $lig_u->email;
                    $tab_param_mail['cc'][] = $lig_u->email;
                    while ($lig_u = mysqli_fetch_object($req)) {
                        $email_autres_profs_grp .= "," . $lig_u->email;
                        $tab_param_mail['cc'][] = $lig_u->email;
                    }
                }
                $sujet_mail = "Demande de validation de correction d'appréciation";
                $ajout_header = "";
                if ($email_declarant != "") {
                    $ajout_header .= "Cc: {$nom_declarant} <" . $email_declarant . ">";
                    $tab_param_mail['cc'][] = $email_declarant;
                    if ($email_autres_profs_grp != '') {
                        $ajout_header .= ", {$email_autres_profs_grp}";
                    }
                    $ajout_header .= "\r\n";
                    $ajout_header .= "Reply-to: {$nom_declarant} <" . $email_declarant . ">\r\n";
                    $tab_param_mail['replyto'] = $email_declarant;
                    $tab_param_mail['replyto_name'] = $nom_declarant;
                } elseif ($email_autres_profs_grp != '') {
                    $ajout_header .= "Cc: {$email_autres_profs_grp}\r\n";
                }
                $salutation = (date("H") >= 18 or date("H") <= 5) ? "Bonsoir" : "Bonjour";
                $texte_mail = $salutation . ",\n\n" . $texte_mail . "\nCordialement.\n-- \n" . $nom_declarant;
                fich_debug_proposition_correction_app($prefixe_debug . " : envoi_mail({$sujet_mail}, \n{$texte_mail}, \n{$email_destinataires}, \n{$ajout_header})\n");
                $envoi = envoi_mail($sujet_mail, $texte_mail, $email_destinataires, $ajout_header, "plain", $tab_param_mail);
                if (!$envoi) {
                    fich_debug_proposition_correction_app($prefixe_debug . " : Erreur lors de l envoi du mail.\n\n");
                }
            } else {
                $msg .= "Aucun compte scolarité avec adresse mail n'est associé à cet(te) élève.<br />Pas de compte secours avec adresse mail non plus.<br />La correction a été soumise, mais elle n'a pas fait l'objet d'un envoi de mail.<br />";
                fich_debug_proposition_correction_app($prefixe_debug . " : Aucun compte secours ni scol associé à la classe.\n");
            }
        }
    }
    return $msg;
}
Пример #19
0
function delete_news($id)
{
    //On récupère l'id de la catégorie où se situe la news
    $query = Nw::$DB->query('SELECT u_id, u_pseudo, u_alias, u_email, n_titre, n_id_cat as id_cat, n_id_auteur
        FROM ' . Nw::$prefix_table . 'news
            LEFT JOIN ' . Nw::$prefix_table . 'members ON n_id_auteur = u_id
        WHERE n_id=' . intval($id)) or Nw::$DB->trigger(__LINE__, __FILE__);
    $dn_news = $query->fetch_assoc();
    $query->free();
    $id_cat = $dn_news['id_cat'];
    $titre_news = $dn_news['n_titre'];
    // Suppression des contributions
    $not_delete_first_vrs = false;
    $query = Nw::$DB->query('SELECT v_id, v_id_membre
        FROM ' . Nw::$prefix_table . 'news_versions
        WHERE v_id_news=' . intval($id) . '
        ORDER BY v_id ASC') or Nw::$DB->trigger(__LINE__, __FILE__);
    while ($donnees = $query->fetch_assoc()) {
        if ($not_delete_first_vrs) {
            Nw::$DB->query('UPDATE ' . Nw::$prefix_table . 'members_stats 
                SET s_nb_contrib = s_nb_contrib - 1
                WHERE s_id_membre = ' . intval($donnees['v_id_membre'])) or Nw::$DB->trigger(__LINE__, __FILE__);
        }
        if ($not_delete_first_vrs == false) {
            $not_delete_first_vrs = true;
        }
    }
    Nw::$DB->query('UPDATE ' . Nw::$prefix_table . 'members_stats 
        SET s_nb_news = s_nb_news - 1
        WHERE s_id_membre = ' . intval($dn_news['n_id_auteur'])) or Nw::$DB->trigger(__LINE__, __FILE__);
    //On supprime une news de la catégorie
    Nw::$DB->query('UPDATE ' . Nw::$prefix_table . 'categories 
        SET c_nbr_news=c_nbr_news-1
        WHERE c_id=' . $id_cat) or Nw::$DB->trigger(__LINE__, __FILE__);
    // Longue requête (suppression de TOUTE la news)
    Nw::$DB->query('DELETE t1, t2, t3, t4, t5, t6, t7
            FROM ' . Nw::$prefix_table . 'news t1
                LEFT JOIN ' . Nw::$prefix_table . 'news_versions t2 ON t1.n_id=t2.v_id_news
                LEFT JOIN ' . Nw::$prefix_table . 'news_commentaires t3 ON t1.n_id=t3.c_id_news
                LEFT JOIN ' . Nw::$prefix_table . 'plussoies t4 ON t4.p_id_com=t3.c_id
                LEFT JOIN ' . Nw::$prefix_table . 'news_vote t5 ON t5.v_id_news=t1.n_id
                LEFT JOIN ' . Nw::$prefix_table . 'news_favs t6 ON t6.f_id_news=t1.n_id
                LEFT JOIN ' . Nw::$prefix_table . 'news_flags t7 ON t7.f_id_news=t1.n_id
            WHERE t1.n_id=' . $id) or Nw::$DB->trigger(__LINE__, __FILE__);
    $add_champs_sql = '';
    $add_value_sql = '';
    $text_log = array();
    $text_log[] = Nw::$lang['news']['log_news_9'];
    if (check_auth('can_delete_news')) {
        if (!empty($_POST['raison'])) {
            $text_log[] = sprintf(Nw::$lang['news']['log_del_add_raison'], $_POST['raison']);
        }
        if (!empty($_POST['contenu'])) {
            $titre_mail = sprintf(Nw::$lang['news']['mail_titre_news_del'], $titre_news);
            $content_mail = sprintf(Nw::$lang['news']['mail_news_del'], $dn_news['u_pseudo'], Nw::$site_url . 'profile/' . $dn_news['u_alias'] . '/', Nw::$dn_mbr['u_pseudo'], Nw::$site_name, $titre_news, nl2br($_POST['contenu']), Nw::$site_url . 'help-rules.html');
            @envoi_mail($dn_news['u_email'], $titre_mail, $content_mail);
            $text_log[] = sprintf(Nw::$lang['news']['log_del_add_email'], Nw::$dn_mbr['u_pseudo'], $_POST['contenu']);
        }
    }
    if (count($text_log) > 1) {
        $add_champs_sql = 'l_texte, ';
        $add_value_sql = '\'' . Nw::$DB->real_escape_string(implode("\r", $text_log)) . '\', ';
    }
    Nw::$DB->query('INSERT INTO ' . Nw::$prefix_table . 'news_logs (l_id_news, l_id_membre, l_titre, l_action, ' . $add_champs_sql . 'l_date, l_ip) VALUES(' . intval($id) . ', ' . intval(Nw::$dn_mbr['u_id']) . ', \'' . insertBD($titre_news) . '\', 9, ' . $add_value_sql . 'NOW(), \'' . get_ip() . '\')') or Nw::$DB->trigger(__LINE__, __FILE__);
}
Пример #20
0
			}
			if(getSettingAOui('RegBaseCpe_obtenir_compte_et_motdepasse')) {
				$destinataire="cpe";
				enregistre_infos_actions($titre,$texte,$destinataire,$mode);
			}

			if(getSettingAOui('SendMail_obtenir_compte_et_motdepasse')) {
				$titre="Demande de compte et mot de passe : $nom $prenom";
				$texte=nl2br("La demande suivante a été formulée par $nom $prenom ($email) (statut déclaré lors de la demande : ".$statut_demandeur.")\nDescription de la demande:\n".preg_replace("/[\\\]{1,}n/","\n",$description));
				$destinataire=getSettingValue('gepiDemandeCompteMdpAdress');
				if($destinataire=="") {
					$destinataire=getSettingValue('gepiAdminAdress');
				}

				if($destinataire!="") {
					envoi_mail($titre, $texte, $destinataire);
				}
			}

			$suite="y";

		}
		else {
			$msg.="Le captcha n'est pas bon.<br />";
			unset($_SESSION['captcha']);
		}
	}
}

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
Пример #21
0
        }
        if ($envoi_mail_actif == 'y') {
            if (getSettingValue('url_racine_gepi') != "") {
                $texte_mail .= "\nPrendre en compte la proposition : " . getSettingValue('url_racine_gepi') . "/groupes/edit_eleves.php?id_groupe=" . $current_group["id"] . " \n(vous devez être connecté(e) dans GEPI avant de cliquer sur ce lien).\n";
            }
            // On utilise un témoin
            if (isset($nom_eleve) && $nom_eleve != "" && getSettingValue("gepiAdminAdress") != '') {
                $gepiPrefixeSujetMail = getSettingValue("gepiPrefixeSujetMail") ? getSettingValue("gepiPrefixeSujetMail") : "";
                if ($gepiPrefixeSujetMail != '') {
                    $gepiPrefixeSujetMail .= " ";
                }
                $ajout_header = "";
                if ($email_declarant != "") {
                    $ajout_header .= "Cc: {$nom_declarant} <" . $email_declarant . ">\r\n";
                }
                $envoi = envoi_mail($sujet_mail, $texte_mail, getSettingValue("gepiAdminAdress"), $ajout_header);
            }
        }
        // On utilise un témoin
        if (isset($nom_eleve) && $nom_eleve != "" && $msg == "") {
            $msg = "Enregistrement effectué.";
        }
    }
}
$themessage = 'Des informations ont été modifiées. Voulez-vous vraiment quitter sans enregistrer ?';
//**************** EN-TETE **************************************
$titre_page = "Gestion des groupes";
require_once "../lib/header.inc.php";
//**************** FIN EN-TETE **********************************
//debug_var();
$tab_sig = array();
Пример #22
0
 $chaine_tmp .= "</div>\n";
 $lignes_cdt_mail .= $chaine_tmp;
 echo $chaine_tmp;
 if ($envoi_mail == "y") {
     if (!check_mail($_POST['mail_dest'])) {
         $message = "L'adresse mail choisie '" . $_POST['mail_dest'] . "' est invalide.";
         echo "<p style='color:red; text-align:center;'>{$message}</p>\n\t\t\t\t\t<script type='text/javascript'>\n\t\t\t\t\t\tdocument.getElementById('div_compte_rendu_envoi_mail').innerHTML=\"<span style='color:red'>{$message}</span>\";\n\t\t\t\t\t</script>\n";
     } else {
         $sujet = "Cahier de textes";
         $message = "Bonjour(soir),\nVoici le contenu du cahier de textes pour pour la semaine choisie :\n" . $lignes_cdt_mail;
         $destinataire = $_POST['mail_dest'];
         $header_suppl = "";
         if (isset($_SESSION['email']) && check_mail($_SESSION['email'])) {
             $header_suppl .= "Bcc:" . $_SESSION['email'] . "\r\n";
         }
         $envoi = envoi_mail($sujet, $message, $destinataire, $header_suppl, "html");
         if ($envoi) {
             $message = "Le cahier de textes de la semaine choisie a été expédié à l'adresse mail choisie '" . $_POST['mail_dest'] . "'.";
             echo "<p style='color:green; text-align:center;'>{$message}</p>\n\t\t\t\t\t\t<script type='text/javascript'>\n\t\t\t\t\t\t\tdocument.getElementById('div_compte_rendu_envoi_mail').innerHTML=\"<span style='color:green'>{$message}</span>\";\n\t\t\t\t\t\t</script>\n";
         } else {
             $message = "Echec de l'envoi du cahier de textes à l'adresse mail choisie '" . $_POST['mail_dest'] . "'.";
             echo "<p style='color:red; text-align:center;'>{$message}</p>\n\t\t\t\t\t\t<script type='text/javascript'>\n\t\t\t\t\t\t\tdocument.getElementById('div_compte_rendu_envoi_mail').innerHTML=\"<span style='color:red'>{$message}</span>\";\n\t\t\t\t\t\t</script>\n";
         }
     }
     // DEBUG:
     //echo "<div style='border: 1px solid red; text-align:center;'>$lignes_cdt_mail</div>";
 }
 //++++++++++++++++++++++++++++++
 echo "<div id='lien_mail' style='text-align:right; display:none'><a href=\"javascript:afficher_div('div_envoi_cdt_par_mail','y',10,10)\" title=\"Envoyer par mail *la semaine affichée* du cahier de textes\n(par exemple pour envoyer à un parent d'élève qui a oublié ses compte et mot de passe).\nPour envoyer plus d'une semaine par mail, vous pouvez utiliser la page de consultation des cahiers de textes.\"><img src='../images/icons/courrier_envoi.png' class='icone16' alt='Mail' /></a></div>\n\t\t\t<script type='text/javascript'>document.getElementById('lien_mail').style.display=''</script>\n";
 //echo "</div>\n";
 $titre_infobulle = "Envoi du CDT par mail";
Пример #23
0
    // 20130812
    if ($envoi_mail == "y") {
        if (!check_mail($_POST['mail_dest'])) {
            $message = "L'adresse mail choisie '" . $_POST['mail_dest'] . "' est invalide.";
            echo "<p style='color:red; text-align:center;'>{$message}</p>\n\t\t\t<script type='text/javascript'>\n\t\t\t\tdocument.getElementById('div_compte_rendu_envoi_mail').innerHTML=\"<span style='color:red'>{$message}</span>\";\n\t\t\t</script>\n";
        } else {
            $sujet = "Cahier de textes";
            $message = "Bonjour(soir),\nVoici le contenu du cahier de textes à compter du " . $date_debut_cdt_mail . ":\n" . $lignes_cdt_mail;
            $destinataire = $_POST['mail_dest'];
            $tab_param_mail['destinataire'] = $_POST['mail_dest'];
            $header_suppl = "";
            if (isset($_SESSION['email']) && check_mail($_SESSION['email'])) {
                $header_suppl .= "Bcc:" . $_SESSION['email'] . "\r\n";
                $tab_param_mail['bcc'] = $_SESSION['email'];
            }
            $envoi = envoi_mail($sujet, $message, $destinataire, $header_suppl, "html", $tab_param_mail);
            if ($envoi) {
                $message = "Le cahier de textes a été expédié à l'adresse mail choisie '" . $_POST['mail_dest'] . "'.";
                echo "<p style='color:green; text-align:center;'>{$message}</p>\n\t\t\t\t<script type='text/javascript'>\n\t\t\t\t\tdocument.getElementById('div_compte_rendu_envoi_mail').innerHTML=\"<span style='color:green'>{$message}</span>\";\n\t\t\t\t</script>\n";
            } else {
                $message = "Echec de l'envoi du cahier de textes à l'adresse mail choisie '" . $_POST['mail_dest'] . "'.";
                echo "<p style='color:red; text-align:center;'>{$message}</p>\n\t\t\t\t<script type='text/javascript'>\n\t\t\t\t\tdocument.getElementById('div_compte_rendu_envoi_mail').innerHTML=\"<span style='color:red'>{$message}</span>\";\n\t\t\t\t</script>\n";
            }
        }
        // DEBUG:
        //echo "<div style='border: 1px solid red; text-align:center;'>$lignes_cdt_mail</div>";
    }
    require "../lib/footer.inc.php";
    die;
}
echo "<hr />\n";
Пример #24
0
					if((getSettingValue('mode_email_ele')=='mon_compte')) {
						$sql="UPDATE eleves SET email='$reg_email' WHERE login='******'login']."';";
						$update_eleve=mysqli_query($GLOBALS["mysqli"], $sql);
						if(!$update_eleve) {$msg.="<br />Erreur lors de la mise à jour de la table 'eleves'.";}

						if((getSettingValue('envoi_mail_actif')!='n')&&(getSettingValue('informer_scolarite_modif_mail')!='n')) {
							$sujet_mail=remplace_accents("Mise à jour mail ".$_SESSION['nom']." ".$_SESSION['prenom'],'all');
							$message_mail="L'adresse email de l'élève ";
							$message_mail.=remplace_accents($_SESSION['nom']." ".$_SESSION['prenom'],'all')." est passée à '$reg_email'. Vous devriez mettre à jour Sconet en conséquence.";
							$destinataire_mail=getSettingValue('email_dest_info_modif_mail');
							if($destinataire_mail=="") {
								$destinataire_mail=getSettingValue('gepiSchoolEmail');
							}
							if(($destinataire_mail!='')&&(check_mail($destinataire_mail))) {
								envoi_mail($sujet_mail, $message_mail, $destinataire_mail);
							}
						}
					}
				}
			}
		}
	}


	if ($_SESSION['statut'] == "scolarite" OR $_SESSION['statut'] == "professeur" OR $_SESSION['statut'] == "cpe")
	if ($user_show_email != $reg_show_email) {
	if ($reg_show_email != "no" and $reg_show_email != "yes") $reg_show_email = "no";
		$reg = mysqli_query($GLOBALS["mysqli"], "UPDATE utilisateurs SET show_email = '$reg_show_email' WHERE login = '******'login'] . "'");
		if ($reg) {
			if($msg!="") {$msg.="<br />";}
Пример #25
0
                                }
                                $msg = mb_substr($msg, 0, mb_strlen($msg) - 2);
                                $msg .= ".<br />";
                                $message_mail2 .= "Compte-rendu " . $obj_classe->classe . ": Mail envoyé à {$destinataires_bcc}\n\n";
                            } else {
                                $msg .= $obj_classe->classe . " échec de l'envoi du mail.<br />";
                            }
                        }
                    }
                }
            }
            if (isset($_SESSION['email']) && check_mail($_SESSION['email'])) {
                $sujet_mail2 = "[GEPI]: Compte-rendu envoi de mail ev n°" . $id_ev;
                $message_mail2 .= "\nFin du compte-rendu.\n\nBien cordialement.\n-- \n" . getSettingValue('gepiSchoolName');
                $tab_param_mail['destinataire'] = $_SESSION['email'];
                envoi_mail($sujet_mail2, $message_mail2, $_SESSION['email'], "", "plain", $tab_param_mail);
            }
        }
    }
}
$javascript_specifique[] = "lib/tablekit";
$utilisation_tablekit = "ok";
$themessage = 'Des informations ont été modifiées. Voulez-vous vraiment quitter sans enregistrer ?';
$message_suppression = "Confirmation de suppression";
//**************** EN-TETE *****************
$titre_page = "Gestion des dates";
require_once "../lib/header.inc.php";
//**************** FIN EN-TETE *************
echo "<a name=\"debut_de_page\"></a>";
//debug_var();
/*
                $oldemail = $obj->email;
                $message = '';
                $total = 0;
            }

            $message .= "Facture ".$obj->facnumber." : ".price($obj->total_ttc)." : ".$obj->name."\n";
            $total += $obj->total_ttc;

            dol_syslog("email_unpaid_invoices_to_representatives.php: ".$obj->email);
            $i++;
        }

        // Si il reste des envois en buffer
        if ($total)
        {
            envoi_mail($oldemail,$message,$total);
        }
    }
    else
    {
        print "No unpaid invoices to companies linked to a particular commercial dolibarr user\n";
    }
}
else
{
    dol_print_error($db);
    dol_syslog("email_unpaid_invoices_to_representatives.php: Error");
}

/**
 * 	Send email
Пример #27
0
            $date_debut_r = substr($jour, 0, 4) . "-" . substr($jour, 4, 2) . "-" . substr($jour, 6, 2) . " 08:00:00";
            $designation_user = civ_nom_prenom($login_user);
            $subject = "[GEPI]: Remplacement annulé";
            $texte_mail = "Bonjour " . $designation_user . ",\n\nLe *remplacement* que vous deviez effectuer est *annulé*:\n\n" . get_nom_classe($id_classe) . " le " . formate_date($date_debut_r, "n", "complet") . " en " . $info_creneau . "\n" . $chaine_commentaire_validation . $chaine_salle . "en remplacement de " . get_info_grp($id_groupe, array('description', 'matieres', 'classes', 'profs'), "") . ".\n\nSi d'autres professeurs sont intéressés, le remplacement du cours reste bienvenu.\n\nMerci.\n\n\nCordialement.\n-- \n" . civ_nom_prenom($_SESSION['login']);
            $headers = "";
            if (isset($_SESSION['email']) && check_mail($_SESSION['email'])) {
                $headers .= "Reply-to:" . $_SESSION['email'] . "\r\n";
                $tab_param_mail['replyto'] = $_SESSION['email'];
            }
            $message_id = 'remplacement_c' . $id_creneau . "_j" . $jour;
            if (isset($message_id)) {
                $headers .= "Message-id: {$message_id}\r\n";
            }
            //if(isset($references_mail)) {$headers .= "References: $references_mail\r\n";}
            // On envoie le mail
            $envoi = envoi_mail($subject, $texte_mail, $mail_dest, $headers, "plain", $tab_param_mail);
        }
    }
}
//$javascript_specifique[] = "lib/tablekit";
//$utilisation_tablekit="ok";
$avec_js_et_css_edt = "y";
$themessage = 'Des informations ont été modifiées. Voulez-vous vraiment quitter sans enregistrer ?';
// onclick=\"return confirm_abandon (this, change, '$themessage')\"
$message_suppression = "Confirmation de suppression";
//**************** EN-TETE *****************
$titre_page = "Attribuer remplacements";
require_once "../lib/header.inc.php";
//**************** FIN EN-TETE *************
//debug_var();
//===================================================================
Пример #28
0
        } else {
            $concours2 = false;
        }
        if (isset($_POST['concours3'])) {
            $concours3 = true;
        } else {
            $concours3 = false;
        }
        $exposant = ['firstname' => htmlspecialchars($_POST['firstname']), 'lastname' => htmlspecialchars($_POST['lastname']), 'email' => htmlspecialchars($_POST['email']), 'city' => htmlspecialchars($_POST['city']), 'cp' => htmlspecialchars($_POST['cp']), 'country' => htmlspecialchars($_POST['country']), 'newsletter' => htmlspecialchars($_POST['newsletter']), 'club' => htmlspecialchars($_POST['club']), 'marque' => htmlspecialchars($_POST['marque']), 'model' => htmlspecialchars($_POST['model']), 'type' => htmlspecialchars($_POST['type']), 'motorisation' => htmlspecialchars($_POST['motorisation']), 'immat' => htmlspecialchars($_POST['immat']), 'date_circu' => htmlspecialchars($_POST['date_circu']), 'infos' => htmlspecialchars($_POST['infos']), 'concours1' => $concours1, 'concours2' => $concours2, 'concours3' => $concours3];
        try {
            /* inscription dans la bdd*/
            $exposant_id = ajouter_inscription($exposant);
            try {
                /* envoi emails*/
                envoi_mail("inscription", $exposant_id);
                envoi_mail("nouvel_inscrit", $exposant_id);
                /*  */
                /* retour à la page des Bielles Meusiennes avec un message de réussite ou d'erreur */
                header('Location: http://hiddenj.jimdo.com/design-formulaire-1/success');
            } catch (Exception $e) {
                /* effacer les données dans la bdd*/
                /* */
                header('Location: http://hiddenj.jimdo.com/design-formulaire-1/error3');
            }
        } catch (Exception $e) {
            header('Location: http://hiddenj.jimdo.com/design-formulaire-1/error4');
        }
    } else {
        header('Location: http://hiddenj.jimdo.com/design-formulaire-1/error5');
    }
}
Пример #29
0
                }
                $ajout_header = "";
                if ($email_declarant != "") {
                    $ajout_header .= "Cc: {$nom_declarant} <" . $email_declarant . ">\r\n";
                    $tab_param_mail['cc'][] = $email_declarant;
                    $tab_param_mail['cc_name'][] = $nom_declarant;
                }
                $destinataire_mail = getSettingValue("gepiAdminAdress");
                if (check_mail($destinataire_mail)) {
                    $tab_param_mail['destinataire'][] = $destinataire_mail;
                }
                if (getSettingValue('email_dest_info_erreur_affect_grp') != "" && getSettingValue('email_dest_info_erreur_affect_grp') != getSettingValue("gepiAdminAdress")) {
                    $destinataire_mail .= "," . getSettingValue("email_dest_info_erreur_affect_grp");
                    $tab_param_mail['destinataire'][] = getSettingValue("email_dest_info_erreur_affect_grp");
                }
                $envoi = envoi_mail($sujet_mail, $texte_mail, $destinataire_mail, $ajout_header, "plain", $tab_param_mail);
            }
        }
        // On utilise un témoin
        if (isset($nom_eleve) && $nom_eleve != "" && $msg == "") {
            $msg = "Enregistrement effectué.";
        }
    }
}
$themessage = 'Des informations ont été modifiées. Voulez-vous vraiment quitter sans enregistrer ?';
//**************** EN-TETE **************************************
$titre_page = "Gestion des groupes";
require_once "../lib/header.inc.php";
//**************** FIN EN-TETE **********************************
//debug_var();
$tab_sig = array();
            }
            print "Service to expire " . $obj->ref . ", label " . dol_concatdesc($obj->plabel, $obj->description) . ", due date " . dol_print_date($db->jdate($obj->date_fin_validite), 'day') . " (linked to company " . $obj->name . ", sale representative " . dolGetFirstLastname($obj->firstname, $obj->lastname) . ", email " . $obj->email . "): ";
            if (dol_strlen($obj->email)) {
                print "qualified.";
            } else {
                print "disqualified (no email).";
            }
            print "\n";
            unset($outputlangs);
            $total += $obj->total_ttc;
            $i++;
        }
        // Si il reste des envois en buffer
        if ($foundtoprocess) {
            if (dol_strlen($oldemail) && $oldemail != 'none') {
                envoi_mail($mode, $oldemail, $message, $total, $oldlang, $oldsalerepresentative, $duration_value);
            } else {
                if ($oldemail != 'none') {
                    print "- No email sent for " . $oldsalerepresentative . ", total: " . $total . "\n";
                }
            }
        }
    } else {
        print "No services to expire (for companies linked to a particular commercial dolibarr user) found\n";
    }
    exit(0);
} else {
    dol_print_error($db);
    dol_syslog("email_expire_services_to_representatives.php: Error");
    exit(-1);
}