PHPIndex

This page lists files in the current directory. You can view content, get download/execute commands for Wget, Curl, or PowerShell, or filter the list using wildcards (e.g., `*.sh`).

css
geoloc
images
include
js
logs
plugins
upload
AUTHORS
wget 'https://lists2.roe3.org/pmnl3/AUTHORS'
View Content
Version initiale jusqu'à V.0.8beta5 (2005)
Grégory KOKANOSKY <gregory.kokanosky@free.fr>
http://gregory.kokanosky.free.fr/phpmynewsletter/

Reprise du projet en V.2.0 (Quelque part, début 2014...)
Arnaud GUENELEY <arnaud.gueneley@gmail.com>
http://www.phpmynewsletter.com
CHANGELOG
wget 'https://lists2.roe3.org/pmnl3/CHANGELOG'
View Content
v2.0.5
                            GENERAL :
                            * Compatibilité PHP 7 totale
                            CORRECTIONS :
                            * Correction des bugs des versions antérieures
                            * Amélioration du script d'installation et correction du bug de création de la base
                            * Amélioration de la qualité des calculs des statistiques d'ouvertures (navigateurs, OS,...)
                            * Correction de la table des codes Géoloc (https://www.iso.org/obp/ui/)
                            * Correction du bug qui altérait le css dans les messages
                            * Ajout du "sql_mode = ''" pour les serveurs dédiés (tolérance aux champs non définis avec des valeurs par défaut)
                            * Amélioration du process unique_id, il y avait un risque de doublons de calcul de hash
                            * Adaptation globale pour une installation en sous-domaine
                            * Amélioration du recensement des mails en erreur à l'envoi (via phpmailer) en tâche planifiée (n'étaient pas comptabilisés)
                            * Correction du rattachement des clés DKIM déposées sur le serveur
                            * Correction du traitement des mails en bounce
                            * Ajout du calcul du prefix des tables (ex : "pmnl2_") dans la config pour gestion des tables plus fine
                            * Correction du bug outlook : dkim=fail (body hash did not verify) https://github.com/PHPMailer/PHPMailer/issues/892
                            NOUVEAUTES :
                            * Choix du menu : horizontal avec menus déroulants ou vertical traditionnel (configuration globale > règlages divers)
                            * Choix d'afficher ou ne pas afficher le loader (configuration globale > règlages divers)
                            * Géolocalisation des ouvertures (amcharts)
                            * Création de templates par un éditeur Wysiwyg (What You See Is What You Get)
                            * Création de la gestion des droits (un ou plusieurs droits à des utilisateurs crées par un admin) et log des actions
                            * Test des enregistrement DKIM, SPF et DMARC du domaine expéditeur
                            * Sauvegarde de la base à la demande et téléchargement (nombre de sauvegardes paramétrable)
                            * Regénération d'un mot de passe envoyé par mail si perdu
                            * Possibilité aux abonnés "free mobile" de recevoir des textos de fin de tâche d'envoi, d'inscriptions et désinscriptions
                            * Utilisation des CDN's publics pour l'import des librairies JS et CSS
                            * Vérification obligatoire des liens contenus dans un message avant preview
                            * Passage des champs des sujets en utf8mb4_unicode_ci pour possibilité d'ajouter des smileys
                            OUTILS INTEGRES :
                            * Phpmailer 5.2.26
                            AMELIORATIONS :
                            * Meilleure gestion de la comparaison des versions pour mises à jour possibles de versions mineures
                            * Affichage des mails en erreur par liste
                            * Code html de souscription basculé dans les paramètres des newsletters
                            GESTION DU TRACKING :
                            * Géolocalisation des ouvertures (amcharts)
                            * Affichage des liens cliqués en modal
                            GESTION DES MESSAGES ENVOYES :
                            * Suppression de la mention phpmynewsletter 2.0 en bas des mails envoyés
                            * Ajout des mails de REPLY et de BOUNCE
                            GESTION DES TACHES PLANIFIEES :
                            * Correction du bug de suppression de la tâche planifiée
                            GESTION DES LOGS :
                            * Correction du décalage dans les colonnes lorsqu'il n'y a pas de fichier log présent
                            * Affichage des logs en modal
                            GESTIONS DES ABONNES :
                            * calcul du profil des abonnés (rubrique Profils des abonnés)
                            * pagination de la liste des abonnés en erreur en ajax
                            GESTIONS DES SMTPs :
                            * Modification possible d'un smtp déclaré
                            * Remise à 0 des compteurs (load balancing smtp) lors de la preview
                            GESTION DE LA REDACTION :
                            * Ajout de templates responsive (depuis TinyMCE)
                            * Thème "pmnl" des outils de rédaction TinyMCE
                            GESTION DES BOUNCES :
                            * Correction du bug qui empêchait la suppression correcte des mails en erreur
                            * Ajout de la possibilité d'un mail de bounce différent de l'expéditeur (alias d'un Return Path)
                            * Ajout du paramètre array('DISABLE_AUTHENTICATOR' => 'GSSAPI') à la connexion imap pour les accéder aux serveurs de messagerie de type Exchange
                            * Amélioration du REGEXP pour récupération des mails en bounce sur serveurs de messagerie de type Exchange 
v2.0.4
                            GENERAL :
                            * Correction des bugs de la version 2.0.3
                            * Traduction complète du script, mise en fichier de tous les textes.
                            * Validation de PhpMyNewsLetter pour PHP 5.4 et supérieur 
                            (tests généraux avec HHVM beaucoup plus pointu) et prêt pour PHP 7.0 (sauf erreur ou omission de ma part...)
                            * Suppressio des "HIDE" dans le menu gauche pour amélioration de la présentation /ergonomie
                            TRADUCTIONS :
                            * anglais / english
                            OUTILS INTEGRES :
                            * Phpmailer 5.2.14 
                            * Amcharts 3.13.2 (librairie internalisée)
                            * TinyMCE 4.1.9 (librairie internalisée)
                            * DropZone 4.0.1 (librairie internalisée)
                            * jQuery 1.11.2 (librairie internalisée)
                            AMELIORATIONS :
                            * Internalisation de l'heure serveur via php, puis incrément javascript (évite les appels ajax à chaque seconde)
                            * Compte rendu des imports corrects et en erreur (par compteur)
                            * Création de tous les répertoires nécessaires centralisés dans install.php (upload, DKIM, backup_crontab)
                            * Test de la disponibilité de la fonction exec php
                            * Prise en compte du numéro de campagne pour la gestion des mails en erreur, supprimés, désinscrits
                            * Mot de passe administrateur obligatoire à l'installation
                            * Visualisation des logs en modal (plus de téléchargement)
                            * Suppression des espaces dans les noms documents envoyés sur le serveur par upload
                            * Compression du code html pour envoi des mails (suppression des espaces et retour à la ligne inutiles)
                            * Signalement des désinsriptions
                            * Mails en erreur, désinscrits, supprimés par administrateur conservés en archive pour garder les listes saines
                            GESTION ET VISUALISATION DES STATISTIQUES :
                            * Suppression de JpGraph (incompatible HHVM)
                            * Intégration de AmCharts pour comptes rendus d'envois, librairies externalisées
                            * Statistiques des environnements à la lecture des mails :
                                - Navigateurs et versions,
                                - Système d'exploitation,
                                - Support de lecture : ordinateur, tablette, téléphone mobile
                                - Types de clients mails (thunderbird, Outlook, Icedove, etc...)
                                - Identification des lectures Gmail
                            * Bascule simplifiée d'une liste à une autre
                            * Statistiques globales de toutes les listes sur la page des listes
                            * Intégration de la librairie Charts.js pour statistiques globales par liste et globales toutes listes confondues
                            * Ajout du nombre de clics dans chaque campagne
                            GESTION DU TRACKING :
                            * Ajout de la détection des OS, version, navigateur, support
                            * Calcul du taux d'ouverture (Open Rate)
                            * Calcul du ratio CTR (taux de clics sur envois) (CTR  : Click Through Rates)
                            * Calcul du ratio ACTR (CTR ajusté : taux de clics sur ouvertures) (ACTR : Adjusted Click Through Rate)
                            * Détection des clients sur ouverture d'un mail (Outlook, Icedove, Thunderbird, Lotus,...)
                            * Correction d'un bug dans les calculs / stats
                            GESTION DES MESSAGES ENVOYES :
                            * Mise en place du "multi-part message in MIME format", balise AltBody
                            * Messages quoted printable, et AltBody pour les clients mails non graphiques    
                            * Encodage des mails envoyés possible en base64 au lieu de 8bit
                            * Classe de test de l'email via SMTP avant envoi du mail
                            (Attention : yahoo, ymail et rocketmail renvoient toujours OK)         
                            GESTION DES TACHES PLANIFIEES :
                            * Compte rendu automatique de fin de tâche planifiée par mail
                            * possibilité de suppression d'une tâche planifiée non encore réalisée
                            GESTION DES LOGS :
                            * Ajout de l'environnement technique dans l'entête du log d'envoi final
                            * Log des actions d'une journée
                            * Log pour chaque envoi
                            * Visualisation des logs en modal (plus de téléchargement)
                            GESTIONS DES LISTES :
                            * Duplication d'une liste en 2 clics
                            * Fusion de 2 à n listes dans une liste nouvelle, avec contrôle des doublons
                            * Correction du problème des imports
                            * Gestion d'une table des emails supprimés manuellement, désinscrits en erreur. 
                            (Evite les doublons en erreur d'envoi, permet une vérification aux inscriptions et ajouts manuels)
                            * Notification de nouvel inscrit dans une liste (choix optionnel, désactivable dans configuration générale, onglet inscriptions)
                            * Notifications des désinscriptions
                            * Purge d'une liste (=suppression des mails d'une liste, uniquement)
                            GESTIONS DES ABONNES :
                            * Gestion des abonnés sur une seule page au lieu de 5
                            * Ajout de la vérification de la structure d'une adresse mail
                            * Ajout de la vérification du DNS correspondant au domaine du mail
                            * Ajout de la possibilité de supprimer des mails en masse depuis un fichier externe
                            * Ajout de couleurs pour distinguer les opérations : vert=ajout, rouge=suppression, jaune=autres opérations
                            GESTIONS DES SMTPs : (Nouveau)
                            * Pseudo LOAD BALANCING des envois sur plusieurs SMTP paramètrables
                            * Ajout de la zone de choix d'un port pour configurer un nouveau SMTP
                            * Gestion automatiques du SMTP Gmail, des SMTP mutualisés OVH, 1and1, Gandi, Online, Infomaniak par simple choix en liste déroulante
                            * Distinction smtp GMAIL SSL (port 465) et TLS (port 587)
                            GESTION DE LA REDACTION :
                            * blocage de l'accès à la preview tant que la sauvegarde initiale n'est pas faite
                            (risque de blocage sur planification d'envoi)
                            * simulation de divers navigateurs (sur mobiles / tablettes) pour validation des messages dits "responsives"
                            GESTION DES ENVOIS (dans la configuration globale) :
                            * Activation / désactivation possible du tracking
                            GESTION DES BOUNCES :
                            * Suppression d'un email dans toutes les listes quand il est erreur bounce
v2.0.3
                            * Corrections de bugs signalés sur le forum
                            * Génération d'un code HTML de souscription en ligne et en pop up
                            * Mise en place des envois planifiés (valable sur serveurs dédiés et VPS !)
                            * Gestion de la mailq, visualisation des mails en cours d'envoi et suppression individuelle / globale
                            * Distingo des hébergements dédiés et mutualisés
                            * Modératon de la vitesse du traitement des bounce

v2.0.2
                            * Correction des bugs de la version 2.0.1
                            * Gestion du Timezone, liste des fuseaux horaires à l'installation, modification possible en administration.
                            * Test de la force du mot de passe à l'installation
                            * Pas de gestion des bounce si la configuration n'a pas été générée
                            * Souscription avec validation par captcha
                            * Envoi des souscriptions (ou désinscriptions) en format html
                            * Rechargement automatique du traitement des mails en erreurs (page tracking)
                            * Test des paramètres pour traitement des mails bounce dans la configuration globale
                            * Génération du code HTML de souscription aux lettres d'information (page configuration de la lettre d'information)
                            * TinyMCE 4.0.26
                            * PHPMailer 5.2.8
                            * Ajout du List-Unsubscribe dans le header d'un mail
                            * Vue du mail on-line
                            * Ajout de pièces jointes (possibilités d'ajout et de suppression à tous les niveaux de création et d'envoi d'une campagne de mailing)
                            * Contrôle de la version courante et information si nouvelle version disponible
                            * Réécriture plus claire du portail de gestion

01/05/2014  v2.0.1
                            * Correction des bugs de la version beta
                            * auto-suggestion dans la recherche d'un mail pour les listes > 500 mails
                          
12/02/2014  v2.0beta1     
                            PHP :
                            * Reprise complète du code php
                            * réécriture complète en UTF-8
                            * Réduction du nombre de fichiers de fonction et de classes
                            * Mise en place de tokens
                            HTML :
                            * Reprise complète du style (http://html5up.net), ergonomie, disposition des fonctionnalités
                            SQL :
                            * Ajout des "IF NOT EXIST" sur la création des tables : install.php
                            * reprise de la classe de connexion
                            * Optimisation automatique des tables (mysql)
                            * Passage des tables en UTF8
                            * Possibilité de choisir le moteur de base de données MySql à l'installation : InnoDB ou MyIsam
                            PHPMAILER :
                            * Mise à jour de PhpMailer V.5.2.7 (https://github.com/Synchro/PHPMailer/releases)
                            * Suppression de la version de phpmailer dans les headers
                            REDACTION DES MAILS :
                            * Ajout de tinymce (V.4.0.16 : http://www.tinymce.com/) pour :
                            - la composition des messages
                            - en-têtes et pieds de message 
                            * Avec plugins :
                            - responsive filemanger 9 pour gestion des images ajoutées dans les messages
                            - colorpicker
                            * Suppression des espaces dans les noms de fichiers uploadés sur le serveur via responsive filemanager 9
                            * Sauvegarde automatique des messages en cours de composition
                            * Limitation à 78 caractères dans le sujet (norme RFC 2822 section 2.1.1) avec décompte du nombre de caractères restants possible
                            * Choix de composition d'un mail : TinyMCE ou code HTML (généré par une autre appli par exemple)
                            * Bouton d'enregistrement d'un mail en cours de composition
                            ENVOI DES MAILS :
                            * ajout de la possibilité d'usage du SMTP gmail (NB : avoir un compte gmail !)
                            * Suppression de la fonction email() de on-line
                            * Ajout de l'envoi d'un mail de prévisualisation avant envoi de masse
                            * Envoi des mails en ajax avec barre de progression et indication du pourcentage de la progression
                            * Traitement des mails non distribués (le "bounce handler") : mise à jour de la base pour traitement dans la page de gestion des e-mails
                            * Mise en place de la reprise d'un envoi si un envoi n'a pas été terminé. Cette fonctionnalité permet également d'adresser une lettre d'information aux inscrits postérieurs à l'envoi 
                            d'une lettre d'information.
                            GESTION DES EMAILS :
                            * Gestion des e-mails en erreur : modification ou suppression manuelle
                            * Horodatage des listes d'abonnés exportées via la console administration
                            STATISTIQUES :
                            * Mise en place de statistiques issues du tracking 
                            (mails envoyés, mails ouverts, lectures de mails, désinscription, échec de distribution)
                            * Graphiques de stats JpGraph v3.5.0b1 (http://jpgraph.net/)
                            * Tracking des liens cliqués inclus dans les mails, avec rendu graphique

29/05/2005  v0.8beta4     * Mail charset is now configurable
                          * News subscription form
                          * Bugfix tickets #61,#64,#53

19/03/2005  v0.8beta3     * Some work on xhtml code validity (not perfect).
                          * the usual Charset joke again and again.
                          * Preliminary online.net spectific email() php function support.

13/02/2005  v0.8beta2     * Mainly a 'PHP config' oriented beta :
                                - register_global = Off support
                                - error_reporting  =  E_ALL, 
                                - open_basedir restriction handling ...
                          * HTML preview in message composing
                          * Bugfix, Bugfix, Bugfix
                          * New translations.

19/01/2005  v0.8beta1     New admin interface
                          UTF-8 support
                          Archives interface
                          Preliminary log support
                          Much more ... :)

03/09/2002  v0.7beta1     Brand new version
                          Multiple newsletter support
                          SMTP support
                          DB Layer

01/06/2002  v0.6.10       ????

27/05/2002  v0.6.9        Fixing a bug in text file importation.

22/05/2002  v0.6.8b       0.6.8 was broken. Fixing a bug in sending process.

21/05/2002  v0.6.8        "Security" fix, using hash to identify users
                          Now using php extension

11/05/2002  v0.6.7        Security Fix in admin area 
                          Security hole causes by cookie.                 

26/01/2002  v0.6.6        New Year Release
                          New installation process.
                          Sending log file.
                          Bugfixes (again and again)

            v0.6.53       Bugfix + Slovak lang-file (thanks to Fedor "fi0dor" Tirsel)

08/11/2001  v0.6.52       BugFix Release + New lang-file
22/04/2001  v0.6.51       Bugfix dans le fichier admin.php et dans la config
13/02/2001  v0.6.5        Nouvelle config
                          Export
                          Bugfixes
                          Envoi fragmenté

??/??/??    v0.6.0

14/11/2000  v0.59         Passage aux classes.
    (=(v0.6beta)          Correction de bugs pour l'envoi en html.
                          Interface de configuration.
                          Importation d'email à partir d'un fichier texte.
                          Des bugfixes par milliers...
                          De belles icones
                          Support de l'anglais et du francais.
         
13/10/2000  v0.5.2        Ajout de la protection mot de passe de l'administration.
                          (merci à logon pour le code)         
08/10/2000  v0.5.1        Correction d'un bug dans l'envoi de message en format texte.
24/09/2000  v0.5          Changement dans la numérotation.
                          Correction de très (trop) nombreux bugs.
                          L'envoi en html doit fonctionner maintenant.
                          Apercu avant envoi des messages.
                          Logs des messages envoyés.
                          Nouveaux messages dans la zone d'administration. 
                          Le flush de la table temp se fait automatiquement.
                          Nouveau logo (cool :-)
                
27/07/2000  v0.0.4        version unifiée pour online, nexen et les autres FAI.
                          Fonctionne maintenant comme les vraies newsletter : mail de validation d'abonnement.
                          Fonction send_mail
                          Verification du format des adresses rentrées dans le formulaire.

19/07/2000  v0.0.3 nx     version adaptée à la fonction mail de nexen.
19/07/2000  v0.03         correction de bugs: ajout de stripslashes.
            v0.0.2a       correction de bug / message d'erreur
            v0.0.2        console d'administration permet la suppression des utilisateurs.        
05/06/2000  v0.0.1        premiere release publique.
LICENSE
wget 'https://lists2.roe3.org/pmnl3/LICENSE'
View Content
                    GNU GENERAL PUBLIC LICENSE
                       Version 2, June 1991

 Copyright (C) 1989, 1991 Free Software Foundation, Inc.
                       59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 Everyone is permitted to copy and distribute verbatim copies
 of this license document, but changing it is not allowed.

                            Preamble

  The licenses for most software are designed to take away your
freedom to share and change it.  By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users.  This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it.  (Some other Free Software Foundation software is covered by
the GNU Library General Public License instead.)  You can apply it to
your programs, too.

  When we speak of free software, we are referring to freedom, not
price.  Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.

  To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.

  For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have.  You must make sure that they, too, receive or can get the
source code.  And you must show them these terms so they know their
rights.

  We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.

  Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software.  If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.

  Finally, any free program is threatened constantly by software
patents.  We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary.  To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.

  The precise terms and conditions for copying, distribution and
modification follow.
                    GNU GENERAL PUBLIC LICENSE
   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION

  0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License.  The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language.  (Hereinafter, translation is included without limitation in
the term "modification".)  Each licensee is addressed as "you".

Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope.  The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.

  1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.

You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.

  2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:

    a) You must cause the modified files to carry prominent notices
    stating that you changed the files and the date of any change.

    b) You must cause any work that you distribute or publish, that in
    whole or in part contains or is derived from the Program or any
    part thereof, to be licensed as a whole at no charge to all third
    parties under the terms of this License.

    c) If the modified program normally reads commands interactively
    when run, you must cause it, when started running for such
    interactive use in the most ordinary way, to print or display an
    announcement including an appropriate copyright notice and a
    notice that there is no warranty (or else, saying that you provide
    a warranty) and that users may redistribute the program under
    these conditions, and telling the user how to view a copy of this
    License.  (Exception: if the Program itself is interactive but
    does not normally print such an announcement, your work based on
    the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole.  If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works.  But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.

Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.

In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.

  3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:

    a) Accompany it with the complete corresponding machine-readable
    source code, which must be distributed under the terms of Sections
    1 and 2 above on a medium customarily used for software interchange; or,

    b) Accompany it with a written offer, valid for at least three
    years, to give any third party, for a charge no more than your
    cost of physically performing source distribution, a complete
    machine-readable copy of the corresponding source code, to be
    distributed under the terms of Sections 1 and 2 above on a medium
    customarily used for software interchange; or,

    c) Accompany it with the information you received as to the offer
    to distribute corresponding source code.  (This alternative is
    allowed only for noncommercial distribution and only if you
    received the program in object code or executable form with such
    an offer, in accord with Subsection b above.)

The source code for a work means the preferred form of the work for
making modifications to it.  For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable.  However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.

If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
  4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License.  Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.

  5. You are not required to accept this License, since you have not
signed it.  However, nothing else grants you permission to modify or
distribute the Program or its derivative works.  These actions are
prohibited by law if you do not accept this License.  Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.

  6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions.  You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.

  7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License.  If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all.  For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.

If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.

It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices.  Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.

This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.

  8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded.  In such case, this License incorporates
the limitation as if written in the body of this License.

  9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time.  Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.

Each version is given a distinguishing version number.  If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation.  If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.

  10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission.  For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this.  Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.

                            NO WARRANTY

  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.

  12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.

                     END OF TERMS AND CONDITIONS
README.md
wget 'https://lists2.roe3.org/pmnl3/README.md'
View Content
![PhpMyNewsLetter 2.0](https://www.phpmynewsletter.com/css/images/phpmynewsletter_v2.png) 
phpmynewsletter 2.0
===================

# VERSION COURANTE : 2.0.5
 
# INSTALLATION
Télécharger le fichier zip : https://github.com/Arnaud69/phpmynewsletter-2.0/archive/master.zip
Dézipper dans un répertoire ou à la racine d'un sous-domaine dédié aux newsletter, appelez le script install.php depuis votre navigateur, remplissez les champs, et suivez la procédure.

# SYNOPSIS
Envoyez des emails, ajoutez des pièces jointes, gérez les retours (bounces), suivez les clics, les ouvertures, géolocalisation, etc...

# CONFIGURATION MINIMALE REQUISE :
 - PHP 5.3 min avec : imap, curl, openssl, module php exec
 - Mysql 5.x min
 - VPS/linux ou dédié server/linux pour un accès à crontab et gestion des bounces
 - les emails de vos correspondants
 - Et vos petites mains pour écrire de jolis mails et faire de belles campagnes !

# CHANGELOG :
## GENERAL :
- Compatibilité PHP 7 totale
## CORRECTIONS :
- Correction des bugs des versions antérieures
- Amélioration du script d'installation et correction du bug de création de la base
- Amélioration de la qualité des calculs des statistiques d'ouvertures (navigateurs, OS,...)
- Correction de la table des codes Géoloc (https://www.iso.org/obp/ui/)
- Correction du bug qui altérait le css dans les messages
- Ajout du "sql_mode = ''" pour les serveurs dédiés (tolérance aux champs non définis avec des valeurs par défaut)
- Amélioration du process unique_id, il y avait un risque de doublons de calcul de hash
- Adaptation globale pour une installation en sous-domaine
- Amélioration du recensement des mails en erreur à l'envoi (via phpmailer) en tâche planifiée (n'étaient pas comptabilisés)
- Correction du rattachement des clés DKIM
- Correction du traitement des mails en bounce
- Ajout du calcul du prefix des tables (ex : "pmnl2_") dans la config pour gestion des tables plus fine
## NOUVEAUTES :
- Champs sujets passés en utf8mb4 pour permettre usage des Emojis
- Gestion du Pre-Header
- Choix du menu : horizontal avec menus déroulants ou vertical traditionnel (configuration globale > règlages divers). Préférez le menu horizontal !
- Choix d'afficher ou ne pas afficher le loader (configuration globale > règlages divers)
- Géolocalisation des ouvertures (amcharts)
- Création de templates par un éditeur Wysiwyg (What You See Is What You Get)
- Création de la gestion des droits (un ou plusieurs droits à des utilisateurs crées par un admin) et log des actions
- Test des enregistrement DKIM, SPF et DMARC du domaine expéditeur
- Sauvegarde de la base à la demande et téléchargement (nombre de sauvegardes paramétrable)
- Regénération d'un mot de passe envoyé par mail si perdu
- Possibilité aux abonnés "free mobile" de recevoir des textos de fin de tâche d'envoi, d'inscriptions et désinscriptions
- Utilisation des CDNs pour l'import des librairies JS et CSS (au maximum)
- Vérification obligatoire des liens contenus dans un message avant preview
## OUTILS INTEGRES :
- Phpmailer 5.2.26
## AMELIORATIONS :
- Meilleure gestion de la comparaison des versions pour mises à jour possibles de versions mineures
- Affichage des mails en erreur par liste
- Code html de souscription basculé dans les paramètres des newsletters
## GESTION DU TRACKING :
- Géolocalisation des ouvertures (amcharts)
- Affichage des liens cliqués en modal
## GESTION DES MESSAGES ENVOYES :
- Suppression de la mention phpmynewsletter 2.0 en bas des mails envoyés
- Ajout des mails de REPLY et de BOUNCE
## GESTION DES TACHES PLANIFIEES :
- Correction du bug de suppression de la tâche planifiée
## GESTION DES LOGS :
- Correction du décalage dans les colonnes lorsqu'il n'y a pas de fichier log présent
- Affichage des logs en modal
## GESTIONS DES ABONNES :
- Calcul du profil des abonnés (rubrique Profils des abonnés)
- Pagination de la liste des abonnés en erreur en ajax
## GESTIONS DES SMTPs :
- Modification possible d'un smtp déclaré
- Remise à 0 des compteurs (load balancing smtp) lors de la preview
## GESTION DE LA REDACTION :
- Ajout de templates responsive (depuis TinyMCE)
- Thème "pmnl" des outils de rédaction TinyMCE
## GESTION DES BOUNCES :
- Correction du bug qui empêchait la suppression correcte des mails en erreur
- Ajout de la possibilité d'un mail de bounce différent de l'expéditeur (alias d'un Return Path)
- Ajout du paramètre array('DISABLE_AUTHENTICATOR' => 'GSSAPI') à la connexion imap pour les accéder aux serveurs de messagerie de type Exchange
- Amélioration du REGEXP pour récupération des mails en bounce sur serveurs de messagerie de type Exchange 

# SCREENSHOT, PREVIEW
## Présentation en menu vertical
![Menu vertical](https://www.phpmynewsletter.com/images/2.0.5/vertical_menu.png)
## Le nouvel éditeur en mode Wysiwyg : glisser et déposer des blocs, puis les personnaliser
![Editeur en mode WysiWyg](https://www.phpmynewsletter.com/images/2.0.5/wysiwyg.png)
## Présentation en menu vertical et vue de la gestion des utilisateurs
![Menu horizontal et gestion des utilisateurs de Phpmynewsletter](https://www.phpmynewsletter.com/images/2.0.5/account_manager.png)
## La nouvelle gestion des comptes utilsateurs de PhpMyNewsLetter
![Gestion des comptes expéditeurs](https://www.phpmynewsletter.com/images/2.0.5/account_manager.png)
## La gestion détaillée des comptes utilisateurs
![Gestion des utilisateurs de Phpmynewsletter, détail de la gestion des droits](https://www.phpmynewsletter.com/images/2.0.5/account_manager_detail.png)
## La gestion des SMTPs pour le load balancing (plusieurs smtp = distribution plus rapide des mails)
![Gestion des SMTPs pour load balancing SMTP](https://www.phpmynewsletter.com/images/2.0.5/1.jpg)
## Les statistiques globales
![Statistiques](https://www.phpmynewsletter.com/images/2.0.5/full_stats.png)
## L'accès au profil des utilsateurs
![Profils des utilisateurs](https://www.phpmynewsletter.com/images/2.0.5/users_profils.png)

# SUPPORT
Support sur forum : https://www.phpmynewsletter.com/forum/.

# Roadmap for next version, TODO 2.0.6
- Gestion indépendate des templates
- Intégration d'un formulaire d'ajout des clés DKIM
- Champs de personnalisation des emails
- Champs de personnalisation des fonds d'écran
- Compatibilité avec Postgresql et MsSQL
- Mise à jour d'un simple clic
- PHPMailer 6.x
- Traduction complète en anglais
- Si vous pensez à quelque chose qui puisse améliorer le produit, demandez !
 
# LICENSE
GNU GPL

Mettez une étoile si vous aimez  ;-)

VERSION
wget 'https://lists2.roe3.org/pmnl3/VERSION'
View Content
2.0.5
_loader.php
wget 'https://lists2.roe3.org/pmnl3/_loader.php'
View Content
<?php
include( 'include/config.php' );
if( $type_env=='dev' ) { 
	error_reporting(E_ALL);
	ini_set('display_errors',1);
}
ini_set('mail.add_x_header','Off');
$_SESSION['timezone'] = $timezone;
$popup = false;
$display_archive = false;
include( 'include/db/db_connector.inc.php' );
include_once( 'include/lib/pmn_fonctions.php' );
if( $type_serveur='dedicated' ) {
	$cnx->query( "SET sql_mode = '';" );
}



blank.gif
wget 'https://lists2.roe3.org/pmnl3/blank.gif'
View Content
c.php
wget 'https://lists2.roe3.org/pmnl3/c.php'
View Content
<?php
session_start();
$_SESSION['c'] = rand(1000,9999);
$img = imagecreatetruecolor(70, 30);
$fill_color=imagecolorallocate($img,255,255,255);
imagefilledrectangle($img, 0, 0, 70, 30, $fill_color);
$text_color=imagecolorallocate($img,10,10,10);
$font = getcwd() . '/css/28DaysLater.ttf';
imagettftext($img, 23, 0, 5,30, $text_color, $font, $_SESSION['c']);
header("Content-type: image/jpeg");
imagejpeg($img);
imagedestroy($img);


dl.php
wget 'https://lists2.roe3.org/pmnl3/dl.php'
View Content
<?php
session_start();
if(!file_exists("include/config.php")) {
    header("Location:install.php");
    exit;
} else {
    include("_loader.php");
}
$row_config_globale = $cnx->SqlRow("SELECT * FROM $table_global_config");
(count($row_config_globale)>0)?$r='SUCCESS':$r='';
if($r != 'SUCCESS') {
    include("include/lang/english.php");
    echo "<div class='error'>".translate($r)."<br>";
    echo "</div>";
    exit;
}
if(empty($row_config_globale['language']))$row_config_globale['language']="english";
include("include/lang/".$row_config_globale['language'].".php");
$token=(empty($_GET['token'])?"":$_GET['token']);
if(!isset($token) || $token=="")$token=(empty($_GET['token'])?"":$_GET['token']);
if(tok_val($token)){
    if(!checkAdminAccess($row_config_globale['admin_pass'],$form_pass)) {
        if(!empty($_POST['form'])&&$_POST['form'])
            header("Location:login.php?error=1");
        else
            header("Location:login.php");
        exit;
    }
} else {
    header("Location:login.php?error=2");
    exit;
}
function readfile_chunked($filename) { 
    $chunksize = 1*(1024*1024); // how many bytes per chunk 
    $buffer = ''; 
    $handle = fopen($filename, 'rb'); 
    if ($handle === false) { 
        return false; 
    } 
    while (!feof($handle)) { 
        $buffer = fread($handle, $chunksize); 
        print $buffer; 
    } 
    return fclose($handle); 
}
$log =(empty($_GET['log'])?"":urldecode($_GET['log']));
if(file_exists($log)){       
    header("Pragma: public");
    header("Expires: 0"); 
    header("Cache-Control: must-revalidate, post-check=0, pre-check=0"); 
    header("Cache-Control: private",false);
    header("Content-Type: text/plain\n");
    header("Content-disposition: attachment; filename=".str_replace("logs/","",$log));
    header("Content-Transfer-Encoding: binary"); 
    header("Content-Length: ".filesize($log));
    header("Pragma: no-cache");
    ob_clean(); 
    flush();
    readfile_chunked($log);
}
export.php
wget 'https://lists2.roe3.org/pmnl3/export.php'
View Content
<?php
if(!file_exists("include/config.php")) {
    header("Location:install.php");
    exit;
} else {
    include("_loader.php");
}
$token=(empty($_POST['token'])?"":$_POST['token']);
if(!isset($token) || $token=="")$token=(empty($_GET['token'])?"":$_GET['token']);
if(!tok_val($token)){
	header("Location:login.php?error=2");
	exit;
} else {
    $row_config_globale = $cnx->SqlRow("SELECT * FROM $table_global_config");
}
$list_id     = $_POST['list_id'];
$list_total_subscribers=get_newsletter_total_subscribers($cnx,$row_config_globale['table_email'],$list_id,-1);
if($list_total_subscribers>1000000)ini_set('memory_limit', '2G');
export_subscribers($cnx, $row_config_globale['table_email'], $list_id);


favicon.ico
wget 'https://lists2.roe3.org/pmnl3/favicon.ico'
View Content
favicon.png
wget 'https://lists2.roe3.org/pmnl3/favicon.png'
View Content
install.php
wget 'https://lists2.roe3.org/pmnl3/install.php'
View Content
<?php
$version        = '2.0.5';
$timezone       = '';
error_reporting(E_ALL);
ini_set('display_errors',1);
if(file_exists("include/config.php")) {
	header("Location:index.php");
	exit;
}else{
	include('include/lib/pmn_fonctions.php');
	include('include/lib/constantes.php');
}
$langfileArray  = array('english','francais');
$langfile       = (isset($_POST['langfile'])&&in_array($_POST['langfile'],$langfileArray) ? $_POST['langfile'] :"");
$db_typeArray   = array('mysql');
$db_type        = (isset($_POST['db_type'])&&in_array($_POST['db_type'],$db_typeArray) ? $_POST['db_type'] : "");
$stepArray      = array(1,2,3,4);
$step           = (isset($_POST['step'])&&in_array($_POST['step'],$stepArray) ? $_POST['step'] : 1);
$opArray        = array('saveConfig');
$op             = (isset($_POST['op'])&&in_array($_POST['op'],$opArray) ? $_POST['op'] : "");
if (empty($langfile)) {
	include("./include/lang/francais.php");
} else {
	include_once("include/lang/" . $langfile . ".php");
}
?>
<!DOCTYPE HTML>
<html lang="fr">
<head>
	<meta charset="utf-8" />
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<title><?php echo tr("INSTALL_TITLE");?></title>
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<script src="js/wysiwyg/jquery-1.10.2.min.js"></script>
	<script src="js/wysiwyg/jquery-ui.js"></script>
	<script src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
	<link href="//code.jquery.com/ui/1.12.0/themes/redmond/jquery-ui.css" rel="stylesheet" media="screen">
	<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous" rel="stylesheet">
	<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-select/1.12.2/css/bootstrap-select.min.css">
	<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-select/1.12.2/js/bootstrap-select.min.js"></script>
	<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-select/1.12.2/js/i18n/defaults-<?php echo tr("I18N_LNG");?>.min.js"></script>
	<link href="css/styles.css" rel="stylesheet">
	<!--[if lt IE 9]>
		<script src="//oss.maxcdn.com/libs/html5shiv/3.7.3/html5shiv.js"></script>
		<script src="//oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
	<![endif]-->
	<link href="https://gitcdn.github.io/bootstrap-toggle/2.2.2/css/bootstrap-toggle.min.css" rel="stylesheet">
	<script src="https://gitcdn.github.io/bootstrap-toggle/2.2.2/js/bootstrap-toggle.min.js"></script>
	<script src="js/jsclock-0.8.min.js"></script>
</head>
<body>
	<div class="container">
		<div class="jumbotron">
			<h1><a href="http://www.phpmynewsletter.com">PhpMyNewsLetter</a></h1>
			<p>
				<a href="http://www.phpmynewsletter.com/forum/" target="_blank"><?php echo tr("SUPPORT");?></a>
				-
				<a><?php echo tr("TIME_SERVER");?> : <span id='ts'></span></a>
			</p>
		</div>
		<div class="panel-group">
			<div class="panel panel-primary">
				<div class="panel-heading"><h2 class="section_title"><?php echo tr("INSTALL_TITLE") . " " . $step . "/4";?></a>
					<h5><?php
					echo ($step==1 ?' <span class="glyphicon glyphicon-circle-arrow-right"></span> '.tr("INSTALL_VERSIONS_EXTENSIONS") . ', ' . tr("INSTALL_LANGUAGE") :
						($step==2 ?' <span class="glyphicon glyphicon-circle-arrow-right"></span> '.tr("INSTALL_VERSIONS_EXTENSIONS") . ', ' . tr("INSTALL_LANGUAGE").' <span class="glyphicon glyphicon-circle-arrow-right"></span> '.tr("INSTALL_DB_TYPE") :
							($step==3 ?' <span class="glyphicon glyphicon-circle-arrow-right"></span> '.tr("INSTALL_VERSIONS_EXTENSIONS") . ', ' . tr("INSTALL_LANGUAGE").' <span class="glyphicon glyphicon-circle-arrow-right"></span> '.tr("INSTALL_DB_TYPE").' <span class="glyphicon glyphicon-circle-arrow-right"></span> '.tr("INSTALL_ENVIRONMENT").', '.tr("INSTALL_DB_TITLE").', '.tr("INSTALL_GENERAL_SETTINGS") :
								($step==4 ?  '<span class="glyphicon glyphicon-circle-arrow-right"></span> '.tr("INSTALL_VERSIONS_EXTENSIONS") . ', ' . tr("INSTALL_LANGUAGE").' <span class="glyphicon glyphicon-circle-arrow-right"></span> '.tr("INSTALL_DB_TYPE").' <span class="glyphicon glyphicon-circle-arrow-right"></span> '.tr("INSTALL_ENVIRONMENT").', '.tr("INSTALL_DB_TITLE").', '.tr("INSTALL_GENERAL_SETTINGS").' <span class="glyphicon glyphicon-circle-arrow-right"></span> '.tr("INSTALL_STEP_FINISHED") : ''
								)
							)
						)
					)
					?></h5>
				</div>
				<div class="panel-body">
				<?php
					if($step==1){
						echo '<h3>'.tr("INSTALL_VERSIONS_EXTENSIONS").'</h3>';
						if (version_compare(PHP_VERSION, '5.3.0', '>')) {
							echo "<h4 class='alert alert-success'>PHP : ".phpversion()." ".tr("OK_BTN")."</h4>";
						} else {
							echo "<h4 class='alert alert-danger'>PHP : ".phpversion()." ".tr("INSTALL_OBSOLETE")."</h4>";
						}
						if (extension_loaded('imap')) {
							echo "<h4 class='alert alert-success'>".tr("INSTALL_VERSIONS_EXTENSIONS")." imap ".tr("OK_BTN")."</h4>";
						} else {
							echo "<h4 class='alert alert-danger'>".tr("INSTALL_VERSIONS_EXTENSIONS")." imap ".tr("INSTALL_MISSING")."</h4>";
						}
						if (extension_loaded('curl')) {
							echo "<h4 class='alert alert-success'>".tr("INSTALL_VERSIONS_EXTENSIONS")." curl ".tr("OK_BTN")."</h4>";
						} else {
							echo "<h4 class='alert alert-danger'>".tr("INSTALL_VERSIONS_EXTENSIONS")." curl ".tr("INSTALL_MISSING")."</h4>";
						}
					}
					if (empty($langfile)) {
						echo '<h3>'.tr("INSTALL_LANGUAGE").'</h3>';
						echo "<form action='".$_SERVER['PHP_SELF']."' method='post'>";
						echo "<input type='hidden' name='step' value=" . ($step + 1) . " />";
						echo tr("INSTALL_LANGUAGE_LABEL") . " : <select name='langfile' class='selectpicker' data-width='auto'>";
						echo "<option value='english'>English</option><option value='francais' selected>Francais</option>";
						echo "</select><br /><br /><input class='btn btn-primary' type='submit' value='" . tr("OK_BTN") . "'>";
						echo "</form>";
					} elseif (empty($db_type) && isset($langfile)) {
						echo '<h3>'.tr("INSTALL_DB_TYPE").'</h3>';
						echo "<form action='".$_SERVER['PHP_SELF']."' method='post'>";
						echo tr("INSTALL_DB_TYPE") . " : <select name='db_type' class='selectpicker' data-width='auto'>";
						echo "<option value='mysql' selected>MySQL</option>";
						echo "<input type='hidden' NAME='langfile' value='$langfile'>";
						echo "<input type='hidden' name='step' value=" . ($step + 1) . " />";
						echo "</select><br /><br /><input class='btn btn-primary' type='submit' value='" . tr("OK_BTN") . "'>";
						echo "</form>";
					} elseif (isset($db_type) && empty($op) && isset($langfile)) {
						echo "<form method='post' name='global_config' action='".$_SERVER['PHP_SELF']."'>";
						echo '<h3>'.tr("INSTALL_ENVIRONMENT").', '.tr("INSTALL_DB_TITLE").', '.tr("INSTALL_GENERAL_SETTINGS").'</h3>';
						echo "<div class='row'><div class='col-md-4'>".tr("INSTALL_ENVIRONMENT") . " : </div><div class='col-md-6'><select name='type_env' class='selectpicker' data-width='auto'>";
						echo "<option value='dev'>".tr("INSTALL_DEVELOPMENT")."</option><option value='prod' selected>".tr("INSTALL_PRODUCTION")."</option>";
						echo '</select></div></div><br>';
						echo "<div class='row'><div class='col-md-4'>".tr("INSTALL_SERVER_TYPE") . " : </div><div class='col-md-6'><select name='type_serveur' class='selectpicker' data-width='auto'>";
						echo "<option value='shared' selected>".tr("SHARED_SERVER")."</option><option value='dedicated'>".tr("DEDICATED_SERVER")."</option>";
						echo "</select></div></div><br>";
						echo '<h3>'.tr("INSTALL_DB_TITLE").'</h3>';
						echo "<div class='row'><div class='col-md-4'>".tr("INSTALL_DB_HOSTNAME") . 	" : </div><div class='col-md-6'><input class='form-control' type='text'  name='db_host' value='localhost'></div></div><br>";
						echo "<div class='row'><div class='col-md-4'>".tr("INSTALL_DB_NAME") . 		" : </div><div class='col-md-6'><input class='form-control' type='text'  name='db_name' value='phpMyNewsletter'></div></div><br>";
						echo "<div class='row'><div class='col-md-4'>".tr("INSTALL_DB_LOGIN") . 	" : </div><div class='col-md-6'><input class='form-control' type='text'  name='db_login' value=''></div></div><br>";
						echo "<div class='row'><div class='col-md-4'>".tr("INSTALL_DB_PASS") . 		" : </div><div class='col-md-6'><input class='form-control' type='password' name='db_pass' value=''></div></div><br>";
						echo "<div class='row'><div class='col-md-4'>".tr("INSTALL_DB_TABLE_PREFIX") . 	" : </div><div class='col-md-6'><input class='form-control' type='text'  name='table_prefix' value='pmn2_'></div></div><br>";
						echo "<div class='row'><div class='col-md-4'>".tr("INSTALL_DB_CREATE_DB") . 	" : </div><div class='col-md-6'><input type='checkbox' name='createdb' value='1'></div></div><br>";
						echo "<div class='row'><div class='col-md-4'>".tr("INSTALL_DB_CREATE_TABLES") . " : </div><div class='col-md-6'><input type='checkbox' checked name='createtables' value='1'></div></div><br>";
						echo "<div class='row'><div class='col-md-4'>".tr("STORAGE_ENGINE") . 		" : </div><div class='col-md-6'><select name='storage_engine' class='selectpicker' data-width='auto'>";
						echo "<option value='MyISAM' selected>MyISAM</option><option value='InnoDB'>InnoDB</option></select></div></div><br>";
						echo '<h3>'.tr("INSTALL_GENERAL_SETTINGS").'</h3>';
						echo "<div class='row'><div class='col-md-4'>".tr("LOCAL_TIME_ZONE"). 		" : </div><div class='col-md-6'><select name='timezone' class='selectpicker' data-width='auto'>".$LISTE_PAYS_SIMPLE.'</select></div></div><br>';
						echo "<div class='row'><div class='col-md-4'>".tr("INSTALL_ADMIN_PASS")."<br>(Attention : cette zone n'est pas cachée, le mot de passe est affiché en clair) : </div><div class='col-md-6'><input class='form-control' type='text' id='admin_pass' name='admin_pass' value=''></div></div><br>";
						echo "<div class='row'><div class='col-md-4'>".tr("INSTALL_ADMIN_BASEURL")." : </div><div class='col-md-6'><input class='form-control' type='text'  name='base_url' size='30' value='".((isset($_SERVER['HTTPS'])&&$_SERVER['HTTPS'] == "on") ? "https" : "http")."://" . $_SERVER['HTTP_HOST'] . "'><span style='text-transform: lowercase;'>(" . tr("EXAMPLE") . " : http://www.example.com)</span></div></div><br>";
						echo "<div class='row'><div class='col-md-4'>".tr("INSTALL_ADMIN_PATH_TO_PMNL")." : </div><div class='col-md-6'><input class='form-control' type='text'  name='path' size='30' value='".str_replace((__DIR__), "",$_SERVER['DOCUMENT_ROOT'])."/'><span style='text-transform: lowercase;'>(" . tr("EXAMPLE") . " : tools/newsletter/)</span></div></div><br>";
						echo "<div class='row'><div class='col-md-4'>".tr("INSTALL_LANGUAGE"). 		" : </div><div class='col-md-6'><select name='language' class='selectpicker' data-width='auto'>".getLanguageList($langfile)."</select></div></div><br>";
						echo "<div class='row'><div class='col-md-4'>".tr("INSTALL_ADMIN_NAME"). 	" : </div><div class='col-md-6'><input class='form-control' type='text'  name='admin_name' size='30' value='Admin'></div></div><br>";
						echo "<div class='row'><div class='col-md-4'>".tr("INSTALL_ADMIN_EMAIL"). 	" : </div><div class='col-md-6'><input class='form-control' type='text'  name='admin_email' size='30' value='admin@" . @str_replace("www.", "",$_SERVER['HTTP_HOST']) . "'></div></div><br>";
						echo '<h3>'.tr("INSTALL_MESSAGE_SENDING_TITLE").'</h3>';
						echo "<div class='row'><div class='col-md-4'>".tr("INSTALL_MESSAGE_SENDING_LOOP")." : </div><div class='col-md-6'><input type='text'  name='sending_limit' size='3' value='3'></div></div><br>";
						echo "<div class='row'><div class='col-md-4'>".tr("INSTALL_SENDING_METHOD")." : </div><div class='col-md-6'><select name='sending_method' class='selectpicker' data-width='auto'>";
						echo "<option value='smtp' selected>smtp</option>";
						echo "<option value='lbsmtp'>Load Balancing SMTP</option>";
						echo "<option value='smtp_gmail_tls'>smtp Gmail TLS (port 587)</option>";
						echo "<option value='smtp_gmail_ssl'>smtp Gmail SSL (port 465)</option>";
						echo "<option value='smtp_mutu_ovh'>smtp ".tr("INSTALL_SHARED")." OVH</option>";
						echo "<option value='smtp_mutu_1and1'>smtp ".tr("INSTALL_SHARED")." 1AND1 (fr)</option>";
						echo "<option value='smtp_mutu_gandi'>smtp ".tr("INSTALL_SHARED")." GANDI</option>";
						echo "<option value='smtp_mutu_online'>smtp ".tr("INSTALL_SHARED")." ONLINE</option>";
						echo "<option value='smtp_mutu_infomaniak'>smtp ".tr("INSTALL_SHARED")." INFOMANIAK</option>";
						echo "<option value='php_mail'>" . tr("INSTALL_PHP_MAIL_FONCTION") . "</option>";
						echo "</select></div></div><br>";
						echo "<div class='row'><div class='col-md-4'>".tr("INSTALL_SMTP_HOST").		" : </div><div class='col-md-6'><input class='form-control' type='text' name='smtp_host' value=''></div></div><br>";
						echo "<div class='row'><div class='col-md-4'>".tr("INSTALL_SMTP_PORT").		" : </div><div class='col-md-6'><input class='form-control' type='text' name='smtp_port' value=''></div></div><br>";
						echo "<div class='row'><div class='col-md-4'>".tr("INSTALL_SMTP_AUTH_NEEDED").	" </div><div class='col-md-6'><input type='radio' name='smtp_auth' value='0' checked > " . tr("NO") . "  <input type='radio' name='smtp_auth' value='1'> " . tr("YES")  ."</div></div><br>";
						echo "<div class='row'><div class='col-md-4'>".tr("INSTALL_SMTP_USERNAME").	" : </div><div class='col-md-6'><input class='form-control' type='text' name='smtp_login' value=''></div></div><br>";
						echo "<div class='row'><div class='col-md-4'>".tr("INSTALL_SMTP_PASSWORD").	" : </div><div class='col-md-6'><input class='form-control' type='text' name='smtp_pass' value=''></div></div><br>";
						echo '<h3>'.tr("GCONFIG_SUBSCRIPTION_TITLE").'</h3>';
						echo "<div class='row'><div class='col-md-4'>".tr("INSTALL_VALIDATION_PERIOD").	" : </div><div class='col-md-6'><input class='form-control' type='text'  name='validation_period' size='3' value='6'></div></div><br>";
						echo "<div class='row'><div class='col-md-4'>".tr("INSTALL_SUB_CONFIRM").	" </div><div class='col-md-6'><input type='radio' name='sub_validation'  value='0'> " . tr("NO")."  <input type='radio' name='sub_validation' value='1' checked> " . tr("YES")  ."</div></div><br>";
						echo "<div class='row'><div class='col-md-4'>".tr("INSTALL_UNSUB_CONFIRM") .	" </div><div class='col-md-6'><input type='radio' name='unsub_validation' value='0'> " . tr("NO") . " <input type='radio' name='unsub_validation' value='1' checked> " . tr("YES")."</div></div><br>";
						echo "<div class='row'><div class='col-md-4'>".tr("GCONFIG_ALERT_SUB") . 	" </div><div class='col-md-6'><input type='radio' name='alert_sub' value='0'> " . tr("NO") ." <input type='radio' name='alert_sub' value='1' checked> " . tr("YES")."</div></div><br>";
						echo "<input type='hidden' name='op' value='saveConfig'>";
						echo "<input type='hidden' name='langfile' value='$langfile'>";
						echo "<input type='hidden' name='db_type' value='$db_type'><br>";
						echo "<input type='hidden' name='mod_sub' value='0'><br>";
						echo "<input type='hidden' name='step' value=" . ($step + 1) . " />";
						echo "<div align='center'><input id='submit' type='submit' value='Go Go Go !!!'></div>";
						echo "<script>$('#submit').click(function(){if($.trim($('#admin_pass').val())==''){alert('" . tr("INSTALL_CHOOSE_PASSWORD") . "');return false;}})</script>";
						echo '</form>';
					} elseif (isset($db_type) && $op == "saveConfig") {
						echo '<h3>'. tr("INSTALL_RESULT_INSTALLATION") .'</h3>';
						$createdb          = (isset($_POST['createdb']) ? $_POST['createdb'] : 0);
						$createtables      = (isset($_POST['createtables']) ? $_POST['createtables'] : 0);
						$smtp_host         = (isset($_POST['smtp_host']) ? $_POST['smtp_host'] : "");
						$smtp_port         = (isset($_POST['smtp_port']) ? $_POST['smtp_port'] : "");
						$smtp_auth         = (isset($_POST['smtp_auth']) ? $_POST['smtp_auth'] : 0);
						$smtp_login        = (isset($_POST['smtp_login']) ? $_POST['smtp_login'] : "");
						$smtp_pass         = (isset($_POST['smtp_pass']) ? $_POST['smtp_pass'] : "");
						$mod_sub           = (isset($_POST['mod_sub']) ? $_POST['mod_sub'] : 0);
						$db_type           = (isset($_POST['db_type']) ? $_POST['db_type'] : "");
						$hostname          = (isset($_POST['db_host']) ? $_POST['db_host'] : "");
						$login             = (isset($_POST['db_login']) ? $_POST['db_login'] : "");
						$pass              = (isset($_POST['db_pass']) ? $_POST['db_pass'] : "");
						$database          = (isset($_POST['db_name']) ? $_POST['db_name'] : "");
						$table_prefix      = (isset($_POST['table_prefix']) ? $_POST['table_prefix'] : "pmn2_");
						$storage_engine    = (isset($_POST['storage_engine']) ? $_POST['storage_engine'] : "MyISAM");
						$admin_pass        = (isset($_POST['admin_pass']) ? $_POST['admin_pass'] : "");
						$timezone          = (isset($_POST['timezone']) ? $_POST['timezone'] : "");
						$base_url          = (isset($_POST['base_url']) ? $_POST['base_url'] : "");
						$path              = (isset($_POST['path']) ? $_POST['path'] : "");
						$sending_method    = (isset($_POST['sending_method']) ? $_POST['sending_method'] : "");
						$language          = (isset($_POST['language']) ? $_POST['language'] : "");
						$sending_limit     = (isset($_POST['sending_limit']) ? $_POST['sending_limit'] : "");
						$validation_period = (isset($_POST['validation_period']) ? $_POST['validation_period'] : "");
						$sub_validation    = (isset($_POST['sub_validation']) ? $_POST['sub_validation'] : "");
						$unsub_validation  = (isset($_POST['unsub_validation']) ? $_POST['unsub_validation'] : "");
						$admin_email       = (isset($_POST['admin_email']) ? $_POST['admin_email'] : "");
						$admin_name        = (isset($_POST['admin_name']) ? $_POST['admin_name'] : "");
						$sub_validation    = (isset($_POST['sub_validation']) ? $_POST['sub_validation'] : "");
						$type_serveur      = (isset($_POST['type_serveur']) ? $_POST['type_serveur'] : "shared");
						$type_env          = (isset($_POST['type_env']) ? $_POST['type_env'] : "dev");
						$alert_sub         = (isset($_POST['alert_sub']) ? $_POST['alert_sub'] : "1");
						if ($createdb == 1) {
							switch($db_type){
							case 'mysql':
								$conn = new mysqli($hostname, $login, $pass);
								if ($conn->connect_error) {
									die("<h4 class='alert alert-danger'>" . tr("ERROR_SQL", $conn->connect_error) . "<br>" . tr("INSTALL_CREATE_DB_DOWN") . " !<br>" . tr("INSTALL_REFRESH") . " !</h4>");
								}
								$sql = "CREATE DATABASE IF NOT EXISTS $database";
								if ($conn->query($sql) === TRUE) {
									echo "<h4 class='alert alert-success'>" . tr("INSTALL_SAVE_CREATE_DB", $database) . " OK</h4>";
								} else {
									die("<h4 class='alert alert-danger'>" . tr("ERROR_SQL", $conn->error) . "<br>" . tr("QUERY") . " : " . $sql . "<br>" . tr("INSTALL_CREATE_DB_DOWN") . " !<br>" . tr("INSTALL_REFRESH") . " !</h4>");
								}
								$conn->close();
							break;
								case 'mssql':
								case 'pgsql':
								case 'oracle':
								die('Not yet available... :-(');
							break;
							}
						}
						include_once("include/db/db_connector.inc.php");
						if(!is_dir("upload")){
							if(mkdir("upload",0755)){
								echo '<h4 class="alert alert-success">'.tr("UPLOAD_DIRECTORY").' '.tr("DONE").'</h4>';
							} else {
								die('<h4 class="alert alert-danger">'.tr("UPLOAD_DIRECTORY").' : "'.$path.'upload".<br>'
								. tr("CHECK_PERMISSIONS_OR_CREATE") . ' "'.$path.'upload" ' . tr("MANUALLY") . '<br>' . tr("INSTALL_REFRESH") . ' !</div>');
							}
						}
						if(!is_dir("include/DKIM")){
							if(mkdir("include/DKIM",0755)){
								echo '<h4 class="alert alert-success">'.tr("DKIM_DIRECTORY").' '.tr("DONE").'</h4>';
							} else {
								die('<h4 class="alert alert-danger">'.tr("DKIM_DIRECTORY").' : "'.$path.'include/DKIM".<br>'
								. tr("CHECK_PERMISSIONS_OR_CREATE") . ' "'.$path.'include/DKIM" ' . tr("MANUALLY") . '<br>' . tr("INSTALL_REFRESH") . ' !</div>');
							}
						}
						if(!is_dir("logs")){
							if(mkdir("logs",0777)){
								echo '<h4 class="alert alert-success">'.tr("LOGS_DIRECTORY").' '.tr("DONE").'</h4>';
							} else {
								die('<h4 class="alert alert-danger">'.tr("LOGS_DIRECTORY").' : "'.$path.'logs".<br>'
								. tr("CHECK_PERMISSIONS_OR_CREATE") . ' "'.$path.'logs" ' . tr("MANUALLY") . '<br>' . tr("INSTALL_REFRESH") . ' !</div>');
							}
						}
						if(!is_dir("include/backup_crontab")){
							if(mkdir("include/backup_crontab",0755)){
								echo '<h4 class="alert alert-success">'.tr("BK_CRONTAB_DIRECTORY").' '.tr("DONE").'</h4>';
							} else {
								die('<h4 class="alert alert-danger">'.tr("BK_CRONTAB_DIRECTORY").' : "'.$path.'include/backup_crontab".<br>'
								. tr("CHECK_PERMISSIONS_OR_CREATE") . ' "'.$path.'include/backup_crontab" ' . tr("MANUALLY") . '<br>' . tr("INSTALL_REFRESH") . ' !</div>');
							}
						}
						if ($db_type == "mysql") {
							if ($createtables == 1) {
								$cnx->query( "SET sql_mode = '';" );
								$sql = 'CREATE TABLE IF NOT EXISTS `' . $table_prefix . 'archives` (
									`id` INT(7) UNSIGNED NOT NULL AUTO_INCREMENT,
									`date` DATETIME NOT NULL DEFAULT "000-00-00 00:00:00",
									`type` TEXT NOT NULL,
									`subject` VARCHAR(255) CHARACTER SET utf8mb4 NOT NULL DEFAULT "",
									`message` LONGTEXT NOT NULL,
									`list_id` INT(4) NOT NULL DEFAULT "0",
									`sender_email` VARCHAR(255) NOT NULL,
									`draft` LONGTEXT NOT NULL,
									`preheader` TEXT NOT NULL,
									PRIMARY KEY (`id`),
									KEY `list_id` (`list_id`),
									KEY `sender_email` (`sender_email`)
								) ENGINE='.$storage_engine.' DEFAULT CHARSET=utf8  AUTO_INCREMENT=1;';
								if($cnx->Sql($sql)){
									echo '<h4 class="alert alert-success">'.tr("INSTALL_SAVE_CREATE_TABLE", $table_prefix . "archives") .' '.tr("DONE").'</h4>';
								}else{
									die("<h4 class='alert alert-danger'>" . tr("ERROR_SQL", $db->DbError()) . "<br>" . tr("QUERY") . " : " . $sql . "<br>" . tr("INSTALL_REFRESH") . " !</h4>");
								}

								$sql = 'CREATE TABLE IF NOT EXISTS `' . $table_prefix . 'autosave` (
									`list_id` INT(4) UNSIGNED NOT NULL DEFAULT "0",
									`subject` VARCHAR(255) CHARACTER SET utf8mb4 NOT NULL DEFAULT "",
									`textarea` LONGTEXT NOT NULL,
									`type` TEXT NOT NULL,
									`draft` longtext NOT NULL,
									`sender_email` VARCHAR(255) NOT NULL,
									`preheader` TEXT NOT NULL,
									UNIQUE KEY `list_id` (`list_id`)
								) ENGINE='.$storage_engine.' DEFAULT CHARSET=utf8;';
								if($cnx->Sql($sql)){
									echo '<h4 class="alert alert-success">'.tr("INSTALL_SAVE_CREATE_TABLE", $table_prefix . "autosave") .' '.tr("DONE").'</h4>';
								}else{
									die("<h4 class='alert alert-danger'>" . tr("ERROR_SQL", $db->DbError()) . "<br>" . tr("QUERY") . " : " . $sql . "<br>" . tr("INSTALL_REFRESH") . " !</h4>");
								}

								$sql = 'CREATE TABLE IF NOT EXISTS `' . $table_prefix . 'codes` (
									`code` VARCHAR(2) NOT NULL,
									`lat` DECIMAL(10,8) NOT NULL,
									`long` DECIMAL(11,8) NOT NULL,
									`country` VARCHAR(50) NOT NULL,
									`color` VARCHAR(7) NOT NULL,
									KEY `code` (`code`),
									KEY `lat` (`lat`),
									KEY `long` (`long`),
									KEY `country` (`country`),
									KEY `color` (`color`)
								) ENGINE='.$storage_engine.' DEFAULT CHARSET=utf8;';
								if($cnx->Sql($sql)){
									echo '<h4 class="alert alert-success">'.tr("INSTALL_SAVE_CREATE_TABLE", $table_prefix . "codes") .' '.tr("DONE").'</h4>';
								}else{
									die("<h4 class='alert alert-danger'>" . tr("ERROR_SQL", $db->DbError()) . "<br>" . tr("QUERY") . " : " . $sql . "<br>" . tr("INSTALL_REFRESH") . " !</h4>");
								}

								$sql = 'CREATE TABLE IF NOT EXISTS `' . $table_prefix . 'config` (
									`admin_pass` VARCHAR(64) NOT NULL DEFAULT "",
									`archive_limit` VARCHAR(64) NOT NULL DEFAULT "",
									`base_url` VARCHAR(64) NOT NULL DEFAULT "",
									`path` VARCHAR(64) NOT NULL DEFAULT "",
									`sending_method` ENUM("smtp","lbsmtp","php_mail","php_mail_infomaniak","smtp_gmail_tls","smtp_gmail_ssl","smtp_mutu_ovh","smtp_mutu_1and1","smtp_mutu_gandi","smtp_mutu_online","smtp_mutu_infomaniak","smtp_over_tls","smtp_over_ssl") NOT NULL DEFAULT "php_mail",
									`language` VARCHAR(64) NOT NULL DEFAULT "",
									`table_email` VARCHAR(255) NOT NULL DEFAULT "",
									`table_temp` VARCHAR(255) NOT NULL DEFAULT "",
									`table_listsconfig` VARCHAR(255) NOT NULL DEFAULT "",
									`table_archives` VARCHAR(255) NOT NULL DEFAULT "",
									`smtp_host` VARCHAR(255) NOT NULL DEFAULT "",
									`smtp_port` VARCHAR(5) NOT NULL,
									`smtp_auth` ENUM("0","1") NOT NULL DEFAULT "0",
									`smtp_login` VARCHAR(255) NOT NULL DEFAULT "",
									`smtp_pass` VARCHAR(255) NOT NULL DEFAULT "",
									`sending_limit` INT(4) NOT NULL DEFAULT "30",
									`validation_period` TINYINT(4) NOT NULL DEFAULT "0",
									`sub_validation` ENUM("0","1") NOT NULL DEFAULT "1",
									`unsub_validation` ENUM("0","1") NOT NULL DEFAULT "1",
									`admin_email` VARCHAR(255) NOT NULL DEFAULT "",
									`admin_name` VARCHAR(255) NOT NULL DEFAULT "",
									`mod_sub` ENUM("0","1") NOT NULL DEFAULT "0",
									`mod_sub_table` VARCHAR(255) NOT NULL DEFAULT "",
									`charset` VARCHAR(255) NOT NULL DEFAULT "utf-8",
									`table_tracking` VARCHAR(255) NOT NULL DEFAULT "",
									`table_send` VARCHAR(255) NOT NULL DEFAULT "",
									`table_sauvegarde` VARCHAR(255) NOT NULL DEFAULT "",
									`table_send_suivi` VARCHAR(255) NOT NULL DEFAULT "",
									`table_track_links` VARCHAR(255) NOT NULL DEFAULT "",
									`table_upload` VARCHAR(255) NOT NULL DEFAULT "",
									`table_crontab` VARCHAR(255) NOT NULL DEFAULT "",
									`table_email_deleted` VARCHAR(255) NOT NULL DEFAULT "",
									`table_smtp` VARCHAR(255) NOT NULL DEFAULT "",
									`alert_sub` ENUM("0","1") NOT NULL DEFAULT "1",
									`active_tracking` ENUM("0","1") NOT NULL DEFAULT "1",
									`end_task` ENUM("0","1") NOT NULL DEFAULT "1",
									`lost_pass` VARCHAR(64) NOT NULL,
									`table_senders` VARCHAR(255) NOT NULL,
									`table_users` VARCHAR(255) NOT NULL,
									`table_codes` VARCHAR(255) NOT NULL
								) ENGINE='.$storage_engine.' DEFAULT CHARSET=utf8;';
								if($cnx->Sql($sql)){
									echo '<h4 class="alert alert-success">'.tr("INSTALL_SAVE_CREATE_TABLE", $table_prefix . "config") .' '.tr("DONE").'</h4>';
								}else{
									die("<h4 class='alert alert-danger'>" . tr("ERROR_SQL", $db->DbError()) . "<br>" . tr("QUERY") . " : " . $sql . "<br>" . tr("INSTALL_REFRESH") . " !</h4>");
								}

								$sql = 'CREATE TABLE IF NOT EXISTS `' . $table_prefix . 'crontab` (
									`id` INT(7) UNSIGNED NOT NULL AUTO_INCREMENT,
									`job_id` VARCHAR(12) NOT NULL,
									`list_id` INT(4) UNSIGNED NOT NULL DEFAULT "0",
									`msg_id` INT(7) UNSIGNED NOT NULL DEFAULT "0",
									`min` TINYINT(2) NOT NULL DEFAULT "0",
									`hour` TINYINT(2) NOT NULL DEFAULT "0",
									`day` TINYINT(2) NOT NULL DEFAULT "1",
									`month` TINYINT(2) NOT NULL DEFAULT "1",
									`etat` ENUM("scheduled","done","deleted") NOT NULL DEFAULT "scheduled",
									`command` VARCHAR(255) NOT NULL,
									`mail_body` LONGTEXT NOT NULL,
									`mail_subject` VARCHAR(255) CHARACTER SET utf8mb4 NOT NULL DEFAULT "",
									`type` TEXT NOT NULL,
									`date` DATETIME NOT NULL DEFAULT "0000-00-00 00:00:00",
									PRIMARY KEY (`id`),
									KEY `job_id` (`job_id`),
									KEY `list_id` (`list_id`),
									KEY `msg_id` (`msg_id`),
									KEY `date` (`date`)
								) ENGINE='.$storage_engine.'  DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;';
								if($cnx->Sql($sql)){
									echo '<h4 class="alert alert-success">'.tr("INSTALL_SAVE_CREATE_TABLE", $table_prefix . "crontab") .' '.tr("DONE").'</h4>';
								}else{
									die("<h4 class='alert alert-danger'>" . tr("ERROR_SQL", $db->DbError()) . "<br>" . tr("QUERY") . " : " . $sql . "<br>" . tr("INSTALL_REFRESH") . " !</h4>");
								}

								$sql = 'CREATE TABLE IF NOT EXISTS `' . $table_prefix . 'email` (
									`id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
									`email` VARCHAR(255) NOT NULL DEFAULT "",
									`list_id` INT(4) UNSIGNED NOT NULL DEFAULT "0",
									`hash` VARCHAR(40) NOT NULL DEFAULT "",
									`error` ENUM("N","Y") NOT NULL DEFAULT "N",
									`status` VARCHAR(255) DEFAULT NULL,
									`type` ENUM("","autoreply","blocked","generic","soft","hard","temporary","unsub","by_admin") NOT NULL DEFAULT "",
									`categorie` VARCHAR(255) DEFAULT NULL,
									`short_desc` text,
									`long_desc` text,
									`campaign_id` INT(7) DEFAULT NULL,
									PRIMARY KEY (`id`),
									UNIQUE KEY `unique_email_by_list` (`email`,`list_id`),
									KEY `hash` (`hash`),
									KEY `error` (`error`),
									KEY `status` (`status`),
									KEY `type` (`type`),
									KEY `categorie` (`categorie`),
									KEY `campaign_id` (`campaign_id`)
								) ENGINE='.$storage_engine.' DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;';
								if($cnx->Sql($sql)){
									echo '<h4 class="alert alert-success">'.tr("INSTALL_SAVE_CREATE_TABLE", $table_prefix . "email") .' '.tr("DONE").'</h4>';
								}else{
									die("<h4 class='alert alert-danger'>" . tr("ERROR_SQL", $db->DbError()) . "<br>" . tr("QUERY") . " : " . $sql . "<br>" . tr("INSTALL_REFRESH") . " !</h4>");
								}

								$sql = 'CREATE TABLE IF NOT EXISTS `' . $table_prefix . 'email_deleted` (
									`id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
									`email` VARCHAR(255) NOT NULL DEFAULT "",
									`list_id` INT(4) UNSIGNED NOT NULL DEFAULT "0",
									`hash` VARCHAR(40) NOT NULL DEFAULT "",
									`error` ENUM("N","Y") NOT NULL DEFAULT "N",
									`status` VARCHAR(255) DEFAULT NULL,
									`type` ENUM("","autoreply","blocked","generic","soft","hard","temporary","unsub","by_admin") NOT NULL DEFAULT "",
									`categorie` VARCHAR(255) NOT NULL,
									`short_desc` TEXT NOT NULL,
									`long_desc` TEXT NOT NULL,
									`campaign_id` INT(7) UNSIGNED NOT NULL DEFAULT "0",
									PRIMARY KEY (`id`),
									UNIQUE KEY `unique_email_by_list` (`email`,`list_id`),
									KEY `hash` (`hash`),
									KEY `error` (`error`),
									KEY `status` (`status`),
									KEY `type` (`type`),
									KEY `categorie` (`categorie`),
									KEY `campaign_id` (`campaign_id`)
								) ENGINE='.$storage_engine.' DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;';
								if($cnx->Sql($sql)){
									echo '<h4 class="alert alert-success">'.tr("INSTALL_SAVE_CREATE_TABLE", $table_prefix . "email_deleted") .' '.tr("DONE").'</h4>';
								}else{
									die("<h4 class='alert alert-danger'>" . tr("ERROR_SQL", $db->DbError()) . "<br>" . tr("QUERY") . " : " . $sql . "<br>" . tr("INSTALL_REFRESH") . " !</h4>");
								}

								$sql = 'CREATE TABLE IF NOT EXISTS `' . $table_prefix . 'listsconfig` (
									`list_id` INT(4) UNSIGNED NOT NULL AUTO_INCREMENT,
									`newsletter_name` VARCHAR(255) NOT NULL DEFAULT "",
									`from_addr` VARCHAR(255) NOT NULL DEFAULT "",
									`from_name` VARCHAR(255) NOT NULL DEFAULT "",
									`subject` TEXT CHARACTER SET utf8mb4 NOT NULL DEFAULT "",
									`header` TEXT NOT NULL,
									`footer` TEXT NOT NULL,
									`subscription_subject` TEXT CHARACTER SET utf8mb4 NOT NULL DEFAULT "",
									`subscription_body` TEXT NOT NULL,
									`welcome_subject` TEXT CHARACTER SET utf8mb4 NOT NULL DEFAULT "",
									`welcome_body` TEXT NOT NULL,
									`quit_subject` TEXT CHARACTER SET utf8mb4 NOT NULL DEFAULT "",
									`quit_body` TEXT NOT NULL,
									`preview_addr` VARCHAR(255) NOT NULL DEFAULT "",
									PRIMARY KEY (`list_id`)
								) ENGINE='.$storage_engine.' DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;';
								if($cnx->Sql($sql)){
									echo '<h4 class="alert alert-success">'.tr("INSTALL_SAVE_CREATE_TABLE", $table_prefix . "listconfig") .' '.tr("DONE").'</h4>';
								}else{
									die("<h4 class='alert alert-danger'>" . tr("ERROR_SQL", $db->DbError()) . "<br>" . tr("QUERY") . " : " . $sql . "<br>" . tr("INSTALL_REFRESH") . " !</h4>");
								}

								$sql = 'CREATE TABLE IF NOT EXISTS `' . $table_prefix . 'send` (
									`id` INT(7) UNSIGNED NOT NULL AUTO_INCREMENT,
									`id_mail` INT(7) UNSIGNED NOT NULL,
									`id_list` INT(7) UNSIGNED NOT NULL,
									`cpt` INT(7) NOT NULL,
									`error` INT(7) UNSIGNED NOT NULL DEFAULT "0",
									`leave` INT(7) UNSIGNED NOT NULL DEFAULT "0",
									PRIMARY KEY (`id`),
									KEY `id_mail` (`id_mail`),
									KEY `id_list` (`id_list`),
									KEY `cpt` (`cpt`)
								) ENGINE='.$storage_engine.' DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;';
								if($cnx->Sql($sql)){
									echo '<h4 class="alert alert-success">'.tr("INSTALL_SAVE_CREATE_TABLE", $table_prefix . "send") .' '.tr("DONE").'</h4>';
								}else{
									die("<h4 class='alert alert-danger'>" . tr("ERROR_SQL", $db->DbError()) . "<br>" . tr("QUERY") . " : " . $sql . "<br>" . tr("INSTALL_REFRESH") . " !</h4>");
								}

								$sql = 'CREATE TABLE IF NOT EXISTS `' . $table_prefix . 'senders` (
									`id_sender` VARCHAR(255) NOT NULL,
									`name_organisation` VARCHAR(255) CHARACTER SET utf8mb4 NOT NULL,
									`email` VARCHAR(255) NOT NULL,
									`email_reply` VARCHAR(255) NOT NULL,
									`smtp` VARCHAR(255) NOT NULL,
									`smtp_port` INT(5) NOT NULL,
									`smtp_option` VARCHAR(50) NOT NULL DEFAULT "notls",
									`smtp_auth` VARCHAR(1) NOT NULL DEFAULT "N",
									`smtp_user` VARCHAR(255) NOT NULL,
									`smtp_password` VARCHAR(255) NOT NULL,
									`bounce_email` VARCHAR(255) NOT NULL,
									`bounce_server` VARCHAR(255) NOT NULL,
									`bounce_user` VARCHAR(255) NOT NULL,
									`bounce_password` VARCHAR(255) NOT NULL,
									`bounce_service` VARCHAR(50) NOT NULL DEFAULT "imap",
									`bounce_port` INT(5) NOT NULL,
									`bounce_option` VARCHAR(50) NOT NULL DEFAULT "notls",
									`last_send` INT(7) NOT NULL,
									KEY `id_sender` (`id_sender`),
									KEY `email` (`email`),
									KEY `last_send` (`last_send`)
								) ENGINE='.$storage_engine.' DEFAULT CHARSET=utf8;';
								if($cnx->Sql($sql)){
									echo '<h4 class="alert alert-success">'.tr("INSTALL_SAVE_CREATE_TABLE", $table_prefix . "senders") .' '.tr("DONE").'</h4>';
								}else{
									die("<h4 class='alert alert-danger'>" . tr("ERROR_SQL", $db->DbError()) . "<br>" . tr("QUERY") . " : " . $sql . "<br>" . tr("INSTALL_REFRESH") . " !</h4>");
								}

								$sql = 'CREATE TABLE IF NOT EXISTS `' . $table_prefix . 'send_suivi` (
									`id` INT(9) UNSIGNED NOT NULL AUTO_INCREMENT,
									`list_id` INT(4) UNSIGNED NOT NULL,
									`msg_id` INT(7) UNSIGNED NOT NULL,
									`last_id_send` INT(9) UNSIGNED NOT NULL,
									`nb_send` INT(9) UNSIGNED NOT NULL,
									`total_to_send` INT(9) UNSIGNED NOT NULL,
									`tts` DECIMAL(11,5) NOT NULL,
									PRIMARY KEY (`id`),
									UNIQUE KEY `list_id` (`list_id`,`msg_id`),
									KEY `last_id_send` (`last_id_send`),
									KEY `nb_send` (`nb_send`),
									KEY `total_to_send` (`total_to_send`)
								) ENGINE='.$storage_engine.' DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;';
								if($cnx->Sql($sql)){
									echo '<h4 class="alert alert-success">'.tr("INSTALL_SAVE_CREATE_TABLE", $table_prefix . "send_suivi") .' '.tr("DONE").'</h4>';
								}else{
									die("<h4 class='alert alert-danger'>" . tr("ERROR_SQL", $db->DbError()) . "<br>" . tr("QUERY") . " : " . $sql . "<br>" . tr("INSTALL_REFRESH") . " !</h4>");
								}

								$sql = 'CREATE TABLE IF NOT EXISTS `' . $table_prefix . 'smtp` (
									`smtp_id` INT(7) NOT NULL AUTO_INCREMENT,
									`smtp_name` TEXT NOT NULL,
									`smtp_url` VARCHAR(255) NOT NULL,
									`smtp_user` TEXT NOT NULL,
									`smtp_pass` TEXT NOT NULL,
									`smtp_port` INT(5) UNSIGNED NOT NULL,
									`smtp_secure` TEXT NOT NULL,
									`smtp_limite` INT(4) UNSIGNED NOT NULL,
									`smtp_used` INT(4) UNSIGNED NOT NULL,
									`smtp_date_create` DATETIME NOT NULL DEFAULT "0000-00-00 00:00:00",
									`smtp_date_update` DATETIME NOT NULL DEFAULT "0000-00-00 00:00:00",
									`id_use` INT(6) UNSIGNED NOT NULL DEFAULT "0",
									PRIMARY KEY (`smtp_id`),
									KEY `smtp_used` (`smtp_used`),
									KEY `smtp_limite` (`smtp_limite`),
									KEY `smtp_url` (`smtp_url`),
									KEY `smtp_port` (`smtp_port`)
								) ENGINE='.$storage_engine.' DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;';
								if($cnx->Sql($sql)){
									echo '<h4 class="alert alert-success">'.tr("INSTALL_SAVE_CREATE_TABLE", $table_prefix . "smtp") .' '.tr("DONE").'</h4>';
								}else{
									die("<h4 class='alert alert-danger'>" . tr("ERROR_SQL", $db->DbError()) . "<br>" . tr("QUERY") . " : " . $sql . "<br>" . tr("INSTALL_REFRESH") . " !</h4>");
								}

								$sql = ' CREATE TABLE IF NOT EXISTS `' . $table_prefix . 'sub` (
									`email` VARCHAR(255) NOT NULL DEFAULT "",
									`list_id` INT(4) UNSIGNED NOT NULL DEFAULT "0",
									KEY `list_id` (`list_id`)
								) ENGINE='.$storage_engine.' DEFAULT CHARSET=utf8;';
								if($cnx->Sql($sql)){
									echo '<h4 class="alert alert-success">'.tr("INSTALL_SAVE_CREATE_TABLE", $table_prefix . "sub") .' '.tr("DONE").'</h4>';
								}else{
									die("<h4 class='alert alert-danger'>" . tr("ERROR_SQL", $db->DbError()) . "<br>" . tr("QUERY") . " : " . $sql . "<br>" . tr("INSTALL_REFRESH") . " !</h4>");
								}

								$sql = 'CREATE TABLE IF NOT EXISTS `' . $table_prefix . 'temp` (
									`email` VARCHAR(255) NOT NULL DEFAULT "",
									`list_id` INT(4) UNSIGNED NOT NULL DEFAULT "0",
									`hash` VARCHAR(40) NOT NULL DEFAULT "",
									`date` date NOT NULL DEFAULT "0000-00-00",
									KEY `email` (`email`),
									KEY `list_id` (`list_id`),
									KEY `hash` (`hash`),
									KEY `date` (`date`)
								) ENGINE='.$storage_engine.' DEFAULT CHARSET=utf8;';
								if($cnx->Sql($sql)){
									echo '<h4 class="alert alert-success">'.tr("INSTALL_SAVE_CREATE_TABLE", $table_prefix . "temp") .' '.tr("DONE").'</h4>';
								}else{
									die("<h4 class='alert alert-danger'>" . tr("ERROR_SQL", $db->DbError()) . "<br>" . tr("QUERY") . " : " . $sql . "<br>" . tr("INSTALL_REFRESH") . " !</h4>");
								}

								$sql = 'CREATE TABLE IF NOT EXISTS `' . $table_prefix . 'track` (
									`id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
									`hash` VARCHAR(40) NOT NULL DEFAULT "",
									`subject` INT(9) NOT NULL,
									`date` DATETIME NOT NULL,
									`open_count` SMALLINT(3) NOT NULL,
									`ip` VARCHAR(20) NOT NULL,
									`browser` VARCHAR(150) NOT NULL,
									`version` VARCHAR(150) NOT NULL,
									`platform` VARCHAR(255) NOT NULL,
									`useragent` TEXT NOT NULL,
									`devicetype` VARCHAR(10) NOT NULL,
									`lat` DECIMAL(10,8) NOT NULL,
									`lng` DECIMAL(11,8) NOT NULL,
									`city` VARCHAR(255) NOT NULL,
									`postal_code` VARCHAR(255) NOT NULL,
									`region` VARCHAR(255) NOT NULL,
									`country` VARCHAR(255) NOT NULL,
									PRIMARY KEY (`id`),
									KEY `hash` (`hash`),
									KEY `subject` (`subject`),
									KEY `date` (`date`),
									KEY `open_count` (`open_count`),
									KEY `ip` (`ip`),
									KEY `browser` (`browser`),
									KEY `version` (`version`),
									KEY `platform` (`platform`),
									KEY `devicetype` (`devicetype`),
									KEY `lat` (`lat`),
									KEY `lng` (`lng`),
									KEY `city` (`city`),
									KEY `postal_code` (`postal_code`),
									KEY `region` (`region`),
									KEY `country` (`country`)
								) ENGINE='.$storage_engine.' DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;';
								if($cnx->Sql($sql)){
									echo '<h4 class="alert alert-success">'.tr("INSTALL_SAVE_CREATE_TABLE", $table_prefix . "track") .' '.tr("DONE").'</h4>';
								}else{
									die("<h4 class='alert alert-danger'>" . tr("ERROR_SQL", $db->DbError()) . "<br>" . tr("QUERY") . " : " . $sql . "<br>" . tr("INSTALL_REFRESH") . " !</h4>");
								}

								$sql = 'CREATE TABLE IF NOT EXISTS `' . $table_prefix . 'track_links` (
									`id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
									`list_id` INT(4) UNSIGNED NOT NULL DEFAULT "0",
									`msg_id` INT(7) UNSIGNED NOT NULL DEFAULT "0",
									`link` VARCHAR(2000) DEFAULT NULL,
									`hash` VARCHAR(40) DEFAULT NULL,
									`cpt` INT(7) UNSIGNED NOT NULL DEFAULT "0",
									`dt_track_link` DATETIME,
									PRIMARY KEY (`id`),
									KEY `list_id` (`list_id`),
									KEY `msg_id` (`msg_id`),
									KEY `hash` (`hash`),
									KEY `cpt` (`cpt`),
									KEY `link` (`link`(255)),
									KEY `dt_track_link` (`dt_track_link`)
								) ENGINE='.$storage_engine.' DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;';
								if($cnx->Sql($sql)){
									echo '<h4 class="alert alert-success">'.tr("INSTALL_SAVE_CREATE_TABLE", $table_prefix . "track_links") .' '.tr("DONE").'</h4>';
								}else{
									die("<h4 class='alert alert-danger'>" . tr("ERROR_SQL", $db->DbError()) . "<br>" . tr("QUERY") . " : " . $sql . "<br>" . tr("INSTALL_REFRESH") . " !</h4>");
								}

								$sql = 'CREATE TABLE IF NOT EXISTS `' . $table_prefix . 'upload` (
									`id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
									`list_id` INT(4) UNSIGNED NOT NULL DEFAULT 0,
									`msg_id` INT(7) UNSIGNED NOT NULL DEFAULT 0,
									`name` VARCHAR(2000) DEFAULT NULL,
									`date` DATETIME NOT NULL DEFAULT "000-00-00 00:00:00",
									PRIMARY KEY (`id`),
									KEY `list_id` (`list_id`),
									KEY `msg_id` (`msg_id`),
									KEY `name` (`name`(255)),
									KEY `date` (`date`)
								) ENGINE='.$storage_engine.'  DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;';
								if($cnx->Sql($sql)){
									echo '<h4 class="alert alert-success">'.tr("INSTALL_SAVE_CREATE_TABLE", $table_prefix . "upload") .' '.tr("DONE").'</h4>';
								}else{
									die("<h4 class='alert alert-danger'>" . tr("ERROR_SQL", $db->DbError()) . "<br>" . tr("QUERY") . " : " . $sql . "<br>" . tr("INSTALL_REFRESH") . " !</h4>");
								}
								$sql = 'CREATE TABLE IF NOT EXISTS `' . $table_prefix . 'users` (
									`id_user` VARCHAR(255) NOT NULL,
									`email` VARCHAR(255) NOT NULL,
									`password` VARCHAR(64) NOT NULL,
									`listes` VARCHAR(1) NOT NULL DEFAULT "Y",
									`abonnes` VARCHAR(1) NOT NULL DEFAULT "Y",
									`redaction` VARCHAR(1) NOT NULL DEFAULT "Y",
									`envois` VARCHAR(1) NOT NULL DEFAULT "Y",
									`stats` VARCHAR(1) NOT NULL DEFAULT "Y",
									`bounce` VARCHAR(1) NOT NULL DEFAULT "Y",
									`liste` INT(4) NOT NULL,
									`log` VARCHAR(1) NOT NULL DEFAULT "Y",
									KEY `id_user` (`id_user`),
									KEY `email` (`email`)
								) ENGINE='.$storage_engine.'  DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;';
								if($cnx->Sql($sql)){
									echo '<h4 class="alert alert-success">'.tr("INSTALL_SAVE_CREATE_TABLE", $table_prefix . "users") .' '.tr("DONE").'</h4>';
								}else{
									die("<h4 class='alert alert-danger'>" . tr("ERROR_SQL", $db->DbError()) . "<br>" . tr("QUERY") . " : " . $sql . "<br>" . tr("INSTALL_REFRESH") . " !</h4>");
								}

								$sql = 'TRUNCATE TABLE `' . $table_prefix . 'codes`;
									INSERT INTO `' . $table_prefix . 'codes` (`code`, `lat`, `long`, `country`, `color`) VALUES
									("AD", "42.50000000", "1.50000000", "Andorra", "#d8854f"),
									("AE", "24.00000000", "54.00000000", "United Arab Emirates", "#eea638"),
									("AF", "33.00000000", "65.00000000", "Afghanistan", "#eea638"),
									("AG", "17.05000000", "-61.80000000", "Antigua and Barbuda", "#a7a737"),
									("AI", "18.25000000", "-63.16670000", "Anguilla", "#a7a737"),
									("AL", "41.00000000", "20.00000000", "Albania", "#d8854f"),
									("AM", "40.00000000", "45.00000000", "Armenia", "#d8854f"),
									("AO", "-12.50000000", "18.50000000", "Angola", "#de4c4f"),
									("AQ", "-90.00000000", "0.00000000", "Antarctica", "#98d84e"),
									("AR", "-34.00000000", "-64.00000000", "Argentina", "#86a965"),
									("AS", "-14.33330000", "-170.00000000", "American Samoa", "#8aabb0"),
									("AT", "47.33330000", "13.33330000", "Austria", "#d8854f"),
									("AU", "-27.00000000", "133.00000000", "Australia", "#8aabb0"),
									("AW", "12.50000000", "-69.96670000", "Aruba", "#86a965"),
									("AZ", "40.50000000", "47.50000000", "Azerbaijan", "#d8854f"),
									("BA", "44.00000000", "18.00000000", "Bosnia and Herzegovina", "#d8854f"),
									("BB", "13.16670000", "-59.53330000", "Barbados", "#a7a737"),
									("BD", "24.00000000", "90.00000000", "Bangladesh", "#eea638"),
									("BE", "50.83330000", "4.00000000", "Belgium", "#d8854f"),
									("BF", "13.00000000", "-2.00000000", "Burkina Faso", "#de4c4f"),
									("BG", "43.00000000", "25.00000000", "Bulgaria", "#d8854f"),
									("BH", "26.00000000", "50.55000000", "Bahrain", "#eea638"),
									("BI", "-3.50000000", "30.00000000", "Burundi", "#de4c4f"),
									("BJ", "9.50000000", "2.25000000", "Benin", "#de4c4f"),
									("BM", "32.33330000", "-64.75000000", "Bermuda", "#a7a737"),
									("BN", "4.50000000", "114.66670000", "Brunei", "#eea638"),
									("BO", "-17.00000000", "-65.00000000", "Bolivia", "#86a965"),
									("BR", "-10.00000000", "-55.00000000", "Brazil", "#86a965"),
									("BS", "24.25000000", "-76.00000000", "Bahamas", "#a7a737"),
									("BT", "27.50000000", "90.50000000", "Bhutan", "#eea638"),
									("BV", "-54.43330000", "3.40000000", "Bouvet Island", "#de4c4f"),
									("BW", "-22.00000000", "24.00000000", "Botswana", "#de4c4f"),
									("BY", "53.00000000", "28.00000000", "Belarus", "#d8854f"),
									("BZ", "17.25000000", "-88.75000000", "Belize", "#a7a737"),
									("CA", "54.00000000", "-100.00000000", "Canada", "#a7a737"),
									("CC", "-12.50000000", "96.83330000", "Cocos (Keeling) Islands (the)", "#8aabb0"),
									("CD", "0.00000000", "25.00000000", "Congo, Dem. Rep.", "#de4c4f"),
									("CF", "7.00000000", "21.00000000", "Central African Rep.", "#de4c4f"),
									("CG", "-1.00000000", "15.00000000", "Congo, Rep.", "#de4c4f"),
									("CH", "47.00000000", "8.00000000", "Switzerland", "#d8854f"),
									("CI", "8.00000000", "-5.00000000", "Cote d\'Ivoire", "#de4c4f"),
									("CK", "-21.23330000", "-159.76670000", "Cook Islands (the)", "#a7a737"),
									("CL", "-30.00000000", "-71.00000000", "Chile", "#86a965"),
									("CM", "6.00000000", "12.00000000", "Cameroon", "#de4c4f"),
									("CN", "35.00000000", "105.00000000", "China", "#eea638"),
									("CO", "4.00000000", "-72.00000000", "Colombia", "#86a965"),
									("CR", "10.00000000", "-84.00000000", "Costa Rica", "#a7a737"),
									("CU", "21.50000000", "-80.00000000", "Cuba", "#a7a737"),
									("CV", "16.00000000", "-24.00000000", "Cape Verde", "#de4c4f"),
									("CX", "-10.50000000", "105.66670000", "Christmas Island", "#eea638"),
									("CY", "35.00000000", "33.00000000", "Cyprus", "#d8854f"),
									("CZ", "49.75000000", "15.50000000", "Czech Republic", "#d8854f"),
									("DE", "51.00000000", "9.00000000", "Germany", "#d8854f"),
									("DJ", "11.50000000", "43.00000000", "Djibouti", "#de4c4f"),
									("DK", "56.00000000", "10.00000000", "Denmark", "#d8854f"),
									("DM", "15.41670000", "-61.33330000", "Dominica", "#a7a73"),
									("DO", "19.00000000", "-70.66670000", "Dominican Republic", "#a7a737"),
									("DZ", "28.00000000", "3.00000000", "Algeria", "#de4c4f"),
									("EC", "-2.00000000", "-77.50000000", "Ecuador", "#86a965"),
									("EE", "59.00000000", "26.00000000", "Estonia", "#d8854f"),
									("EG", "27.00000000", "30.00000000", "Egypt", "#de4c4f"),
									("EH", "24.50000000", "-13.00000000", "Western Sahara", "#d8854f"),
									("ER", "15.00000000", "39.00000000", "Eritrea", "#de4c4f"),
									("ES", "40.00000000", "-4.00000000", "Spain", "#d8854f"),
									("ET", "8.00000000", "38.00000000", "Ethiopia", "#de4c4f"),
									("FI", "62.00000000", "26.00000000", "Finland", "#d8854f"),
									("FJ", "-18.00000000", "175.00000000", "Fiji", "#8aabb0"),
									("FK", "-51.75000000", "-59.00000000", "Falkland Islands", "#86a965"),
									("FM", "6.91670000", "158.25000000", "Micronesia", "#eea638"),
									("FO", "62.00000000", "-7.00000000", "Faroe Islands", "#d8854f"),
									("FR", "46.00000000", "2.00000000", "France", "#d8854f"),
									("GA", "-1.00000000", "11.75000000", "Gabon", "#de4c4f"),
									("GB", "54.00000000", "-2.00000000", "United Kingdom", "#d8854f"),
									("GD", "12.11670000", "-61.66670000", "Grenada", "#a7a737"),
									("GE", "42.00000000", "43.50000000", "Georgia", "#d8854f"),
									("GF", "4.00000000", "-53.00000000", "French Guiana", "#86a965"),
									("GH", "8.00000000", "-2.00000000", "Ghana", "#de4c4f"),
									("GI", "36.18330000", "-5.36670000", "Gibraltar", "#d8854f"),
									("GL", "72.00000000", "-40.00000000", "Greenland", "#d14ed8"),
									("GM", "13.46670000", "-16.56670000", "Gambia", "#de4c4f"),
									("GN", "11.00000000", "-10.00000000", "Guinea", "#de4c4f"),
									("GP", "16.25000000", "-61.58330000", "Guadeloupe", "#a7a737"),
									("GQ", "2.00000000", "10.00000000", "Equatorial Guinea", "#de4c4f"),
									("GR", "39.00000000", "22.00000000", "Greece", "#d8854f"),
									("GS", "-54.50000000", "-37.00000000", "South Georgia and the South Sandwich Islands", "#86a965"),
									("GT", "15.50000000", "-90.25000000", "Guatemala", "#a7a737"),
									("GU", "13.46670000", "144.78330000", "Guam", "#eea638"),
									("GW", "12.00000000", "-15.00000000", "Guinea-Bissau", "#de4c4f"),
									("GY", "5.00000000", "-59.00000000", "Guyana", "#86a965"),
									("HK", "22.25000000", "114.16670000", "Hong Kong", "#eea638"),
									("HM", "-53.10000000", "72.51670000", "Heard Island and McDonald Islands", "#98d84e"),
									("HN", "15.00000000", "-86.50000000", "Honduras", "#a7a737"),
									("HR", "45.16670000", "15.50000000", "Croatia", "#d8854f"),
									("HT", "19.00000000", "-72.41670000", "Haiti", "#a7a737"),
									("HU", "47.00000000", "20.00000000", "Hungary", "#d8854f"),
									("ID", "-5.00000000", "120.00000000", "Indonesia", "#eea638"),
									("IE", "53.00000000", "-8.00000000", "Ireland", "#d8854f"),
									("IL", "31.50000000", "34.75000000", "Israel", "#eea638"),
									("IN", "20.00000000", "77.00000000", "India", "#eea638"),
									("IO", "-6.00000000", "71.50000000", "British Indian Ocean Territory", "#eea638"),
									("IQ", "33.00000000", "44.00000000", "Iraq", "#eea638"),
									("IR", "32.00000000", "53.00000000", "Iran", "#eea638"),
									("IS", "65.00000000", "-18.00000000", "Iceland", "#d8854f"),
									("IT", "42.83330000", "12.83330000", "Italy", "#d8854f"),
									("JM", "18.25000000", "-77.50000000", "Jamaica", "#a7a737"),
									("JO", "31.00000000", "36.00000000", "Jordan", "#eea638"),
									("JP", "36.00000000", "138.00000000", "Japan", "#eea638"),
									("KE", "1.00000000", "38.00000000", "Kenya", "#de4c4f"),
									("KG", "41.00000000", "75.00000000", "Kyrgyzstan", "#eea638"),
									("KH", "13.00000000", "105.00000000", "Cambodia", "#eea638"),
									("KI", "1.41670000", "173.00000000", "Kiribati", "#8aabb0"),
									("KM", "-12.16670000", "44.25000000", "Comoros", "#de4c4f"),
									("KN", "17.33330000", "-62.75000000", "Saint Kitts and Nevis", "#a7a737"),
									("KP", "40.00000000", "127.00000000", "Korea, Dem. Rep.", "#eea638"),
									("KR", "37.00000000", "127.50000000", "Korea, Republic of", "#eea638"),
									("KW", "29.33750000", "47.65810000", "Kuwait", "#eea638"),
									("KY", "19.50000000", "-80.50000000", "Cayman Islands", "#a7a737"),
									("KZ", "48.00000000", "68.00000000", "Kazakhstan", "#eea638"),
									("LA", "18.00000000", "105.00000000", "Laos", "#eea638"),
									("LB", "33.83330000", "35.83330000", "Lebanon", "#eea638"),
									("LC", "13.88330000", "-61.13330000", "Saint Lucia", "#a7a737"),
									("LI", "47.16670000", "9.53330000", "Liechtenstein", "#d8854f"),
									("LK", "7.00000000", "81.00000000", "Sri Lanka", "#eea638"),
									("LR", "6.50000000", "-9.50000000", "Liberia", "#de4c4f"),
									("LS", "-29.50000000", "28.50000000", "Lesotho", "#de4c4f"),
									("LT", "55.00000000", "24.00000000", "Lithuania", "#d8854f"),
									("LU", "49.75000000", "6.00000000", "Luxembourg", "#d8854f"),
									("LV", "57.00000000", "25.00000000", "Latvia", "#d8854f"),
									("LY", "25.00000000", "17.00000000", "Libya", "#de4c4f"),
									("MA", "32.00000000", "-5.00000000", "Morocco", "#de4c4f"),
									("MC", "43.73330000", "7.40000000", "Monaco", "#d8854f"),
									("MD", "47.00000000", "29.00000000", "Moldova", "#d8854f"),
									("ME", "42.50000000", "19.40000000", "Montenegro", "#d8854f"),
									("MG", "-20.00000000", "47.00000000", "Madagascar", "#de4c4f"),
									("MH", "9.00000000", "168.00000000", "Marshall Islands", "#eea638"),
									("MK", "41.83330000", "22.00000000", "Macedonia, FYR", "#d8854f"),
									("ML", "17.00000000", "-4.00000000", "Mali", "#de4c4f"),
									("MM", "22.00000000", "98.00000000", "Myanmar", "#eea638"),
									("MN", "46.00000000", "105.00000000", "Mongolia", "#eea638"),
									("MO", "22.16670000", "113.55000000", "Macao", "#eea638"),
									("MP", "15.20000000", "145.75000000", "Northern Mariana Islands", "#eea638"),
									("MQ", "14.66670000", "-61.00000000", "Martinique", "#a7a737"),
									("MR", "20.00000000", "-12.00000000", "Mauritania", "#de4c4f"),
									("MS", "16.75000000", "-62.20000000", "Montserrat", "#a7a737"),
									("MT", "35.83330000", "14.58330000", "Malta", "#d8854f"),
									("MU", "-20.28330000", "57.55000000", "Mauritius", "#de4c4f"),
									("MV", "3.25000000", "73.00000000", "Maldives", "#eea638"),
									("MW", "-13.50000000", "34.00000000", "Malawi", "#de4c4f"),
									("MX", "23.00000000", "-102.00000000", "Mexico", "#a7a737"),
									("MY", "2.50000000", "112.50000000", "Malaysia", "#eea638"),
									("MZ", "-18.25000000", "35.00000000", "Mozambique", "#de4c4f"),
									("NA", "-22.00000000", "17.00000000", "Namibia", "#de4c4f"),
									("NC", "-21.50000000", "165.50000000", "New Caledonia", "#a7a737"),
									("NE", "16.00000000", "8.00000000", "Niger", "#de4c4f"),
									("NF", "-29.03330000", "167.95000000", "Norfolk Island", "#8aabb0"),
									("NG", "10.00000000", "8.00000000", "Nigeria", "#de4c4f"),
									("NI", "13.00000000", "-85.00000000", "Nicaragua", "#a7a737"),
									("NL", "52.50000000", "5.75000000", "Netherlands", "#d8854f"),
									("NO", "62.00000000", "10.00000000", "Norway", "#d8854f"),
									("NP", "28.00000000", "84.00000000", "Nepal", "#eea638"),
									("NR", "-0.53330000", "166.91670000", "Nauru", "#8aabb0"),
									("NU", "-19.03330000", "-169.86670000", "Niue", "#8aabb0"),
									("NZ", "-41.00000000", "174.00000000", "New Zealand", "#8aabb0"),
									("OM", "21.00000000", "57.00000000", "Oman", "#eea638"),
									("PA", "9.00000000", "-80.00000000", "Panama", "#a7a737"),
									("PE", "-10.00000000", "-76.00000000", "Peru", "#86a965"),
									("PF", "-15.00000000", "-140.00000000", "French Polynesia", "#a7a737"),
									("PG", "-6.00000000", "147.00000000", "Papua New Guinea", "#8aabb0"),
									("PH", "13.00000000", "122.00000000", "Philippines", "#eea638"),
									("PK", "30.00000000", "70.00000000", "Pakistan", "#eea638"),
									("PL", "52.00000000", "20.00000000", "Poland", "#d8854f"),
									("PM", "46.83330000", "-56.33330000", "Saint Pierre and Miquelon", "#a7a737"),
									("PR", "18.25000000", "-66.50000000", "Puerto Rico", "#a7a737"),
									("PS", "32.00000000", "35.25000000", "Palestinian Territory", "#eea638"),
									("PT", "39.50000000", "-8.00000000", "Portugal", "#d8854f"),
									("PW", "7.50000000", "134.50000000", "Palau", "#eea638"),
									("PY", "-23.00000000", "-58.00000000", "Paraguay", "#86a965"),
									("QA", "25.50000000", "51.25000000", "Qatar", "#eea638"),
									("RE", "-21.10000000", "55.60000000", "Reunion", "#de4c4f"),
									("RO", "46.00000000", "25.00000000", "Romania", "#d8854f"),
									("RS", "44.00000000", "21.00000000", "Serbia", "#d8854f"),
									("RU", "60.00000000", "100.00000000", "Russian Federation", "#d8854f"),
									("RW", "-2.00000000", "30.00000000", "Rwanda", "#de4c4f"),
									("SA", "25.00000000", "45.00000000", "Saudi Arabia", "#eea638"),
									("SB", "-8.00000000", "159.00000000", "Solomon Islands", "#8aabb0"),
									("SC", "-4.58330000", "55.66670000", "Seychelles", "#de4c4f"),
									("SD", "15.00000000", "30.00000000", "Sudan", "#de4c4f"),
									("SE", "62.00000000", "15.00000000", "Sweden", "#d8854f"),
									("SG", "1.36670000", "103.80000000", "Singapore", "#eea638"),
									("SH", "-15.93330000", "-5.70000000", "Saint Helena, Ascension and Tristan da Cunha", "#de4c4f"),
									("SI", "46.00000000", "15.00000000", "Slovenia", "#d8854f"),
									("SJ", "78.00000000", "20.00000000", "Svalbard and Jan Mayen", "#d14ed8"),
									("SK", "48.66670000", "19.50000000", "Slovakia", "#d8854f"),
									("SL", "8.50000000", "-11.50000000", "Sierra Leone", "#de4c4f"),
									("SM", "43.76670000", "12.41670000", "San Marino", "#d8854f"),
									("SN", "14.00000000", "-14.00000000", "Senegal", "#de4c4f"),
									("SO", "10.00000000", "49.00000000", "Somalia", "#de4c4f"),
									("SR", "4.00000000", "-56.00000000", "Suri", "#86a965"),
									("ST", "1.00000000", "7.00000000", "Sao Tome and Principe", "#de4c4f"),
									("SV", "13.83330000", "-88.91670000", "El Salvador", "#a7a737"),
									("SY", "35.00000000", "38.00000000", "Syria", "#eea638"),
									("SZ", "-26.50000000", "31.50000000", "Swaziland", "#de4c4f"),
									("TC", "21.75000000", "-71.58330000", "Turks and Caicos Islands", "#a7a737"),
									("TD", "15.00000000", "19.00000000", "Chad", "#de4c4f"),
									("TF", "-43.00000000", "67.00000000", "French Southern Territories", "#98d84e"),
									("TG", "8.00000000", "1.16670000", "Togo", "#de4c4f"),
									("TH", "15.00000000", "100.00000000", "Thailand", "#eea638"),
									("TJ", "39.00000000", "71.00000000", "Tajikistan", "#eea638"),
									("TK", "-9.00000000", "-172.00000000", "Tokelau", "#8aabb0"),
									("TM", "40.00000000", "60.00000000", "Turkmenistan", "#eea638"),
									("TN", "34.00000000", "9.00000000", "Tunisia", "#de4c4f"),
									("TO", "-20.00000000", "-175.00000000", "Tonga", "#8aabb0"),
									("TR", "39.00000000", "35.00000000", "Turkey", "#d8854f"),
									("TT", "11.00000000", "-61.00000000", "Trinidad and Tobago", "#a7a737"),
									("TV", "-8.00000000", "178.00000000", "Tuvalu", "#8aabb0"),
									("TW", "23.50000000", "121.00000000", "Taiwan", "#eea638"),
									("TZ", "-6.00000000", "35.00000000", "Tanzania", "#de4c4f"),
									("UA", "49.00000000", "32.00000000", "Ukraine", "#d8854f"),
									("UG", "1.00000000", "32.00000000", "Uganda", "#de4c4f"),
									("UM", "19.28330000", "166.60000000", "United States Minor Outlying Islands", "#eea638"),
									("US", "38.00000000", "-97.00000000", "United States", "#a7a737"),
									("UY", "-33.00000000", "-56.00000000", "Uruguay", "#86a965"),
									("UZ", "41.00000000", "64.00000000", "Uzbekistan", "#eea638"),
									("VA", "41.90000000", "12.45000000", "Holy See", "#d8854f"),
									("VC", "13.25000000", "-61.20000000", "Saint Vincent and the Grenadines", "#a7a737"),
									("VE", "8.00000000", "-66.00000000", "Venezuela", "#86a965"),
									("VG", "18.50000000", "-64.50000000", "Virgin Islands", "#a7a737"),
									("VI", "18.33330000", "-64.83330000", "Virgin Islands", "#a7a737"),
									("VN", "16.00000000", "106.00000000", "Vietnam", "#eea638"),
									("VU", "-16.00000000", "167.00000000", "Vanuatu", "#8aabb0"),
									("WF", "-13.30000000", "-176.20000000", "Wallis and Futuna", "#a7a737"),
									("WS", "-13.58330000", "-172.33330000", "Samoa", "#8aabb0"),
									("YE", "15.00000000", "48.00000000", "Yemen, Rep.", "#eea638"),
									("YT", "-12.83330000", "45.16670000", "Mayotte", "#de4c4f"),
									("ZA", "-29.00000000", "24.00000000", "South Africa", "#de4c4f"),
									("ZM", "-15.00000000", "30.00000000", "Zambia", "#de4c4f"),
									("ZW", "-20.00000000", "30.00000000", "Zimbabwe", "#de4c4f"),
									("MF", "18.40000000", "-63.40000000", "Saint Martin", "#a7a737"),
									("CW", "9.30000000", "72.52600000", "Curacao", "#86a965");';
								if($cnx->Sql($sql)){
									echo '<h4 class="alert alert-success">Chargement des codes pays fait</h4>';
								}else{
									die("<h4 class='alert alert-danger'>" . tr("ERROR_SQL", $db->DbError()) . "<br>" . tr("QUERY") . " : " . $sql . "<br>" . tr("INSTALL_REFRESH") . " !</h4>");
								}

							}
						} elseif ($db_type == "pgsql") {
							die('PGSQL, ' . tr("NOT_YET_AVAILABLE"));
						} elseif ($db_type == "mssql") {
							die('MSSQL, ' . tr("NOT_YET_AVAILABLE"));
						} elseif ($db_type == "oracle") {
							die('ORACLE, ' . tr("NOT_YET_AVAILABLE"));
						}
						$table_prefix 		= $cnx->CleanInput($table_prefix);
						$admin_pass 		= $cnx->CleanInput($admin_pass);
						$base_url 			= $cnx->CleanInput($base_url);
						$path 				= $cnx->CleanInput($path);
						$smtp_host 			= $cnx->CleanInput($smtp_host);
						$smtp_login 		= $cnx->CleanInput($smtp_login);
						$smtp_pass 			= $cnx->CleanInput($smtp_pass);
						$smtp_port 			= $cnx->CleanInput($smtp_port);
						$sending_limit 		= $cnx->CleanInput($sending_limit);
						$validation_period 	= $cnx->CleanInput($validation_period);
						$sub_validation 	= $cnx->CleanInput($sub_validation);
						$unsub_validation 	= $cnx->CleanInput($unsub_validation);
						$admin_email 		= $cnx->CleanInput($admin_email);
						$admin_name 		= $cnx->CleanInput($admin_name);
						$mod_sub 			= $cnx->CleanInput($mod_sub);
						$alert_sub 			= $cnx->CleanInput($alert_sub);
						$admin_pass 		= md5($admin_pass);
						$sql = "TRUNCATE TABLE `" . $table_prefix . "config`;
							INSERT INTO `" . $table_prefix . "config` VALUES (
							'$admin_pass', '30', '$base_url', '$path', '$sending_method',
							'$language', '" . $table_prefix . "email', '" . $table_prefix . "temp',
							'". $table_prefix . "listsconfig', '" . $table_prefix . "archives',
							'$smtp_host', '$smtp_port', '$smtp_auth','$smtp_login',
							'$smtp_pass', '$sending_limit', '$validation_period',
							'$sub_validation', '$unsub_validation', '$admin_email',
							'$admin_name','$mod_sub',  '" . $table_prefix . "sub',
							'utf-8', '" . $table_prefix . "track', '" . $table_prefix . "send',
							'" . $table_prefix . "autosave', '" . $table_prefix . "send_suivi',
							'" . $table_prefix . "track_links', '" . $table_prefix . "upload',
							'" . $table_prefix . "crontab','" . $table_prefix . "email_deleted',
							'" . $table_prefix . "smtp','$alert_sub','1','1','',
							'" . $table_prefix . "senders','" . $table_prefix . "users',
							'" . $table_prefix . "codes')";
						if($cnx->Sql($sql)){
							echo '<h4 class="alert alert-success">' . tr("INSTALL_SAVE_CONFIG") . ' ' .tr("DONE").'</h4>';
						}else{
							die('<h4 class="alert alert-danger">' . tr("ERROR_SQL", $db->DbError()) . '<br>' . tr("QUERY") . ' : ' . $sql . '<br>' . tr("INSTALL_REFRESH") . ' !</h4>');
						}
						$configfile = "<?php\nif ( !defined( '_CONFIG' ) ) {\n\tdefine('_CONFIG', 1);";
						$configfile .= "\n\t$" . "db_type              = '$db_type';";
						$configfile .= "\n\t$" . "hostname             = '$hostname';";
						$configfile .= "\n\t$" . "login                = '$login';";
						$configfile .= "\n\t$" . "pass                 = '$pass';";
						$configfile .= "\n\t$" . "database             = '$database';";
						$configfile .= "\n\t$" . "type_serveur         = '$type_serveur';";
						$configfile .= "\n\t$" . "type_env             = '$type_env';";
						$configfile .= "\n\t$" . "timezone             = '$timezone';";
						$configfile .= "\n\t$" . "nb_backup            = '5';";
						$configfile .= "\n\t$" . "prefix               = '$table_prefix';";
						$configfile .= "\n\t$" . "code_mailtester      = '';";
						$configfile .= "\n\t$" . "key_dkim             = '';";
						$configfile .= "\n\t$" . "timer_ajax           = 10;";
						$configfile .= "\n\t$" . "timer_cron           = 4;";
						$configfile .= "\n\t$" . "end_task             = 0;";
						$configfile .= "\n\t$" . "loader               = 0;";
						$configfile .= "\n\t$" . "menu                 = 'hz';";
						$configfile .= "\n\t$" . "free_id              = '';";
						$configfile .= "\n\t$" . "free_pass            = '';";
						$configfile .= "\n\t$" . "end_task_sms         = 0;";
						$configfile .= "\n\t$" . "sub_validation_sms   = 0;";
						$configfile .= "\n\t$" . "unsub_validation_sms = 0;";
						$configfile .= "\n\t$" . "alert_unsub          = $alert_sub;";
						$configfile .= "\n\t$" . "table_global_config  = '" . $table_prefix . "config';";
						if(is_exec_available()){
							$configfile .= "\n\t$" . "exec_available       = true;";
						}else{
							$configfile .= "\n\t$" . "exec_available       = false;";
						}
						$configfile .= "\n\t$" . "pmnl_version         = '$version';\n}";
						if (is_writable("include/")) {
							$fc = fopen("include/config.php", "w");
							$w  = fwrite($fc, $configfile);
							echo '<h4 class="alert alert-success">' . tr("INSTALL_SAVE_CONFIG_FILE") . ' : ' . tr("OK_BTN") . ' </div> ';
						} else {
							echo tr("INSTALL_CONFIG_MANUALLY").'<br>';
							echo "<textarea cols=60 rows=18>" . $configfile . "</textarea>";
							die("<h4 class='alert alert-danger'>" . tr("INSTALL_UNABLE_TO_SAVE_CONFIG_FILE") . "<br>" . tr("MANUALLY_SAVE_CONF", $base_url) . ".</h4>");
						}
						echo '<br><div align="center"><img src="js/tinymce/plugins/emoticons/img/smiley-cool.gif" alt="Yeah ! '. tr("YOU_DID_IT") . ' !" title="Yeah ! '. tr("YOU_DID_IT") . ' !" width="18" heigh="18" /><br><a href="index.php">' . tr("INSTALL_FINISHED") . '</a></div>';
						echo '<div class="row"><div class="col-md-11  col-md-offset-1"><h3>'.tr("CREDITS_WITH").' :</h3>
						<ul>
						<li><a href="http://gregory.kokanosky.free.fr/v4/phpmynewsletter/" target="_blank">'. tr("CREDITS_GREGORY") . '</a></li>
						<li><a href="https://github.com/Synchro/PHPMailer">'. tr("CREDITS_PHPMAILER") . '</a></li>
						<li><a href="http://www.tinymce.com/" target="_blank">'. tr("CREDITS_TINYMCE") . '</a></li>
						<li><a href="http://www.crazyws.fr/dev/classes-php/classe-de-gestion-des-bounces-en-php-C72TG.html" target="_blank">'. tr("CREDITS_CRAZY") . '</a></li>
						<li><a href="http://www.amcharts.com/" target="_blank">AM<b>CHARTS</b></a></li>
						<li><a href="http://www.dropzonejs.com/" target="_blank">DropZone.js : '. tr("CREDITS_DND") . '</a></li>
						</ul>
							<h3>'. tr("LICENSE") . ' :</h3>
						<p>'. tr("LICENSE_TERMS") . '.</p>
							<h3>'. tr("CONTRIBUTE") . ' :</h3>
						<p>'. tr("CONTRIBUTE_HELP") . '.</p>
							<h3>'. tr("SUPPORT") . ' :</h3>
						<p>'. tr("ASK_ON_FORUM") . '.</p>
						</div></div>';
					}
				?>
				</div>
			</div>
		</div>
	</div>
	<script type="text/javascript">$('#ts').jsclock('<?php echo date('H:i:s');?>');</script>
</body>
</html>
login.php
wget 'https://lists2.roe3.org/pmnl3/login.php'
View Content
<?php
session_start();
if (!file_exists("include/config.php")) {
	header("Location:install.php");
	exit;
} else {
	include("_loader.php");
}
$row_config_globale = $cnx->SqlRow("SELECT * FROM $table_global_config");
if(isset($_POST)&&count($_POST)>2) {
	if(tok_val($_POST['token_connex'])){
		$sub_mail = $cnx->CleanInput($_POST['form_mail_admin']);
		$sub_pass = $cnx->CleanInput($_POST['form_pass']);
		$is_admin=current($cnx->query("SELECT count(*) AS is_admin
						FROM $table_global_config 
					WHERE admin_pass=".escape_string($cnx,md5($sub_pass))." 
						AND admin_email=".escape_string($cnx,$sub_mail).";")->fetch());
		if($is_admin) {
			$_SESSION['dr_liste']=0;
			$_SESSION['dr_abonnes']='Y';
			$_SESSION['dr_listes']='Y';
			$_SESSION['dr_redaction']='Y';
			$_SESSION['dr_envois']='Y';
			$_SESSION['dr_stats']='Y';
			$_SESSION['dr_bounce']='Y';
			$_SESSION['dr_log']='N';
			$_SESSION['dr_is_admin']=true;
			$_SESSION['dr_is_user']=false;
			$_SESSION['user_on_line']=$row_config_globale['admin_name'];
			tok_gen();
			header("Location: index.php?token=".$_SESSION['_token']."&connex=1");
			die();
		} else {
			$is_user = $cnx->query('SELECT * 
						FROM '.$row_config_globale['table_users'].'
					WHERE password='.escape_string($cnx,md5($sub_pass)).'
						AND email='.escape_string($cnx,$sub_mail).' LIMIT 1;')->fetchAll(PDO::FETCH_ASSOC);
			if (count($is_user) == 0){
				header("Location: login.php");
				die();
			} else {
				if($is_user[0]['liste']==0){
					$_SESSION['dr_liste']='';
				} elseif($is_user[0]['liste']>0){
					$_SESSION['dr_liste']=$is_user[0]['liste'];
				}
				$_SESSION['dr_id_user']=$is_user[0]['id_user'];
				$_SESSION['dr_abonnes']=$is_user[0]['abonnes'];
				$_SESSION['dr_listes']=$is_user[0]['listes'];
				$_SESSION['dr_redaction']=$is_user[0]['redaction'];
				$_SESSION['dr_envois']=$is_user[0]['envois'];
				$_SESSION['dr_stats']=$is_user[0]['stats'];
				$_SESSION['dr_bounce']=$is_user[0]['bounce'];
				$_SESSION['dr_log']=$is_user[0]['log'];
				$_SESSION['dr_is_user']=true;
				$_SESSION['dr_is_admin']=false;
				if($_SESSION['dr_log']=='Y') {
					loggit($_SESSION['dr_id_user'].'.log', $_SESSION['dr_id_user'] . ' connecté');
				}
				$_SESSION['user_on_line']=$is_user[0]['id_user'];
				tok_gen();
				header("Location: index.php?token=".$_SESSION['_token']."&connex=1");
				die();
			}
		}
	}
} else {
	tok_gen();
}
$error = (isset($_GET['error']) ? $_GET['error'] : 0);
(count($row_config_globale)>0) ? $r='SUCCESS' : $r='';
if($r != 'SUCCESS') {
	include("include/lang/english.php");
	echo "<div class='error'>".tr($r)."<br>";
	echo "</div>";
	exit;
}
include("include/lang/".$row_config_globale['language'].".php");
?><!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>PhpMyNewsLetter 2.0 Connexion</title>
<style>
@font-face{font-family:'Source Sans Pro';font-style:normal;font-weight:300;src:local('Source Sans Pro Light'), local('SourceSansPro-Light'), url(//fonts.gstatic.com/s/sourcesanspro/v9/toadOcfmlt9b38dHJxOBGNbE_oMaV8t2eFeISPpzbdE.woff) format('woff');}
@font-face{font-family:'Source Sans Pro';font-style:normal;font-weight:400;src:local('Source Sans Pro'), local('SourceSansPro-Regular'), url(//fonts.gstatic.com/s/sourcesanspro/v9/ODelI1aHBYDBqgeIAH2zlBM0YzuT7MdOe03otPbuUS0.woff) format('woff');}
@font-face{font-family:'Source Sans Pro';font-style:normal;font-weight:700;src:local('Source Sans Pro Bold'), local('SourceSansPro-Bold'), url(//fonts.gstatic.com/s/sourcesanspro/v9/toadOcfmlt9b38dHJxOBGFkQc6VGVFSmCnC_l7QZG60.woff) format('woff');}
@font-face{font-family:'Exo';font-style:normal;font-weight:100;src:local('Exo Thin'), local('Exo-Thin'), url(//fonts.gstatic.com/s/exo/v4/8u62BadBN2JBBSWXwLrcLA.woff2) format('woff2');unicode-range:U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF;}
@font-face{font-family:'Exo';font-style:normal;font-weight:100;src:local('Exo Thin'), local('Exo-Thin'), url(//fonts.gstatic.com/s/exo/v4/gYF2MxrukTV2KAnW2D5gXg.woff2) format('woff2');unicode-range:U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000;}
@font-face{font-family:'Exo';font-style:normal;font-weight:200;src:local('Exo ExtraLight'), local('Exo-ExtraLight'), url(//fonts.gstatic.com/s/exo/v4/Hy3VpD2TiyQkDhJpDnN2QPesZW2xOQ-xsNqO47m55DA.woff2) format('woff2');unicode-range:U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF;}
@font-face{font-family:'Exo';font-style:normal;font-weight:200;src:local('Exo ExtraLight'), local('Exo-ExtraLight'), url(//fonts.gstatic.com/s/exo/v4/wj6hYyVmju_3yhnA0pbyb_esZW2xOQ-xsNqO47m55DA.woff2) format('woff2');unicode-range:U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000;}
@font-face{font-family:'Exo';font-style:normal;font-weight:400;src:local('Exo Regular'), local('Exo-Regular'), url(//fonts.gstatic.com/s/exo/v4/J59yWLG3iwczjwZ63gnONw.woff2) format('woff2');unicode-range:U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF;}
@font-face{font-family:'Exo';font-style:normal;font-weight:400;src:local('Exo Regular'), local('Exo-Regular'), url(//fonts.gstatic.com/s/exo/v4/kxMQ0l4ya_iyNsQ_jUl1Tg.woff2) format('woff2');unicode-range:U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000;}
body{margin:0;padding:0;background:#fff;color:#fff;font-family:Arial;font-size:12px;}
.header{position:absolute;top:calc(50% - 35px);left:calc(50% - 300px);z-index:2;}
.header div{float:left;color:#fff;font-family:'Exo', sans-serif;font-size:35px;}
.header div span{color:#5379fa !important;}
.lost{color:#5379fa !important;font-family:'Exo', sans-serif;font-size:14px;}
.lost a{color:#5379fa !important;font-family:'Exo', sans-serif;font-size:14px;margin-left:70px;}
.login{position:absolute;top:calc(50% - 75px);left:calc(50%);height:150px;width:350px;padding:10px;z-index:2;}
.login input[type=email],.login input[type=text],.login input[type=password]{width:260px;height:30px;background:rgba(255, 251, 251, 0.54);border: 1px solid #407ea2;border-radius:2px;color:#407ea2;font-family:'Exo', sans-serif;font-size:16px;font-weight:400;padding:4px;margin-top:10px;}
.login input[type=button],.login input[type=submit]{width:270px;height:35px;background:#fff;border:1px solid #407ea2;cursor:pointer;border-radius:2px;color:#407ea2;font-family:'Exo', sans-serif;font-size:16px;font-weight:400;padding:6px;margin-top:10px;}
.login input[type=button]:hover,.login input[type=submit]:hover{opacity:0.8;}
.login input[type=button]:active,.login input[type=submit]:active{opacity:0.6;}
.login input[type=text]:focus{outline:none;border:1px solid rgba(255,255,255,0.9);}
.login input[type=password]:focus,.login input[type=submit]:focus{outline:none;border:1px solid rgba(255,255,255,0.9);}
.login input[type=button]:focus,.login input[type=submit]:focus{outline:none;}
::-webkit-input-placeholder{color:#407ea2;}
::-moz-input-placeholder{color:#407ea2);}
.wrp{position:absolute;top:calc(50% - 75px);height:180px;width:600px;left:calc(50% - 300px);border:none;background:rgba(255,255,255,0.55);padding:30px 30px;filter:progid:DXImageTransform.Microsoft.gradient(gradientType=0, startColorstr='#E6FFFFFF', endColorstr='#E6FFFFFF');z-index:999999999;-webkit-box-shadow: 0 6px 6px rgba(0,0,0,0.3);-moz-box-shadow: 0 6px 6px rgba(0,0,0,0.3);box-shadow: 0 6px 6px rgba(0,0,0,0.3);-webkit-border-radius:3px;-moz-border-radius:3px;-ms-border-radius:3px;-o-border-radius:3px;border-radius:3px;overflow:hidden;zoom:1;}
</style>
</head>
<body>
<div class="body"></div>
<div class="grad"></div>
<div class="wrp">
<div class="header"><div>PhpMy<span>NewsLetter</span></div></div>
<div class="login">
<?php if(isset($_GET['reset'])){ ?>
	<form action='reset.php' method='post' name='loginform' autocomplete='false'>
	<input name="form_mail_admin"  placeholder="<?php echo tr("LOGIN_PLEASE_MAIL_ADMIN");?>" type="email" value="" autocomplete="false" autocorrect="off" autocapitalize="off" spellcheck="false" autofocus><br>
	<input type="submit" value="<?php echo tr("RESET_PASSWORD");?>">
	</form>
<?php } elseif(isset($_GET['pass'])){  ?>	
	<div class="lost" style="margin:40px">
	<?php echo tr("NEW_PASSWORD_SEND"); ?>
	</div>
<?php } else { ?>
	<form action='login.php' method='post' name='loginform' autocomplete='false'>
	<input type="text" name="prevent_autofill" id="prevent_autofill" value="" style="display:none;" />
	<input type="password" name="password_fake" id="password_fake" value="" style="display:none;" />
	<input name="form_mail_admin"  placeholder="<?php echo tr("LOGIN_PLEASE_MAIL_ADMIN");?>" type="email" value="" autocomplete="false" autocorrect="off" autocapitalize="off" spellcheck="false" autofocus><br>
	<input name="form_pass" placeholder="<?php echo tr("LOGIN_PASSWORD");?>" type="password" value="" autocomplete="false" autocorrect="off" autocapitalize="off" spellcheck="false"><br>
	<input type="submit" value="<?php echo tr("LOGIN");?>">
	<input type='hidden' name='form' value='1' />
	<input type='hidden' name='token_connex' value='<?php echo $_SESSION['_token'];?>' />
	</form>
	<br>
	<div class="lost"><a href="login.php?reset"><?php echo tr("LOST_PASSWORD"); ?></a></div>
<?php } ?>
</div>
</div>
<script src="//code.jquery.com/jquery-1.12.4.min.js" integrity="sha256-ZosEbRLbNQzLpnKIkEdrPv7lOy9C27hHQ+Xp8a4MxAQ=" crossorigin="anonymous"></script>
<script>(function(a,d,p){a.fn.backstretch=function(c,b){(c===p||0===c.length)&&a.error("No images were supplied for Backstretch");0===a(d).scrollTop()&&d.scrollTo(0,0);return this.each(function(){var d=a(this),g=d.data("backstretch");if(g){if("string"==typeof c&&"function"==typeof g[c]){g[c](b);return}b=a.extend(g.options,b);g.destroy(!0)}g=new q(this,c,b);d.data("backstretch",g)})};a.backstretch=function(c,b){return a("body").backstretch(c,b).data("backstretch")};a.expr[":"].backstretch=function(c){return a(c).data("backstretch")!==p};a.fn.backstretch.defaults={centeredX:!0,centeredY:!0,duration:5E3,fade:0};var r={left:0,top:0,overflow:"hidden",margin:0,padding:0,height:"100%",width:"100%",zIndex:-999999},s={position:"absolute",display:"none",margin:0,padding:0,border:"none",width:"auto",height:"auto",maxHeight:"none",maxWidth:"none",zIndex:-999999},q=function(c,b,e){this.options=a.extend({},a.fn.backstretch.defaults,e||{});this.images=a.isArray(b)?b:[b];a.each(this.images,function(){a("<img />")[0].src=this});this.isBody=c===document.body;this.$container=a(c);this.$root=this.isBody?l?a(d):a(document):this.$container;c=this.$container.children(".backstretch").first();this.$wrap=c.length?c:a('<div class="backstretch"></div>').css(r).appendTo(this.$container);this.isBody||(c=this.$container.css("position"),b=this.$container.css("zIndex"),this.$container.css({position:"static"===c?"relative":c,zIndex:"auto"===b?0:b,background:"none"}),this.$wrap.css({zIndex:-999998}));this.$wrap.css({position:this.isBody&&l?"fixed":"absolute"});this.index=0;this.show(this.index);a(d).on("resize.backstretch",a.proxy(this.resize,this)).on("orientationchange.backstretch",a.proxy(function(){this.isBody&&0===d.pageYOffset&&(d.scrollTo(0,1),this.resize())},this))};q.prototype={resize:function(){try{var a={left:0,top:0},b=this.isBody?this.$root.width():this.$root.innerWidth(),e=b,g=this.isBody?d.innerHeight?d.innerHeight:this.$root.height():this.$root.innerHeight(),j=e/this.$img.data("ratio"),f;j>=g?(f=(j-g)/2,this.options.centeredY&&(a.top="-"+f+"px")):(j=g,e=j*this.$img.data("ratio"),f=(e-b)/2,this.options.centeredX&&(a.left="-"+f+"px"));this.$wrap.css({width:b,height:g}).find("img:not(.deleteable)").css({width:e,height:j}).css(a)}catch(h){}return this},show:function(c){if(!(Math.abs(c)>this.images.length-1)){var b=this,e=b.$wrap.find("img").addClass("deleteable"),d={relatedTarget:b.$container[0]};b.$container.trigger(a.Event("backstretch.before",d),[b,c]);this.index=c;clearInterval(b.interval);b.$img=a("<img />").css(s).bind("load",function(f){var h=this.width||a(f.target).width();f=this.height||a(f.target).height();a(this).data("ratio",h/f);a(this).fadeIn(b.options.speed||b.options.fade,function(){e.remove();b.paused||b.cycle();a(["after","show"]).each(function(){b.$container.trigger(a.Event("backstretch."+this,d),[b,c])})});b.resize()}).appendTo(b.$wrap);b.$img.attr("src",b.images[c]);return b}},next:function(){return this.show(this.index<this.images.length-1?this.index+1:0)},prev:function(){return this.show(0===this.index?this.images.length-1:this.index-1)},pause:function(){this.paused=!0;return this},resume:function(){this.paused=!1;this.next();return this},cycle:function(){1<this.images.length&&(clearInterval(this.interval),this.interval=setInterval(a.proxy(function(){this.paused||this.next()},this),this.options.duration));return this},destroy:function(c){a(d).off("resize.backstretch orientationchange.backstretch");clearInterval(this.interval);c||this.$wrap.remove();this.$container.removeData("backstretch")}};var l,f=navigator.userAgent,m=navigator.platform,e=f.match(/AppleWebKit\/([0-9]+)/),e=!!e&&e[1],h=f.match(/Fennec\/([0-9]+)/),h=!!h&&h[1],n=f.match(/Opera Mobi\/([0-9]+)/),t=!!n&&n[1],k=f.match(/MSIE ([0-9]+)/),k=!!k&&k[1];l=!((-1<m.indexOf("iPhone")||-1<m.indexOf("iPad")||-1<m.indexOf("iPod"))&&e&&534>e||d.operamini&&"[object OperaMini]"==={}.toString.call(d.operamini)||n&&7458>t||-1<f.indexOf("Android")&&e&&533>e||h&&6>h||"palmGetResource"in d&&e&&534>e||-1<f.indexOf("MeeGo")&&-1<f.indexOf("NokiaBrowser/8.5.0")||k&&6>=k)})(jQuery,window);$.backstretch('css/bg.jpg');(function(){function t(e,t){return[].slice.call((t||document).querySelectorAll(e))}if(!window.addEventListener)return;var e=window.StyleFix={link:function(t){try{if(t.rel!=="stylesheet"||t.hasAttribute("data-noprefix"))return}catch(n){return}var r=t.href||t.getAttribute("data-href"),i=r.replace(/[^\/]+$/,""),s=(/^[a-z]{3,10}:/.exec(i)||[""])[0],o=(/^[a-z]{3,10}:\/\/[^\/]+/.exec(i)||[""])[0],u=/^([^?]*)\??/.exec(r)[1],a=t.parentNode,f=new XMLHttpRequest,l;f.onreadystatechange=function(){f.readyState===4&&l()};l=function(){var n=f.responseText;if(n&&t.parentNode&&(!f.status||f.status<400||f.status>600)){n=e.fix(n,!0,t);if(i){n=n.replace(/url\(\s*?((?:"|')?)(.+?)\1\s*?\)/gi,function(e,t,n){return/^([a-z]{3,10}:|#)/i.test(n)?e:/^\/\//.test(n)?'url("'+s+n+'")':/^\//.test(n)?'url("'+o+n+'")':/^\?/.test(n)?'url("'+u+n+'")':'url("'+i+n+'")'});var r=i.replace(/([\\\^\$*+[\]?{}.=!:(|)])/g,"\\$1");n=n.replace(RegExp("\\b(behavior:\\s*?url\\('?\"?)"+r,"gi"),"$1")}var l=document.createElement("style");l.textContent=n;l.media=t.media;l.disabled=t.disabled;l.setAttribute("data-href",t.getAttribute("href"));a.insertBefore(l,t);a.removeChild(t);l.media=t.media}};try{f.open("GET",r);f.send(null)}catch(n){if(typeof XDomainRequest!="undefined"){f=new XDomainRequest;f.onerror=f.onprogress=function(){};f.onload=l;f.open("GET",r);f.send(null)}}t.setAttribute("data-inprogress","")},styleElement:function(t){if(t.hasAttribute("data-noprefix"))return;var n=t.disabled;t.textContent=e.fix(t.textContent,!0,t);t.disabled=n},styleAttribute:function(t){var n=t.getAttribute("style");n=e.fix(n,!1,t);t.setAttribute("style",n)},process:function(){t('link[rel="stylesheet"]:not([data-inprogress])').forEach(StyleFix.link);t("style").forEach(StyleFix.styleElement);t("[style]").forEach(StyleFix.styleAttribute)},register:function(t,n){(e.fixers=e.fixers||[]).splice(n===undefined?e.fixers.length:n,0,t)},fix:function(t,n,r){for(var i=0;i<e.fixers.length;i++)t=e.fixers[i](t,n,r)||t;return t},camelCase:function(e){return e.replace(/-([a-z])/g,function(e,t){return t.toUpperCase()}).replace("-","")},deCamelCase:function(e){return e.replace(/[A-Z]/g,function(e){return"-"+e.toLowerCase()})}};(function(){setTimeout(function(){t('link[rel="stylesheet"]').forEach(StyleFix.link)},10);document.addEventListener("DOMContentLoaded",StyleFix.process,!1)})()})();(function(e){function t(e,t,r,i,s){e=n[e];if(e.length){var o=RegExp(t+"("+e.join("|")+")"+r,"gi");s=s.replace(o,i)}return s}if(!window.StyleFix||!window.getComputedStyle)return;var n=window.PrefixFree={prefixCSS:function(e,r,i){var s=n.prefix;n.functions.indexOf("linear-gradient")>-1&&(e=e.replace(/(\s|:|,)(repeating-)?linear-gradient\(\s*(-?\d*\.?\d*)deg/ig,function(e,t,n,r){return t+(n||"")+"linear-gradient("+(90-r)+"deg"}));e=t("functions","(\\s|:|,)","\\s*\\(","$1"+s+"$2(",e);e=t("keywords","(\\s|:)","(\\s|;|\\}|$)","$1"+s+"$2$3",e);e=t("properties","(^|\\{|\\s|;)","\\s*:","$1"+s+"$2:",e);if(n.properties.length){var o=RegExp("\\b("+n.properties.join("|")+")(?!:)","gi");e=t("valueProperties","\\b",":(.+?);",function(e){return e.replace(o,s+"$1")},e)}if(r){e=t("selectors","","\\b",n.prefixSelector,e);e=t("atrules","@","\\b","@"+s+"$1",e)}e=e.replace(RegExp("-"+s,"g"),"-");e=e.replace(/-\*-(?=[a-z]+)/gi,n.prefix);return e},property:function(e){return(n.properties.indexOf(e)>=0?n.prefix:"")+e},value:function(e,r){e=t("functions","(^|\\s|,)","\\s*\\(","$1"+n.prefix+"$2(",e);e=t("keywords","(^|\\s)","(\\s|$)","$1"+n.prefix+"$2$3",e);n.valueProperties.indexOf(r)>=0&&(e=t("properties","(^|\\s|,)","($|\\s|,)","$1"+n.prefix+"$2$3",e));return e},prefixSelector:function(e){return e.replace(/^:{1,2}/,function(e){return e+n.prefix})},prefixProperty:function(e,t){var r=n.prefix+e;return t?StyleFix.camelCase(r):r}};(function(){var e={},t=[],r={},i=getComputedStyle(document.documentElement,null),s=document.createElement("div").style,o=function(n){if(n.charAt(0)==="-"){t.push(n);var r=n.split("-"),i=r[1];e[i]=++e[i]||1;while(r.length>3){r.pop();var s=r.join("-");u(s)&&t.indexOf(s)===-1&&t.push(s)}}},u=function(e){return StyleFix.camelCase(e)in s};if(i.length>0)for(var a=0;a<i.length;a++)o(i[a]);else for(var f in i)o(StyleFix.deCamelCase(f));var l={uses:0};for(var c in e){var h=e[c];l.uses<h&&(l={prefix:c,uses:h})}n.prefix="-"+l.prefix+"-";n.Prefix=StyleFix.camelCase(n.prefix);n.properties=[];for(var a=0;a<t.length;a++){var f=t[a];if(f.indexOf(n.prefix)===0){var p=f.slice(n.prefix.length);u(p)||n.properties.push(p)}}n.Prefix=="Ms"&&!("transform"in s)&&!("MsTransform"in s)&&"msTransform"in s&&n.properties.push("transform","transform-origin");n.properties.sort()})();(function(){function i(e,t){r[t]="";r[t]=e;return!!r[t]}var e={"linear-gradient":{property:"backgroundImage",params:"red, teal"},calc:{property:"width",params:"1px + 5%"},element:{property:"backgroundImage",params:"#foo"},"cross-fade":{property:"backgroundImage",params:"url(a.png), url(b.png), 50%"}};e["repeating-linear-gradient"]=e["repeating-radial-gradient"]=e["radial-gradient"]=e["linear-gradient"];var t={initial:"color","zoom-in":"cursor","zoom-out":"cursor",box:"display",flexbox:"display","inline-flexbox":"display",flex:"display","inline-flex":"display",grid:"display","inline-grid":"display","min-content":"width"};n.functions=[];n.keywords=[];var r=document.createElement("div").style;for(var s in e){var o=e[s],u=o.property,a=s+"("+o.params+")";!i(a,u)&&i(n.prefix+a,u)&&n.functions.push(s)}for(var f in t){var u=t[f];!i(f,u)&&i(n.prefix+f,u)&&n.keywords.push(f)}})();(function(){function s(e){i.textContent=e+"{}";return!!i.sheet.cssRules.length}var t={":read-only":null,":read-write":null,":any-link":null,"::selection":null},r={keyframes:"name",viewport:null,document:'regexp(".")'};n.selectors=[];n.atrules=[];var i=e.appendChild(document.createElement("style"));for(var o in t){var u=o+(t[o]?"("+t[o]+")":"");!s(u)&&s(n.prefixSelector(u))&&n.selectors.push(o)}for(var a in r){var u=a+" "+(r[a]||"");!s("@"+u)&&s("@"+n.prefix+u)&&n.atrules.push(a)}e.removeChild(i)})();n.valueProperties=["transition","transition-property"];e.className+=" "+n.prefix;StyleFix.register(n.prefixCSS)})(document.documentElement);</script>
</body>
</html>
logout.php
wget 'https://lists2.roe3.org/pmnl3/logout.php'
View Content
<?php
session_start();
if(!file_exists("include/config.php")) {
    header("Location:install.php");
    exit;
} else {
    include("_loader.php");
}
$leave = leaveAdmin();
quick_Exit();


modalbox.php
wget 'https://lists2.roe3.org/pmnl3/modalbox.php'
View Content
<div id="myModal" class="modal fade">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                <h4 class="modal-title">Sample Model Box - Header Area</h4>
            </div>
            <div class="modal-body">
                <form>
                  <div class="form-group">
                    <label for="recipient-name" class="control-label">Recipient:</label>
                    <input type="text" class="form-control" id="recipient-name">
                  </div>
                  <div class="form-group">
                    <label for="message-text" class="control-label">Message:</label>
                    <textarea class="form-control" id="message-text"></textarea>
                  </div>
                </form>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
                <button type="button" class="btn btn-primary">Save</button>
            </div>
        </div>
    </div>
</div>
online.php
wget 'https://lists2.roe3.org/pmnl3/online.php'
View Content
<?php
$i = (!empty($_GET['i'])) ? intval($_GET['i']) : false;
$l = (!empty($_GET['list_id']) ? intval($_GET['list_id']) : false);
$e = (!empty($_GET['email_addr']) ? $_GET['email_addr'] : false);
$h = (!empty($_GET['h'])) ? $_GET['h'] : false;
if(!$i && !$l && !$e && !$h) {
    header("Location:/");
} else {
    include("_loader.php");
    $row_config_globale = $cnx->SqlRow("SELECT * FROM $table_global_config");
    if(empty($row_config_globale['language']))$row_config_globale['language']="english";
    include("include/lang/".$row_config_globale['language'].".php");
    $tPath = ($row_config_globale['path'] == '/' ? $row_config_globale['path'] : '/' . $row_config_globale['path']);
    if ($h=='fake_hash') {
        $msg = get_message_preview($cnx, $row_config_globale['table_sauvegarde'], $l);
        $messageTemp = stripslashes($msg['textarea']);
        $trac  = "";
    } else {
        $msg = get_message($cnx, $row_config_globale['table_archives'], $i);
        $messageTemp = stripslashes($msg['message']);
        $trac  = "<img src='" . $row_config_globale['base_url'] . $tPath . "trc.php?i=$i&h=$h' width='1' />";
    }
    $newsletter = getConfig($cnx, $l, $row_config_globale['table_listsconfig']);
    $tPath = ($row_config_globale['path'] == '' ? '/' : $row_config_globale['path']);
    $body = "";
    $body .= "<html><head><meta charset=\"utf-8\" /></head><body>";
    $body .= "<div align='center' style='font-size:10pt;font-family:arial,helvetica,sans-serif;padding-bottom:5px;color:#878e83;'>";
    $body .= tr("READ_ON_LINE", "<a href='" . $row_config_globale['base_url'] . $tPath . "online.php?i=$i&list_id=$l&email_addr=$e&h=$h'>")."<br />";
    $body .= tr("ADD_ADRESS_BOOK", $newsletter['from_addr'] )."<br />";
    $body .= "<hr noshade='' color='#D4D4D4' width='90%' size='1'></div>";
    $new_url = 'href="' . $row_config_globale['base_url'] . $tPath .'r.php?m='.$i.'&h='.$h.'&l='.$l.'&r=';
    $message = preg_replace_callback(
        '/href="(http:\/\/)?([^"]+)"/',
        function($matches) {
            global $new_url;
            return $new_url.(urlencode(@$matches[1].$matches[2])).'"';
        },$messageTemp);
    $unsubLink = "<br /><div align='center' style='padding-top:10px;font-size:10pt;font-family:arial,helvetica,sans-serif;padding-bottom:10px;color:#878e83;'><hr noshade='' color='#D4D4D4' width='90%' size='1'>"
               .tr("UNSUBSCRIBE_LINK","<a href='" . $row_config_globale['base_url'] . $tPath . "subscription.php?i=$i&list_id=$l&op=leave&email_addr=$e&h=$h' style='' target='_blank'>")
               ."</div></body></html>";
    $body .= $trac . $message . $unsubLink;
    echo $body;
}
op.php
wget 'https://lists2.roe3.org/pmnl3/op.php'
View Content
<?php
$op_true = array(
    'createConfig',
    'init',
    'preview',
    'SaveConfig',
    'saveGlobalconfig',
    'send_preview',
    'subscriber_add',
    'subscriber_del',
    'subscriber_del_temp',
    'val_subscriber_temp',
    'subscriber_import',
    'subscriber_mass_delete',
    'smtp_add',
    'smtp_del',
    'smtp_mod',
    'smtp_maj',
    'modifySender',
    'addSender',
    'delSender',
    'modifyUser',
    'addUser',
    'delUser'
);
if(in_array($op,$op_true)){
    switch($op){
        case 'SaveConfig':
            $save=saveModele($cnx,$_POST['list_id'],$row_config_globale['table_listsconfig'],$_POST['newsletter_name'],
                                  $_POST['from'],$_POST['from_name'],$_POST['subject'],$_POST['header'],$_POST['footer'],
                                  $_POST['subscription_subject'],$_POST['subscription_body'],$_POST['welcome_subject'],
                                  $_POST['welcome_body'],$_POST['quit_subject'],$_POST['quit_body'],$_POST['preview_addr']);
        break;
        case 'createConfig':
            $new_id=createNewsletter($cnx,$row_config_globale['table_listsconfig'],$_POST['newsletter_name'],$_POST['from'],
                                  $_POST['from_name'],$_POST['subject'],$_POST['header'],$_POST['footer'],
                                  $_POST['subscription_subject'],$_POST['subscription_body'],$_POST['welcome_subject'],
                                  $_POST['welcome_body'],$_POST['quit_subject'],$_POST['quit_body'],$_POST['preview_addr']);
            if($new_id > 0){
                $list_id=$new_id;
                $l='l';
            }
        break;
        case 'saveGlobalconfig':
            $smtp_host =(isset($_POST['smtp_host'])?$_POST['smtp_host']:'');
            $smtp_port =(isset($_POST['smtp_port'])?$_POST['smtp_port']:'');
            $smtp_auth =(isset($_POST['smtp_auth'])?$_POST['smtp_auth']:0);
            $smtp_login=(isset($_POST['smtp_login'])?$_POST['smtp_login']:'');
            $smtp_pass =(isset($_POST['smtp_pass'])?$_POST['smtp_pass']:'');
            $mod_sub   =(isset($_POST['mod_sub'])?$_POST['mod_sub']:0);
            $timezone  =(isset($_POST['timezone'])?$_POST['timezone']:'');
            $timer_ajax=(isset($_POST['timer_ajax'])?$_POST['timer_ajax']:10);
            $timer_cron=(isset($_POST['timer_cron'])?$_POST['timer_cron']:3);
            $free_id   =(isset($_POST['free_id'])?$_POST['free_id']:'');
            $free_pass =(isset($_POST['free_pass'])?$_POST['free_pass']:'');
            $key_dkim  =(isset($_POST['key_dkim'])?$_POST['key_dkim']:'');
            $nb_backup =(isset($_POST['nb_backup'])?$_POST['nb_backup']:5);
            $end_task  =(isset($_POST['end_task'])?$_POST['end_task']:'');
            $end_task_sms=(isset($_POST['end_task_sms'])?$_POST['end_task_sms']:'');
            $sub_validation_sms=(isset($_POST['sub_validation_sms'])?$_POST['sub_validation_sms']:'');
            $unsub_validation_sms=(isset($_POST['unsub_validation_sms'])?$_POST['unsub_validation_sms']:'');
            $alert_unsub=(isset($_POST['alert_unsub'])?$_POST['alert_unsub']:'');
            $loader    =(isset($_POST['loader'])?$_POST['loader']:1);
            $menu      =(isset($_POST['menu'])?$_POST['menu']:'hz');
            if(saveConfig($cnx,$_POST['table_config'],$_POST['admin_pass'],50,$_POST['base_url'],$_POST['path'],$_POST['language'],
                               $_POST['table_email'],$_POST['table_temp'],$_POST['table_listsconfig'],$_POST['table_archives'],
                               $_POST['sending_method'],$smtp_host,$smtp_port,$smtp_auth,$smtp_login,$smtp_pass,$_POST['sending_limit'],
                               $_POST['validation_period'],$_POST['sub_validation'],$_POST['unsub_validation'],$_POST['admin_email'],
                               $_POST['admin_name'],$_POST['mod_sub'],$_POST['table_sub'],$_POST['charset'],$_POST['table_track'],
                               $_POST['table_send'],$_POST['table_sauvegarde'],$_POST['table_upload'],$_POST['table_email_deleted'],
                               $_POST['table_senders'],$_POST['alert_sub'],$_POST['active_tracking'])){
                $configSaved=true;
                $row_config_globale = $cnx->SqlRow("SELECT * FROM $table_global_config");
            }else{
                $configSaved=false;
            }
            if($_POST['file']==1){
                $configFile =saveConfigFile($PMNL_VERSION,$_POST['db_host'],$_POST['db_login'],
                                            $_POST['db_pass'],$_POST['db_name'],
                                            $_POST['table_config'],$_POST['db_type'],
                                            $_POST['type_serveur'],$_POST['type_env'],
                                            $timezone, $_POST['code_mailtester'],
                                            $timer_ajax,$timer_cron,$free_id,$free_pass,
                                            $end_task,$end_task_sms,$sub_validation_sms,
                                            $unsub_validation_sms,$alert_unsub,
                                            $nb_backup,$key_dkim,$loader,$menu);
            }
            saveBounceFile($_POST['bounce_host'],$_POST['bounce_user'],$_POST['bounce_pass'],$_POST['bounce_port'],
                           $_POST['bounce_service'],$_POST['bounce_option'],$_POST['bounce_mail']);
            include("include/config.php");
            $row_config_globale = $cnx->SqlRow("SELECT * FROM $table_global_config");
        break;
        case 'subscriber_add':
            $add_addr = (empty($_POST['add_addr']) ? "" : $_POST['add_addr']);
            if(!empty($add_addr)&& validEmailAddress($add_addr) ){
                if(preg_match('/[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4}/', $add_addr)){
                    $add_r=add_subscriber($cnx,$row_config_globale['table_email'],$list_id,$add_addr,$row_config_globale['table_email_deleted']);
                    if($add_r==0){
                        $subscriber_op_msg_a = "<h4 class='alert alert-danger'>".tr("ERROR_ADDING_SUBSCRIBER"," <b>$add_addr</b>").".</h4>";
                    }else if($add_r==-1){
                        $subscriber_op_msg_a = "<h4 class='alert alert-danger'>".tr("ERROR_ALREADY_SUBSCRIBER", "<b>$add_addr</b>").".</h4>";
                    }else if($add_r==2){
                        $subscriber_op_msg_a = "<h4 class='alert alert-success'>".tr("SUBSCRIBER_ADDED", "<b>$add_addr</b>").".</h4>";
                    }else if($add_r==3){
                        $subscriber_op_msg_a = "<h4 class='alert alert-danger'>".tr("SUBSCRIBER_WITH_MAIL_DELETED", "<b>$add_addr</b>")."</h4>";
                    }
                } else {
                    $subscriber_op_msg_a = "<h4 class='alert alert-danger'>".tr("ERROR_SUPPLY_VALID_EMAIL")."</h4>";
                }
            } else {
                $subscriber_op_msg_a = "<h4 class='alert alert-danger'>".tr("ERROR_SUPPLY_VALID_EMAIL")."</h4>";
            }
        break;
        case 'subscriber_del':
            $del_addr = (empty($_POST['del_addr']) ? "" : $_POST['del_addr']);
            $deleted = delete_subscriber($cnx,$row_config_globale['table_email'],$list_id,$del_addr,$row_config_globale['table_email_deleted'],'by_admin');
            if($deleted){
                $subscriber_op_msg_d = "<h4 class='alert alert-success'>".tr("SUBSCRIBER_DELETED","<b>$del_addr</b>")."</h4>";
            }else{
                $subscriber_op_msg_d = "<h4 class='alert alert-danger'>".tr("ERROR_DELETING_SUBSCRIBER","<b>$del_addr</b>")."</h4>";
            }
        break;
        case 'subscriber_del_temp':
            $del_tmpaddr  = (empty($_POST['TmpUserAdress']) ? "" : $_POST['TmpUserAdress']);
            $deleted_temp = delete_subscriber_tmp($cnx,$row_config_globale['table_temp'],$list_id,$del_tmpaddr,$row_config_globale['table_email_deleted'],'by_admin');
            if( $deleted_temp ){
                $subscriber_op_msg_dt =  "<h4 class='alert alert-success'>".tr("SUBSCRIBER_TEMP_DELETED")."</h4>";
            }else{
                $subscriber_op_msg_dt =  "<h4 class='alert alert-danger'>".tr("ERROR_DELETING_TEMP","<i>$del_tmpaddr</i>")."</h4>";
            }
        break;
        case 'val_subscriber_temp':
            $force_tmpaddr = (empty($_POST['TmpUserAdress']) ? "" : $_POST['TmpUserAdress']);
            if (!validEmailAddress($force_tmpaddr)) {
                $deleted_temp = delete_subscriber($cnx,$row_config_globale['table_temp'],$list_id,$force_tmpaddr,$row_config_globale['table_email_deleted'],'hard');
                $subscriber_op_msg_dt =  "<h4 class='alert alert-danger'>".tr("ERROR_ADDING_SUBSCRIBER_TEMP","<i>$force_tmpaddr</i>")."</h4>";
            } else {
                $added_temp = force_subscriber($cnx,$row_config_globale['table_temp'],$list_id,$force_tmpaddr,$row_config_globale['table_email'],unique_id($force_tmpaddr));
                if( $added_temp ){
                    $subscriber_op_msg_dt =  "<h4 class='alert alert-success'>".tr("SUBSCRIBER_TEMP_FORCE_ADDED")." : $force_tmpaddr</h4>";
                }else{
                    $subscriber_op_msg_dt =  "<h4 class='alert alert-danger'>".tr("ERROR_ADDING_SUBSCRIBER_TEMP","<i>$force_tmpaddr</i>")."</h4>";
                }
            }
        break;
        case 'subscriber_import':
            @set_time_limit(300);
            $import_file = (!empty($_FILES['import_file']) ? $_FILES['import_file'] : "");
            if (!empty($import_file) && $import_file != "none" && $import_file['size'] > 0 && is_uploaded_file($import_file['tmp_name'])){
                $tmp_subdir_writable = true;
                $open_basedir = @ini_get('open_basedir');
                if (!empty($open_basedir)){
                    $tmp_subdir="./upload/";
                    $local_filename = $tmp_subdir.basename($import_file['tmp_name']);
                    move_uploaded_file($import_file['tmp_name'], $local_filename);
                    $liste = fopen($local_filename, 'r');
                } else{
                    $liste = fopen($import_file['tmp_name'], 'r');
                }
                if($tmp_subdir_writable){
                    $tx_import = 0;
                    $tx_error  = 0;
                    while (!feof($liste)){    
                        $mail_importe = fgets($liste, 4096);
                        preg_match_all('/[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4}/i', $mail_importe, $found_mails);
                        foreach ($found_mails[0] as $mail_importe){
                            if(strlen($mail_importe)==2){
                                // dummy and pretty function ;-) yeah !
                            }else{
                                $mail_importe = str_replace("'","",$mail_importe);
                                $mail_importe = str_replace('"',"",$mail_importe);
                                $mail_importe = strtolower(trim($mail_importe));
                                if(!empty($mail_importe)){
                                    $added=add_subscriber($cnx,$row_config_globale['table_email'],$list_id,$mail_importe,$row_config_globale['table_email_deleted']);
                                    if($added==-1){
                                        $subscriber_op_msg_i .= "<h4 class='alert alert-danger'>".tr("ERROR_ALREADY_SUBSCRIBER", "<b>$mail_importe</b>").".</h4>";
                                        $tx_error++;
                                    }elseif($added==2){
                                        $subscriber_op_msg_i .= "<h4 class='alert alert-success'>".tr("SUBSCRIBER_ADDED", "<b>$mail_importe</b>").".</h4>";
                                        $tx_import++;
                                    }elseif($added==0){
                                        $subscriber_op_msg_i .= "<h4 class='alert alert-danger'>".tr("ERROR_SQL", DbError())."</h4>";
                                        $tx_error++;
                                    }elseif($added==3){
                                        $subscriber_op_msg_i .= "<h4 class='alert alert-danger'>".tr("EMAIL_ON_DELETED_LIST", "<b>$mail_importe</b>")."</h4>";
                                        $tx_error++;
                                    }
                                } else {
                                    $subscriber_op_msg_i .= "<h4 class='alert alert-danger'>".tr("INVALID_MAIL")." : ".$mail_importe."</h4>";
                                    $tx_error++;
                                }
                            }
                        }
                    }
                    $subscriber_op_msg_i .= "<h4 class='alert alert-success'><b>$tx_import ".tr("MAIL_ADDED")."</b></h4>";
                    $subscriber_op_msg_i .= "<h4 class='alert alert-danger'><b>$tx_error ".tr("MAIL_ADDED_ERROR")."</b></h4>";
                } else{
                    $subscriber_op_msg_i = "<h4 class='alert alert-danger'>".tr("ERROR_IMPORT_TMPDIR_NOT_WRITABLE")." !</h4>";
                }
            }else{
                $subscriber_op_msg_i = "<h4 class='alert alert-danger'>".tr("ERROR_IMPORT_FILE_MISSING")." !</h4>";
            }
        break;
        case 'subscriber_mass_delete':
            @set_time_limit(300);
            $import_file = (!empty($_FILES['import_file']) ? $_FILES['import_file'] : "");
            if (!empty($import_file) && $import_file != "none" && $import_file['size'] > 0 && is_uploaded_file($import_file['tmp_name'])){
                $tmp_subdir_writable = true;
                $open_basedir = @ini_get('open_basedir');
                if (!empty($open_basedir)){
                    $tmp_subdir="./upload/";
                    $local_filename = $tmp_subdir.basename($import_file['tmp_name']);
                    move_uploaded_file($import_file['tmp_name'], $local_filename);
                    $liste = fopen($local_filename, 'r');
                } else{
                    $liste = fopen($import_file['tmp_name'], 'r');
                }
                if($tmp_subdir_writable){
                    $tx_import = 0;
                    $tx_error  = 0;
                    while (!feof($liste)){    
                        $del_addr = fgets($liste, 4096);
                        preg_match_all('/[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4}/i', $del_addr, $found_mails);
                        foreach ($found_mails[0] as $del_addr){
                            if(strlen($del_addr)==2){
                                // dummy and pretty function ;-) yeah !
                            }else{
                                $del_addr = str_replace("'","",$del_addr);
                                $del_addr = str_replace('"',"",$del_addr);
                                $del_addr = strtolower(trim($del_addr));
                                if(!empty($del_addr)&&validEmailAddress($del_addr)){
                                    $deleted = delete_subscriber($cnx,$row_config_globale['table_email'],$list_id,$del_addr,$row_config_globale['table_email_deleted'],'by_admin');
                                    if($deleted == true){
                                        //$subscriber_op_msg_md = "<h4 class='alert alert-success'>".tr("SUBSCRIBER_DELETED","<b>$del_addr</b>")."</h4>";
                                        $tx_import++;
                                    }elseif($deleted == false){
                                        //$subscriber_op_msg_md = "<h4 class='alert alert-danger'>".tr("ERROR_DELETING_SUBSCRIBER","<b>$del_addr</b>")."</h4>";
                                        $tx_error++;
                                    }elseif($deleted == 5){
                                        $subscriber_op_msg_md = "<h4 class='alert alert-danger'>".tr("ERROR_DELETING_SUBSCRIBER_NOT_IN_LIST","<b>$del_addr</b>")."</h4>";
                                        $tx_error++;
                                    }
                                } else {
                                    $subscriber_op_msg_md .= "<h4 class='alert alert-danger'>".tr("INVALID_MAIL")." : ".$del_addr."</h4>";
                                    $tx_error++;
                                }
                            }
                        }
                    }
                    $subscriber_op_msg_md .= "<h4 class='alert alert-success'><b>$tx_import ".tr("MAIL_MASS_DELETED")."</b></h4>";
                    $subscriber_op_msg_md .= "<h4 class='alert alert-danger'><b>$tx_error ".tr("MAIL_ADDED_ERROR")."</b></h4>";
                } else{
                    $subscriber_op_msg_md = "<h4 class='alert alert-danger'>".tr("ERROR_IMPORT_TMPDIR_NOT_WRITABLE")." !</h4>";
                }
            }else{
                $subscriber_op_msg_md = "<h4 class='alert alert-danger'>".tr("ERROR_IMPORT_FILE_MISSING")." !</h4>";
            }
        break;
        case 'smtp_add':
            $smtp_name   =(isset($_POST['smtp_name'])?$cnx->CleanInput($_POST['smtp_name']):'');
            $smtp_url    =(isset($_POST['smtp_url'])?$cnx->CleanInput($_POST['smtp_url']):'');
            $smtp_user   =(isset($_POST['smtp_user'])?$cnx->CleanInput($_POST['smtp_user']):'');
            $smtp_pass   =(isset($_POST['smtp_pass'])?$cnx->CleanInput($_POST['smtp_pass']):'');
            $smtp_port   =(isset($_POST['smtp_port'])?$cnx->CleanInput($_POST['smtp_port']):'');
            $smtp_secure =(isset($_POST['smtp_secure'])?$cnx->CleanInput($_POST['smtp_secure']):'');
            $smtp_limite =(isset($_POST['smtp_limite'])?$cnx->CleanInput($_POST['smtp_limite']):'');
            if($smtp_limite==0 || $smtp_limite==''){
                $smtp_limite=1800;
            }
            $cpt_already_exist = $cnx->SqlRow('SELECT * FROM '.$row_config_globale['table_smtp'].' 
                                                WHERE smtp_url="'.$smtp_url.'" 
                                                  AND smtp_port="'.$smtp_port.'"
                                                  AND smtp_user="'.$smtp_user.'"
                                                  AND smtp_pass="'.$smtp_pass.'"');
            if($cpt_already_exist==0){
                if($cnx->query("INSERT INTO ".$row_config_globale['table_smtp']
                           ." (smtp_name,smtp_url,smtp_user,smtp_pass,smtp_port,smtp_secure,smtp_limite,smtp_used,smtp_date_create,smtp_date_update)
                            VALUES ( '$smtp_name','$smtp_url','$smtp_user','$smtp_pass','$smtp_port','$smtp_secure','$smtp_limite',0,NOW(),NOW() )")){
                    $smtp_manage_msg = "<h4 class='alert alert-success'>Serveur smtp ajouté correctement !</h4>";
                    $daylog = @fopen('logs/daylog-' . date("Y-m-d") . '.txt', 'a+');
                    $daylogmsg= date("Y-m-d H:i:s") . " : ajout serveur smtp : '$smtp_name','$smtp_url','$smtp_limite'\n";
                    fwrite($daylog, $daylogmsg, strlen($daylogmsg));
                    fclose($daylog);
                } else {
                    $smtp_manage_msg = "<h4 class='alert alert-danger'>Ajout du serveur smtp en erreur !</h4>";
                }
            } else {
                $smtp_manage_msg = "<h4 class='alert alert-danger'>Serveur smtp déjà connu !</h4>";
            }
        break;
        case 'smtp_del':
            if($cnx->query("DELETE FROM ".$row_config_globale['table_smtp']." WHERE smtp_id=$smtp_id")){
                $smtp_manage_msg = "<h4 class='alert alert-success'>Suppression correcte du serveur smtp !</h4>";
                $daylog = @fopen('logs/daylog-' . date("Y-m-d") . '.txt', 'a+');
                $daylogmsg= date("Y-m-d H:i:s") . " : suppression du serveur smtp $smtp_id\n";
                fwrite($daylog, $daylogmsg, strlen($daylogmsg));
                fclose($daylog);
                @unlink('logs/smtp-'.$smtp_id.'.txt');
            } else {
                $smtp_manage_msg = "<h4 class='alert alert-danger'>Suppression du serveur smtp en erreur !</h4>";
            }
        break;
        case 'smtp_mod':
        break;
        case 'smtp_maj':
            $smtp_id     =(isset($_POST['smtp_id'])?$cnx->CleanInput($_POST['smtp_id']):'');
            $smtp_url    =(isset($_POST['smtp_url'])?$cnx->CleanInput($_POST['smtp_url']):'');
            $smtp_user   =(isset($_POST['smtp_user'])?$cnx->CleanInput($_POST['smtp_user']):'');
            $smtp_pass   =(isset($_POST['smtp_pass'])?$cnx->CleanInput($_POST['smtp_pass']):'');
            $smtp_port   =(isset($_POST['smtp_port'])?$cnx->CleanInput($_POST['smtp_port']):'');
            $smtp_secure =(isset($_POST['smtp_secure'])?$cnx->CleanInput($_POST['smtp_secure']):'');
            $smtp_limite =(isset($_POST['smtp_limite'])?$cnx->CleanInput($_POST['smtp_limite']):'');
            if($cnx->query("UPDATE ".$row_config_globale['table_smtp']." 
            	                SET smtp_url='$smtp_url' , smtp_user='$smtp_user' , smtp_pass='$smtp_pass',
            	                    smtp_port='$smtp_port' , smtp_secure='$smtp_secure' , smtp_limite='$smtp_limite'
            	            WHERE smtp_id=$smtp_id")){
                $smtp_manage_msg = "<h4 class='alert alert-success'>Mise à jour correcte du serveur smtp !</h4>";
                $daylog = @fopen('logs/daylog-' . date("Y-m-d") . '.txt', 'a+');
                $daylogmsg = date("Y-m-d H:i:s") . " : mise à jour du serveur smtp $smtp_id\n";
                $daylogmsg .= "Nouveaux paramètres :\n HOST : $smtp_url\nUSER : $smtp_user\nPASS : *******\n$PORT : $smtp_port\nSECURE : $smtp_secure\LIMITE : $smtp_limite\n";
                fwrite($daylog, $daylogmsg, strlen($daylogmsg));
                fclose($daylog);
            } else {
                $smtp_manage_msg = "<h4 class='alert alert-danger'>Mise àjour du serveur smtp en erreur !</h4>";
            }
        break;
        default:
        break;
    }
} else{
    $op = '';
}
preview.php
wget 'https://lists2.roe3.org/pmnl3/preview.php'
View Content
<?php
header('Access-Control-Allow-Origin: *');
header('Cache-Control: no-cache, must-revalidate');
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
header('Content-Type: text/html; charset=utf-8');
if(!file_exists("include/config.php")) {
    header("Location:install.php");
    exit;
} else {
    session_start();
    include("_loader.php");
    if(isset($_POST['token'])){$token=$_POST['token'];}elseif(isset($_GET['token'])){$token=$_GET['token'];}else{$token='';}
    if(!tok_val($token)){
        header("Location:login.php?error=2");
        die();
    }
}
$row_config_globale = $cnx->SqlRow("SELECT * FROM $table_global_config");
(count($row_config_globale)>0)?$r='SUCCESS':$r='';
if($r != 'SUCCESS') {
    include("include/lang/english.php");
    echo "<div class='error'>".tr($r)."<br>";
    echo "</div>";
    exit;
}
if(empty($row_config_globale['language']))$row_config_globale['language']="english";
include("include/lang/".$row_config_globale['language'].".php");
if(isset($_GET['list_id'])){$list_id=$_GET['list_id'];}else{$list_id='';}
if(isset($_GET['id'])){$id=$_GET['id'];}else{$id='';}
if(isset($id)&&is_numeric($id)){
    $msg = getMsgById($cnx,$id,$row_config_globale['table_archives']);
    $message = stripslashes($msg['message']);
} else {
    $msg = getConfig($cnx,$list_id,$row_config_globale['table_sauvegarde']);
    $message = stripslashes($msg['textarea']);
}

$format         = $msg['type'];
if(empty($subject)){
    $subject    = stripslashes($msg['subject']);
}
$_SESSION['message'] = $message;
$_SESSION['subject'] = $subject;
$_SESSION['format']  = $format;
$_SESSION['sender_email'] = $msg['sender_email'];
$_SESSION['draft']  = $msg['draft'];
$_SESSION['preheader']  = $msg['preheader'];
$subj                = htmlspecialchars($subject);
if($format == "html"){
    $Vmsg = $message;
} else {
    $Vmsg = htmlspecialchars($message);
}
if($format == "html"){
    echo stripslashes($Vmsg);
} else {
    echo nl2br(stripslashes($Vmsg));
}













r.php
wget 'https://lists2.roe3.org/pmnl3/r.php'
View Content
<?php
if(!empty($_GET['m'])&&!empty($_GET['h'])&&!empty($_GET['l'])&&!empty($_GET['r'])){
	include("_loader.php");
	foreach($_GET as $key=>$value){
		$$key = $cnx->CleanInput($value);
	}
	$r = urldecode($r);
	$row_config_globale = $cnx->SqlRow("SELECT * FROM ".$table_global_config);
	$row_id = $cnx->query("SELECT id FROM ".$row_config_globale['table_track_links']." 
				WHERE list_id ='".$l."'
					AND msg_id='".$m."'
					AND hash  ='".$h."'
					AND link  ='".$r."'")->fetchAll();
	$nb_result=count($row_id);
	if($nb_result==0){
		$cnx->query("INSERT INTO ".$row_config_globale['table_track_links']."(list_id,msg_id,link,hash,cpt,dt_track_link) 
				VALUES ('".$l."','".$m."','".$r."','".$h."','1',now())");
	}elseif($nb_result==1){
		$cnx->query("UPDATE ".$row_config_globale['table_track_links']." 
				SET cpt=cpt+1,dt_track_link=now()
			WHERE list_id ='".$l."' 
				AND msg_id='".$m."' 
				AND hash  ='".$h."' 
				AND link  ='".$r."'");
	}
}
$redirect = urldecode(htmlspecialchars_decode($_GET['r']));
header("Location:$redirect");
reset.php
wget 'https://lists2.roe3.org/pmnl3/reset.php'
View Content
<?php
session_start();
ob_start();
date_default_timezone_set('Europe/Berlin');
if(!file_exists("include/config.php")){
	header("Location:install.php");
	exit;
} else{
	include("_loader.php");
}
$row_config_globale = $cnx->SqlRow("SELECT * FROM $table_global_config");
(count($row_config_globale)>0)?$r='SUCCESS':$r='';
if($r != 'SUCCESS'){
	include("include/lang/english.php");
	echo "<div class='error'>".tr($r)."<br>";
	echo "</div>";
	exit;
}
require('include/lib/PHPMailerAutoload.php');
$tPath        = ($row_config_globale['path'] == '' ? '/' : '/'.$row_config_globale['path']);
$tPath        = str_replace('//','/',$tPath);
if(isset($_GET['x'])) {
	$is_admin=current($cnx->query("SELECT count(*) AS is_admin
		FROM $table_global_config 
			WHERE lost_pass=" . escape_string($cnx,$cnx->CleanInput($_GET['x'])) . " 
				AND admin_email=" . escape_string($cnx,$cnx->CleanInput($_GET['m'])) . ";")->fetch());
	if($is_admin) {
		function randomPassword($length,$count, $characters) {
			// $length - the length of the generated password
			// $count - number of passwords to be generated
			// $characters - types of characters to be used in the password
			// define variables used within the function
			/* USAGE :
			// generate one password using 5 upper and lower case characters
			randomPassword(5,1,"lower_case,upper_case");
			// generate three passwords using 10 lower case characters and numbers
			randomPassword(10,3,"lower_case,numbers");
			// generate five passwords using 12 lower case and upper case characters, numbers and special symbols
			randomPassword(12,5,"lower_case,upper_case,numbers,special_symbols");
			*/  
			$symbols = array();
			$passwords = array();
			$used_symbols = '';
			$pass = '';
			$symbols["lower_case"] = 'abcdefghijklmnopqrstuvwxyz';
			$symbols["upper_case"] = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';
			$symbols["numbers"] = '1234567890';
			$symbols["special_symbols"] = '!?~@#-_+<>[]{}';
			$characters = explode(",",$characters); // get characters types to be used for the passsword
			foreach ($characters as $key=>$value) {
				$used_symbols .= $symbols[$value]; // build a string with all characters
			}
			$symbols_length = strlen($used_symbols) - 1; //strlen starts from 0 so to get number of characters deduct 1
			for ($p = 0; $p < $count; $p++) {
				$pass = '';
				for ($i = 0; $i < $length; $i++) {
					$n = rand(0, $symbols_length); // get a random character from the string with all characters
					$pass .= $used_symbols[$n]; // add the character to the password string
				}
				$passwords[] = $pass;
			}
			return $passwords; // return the generated password
		}
		$new_pass=randomPassword(12,1,"lower_case,upper_case,numbers,special_symbols");
		$cnx->query("UPDATE " . $table_global_config. " 
			SET admin_pass='" . md5($new_pass[0]). "' 
				WHERE admin_email=" . escape_string($cnx,$cnx->CleanInput($_GET['m'])). "
					AND lost_pass=" . escape_string($cnx,$cnx->CleanInput($_GET['x'])));
		$subj = 'Nouveau mot de passe / reset password !';
		$lost_msg = '<br /><br /><br /><br /><br />
			<table style="height: 217px; margin-left: auto; margin-right: auto;" width="660">
			<tbody>
			<tr><td style="text-align: center;"><span style="color: #2446a2;font-size: 14pt;">
			<img src="https://www.phpmynewsletter.com/css/images/phpmynewsletter_v2.png" alt="" width="123" height="72" /><br />Nouveau mot de passe / reset password !</td></tr>
			<tr><td><span style="color: #2446a2;">Voici votre nouveau mot de passe, comme demandé / This is your new password, as asked.</span></td></tr>
			<tr><td align="center"><span style="color: #000000;"><h2>' . $new_pass[0] . '</h2></td></tr>
			<tr><td><span style="color: #2446a2;">Vous pouvez vous connecter / You can connect :</td></tr>
			<tr><td><span style="color: #2446a2;"><a href="' . $row_config_globale['base_url'] . $tPath . '">' . $row_config_globale['base_url'] . $tPath . '</a></td></tr>
			</tbody>
			</table>';
		sendEmail($row_config_globale['sending_method'],$row_config_globale['admin_email'], $row_config_globale['admin_email'], 
			$row_config_globale['admin_name'], $subj, $lost_msg, $row_config_globale['smtp_auth'], $row_config_globale['smtp_host'], 
			$row_config_globale['smtp_login'], $row_config_globale['smtp_pass'], $row_config_globale['charset']);
		header("Location: login.php?pass");
		die();
	} else {
		header("Location: login.php?pass");
	}	
}
$is_admin=current($cnx->query("SELECT count(*) AS is_admin
		FROM $table_global_config 
			WHERE admin_email=" . escape_string($cnx,$cnx->CleanInput($_POST['form_mail_admin'])) . ";")->fetch());
if($is_admin) {
	function random_str($length){
		$characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
		$charactersLength = strlen($characters);
		$randomString = '';
		for ($i = 0; $i < $length; $i++) {
			$randomString .= $characters[rand(0, $charactersLength - 1)];
		}
		return $randomString;
	}
	$chaine_pass = random_str(32);
	$link_reset = $row_config_globale['base_url'] . $tPath . "reset.php?x=" . $chaine_pass . "&m=" . $_POST['form_mail_admin'];
	$cnx->query("UPDATE " . $table_global_config. " 
			SET lost_pass=" . escape_string($cnx,$chaine_pass). " 
				WHERE admin_email='" . $cnx->CleanInput($_POST['form_mail_admin']). "'");
	$subj = 'Mot de passe perdu / lost password !';
	$lost_msg = '<br /><br /><br /><br /><br />
		<table style="height: 217px; margin-left: auto; margin-right: auto;" width="660">
		<tbody>
		<tr><td style="text-align: center;"><span style="color: #2446a2;font-size: 14pt;">
		<img src="https://www.phpmynewsletter.com/css/images/phpmynewsletter_v2.png" alt="" width="123" height="72" /><br />Mot de passe perdu / reset password !</td></tr>
		<tr><td><span style="color: #2446a2;">Quelqu\'un a demandé la réinitialisation de votre mot de passe.</span></td></tr>
		<tr><td><span style="color: #2446a2;"><i>Somebody asked to recover password.</i></span></td></tr>
		<tr><td><span style="color: #2446a2;">Si c\'est bien le cas, cliquez sur le lien ci-dessous.<br>
		Sinon, connectez-vous et changez rapidement votre mot de passe.</span></td></tr>
		<tr><td><span style="color: #2446a2;"><i>If you dit it, please click on link below.<br>
		Else, connect and change password.</i></span></td></tr>
		<tr><td><span style="color: #2446a2;">Cliquez ici ou copier/coller dans votre navigateur :</span></td></tr>
		<tr><td><span style="color: #2446a2;"><i>Click here or copy and paste in your browser :</i></span></td></tr>
		<tr><td><span style="color: #2446a2;"><a href="'.$link_reset.'">'.$link_reset.'</a></span></td></tr>
		</tbody>
		</table>';
	sendEmail($row_config_globale['sending_method'],$row_config_globale['admin_email'], $row_config_globale['admin_email'], 
		$row_config_globale['admin_name'], $subj, $lost_msg, $row_config_globale['smtp_auth'], $row_config_globale['smtp_host'], 
		$row_config_globale['smtp_login'], $row_config_globale['smtp_pass'], $row_config_globale['charset']);
}
header("Location:login.php");
send.php
wget 'https://lists2.roe3.org/pmnl3/send.php'
View Content
<?php
header('Access-Control-Allow-Origin: *');
header('Cache-Control: no-cache, must-revalidate');
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
header('Content-type: application/json');
if (!file_exists("include/config.php")) {
	header("Location:install.php");
	exit;
} else {
	session_start();
	include("_loader.php");
	if (file_exists("include/config_bounce.php")) {
		include("include/config_bounce.php");
	}
	if (isset($_POST['token'])) {
		$token = $_POST['token'];
	} elseif (isset($_GET['token'])) {
		$token = $_GET['token'];
	} else {
		$token = '';
	}
	if (!tok_val($token)) {
		quick_Exit();
		die();
	}
}
$row_config_globale = $cnx->SqlRow("SELECT * FROM $table_global_config");
(count($row_config_globale) > 0) ? $r = 'SUCCESS' : $r = '';
if ($r != 'SUCCESS') {
	include("include/lang/english.php");
	echo "<div class='error'>" . tr($r) . "<br>";
	echo "</div>";
	exit;
}
if (empty($row_config_globale['language']))
	$row_config_globale['language'] = "english";
include("include/lang/" . $row_config_globale['language'] . ".php");
require('include/lib/PHPMailerAutoload.php');
$step         = (empty($_GET['step']) ? "" : $_GET['step']);
$subject      = (!empty($_SESSION['subject'])) ? $_SESSION['subject'] : '';
$message      = (!empty($_SESSION['message'])) ? $_SESSION['message'] : '';
$format       = (!empty($_SESSION['format'])) ? $_SESSION['format'] : '';
$draft        = (!empty($_SESSION['draft'])) ? $_SESSION['draft'] : '';
$preheader    = (!empty($_SESSION['preheader'])) ? $_SESSION['preheader'] : '';
$sender_email = (!empty($_SESSION['sender_email'])) ? $_SESSION['sender_email'] : '';
$list_id      = (!empty($_POST['list_id'])) ? (($_POST['list_id']) + 0) : '';
$list_id      = (!empty($_GET['list_id']) && empty($list_id)) ? (($_GET['list_id']) + 0) : (($list_id) + 0);
$begin        = (!empty($_POST['begin'])) ? $_POST['begin'] : '';
$begin        = (!empty($_GET['begin']) && empty($begin)) ? (($_GET['begin']) + 0) : 0;
$msg_id       = (!empty($_GET['msg_id'])) ? (($_GET['msg_id']) + 0) : '';
$sn           = (!empty($_GET['sn'])) ? (($_GET['sn']) + 0) : '';
$error        = (!empty($_GET['error'])) ? $_GET['error'] : '';
$encode       = (!empty($_GET['encode']) && $_GET['encode'] == 'base64') ? 'base64' : 'quoted-printable';
$force        = (!empty($_POST['force'])) ? $_POST['force'] : '';
$force        = (!empty($_GET['force']) && empty($force)) ? $_GET['force'] : '';
$tPath        = ($row_config_globale['path'] == '' ? '/' : '/'.$row_config_globale['path']);
$tPath        = str_replace('//','/',$tPath);
switch ($step) {
	case "send":
		if (isset($force) && $force == 'true')
			touch('logs/__SEND_PROCESS__' . $list_id . '.pid');

		if (!file_exists('logs/__SEND_PROCESS__' . $list_id . '.pid')) {
			if ($_SESSION['dr_log'] == 'Y' && ($begin < $sn)) {
				loggit($_SESSION['dr_id_user'] . '.log', $_SESSION['dr_id_user'] . ' a interrompu un envoi de campagne "' . $subject . '" par "' . $sender_email . '" en ajax');
			}
			$arr = array(
				'TTS' => 'Envoi stoppé'
			);
			echo json_encode($arr);
			die();
		}
		$tts     = 0;
		$start   = microtime(true);
		$dontlog = 0;
		if (!$handler = @fopen('logs/list' . $list_id . '-msg' . $msg_id . '.txt', 'a+')) {
			$dontlog = 1;
		}
		$daylog            = @fopen('logs/daylog-' . date("Y-m-d") . '.txt', 'a+');
		$limit             = $row_config_globale['sending_limit'];
		$mail              = new PHPMailer();
		$mail->SMTPOptions = array(
			'ssl' => array(
				'verify_peer' => false,
				'verify_peer_name' => false,
				'allow_self_signed' => true
			)
		);
		$mail->CharSet		= $row_config_globale['charset'];
		$mail->ContentType	= "text/html";
		$mail->Encoding		= "quoted-printable";
		$mail->PluginDir	= "include/lib/";
		$msg			= get_message($cnx, $row_config_globale['table_archives'], $msg_id);
		$newsletter		= getConfigSender($cnx, $row_config_globale['table_senders'], $msg['sender_email']);
		$sender_email		= $newsletter['email'];
		$sender_name		= $newsletter['name_organisation'];
		$reply_email		= $newsletter['email_reply'];
		if (empty($sender_email)) {
			$emptysender  	= getConfig($cnx, $list_id, $row_config_globale['table_listsconfig']);
			$sender_email 	= $emptysender['from_addr'];
			$sender_name  	= $emptysender['from_name'];
			$reply_email  	= $emptysender['from_addr'];
		}
		// recherche du mail de bounce (retour des non distribués), du particulier au général, sinon, par défaut : $bounce_mail
		if (empty(trim($newsletter['bounce_email']))) { 		// from array $newsletter : particular desc
			if (empty(trim($bounce_mail))) { 			// from config_bounce.php : global desc
				$bounce_email = $emptysender['from_addr'];	// from array $emptysender : default desc
			} else {
				$bounce_email = $bounce_mail;
			}
		} else {
			$bounce_email = $newsletter['bounce_email'];
		}
		$mail->AddReplyTo($reply_email);
		$mail->SetFrom($sender_email, $sender_name);
		$mail->Sender = $bounce_email;
		$addr = getAddress($cnx, $row_config_globale['table_email'], $list_id, $begin, $limit, $msg_id);
		if ($type_env == 'dev') {
			$daylogmsg = "LIST_ID : $list_id\tBEGIN : $begin\tLIMIT : $limit\tMSG_ID : $msg_id\n";
			fwrite($daylog, $daylogmsg, strlen($daylogmsg));
		}
		$format  = $msg['type'];
		$list_pj = $cnx->query("SELECT *
			FROM " . $row_config_globale['table_upload'] . "
				WHERE list_id=$list_id
				AND msg_id=$msg_id
			ORDER BY id ASC")->fetchAll(PDO::FETCH_ASSOC);
		if (count($list_pj) > 0) {
			foreach ($list_pj as $item) {
				$mail->AddAttachment('upload/' . $item['name']);
			}
		}
		$message       = stripslashes($msg['message']);
		$to_replace    = array("  ","\t","\n","\r","\0","\x0B","\xA0");
		$subject       = stripslashes($msg['subject']);
		$message       = str_replace($to_replace, " ", $message);
		
		if (strpos($message, '</style>') === false) {
			$message = '<style type="text/css"></style>' . $message;
		}
		if (strpos($message, '</title>') === false) {
			$message = '<title>[[SUBJECT]]</title>' . $message;
		} elseif (strpos($message, '<title>[[SUBJECT]]</title>') === false && strpos($message, '<title>') !== false) {
			$message = preg_replace("/<title>(.*)<\/title>/","",$message,1);
			$message = '<title>[[SUBJECT]]</title>' . $message;
		}
		$header        = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!--[if IE]>	
	<html xmlns="http://www.w3.org/1999/xhtml">
<![endif]-->
<!--[if !IE]>
<!-->
	<html style="margin: 0;padding: 0;" xmlns=3D"http://www.w3.org/1999/xhtml">
<!--<![endif]-->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" />
<!--[if !mso]><!-->
	<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<!--<![endif]-->
<meta name="x-apple-disable-message-reformatting" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="description" content="' . $subject . '" />';
		$message       = str_replace('<title>[[SUBJECT]]</title>', $header.'<title>' . $subject . '</title>', $message);
		$preHeaderDesc = stripslashes($msg['preheader']);
		$preHeader     = "<div class='preHeader' align='center' style='font-size:8px;font-family:arial,helvetica,sans-serif;padding-bottom:5px;color:#878e83;'>" . $preHeaderDesc . "</div>";
		$message       = str_replace('</style>', ' .preHeader {display:none!important;}</style></head><body>'.$preHeader, $message);
		$messageSource = str_replace("  ", " ", $message);
		if ($format == "html") {
			$mail->IsHTML(true);
		}
		$mail->WordWrap = 76;
		if (file_exists("include/DKIM/DKIM_config.php") && ($row_config_globale['sending_method'] == 'smtp' || $row_config_globale['sending_method'] == 'php_mail')) {
			include("include/DKIM/DKIM_config.php");
			$mail->DKIM_domain     = $DKIM_domain;
			$mail->DKIM_private    = $DKIM_private;
			$mail->DKIM_selector   = $DKIM_selector;
			$mail->DKIM_passphrase = $DKIM_passphrase;
			$mail->DKIM_identity   = $DKIM_identity;
		}
		$to_send              = count($addr);
		$view_last_send_mails = "";
		$mail->SMTPKeepAlive  = true;
		for ($i = 0; $i < $to_send; $i++) {
			$last_id_send = $addr[$i]['id'];
			$cnx->query("UPDATE " . $row_config_globale['table_send_suivi'] . "
					SET nb_send=nb_send+1,last_id_send=" . $last_id_send . "
						WHERE `msg_id`='" . $msg_id . "' AND `list_id`='" . $list_id . "'");
			$time_info     = "";
			$begintimesend = microtime(true);
			$unsubLink     = "";
			$headtrc       = "";
			$body          = "";
			$message       = $messageSource;
			$mail->ClearAllRecipients();
			$mail->ClearCustomHeaders();
			$mail->AddAddress($addr[$i]['email']);
			$view_last_send_mails .= $addr[$i]['email'];
			include("include/lib/switch_smtp.php");
			$mail->XMailer = ' ';
			$mail->addCustomHeader("List-Unsubscribe",'<'. $row_config_globale['base_url'] . $tPath . 'subscription.php?i=' . $msg_id . '&list_id='
				. $list_id . '&op=leave&email_addr=' . $addr[$i]['email'] . '&h=' . $addr[$i]['hash'] . '>'
				. ( $sender_email != '' ? ', <mailto:' . $sender_email . '?subject=unsubscribe>' : '' )
			);
			if ($row_config_globale['active_tracking'] == '1') {
				$trac = "<img style='border:0' src='" . $row_config_globale['base_url'] . $tPath 
					. "trc.php?i=" . $msg_id . "&h=" . $addr[$i]['hash'] . "' width='1'  height='1 alt='" . $list_id . "' />";
			} else {
				$trac = "";
			}
			if ($format == "html") {
				if ( $row_config_globale['active_tracking'] == '1' ) {
					$new_url = 'href="' . $row_config_globale['base_url'] . $tPath . 'r.php?m=' . $msg_id . '&h=' . $addr[$i]['hash'] . '&l=' . $list_id . '&r=';
					$message   = preg_replace_callback('/href="(http[s]?:\/\/)([^"]+)"/', function($matches) {
						global $new_url;
						return $new_url . (urlencode(@$matches[1] . $matches[2])) . '"';
					}, $message);
				}
				if (strpos($message, '</body>') !== false) {
					$message = str_replace('</body>', '', $message);
					$message = str_replace('</html>', '', $message);
				}
				$headtrc = "<hr noshade='' color='#D4D4D4' width='90%' size='1'>"
							. "<div align='center' style='font-size:12px;font-family:arial,helvetica,sans-serif;padding-bottom:5px;color:#878e83;'>"
							. tr("READ_ON_LINE", "<a href='" . $row_config_globale['base_url'] . $tPath . "online.php?i=$msg_id&list_id=$list_id&email_addr="
							. $addr[$i]['email'] . "&h=" . $addr[$i]['hash'] . "'>") . "<br />"
							. tr("ADD_ADRESS_BOOK", $sender_email) . "<br />";
				$unsubLink = $headtrc . tr("UNSUBSCRIBE_LINK", "<a href='" . $row_config_globale['base_url'] . $tPath
							. "subscription.php?i=$msg_id&list_id=$list_id&op=leave&email_addr=" . $addr[$i]['email']
							. "&h=" . $addr[$i]['hash'] . "' style='' target='_blank'>")
							. $trac
							. "</div></body></html>";
			} else {
				$body = tr("READ_ON_LINE", "<a href='" . $row_config_globale['base_url'] . $tPath . "online.php?i=$msg_id&list_id=$list_id&email_addr=" . $addr[$i]['email'] . "&h=" . $addr[$i]['hash'] . "'>") . "<br />";
				$body .= tr("ADD_ADRESS_BOOK", $sender_email) . "<br />";
				$unsubLink = $row_config_globale['base_url'] . $tPath . "subscription.php?i=" . $msg_id . "&list_id=$list_id&op=leave&email_addr=" . urlencode($addr[$i]['email']) . "&h=" . $addr[$i]['hash'];
			}
			$subject       = (strtoupper($row_config_globale['charset']) == "UTF-8" ? $subject : iconv("UTF-8", $row_config_globale['charset'], $subject));
			$body          = $message . $unsubLink ;
			$mail->Subject = $subject;
			$mail->msgHTML($body);
			// https://github.com/PHPMailer/PHPMailer/issues/892
			// dkim=fail (body hash did not verify)
			$htmlMsg = "";
			$lines = explode("\n", $body);
			foreach ($lines as $line) $htmlMsg .= trim($line)."\n";
			$mail->msgHTML($htmlMsg);
			@set_time_limit(300);
			$ms_err_info = '';
			if (!$mail->Send()) {
				$view_last_send_mails .= ' <b>' . tr("MAIL_IN_ERROR") . '</b>';
				$cnx->query("UPDATE " . $row_config_globale['table_send'] . "
								SET error=error+1
							WHERE `id_mail`='" . $msg_id . "'
								AND `id_list`='" . $list_id . "'");
				$ms_err_info = $mail->ErrorInfo;
				$cnx->query("INSERT INTO " . $row_config_globale['table_email_deleted'] . "
					(id,email,list_id,hash,error,status,type,categorie,short_desc,long_desc,campaign_id)
					SELECT id,email,list_id,hash,'Y',NULL,'',NULL,'','" . $cnx->CleanInput($ms_err_info) . "','" . $msg_id . "'
						FROM " . $row_config_globale['table_email'] . "
							WHERE email='" . $addr[$i]['email'] . "'
								AND list_id='" . $list_id . "'");
				$cnx->query("DELETE FROM " . $row_config_globale['table_email'] . "
							WHERE email='" . $addr[$i]['email'] . "'
								AND list_id='" . $list_id . "'");
				$daylogmsg = date("Y-m-d H:i:s") . " : envoi à " . $addr[$i]['email'] . " en erreur $ms_err_info\n";
				fwrite($daylog, $daylogmsg, strlen($daylogmsg));
			} else {
				$view_last_send_mails .= ' <b>OK</b>';
				$cnx->query("UPDATE " . $row_config_globale['table_email'] . "
								SET campaign_id='" . $msg_id . "'
							WHERE email='" . $addr[$i]['email'] . "'
								AND list_id='" . $list_id . "'");
				$cnx->query("UPDATE " . $row_config_globale['table_send'] . "
								SET cpt=cpt+1
							WHERE `id_mail`='" . $msg_id . "'
								AND `id_list`='" . $list_id . "'");
				$ms_err_info = 'OK';
				$daylogmsg   = date("Y-m-d H:i:s") . " : envoi à " . $addr[$i]['email'] . " OK\n";
				fwrite($daylog, $daylogmsg, strlen($daylogmsg));
			}
			$view_last_send_mails .= '<br>';
			$cnx->query("UPDATE " . $row_config_globale['table_send_suivi'] . "
						SET nb_send=nb_send+1,last_id_send=" . $addr[$i]['id'] . "
							WHERE `msg_id`='" . $msg_id . "' AND `list_id`='" . $list_id . "'");
			$endtimesend = microtime(true);
			$time_info   = substr(($endtimesend - $begintimesend), 0, 5);
			$errstr      = date("Y-m-d H:i:s") . "\tID : " . $addr[$i]['id'] . "\t" . $time_info . "\t\t " . $ms_err_info . " \t" . $addr[$i]['email'] . "\r\n";
			if (!$dontlog) {
				fwrite($handler, $errstr, strlen($errstr));
			}
			$daylogmsg = date("Y-m-d H:i:s") . " : envoi à " . $addr[$i]['email'] . " OK\n";
			fwrite($daylog, $errstr, strlen($errstr));
		}
		$end   = microtime(true);
		$tts   = substr(($end - $start), 0, 5);
		$begin = $begin + $limit;
		if ($begin < $sn) {
			$arr = array(
				'step' => 'send',
				'error' => $error,
				'begin' => $begin,
				'list_id' => $list_id,
				'msg_id' => $msg_id,
				'sn' => $sn,
				'token' => $token,
				'pct' => number_format((($begin / $sn) * 100), 2),
				'TTS' => $tts,
				'force' => 'false',
				'view_last_send_mails' => $view_last_send_mails
			);
			echo json_encode($arr);
			$cnx->query("UPDATE " . $row_config_globale['table_send_suivi'] . "
						SET tts=tts+'" . $tts . "',last_id_send='" . $last_id_send . "',nb_send=nb_send+" . $to_send . "
							WHERE list_id='" . $list_id . "'
								AND msg_id='" . $msg_id . "'");
		} else {
			unlink('logs/__SEND_PROCESS__' . $list_id . '.pid');
			$errstr = "------------------------------------------------------------\r\n";
			$errstr .= "Finished at " . date("Y-m-d H:i:s") . "\r\n";
			$errstr .= "============================================================\r\n";
			if (!$dontlog) {
				fwrite($handler, $errstr, strlen($errstr));
				fclose($handler);
			}
			if ($_SESSION['dr_log'] == 'Y') {
				loggit($_SESSION['dr_id_user'] . '.log', $_SESSION['dr_id_user'] . ' a fini un envoi de campagne "' . $subject . '" par "' . $sender_email . '" en ajax');
			}
			$daylogmsg = date("Y-m-d H:i:s") . " : fin globale de l envoi du message $msg_id, sujet \"$subject\", sur liste $list_id\n";
			fwrite($daylog, $daylogmsg, strlen($daylogmsg));
			$arr = array(
				'step' => 'send',
				'error' => $error,
				'begin' => $sn,
				'list_id' => $list_id,
				'msg_id' => $msg_id,
				'encode' => $encode,
				'sn' => $sn,
				'token' => $token,
				'pct' => 100,
				'TTS' => $tts,
				'view_last_send_mails' => $view_last_send_mails,
				'force' => 'false'
			);
			echo json_encode($arr);
		}
		fclose($daylog);
		break;
	default:
		$message	= $_SESSION['message'];
		$subject	= $_SESSION['subject'];
		$format		= $_SESSION['format'];
		$sender_email	= $_SESSION['sender_email'];
		$draft		= $_SESSION['draft'];
		$preheader	= $_SESSION['preheader'];

		if ($_SESSION['dr_log'] == 'Y') {
			loggit($_SESSION['dr_id_user'] . '.log', $_SESSION['dr_id_user'] . ' a commencé un envoi de campagne "' . $subject . '" par "' . $sender_email . '" en ajax');
		}
		$date    = date("Y-m-d H:i:s");
		$msg_id  = save_message($cnx, $row_config_globale['table_archives'], $subject, $format, $message, $date, $list_id, $sender_email, $draft, $preheader);
		$dontlog = 0;
		if (!$handler = @fopen('logs/list' . $list_id . '-msg' . $msg_id . '.txt', 'a+')) {
			$dontlog = 1;
		}
		$daylog    = @fopen('logs/daylog-' . date("Y-m-d") . '.txt', 'a+');
		$daylogmsg = $date . " : message sauvegardé sous Numéro d'envoi : $msg_id\n";
		fwrite($daylog, $daylogmsg, strlen($daylogmsg));
		$cnx->query("UPDATE " . $row_config_globale['table_upload'] . "
				SET msg_id=" . $msg_id . "
			WHERE list_id=" . $list_id . "
				AND msg_id=0");
		$daylogmsg = "\r\n**********************************************************\r\n" . $date . " : initialisation envoi message $msg_id liste $list_id\n";
		fwrite($daylog, $daylogmsg, strlen($daylogmsg));
		touch('logs/__SEND_PROCESS__' . $list_id . '.pid');
		$num = get_newsletter_total_subscribers($cnx, $row_config_globale['table_email'], $list_id, $msg_id);
		$cnx->query("INSERT into " . $row_config_globale['table_send'] . " (`id_mail`, `id_list`, `cpt`)
						 VALUES ('" . $msg_id . "','" . $list_id . "','0')");
		$cnx->query("INSERT into " . $row_config_globale['table_send_suivi'] . " (`list_id`, `msg_id`, `total_to_send`)
						 VALUES ('" . $list_id . "','" . $msg_id . "','" . $num . "')");
		$errstr = "=GLOBAL=ENVIRONNEMENT=======================================\r\n";
		if (version_compare(PHP_VERSION, '5.3.0', '>')) {
			$errstr .= "PHP : " . phpversion() . " " . tr("OK_BTN") . "\r\n";
		} else {
			$errstr .= "PHP : " . phpversion() . " " . tr("INSTALL_OBSOLETE") . "<\r\n";
		}
		if (extension_loaded('imap')) {
			$errstr .= "imap " . tr("OK_BTN") . "\r\n";
		} else {
			$errstr .= "imap " . tr("NOT_FOUND") . "\r\n";
		}
		if (extension_loaded('curl')) {
			$errstr .= "curl " . tr("OK_BTN") . "\r\n";
		} else {
			$errstr .= "curl " . tr("NOT_FOUND") . "\r\n";
		}
		if (is_exec_available()) {
			$errstr .= "exec " . tr("OK_BTN") . "\r\n";
		} else {
			$errstr .= "exec " . tr("NOT_FOUND") . "\r\n";
		}
		$errstr .= "============================================================\r\n";
		$errstr .= date("d M Y") . "\r\n";
		$errstr .= "Started at " . date("Y-m-d H:i:s") . "\r\n";
		$errstr .= "N° \t Date \t\t Time \t\t Status \t\t Recipient  \r\n";
		$errstr .= "------------------------------------------------------------\r\n";
		if (!$dontlog) {
			fwrite($handler, $errstr, strlen($errstr));
			fclose($handler);
		}
		fwrite($daylog, $errstr, strlen($errstr));
		fclose($daylog);
		DelMsgTemp($cnx, $list_id, $row_config_globale['table_sauvegarde']);
		echo json_encode(array(
			'step' => 'send',
			'error' => 0,
			'begin' => 0,
			'list_id' => (($list_id) + 0),
			'msg_id' => (($msg_id) + 0),
			'encode' => $encode,
			'sn' => (($num) + 0),
			'token' => $token,
			'pct' => 0,
			'force' => $force
		));
		break;
}
send_preview.php
wget 'https://lists2.roe3.org/pmnl3/send_preview.php'
View Content
<?php
header('Access-Control-Allow-Origin: *');
header('Cache-Control: no-cache, must-revalidate');
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
header('Content-type: application/json');
if(!file_exists("include/config.php")) {
	header("Location:install.php");
	exit;
} else {
	session_start();
	include("_loader.php");
	if (file_exists("include/config_bounce.php")) {
		include("include/config_bounce.php");
	}
	if (isset($_POST['token'])) {
		$token = $_POST['token'];
	} elseif (isset($_GET['token'])) {
		$token = $_GET['token'];
	} else {
		$token = '';
	}
	if (!tok_val($token)) {
		quick_Exit();
		die();
	}
}
$row_config_globale = $cnx->SqlRow("SELECT * FROM $table_global_config");
(count($row_config_globale)>0)?$r='SUCCESS':$r='';
if($r != 'SUCCESS') {
	include("include/lang/english.php");
	echo "<div class='error'>".tr($r)."<br>";
	echo "</div>";
	exit;
}
if(empty($row_config_globale['language']))$row_config_globale['language']="english";
include("include/lang/".$row_config_globale['language'].".php");
require 'include/lib/PHPMailerAutoload.php';
$step    = (empty($_GET['step']) ? "" : $_GET['step']);
$subject = (!empty($_POST['subject'])) ? $_POST['subject'] : '';
$message = (!empty($_POST['message'])) ? $_POST['message'] : '';
$format  = (!empty($_POST['format'])) ? $_POST['format'] : '';
$list_id = (!empty($_POST['list_id'])) ? $_POST['list_id'] : '';
$list_id = (!empty($_GET['list_id']) && empty($list_id)) ? $_GET['list_id'] : $list_id;
$begin   = (!empty($_POST['begin'])) ? $_POST['begin'] : '';
$begin   = (!empty($_GET['begin']) && empty($begin)) ? $_GET['begin'] : 0;
$msg_id  = (!empty($_GET['msg_id'])) ? $_GET['msg_id'] : '';
$error   = (!empty($_GET['error'])) ? $_GET['error'] : '';
$encode  = (!empty($_GET['encode'])&&$_GET['encode']=='base64')  ? 'base64' : '8bit';
$tPath = ($row_config_globale['path'] == '' ? '/' : '/'.$row_config_globale['path']);
$tPath = str_replace('//','/',$tPath);
if($row_config_globale['sending_method']=='lbsmtp'){
	$cnx->query("UPDATE ".$row_config_globale['table_smtp']."
		SET smtp_date_update=NOW(),smtp_used=0
			WHERE smtp_date_update < DATE_SUB(CURDATE(), INTERVAL 1 DAY)");
	$daylog = @fopen('logs/daylog-' . date("Y-m-d") . '.txt', 'a+');
	$date    = date("Y-m-d H:i:s");
	$daylogmsg=$date. " : RAZ compteurs load_balancing SMTP\n";
	fwrite($daylog, $daylogmsg, strlen($daylogmsg));
	fclose($daylog);
}
switch ($step) {
	case "sendpreview":
		$mail			= new PHPMailer;
		$mail->SMTPOptions 	= array(
			'ssl' => array(
				'verify_peer' => false,
				'verify_peer_name' => false,
				'allow_self_signed' => true
			)
		);
		$mail->CharSet		= $row_config_globale['charset'];
		$mail->ContentType	="text/html";
		$mail->Encoding 	= "quoted-printable";
		$mail->PluginDir	= "include/lib/";
		$msg			= getConfig($cnx,$list_id,$row_config_globale['table_sauvegarde']);
		$newsletter		= getConfigSender($cnx, $row_config_globale['table_senders'], $msg['sender_email']);
		$sender_email		= $newsletter['email'];
		$sender_name		= $newsletter['name_organisation'];
		$reply_email		= $newsletter['email_reply'];
		$altersender		= getConfig($cnx, $list_id, $row_config_globale['table_listsconfig']);
		if (empty($sender_email)) {
			$sender_email	= $altersender['from_addr'];
			$sender_name	= $altersender['from_name'];
			$reply_email	= $altersender['from_addr'];
		}
		// recherche du mail de bounce (retour des non distribués), du particulier au général, sinon, par défaut : $bounce_mail
		if (empty(trim($newsletter['bounce_email']))) { 		// from array $newsletter : particular desc
			if (empty(trim($bounce_mail))) { 			// from config_bounce.php : global desc
				$bounce_email = $altersender['from_addr'];	// from array $altersender : default desc
			} else {
				$bounce_email = $bounce_mail;
			}
		} else {
			$bounce_email = $newsletter['bounce_email'];
		}
		$mail->AddReplyTo($reply_email);		
		$mail->SetFrom($sender_email,$sender_name);
		$mail->Sender 	= $bounce_email;
		$addr = $dest_adresse = $altersender['preview_addr'];
		include("include/lib/switch_smtp.php");
		$format			= $msg['type'];
		$list_pj = $cnx->query("SELECT *
			FROM ".$row_config_globale['table_upload']."
				WHERE list_id=$list_id
				AND msg_id=0
			ORDER BY id ASC")->fetchAll(PDO::FETCH_ASSOC);
		if(count($list_pj)>0){
			foreach  ($list_pj as $item) {
				$mail->AddAttachment('upload/'.$item['name']);
			}
		}
		if(empty($message)){
			$message    = stripslashes($msg['textarea']);
		}
		$to_replace	= array("  ","\t","\n","\r","\0","\x0B","\xA0");
		$message	= str_replace( $to_replace , " " , $message );
		if(empty($subject)){
			$subject= stripslashes($msg['subject']);
		}
		$subject = $subject.' ('.tr("MAIL_PREVIEW_SEND").')';
		if (strpos($message, '</style>') === false) {
			$message = '<style type="text/css"></style>' . $message;
		}
		if (strpos($message, '</title>') === false) {
			$message = '<title>[[SUBJECT]]</title>' . $message;
		} elseif (strpos($message, '<title>[[SUBJECT]]</title>') === false && strpos($message, '<title>') !== false) {
			$message = preg_replace("/<title>(.*)<\/title>/","",$message,1);
			$message = '<title>[[SUBJECT]]</title>' . $message;
		}
		$header        = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!--[if IE]>	
	<html xmlns="http://www.w3.org/1999/xhtml">
<![endif]-->
<!--[if !IE]>
<!-->
	<html style="margin: 0;padding: 0;" xmlns=3D"http://www.w3.org/1999/xhtml">
<!--<![endif]-->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" />
<!--[if !mso]><!-->
	<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<!--<![endif]-->
<meta name="x-apple-disable-message-reformatting" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="description" content="' . $subject . '" />';
		$message       = str_replace('<title>[[SUBJECT]]</title>', $header.'<title>' . $subject . '</title>', $message);
		$preHeaderDesc = stripslashes($msg['preheader']);
		$preHeader     = "<div class='preHeader' align='center' 
		style='font-size:8px;font-family:arial,helvetica,sans-serif;padding-bottom:5px;color:#878e83;'>" . $preHeaderDesc . "</div>";
		$message       = str_replace('</style>', ' .preHeader {display:none!important;}</style></head><body>'.$preHeader, $message);
		$message       = str_replace("  ", " ", $message);
		if ( $format == "html" ){
			$mail->IsHTML(true);
		}
		$mail->WordWrap = 76;
		if (file_exists("include/DKIM/DKIM_config.php")&&($row_config_globale['sending_method']=='smtp'||$row_config_globale['sending_method']=='php_mail')) {
			include("include/DKIM/DKIM_config.php");
			$mail->DKIM_domain     = $DKIM_domain;
			$mail->DKIM_private    = $DKIM_private;
			$mail->DKIM_selector   = $DKIM_selector;
			$mail->DKIM_passphrase = $DKIM_passphrase;
			$mail->DKIM_identity   = $DKIM_identity;
		}
		$unsubLink = "";
		$mail->ClearAllRecipients();
		$mail->ClearCustomHeaders();
		$mail->ClearAddresses();
		$mail->ClearCCs();
		$mail->ClearBCCs();
		if(isset($code_mailtester) && $code_mailtester!='') {
			$mail->AddAddress($code_mailtester.'@mail-tester.com');
		}
		$mail->AddAddress($addr);
		$mail->XMailer = ' ';
		$mail->addCustomHeader("List-Unsubscribe",'<'. $row_config_globale['base_url'] . $tPath . 'subscription.php?i=' . $msg_id . '&list_id='
			. $list_id . '&op=leave&email_addr=' . $addr . '&h=fake_hash>'
			. ( $sender_email != '' ? ', <mailto:' . $sender_email . '?subject=unsubscribe>' : '' )
		);
		$body = "";
		if ( $row_config_globale['active_tracking'] == '1' ) {
			$trac = "<img style='border:0' src='".$row_config_globale['base_url'] . $tPath 
				. "trc.php?i=" .$msg_id. "&h=fake_hash' alt='' width='1'  height='1' />";
		} else {
			$trac = "";
		}
		if ( $format == "html" ){
			if ( $row_config_globale['active_tracking'] == '1' ) {
				$new_url = 'href="' . $row_config_globale['base_url'] . $tPath . 'r.php?m=' . $msg_id . '&h=fake_hash&l=' . $list_id . '&r=';
				$message = preg_replace_callback( '/href="(http[s]?:\/\/)([^"]+)"/', function($matches) {
						global $new_url;
						return $new_url . (urlencode(@$matches[1] . $matches[2])) . '"';
				},$message);
			}
			if (strpos($message, '</body>') !== false) {
				$message = str_replace('</body>', '', $message);
				$message = str_replace('</html>', '', $message);
			}
			$headtrc = "<hr noshade='' color='#D4D4D4' width='90%' size='1'>"
				. "<div align='center' style='font-size:12px;font-family:arial,helvetica,sans-serif;padding-bottom:5px;color:#878e83;'>"
				. tr("READ_ON_LINE", "<a href='" . $row_config_globale['base_url'] . $tPath . "online.php?i=$msg_id&list_id=$list_id&email_addr="
				. $addr . "&h=fake_hash'>") . "<br />"
				. tr("ADD_ADRESS_BOOK", $sender_email) . "<br />";
			$unsubLink = $headtrc . tr("UNSUBSCRIBE_LINK", "<a href='" . $row_config_globale['base_url'] . $tPath
				. "subscription.php?i=$msg_id&list_id=$list_id&op=leave&email_addr=" . $addr
				. "&h=fake_hash' style='' target='_blank'>")
				. $trac
				. "</div></body></html>";
		} else {
			$body .= tr("READ_ON_LINE", "<a href='".$row_config_globale['base_url'].$tPath
				  ."online.php?i=$msg_id&list_id=$list_id&email_addr=".$addr."&h=fake_hash'>")."<br />";
			$body .= tr("ADD_ADRESS_BOOK", $newsletter['from_addr'])."<br />";
			$unsubLink = $row_config_globale['base_url'] . $tPath . "subscription.php?i=" .$msg_id. "&list_id=$list_id&op=leave&email_addr=" . urlencode($addr)."&h=fake_hash";
		}

		$subject = (strtoupper($row_config_globale['charset']) == "UTF-8" ? $subject : iconv("UTF-8", $row_config_globale['charset'], $subject));
		$body .= $message . $unsubLink ;
		$mail->Subject = $subject;
		$htmlMsg = "";
		$lines = explode("\n", $body);
		foreach ($lines as $line) $htmlMsg .= trim($line)."\n";
		$mail->MsgHTML($htmlMsg);
		if($_SESSION['dr_log']=='Y') {
			loggit($_SESSION['dr_id_user'].'.log', $_SESSION['dr_id_user'] . ' a envoyé une preview de la campagne "'.$subject.'" à "'.$addr.'"');
		}
		@set_time_limit(150);
		if( $type_env=='dev' ) { 
			$mail->SMTPDebug  = 2;
		}
		if (!$mail->Send()) {
			die(tr("ERROR_SENDING"));
		}elseif($type_env=='prod'){
			if(!isset($dontlog)) $dontlog='';
			header("location:index.php?page=compose&op=send_preview&error=$error&list_id=$list_id&errorlog=$dontlog&token=$token&encode=$encode");
		}
		break;
	default:
		if(!isset($num)) $num='';
		header("location:send_preview.php?step=sendpreview&begin=0&list_id=$list_id&msg_id=$msg_id&error=0&token=$token&encode=$encode");
		break;
}

subscription.php
wget 'https://lists2.roe3.org/pmnl3/subscription.php'
View Content
<?php
session_start();
include( "_loader.php" );
$row_config_globale = $cnx->SqlRow( "SELECT * FROM $table_global_config" );
include( "include/lang/" . $row_config_globale[ 'language' ] . ".php" );
$list_id    = ( !empty( $_POST[ 'list_id' ] ) ? $_POST[ 'list_id' ] : "" );
$list_id    = ( empty( $list_id ) && !empty( $_GET[ 'list_id' ] ) ? $_GET[ 'list_id' ] : $list_id );
$email_addr = ( !empty( $_POST[ 'email_addr' ] ) ? $_POST[ 'email_addr' ] : "" );
$email_addr = ( empty( $email_addr ) && !empty( $_GET[ 'email_addr' ] ) ? $_GET[ 'email_addr' ] : $email_addr );
$op         = ( !empty( $_POST[ 'op' ] ) ? $_POST[ 'op' ] : "" );
$op         = ( empty( $op ) && !empty( $_GET[ 'op' ] ) ? $_GET[ 'op' ] : $op );
$hash       = ( !empty( $_POST[ 'hash' ] ) ? $_POST[ 'hash' ] : "" );
$hash       = ( empty( $hash ) && !empty( $_GET[ 'hash' ] ) ? $_GET[ 'hash' ] : $hash );
$i          = ( !empty( $_POST[ 'i' ] ) ? $_POST[ 'i' ] : "" );
$i          = ( empty( $i ) && !empty( $_GET[ 'i' ] ) ? $_GET[ 'i' ] : "" );
$h          = ( !empty( $_POST[ 'h' ] ) ? $_POST[ 'h' ] : "" );
$h          = ( empty( $h ) && !empty( $_GET[ 'h' ] ) ? $_GET[ 'h' ] : "" );
if ( $op == "leave" && !$row_config_globale[ 'unsub_validation' ] ) {
	$op = "leave_direct";
} else if ( $op == "leave_direct" && $row_config_globale[ 'unsub_validation' ] ) {
	$op = "leave";
} else if ( $op == "join" && !$row_config_globale[ 'sub_validation' ] ) {
	$op = "join_direct";
} else if ( $op == "join_direct" && $row_config_globale[ 'sub_validation' ] ) {
	$op = "join";
}
$news = getConfig( $cnx, $list_id, $row_config_globale[ 'table_listsconfig' ] );
require( 'include/lib/PHPMailerAutoload.php' );
$tPath        = ($row_config_globale['path'] == '' ? '/' : '/'.$row_config_globale['path']);
$tPath        = str_replace('//','/',$tPath);
?>
<!DOCTYPE HTML>
<html lang="<?php echo tr( "LN" ); ?>">
	<head>
		<meta charset="utf-8" />
		<title><?php  echo tr( "NEWSLETTER_TITLE" ); ?></title>
		<meta name="viewport" content="width=device-width, initial-scale=1.0">
		<script src="js/wysiwyg/jquery-1.10.2.min.js"></script>
		<script src="js/wysiwyg/jquery-ui.js"></script>
		<script src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
		<link href="//code.jquery.com/ui/1.12.0/themes/redmond/jquery-ui.css" rel="stylesheet" media="screen">
		<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous" rel="stylesheet">
		<!-- Latest compiled and minified CSS -->
		<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-select/1.12.2/css/bootstrap-select.min.css">
		<!-- Latest compiled and minified JavaScript -->
		<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-select/1.12.2/js/bootstrap-select.min.js"></script>
		<!-- (Optional) Latest compiled and minified JavaScript translation files -->
		<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-select/1.12.2/js/i18n/defaults-<?php echo tr("I18N_LNG");?>.min.js"></script>
		<!--[if lt IE 9]>
			<script src="//oss.maxcdn.com/libs/html5shiv/3.7.3/html5shiv.js"></script>
			<script src="//oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
		<![endif]-->
	</head>
	<body>
		<div class="container-fluid">
			<div class="col-md-12">
			<?php 
			if ( isset( $list_id ) && !empty( $list_id ) && isValidNewsletter( $cnx, $row_config_globale[ 'table_listsconfig' ], $list_id ) && isset( $email_addr ) ) {
				if ( !validEmailAddress( $email_addr ) ) {
					echo '<header><h4>' . tr( "SUBSCRIPTION_TITLE" ) . '</h4></header>';
					echo "<h4 class='alert alert-danger'>" . tr( "EMAIL_ADDRESS_NOT_VALID" ) . "</div>";
					exit( );
				}
				switch ( $op ) {
					case "join":
						echo '<header><h4>' . tr( "SUBSCRIPTION_TITLE" ) . '</h4></header>';
						$c = ( empty( $c ) && !empty( $_POST[ 'c' ] ) ? $_POST[ 'c' ] : "" );
						if ( empty( $c ) || ( $_POST[ 'c' ] != $_SESSION[ 'c' ] ) ) {
							$_SESSION[ 'new_sub' ] = $email_addr;
							echo '<form method="post" action="">
								<div class="row">' . tr( "SUBSCRIPTION_CAPTCHA" ) . '
									<div class="col-md-6">
										<img src="c.php" />
									</div>
									<div class="col-md-6">
										<input type="text" name="c" value="" />
									</div>
								</div>
								<div class="row">
									<div class="col-md-12 text-center">
										<input type="hidden" name="email_addr" value="' . $email_addr . '" />
										<input type="hidden" name="list_id" value="' . $list_id . '" />
										<input type="hidden" name="op" value="join" />
										<input class="btn btn-success" type="submit" value="' . tr( "OK_BTN" ) . '">
									</div>
								</div>
							</form>';
						} elseif ( $_POST[ 'c' ] == $_SESSION[ 'c' ] ) {
							if ( $row_config_globale[ 'mod_sub' ] == "0" ) {
								$add = addSubscriberTemp( $cnx, $row_config_globale[ 'table_email' ], $row_config_globale[ 'table_temp' ], $list_id, $email_addr );
								if ( strlen( $add ) > 3 ) {
									$body = $news[ 'subscription_body' ];
									$body .= "\n\n" . tr( "SUBSCRIPTION_MAIL_BODY" ) . ":\n";
									$body .= "<a href='" . $row_config_globale[ 'base_url' ] . $tPath . "subscription.php?op=confirm_join&email_addr=" . urlencode( $email_addr ) 
										. "&hash=$add&list_id=$list_id'>" . tr( "SUBSCRIPTION_I_SUB" ) . "</a>";
									$subj = ( strtoupper( $row_config_globale[ 'charset' ] ) == "UTF-8" 
										? $news[ 'subscription_subject' ] 
										: iconv( "UTF-8", $row_config_globale[ 'charset' ], $news[ 'subscription_subject' ] ) );
									$body = ( strtoupper( $row_config_globale[ 'charset' ] ) == "UTF-8" ? $body : iconv( "UTF-8", $row_config_globale[ 'charset' ], $body ) );
									if ( $row_config_globale[ 'sending_method' ] == 'lbsmtp' ) {
										$info_smtp_lb = $cnx->SqlRow( "SELECT * 
											FROM " . $row_config_globale[ 'table_smtp' ] . " 
												WHERE smtp_used < smtp_limite
													AND smtp_date_update > DATE_SUB(CURDATE(), INTERVAL 1 DAY)
											ORDER BY id_use ASC LIMIT 1" );
										if ( $info_smtp_lb[ 'smtp_user' ] != '' && $info_smtp_lb[ 'smtp_pass' ] != '' ) {
											$auth = 1;
										} else {
											$auth = 0;
										}
										sendEmail( 'lbsmtp', $email_addr, $news[ 'from_addr' ], $news[ 'from_name' ], $subj, $body, $auth, 
											$info_smtp_lb[ 'smtp_url' ], $info_smtp_lb[ 'smtp_user' ], $info_smtp_lb[ 'smtp_pass' ], 
											$row_config_globale[ 'charset' ], $info_smtp_lb[ 'smtp_secure' ], $info_smtp_lb[ 'smtp_port' ] );
										$cnx->query( 'UPDATE ' . $row_config_globale[ 'table_smtp' ] . ' 
												SET smtp_used=smtp_used+1, id_use=' . ( intval( $CURRENT_ID ) + 1 ) . '
											 WHERE smtp_id=' . $info_smtp_lb[ 'smtp_id' ] );
									} else {
										sendEmail( $row_config_globale[ 'sending_method' ], $email_addr, $news[ 'from_addr' ], 
											$news[ 'from_name' ], $subj, $body, $row_config_globale[ 'smtp_auth' ], $row_config_globale[ 'smtp_host' ], 
											$row_config_globale[ 'smtp_login' ], $row_config_globale[ 'smtp_pass' ], $row_config_globale[ 'charset' ] );
									}
									echo "<h4 class='alert alert-success'>" . tr( "SUBSCRIPTION_SEND_CONFIRM_MESSAGE" ) . "</h4>";
								} elseif ( $add == 0 )
									echo "<h4 class='alert alert-danger'>" . tr( "SUBSCRIPTION_ALREADY_SUBSCRIBER" ) . "</h4>";
								else
									echo "<h4 class='alert alert-danger'>" . tr( "ERROR_SQL2" ) . "</h4>";
							} elseif ( $row_config_globale[ 'mod_sub' ] == "1" ) {
								$add = addSubscriberMod( $cnx, $row_config_globale[ 'table_email' ], $row_config_globale[ 'table_sub' ], $list_id, $email_addr );
								if ( $add )
									echo "<h4 class='alert alert-success'>" . tr( "SUBSCRIPTION_WAITING_MODERATION" ) . "</h4>";
								else if ( $add == 0 )
									echo "<h4 class='alert alert-danger'>" . tr( "SUBSCRIPTION_ALREADY_SUBSCRIBER" ) . "</h4>";
								else
									echo "<h4 class='alert alert-danger'>" . tr( "ERROR_SQL2" ) . "</h4>";
							}
							echo '<h4 class="alert alert-info">' . tr( "CLOSE_WINDOW" ) . '</h4>';
							
						}
						break;
					case "leave":
						echo '<header><h4>' . tr( "UNSUBSCRIPTION_TITLE" ) . '</h4></header>';
						$hash = isValidSubscriber( $cnx, $row_config_globale[ 'table_email' ], $list_id, $email_addr );
						if ( $hash == $h && !empty( $hash ) && strlen( $hash ) == 32 ) {
							$body = $news[ 'quit_body' ];
							$body .= "\n\n" . tr( "UNSUBSCRIPTION_MAIL_BODY" ) . " :\n";
							$body .= "<a href='" . $row_config_globale[ 'base_url' ] . $tPath . "subscription.php?op=confirm_leave&email_addr="
								 . urlencode( $email_addr ) . "&hash=$hash&list_id=$list_id&i=$i'>" . tr( "SUBSCRIPTION_UN_SUB" ) . "</a>";
							$subj = ( strtoupper( $row_config_globale[ 'charset' ] ) == "UTF-8" 
								? $news[ 'quit_subject' ] 
								: iconv( "UTF-8", $row_config_globale[ 'charset' ], $news[ 'quit_subject' ] ) );
							$body = ( strtoupper( $row_config_globale[ 'charset' ] ) == "UTF-8" 
								? $body 
								: iconv( "UTF-8", $row_config_globale[ 'charset' ], $body ) );
							if ( sendEmail( $row_config_globale[ 'sending_method' ], $email_addr, $news[ 'from_addr' ], $news[ 'from_name' ], 
								$subj, $body, $row_config_globale[ 'smtp_auth' ], $row_config_globale[ 'smtp_host' ], 
								$row_config_globale[ 'smtp_login' ], $row_config_globale[ 'smtp_pass' ], $row_config_globale[ 'charset' ] ) ) {
								echo "<h4 class='alert alert-success'>" . tr( "UNSUBSCRIPTION_SEND_CONFIRM_MESSAGE" ) . "</h4>";
							} else {
								echo "<h4 class='alert alert-danger'>" . tr( "ERROR_SENDING_CONFIRM_MAIL" ) . "</h4>";
							}
						} else {
							echo "<h4 class='alert alert-danger'>" . tr( "SUBSCRIPTION_NOT_A__SUBSCRIBER" ) . "</h4>";
						}
						echo '<h4 class="alert alert-info">' . tr( "CLOSE_WINDOW" ) . '</h4>';
						
						break;
					case "confirm_join":
						echo '<header><h4>' . tr( "SUBSCRIPTION_TITLE" ) . '</h4></header>';
						$add = addSubscriber( $cnx, $row_config_globale[ 'table_email' ], $row_config_globale[ 'table_temp' ], $list_id, $email_addr, $hash, 
							$row_config_globale[ 'table_email_deleted' ] );
						if ( $add == false ) {
							echo "<h4 class='alert alert-danger'>" . tr( "SUBSCRIPTION_UNKNOWN_EMAIL_ADDRESS" ) . "! </h4>";
						} elseif ( $add == true ) {
							$body = $news[ 'welcome_body' ];
							$body .= "\n\n" . tr( "SUBSCRIPTION_UNSUBSCRIBE_LINK" ) . ":\n";
							$body .= "<a href='" . $row_config_globale[ 'base_url' ] . $tPath . "subscription.php?op=confirm_leave&email_addr=" 
								. urlencode( $email_addr ) . "&hash=$hash&list_id=$list_id'>" . tr( "SUBSCRIPTION_AGREE_UN_SUB" ) . "</a>";
							$subj = ( strtoupper( $row_config_globale[ 'charset' ] ) == "UTF-8" 
								? $news[ 'welcome_subject' ] 
								: iconv( "UTF-8", $row_config_globale[ 'charset' ], $news[ 'welcome_subject' ] ) );
							$body = ( strtoupper( $row_config_globale[ 'charset' ] ) == "UTF-8" 
								? $body 
								: iconv( "UTF-8", $row_config_globale[ 'charset' ], $body ) );
							sendEmail( $row_config_globale[ 'sending_method' ], $email_addr, $news[ 'from_addr' ], $news[ 'from_name' ], $subj, $body,
								 $row_config_globale[ 'smtp_auth' ], $row_config_globale[ 'smtp_host' ], $row_config_globale[ 'smtp_login' ], 
								 $row_config_globale[ 'smtp_pass' ], $row_config_globale[ 'charset' ] );
							echo "<h4 class='alert alert-success'>" . tr( "SUBSCRIPTION_FINISHED" ) . "</h4>";
							if ( $row_config_globale[ 'alert_sub' ] == 1 ) {
								$rapport_sujet = tr( "SUBSCRIPTION_TITLE" );
								$subj          = ( strtoupper( $row_config_globale[ 'charset' ] ) == "UTF-8" ? $rapport_sujet 
									: iconv( "UTF-8", $row_config_globale[ 'charset' ], $rapport_sujet ) );
								$rapport       = '<br /><br /><br /><br /><br />
									<table style="height: 217px; margin-left: auto; margin-right: auto;" width="660">
									<tbody>
									<tr><td style="text-align: center;" colspan="2"><span style="color: #2446a2;font-size: 14pt;">
										<img src="https://www.phpmynewsletter.com/css/images/phpmynewsletter_v2.png" alt="" width="123" height="72" />
										<br />' . tr( "SUBSCRIPTION_TITLE" ) . ' !</td></tr>
									<tr><td><span style="color: #2446a2;">' . tr( "LIST_NUMBER" ) . ' :</span></td>
										<td><span style="color: #2446a2;">' . $list_id . '</span></td></tr>
									<tr><td><span style="color: #2446a2;">' . tr( "EMAIL_ADDRESS" ) . ' :</span></td>
										<td><span style="color: #2446a2;">' . $email_addr . '</td></tr>
									</tbody>
									</table>';
								sendEmail( $row_config_globale[ 'sending_method' ], $row_config_globale[ 'admin_email' ], $row_config_globale[ 'admin_email' ], 
									$row_config_globale[ 'admin_name' ], $subj, $rapport, $row_config_globale[ 'smtp_auth' ], $row_config_globale[ 'smtp_host' ], 
									$row_config_globale[ 'smtp_login' ], $row_config_globale[ 'smtp_pass' ], $row_config_globale[ 'charset' ] );
							}
							if ( $sub_validation_sms == 1 )
								send_sms( $free_id, $free_pass, "Un nouvel abonné sur la liste $list_id : $email_addr. Bonne journée ;-)" );
						} else {
							echo "<h4 class='alert alert-danger'>" . tr( "ERROR_UNKNOWN" ) . "</h4>";
						}
						echo '<h4 class="alert alert-info">' . tr( "CLOSE_WINDOW" ) . '</h4>';
						
						break;
					case "confirm_leave":
						echo '<header><h4>' . tr( "UNSUBSCRIPTION_TITLE" ) . '</h4></header>';
						$rm = removeSubscriber( $cnx, $row_config_globale[ 'table_email' ], $row_config_globale[ 'table_send' ], $list_id, $email_addr, 
							$hash, $i, $row_config_globale[ 'table_email_deleted' ] );
						if ( !$row_config_globale[ 'unsub_validation' ] ) {
							sendEmail( $row_config_globale[ 'sending_method' ], $news[ 'from_addr' ], $news[ 'from_addr' ], $news[ 'from_name' ], 'Désinscription', 
								'Liste : ' . $list_id . '<br />Désinscrit : ' . $email_addr, $row_config_globale[ 'smtp_auth' ], $row_config_globale[ 'smtp_host' ], 
								$row_config_globale[ 'smtp_login' ], $row_config_globale[ 'smtp_pass' ], $row_config_globale[ 'charset' ] );
						}
						if ( $unsub_validation_sms == 1 )
							send_sms( $free_id, $free_pass, "Une désinscription sur la liste $list_id : $email_addr. Bonne journée ;-)" );
						if ( $rm == 1 ) {
							echo "<h4 class='alert alert-success'>" . tr( "UNSUBSCRIPTION_FINISHED" ) . ".</h4>";
						} else if ( $rm == -1 ) {
							echo "<h4 class='alert alert-danger'>" . tr( "UNSUBSCRIPTION_UNKNOWN_EMAIL_ADDRESS" ) . "</h4>";
						} else {
							echo "<h4 class='alert alert-danger'>" . tr( "ERROR_UNKNOWN" ) . "</h4>";
						}
						echo '<h4 class="alert alert-info">' . tr( "CLOSE_WINDOW" ) . '</h4>';
						
						break;
					case "join_direct":
						echo '<header><h4>' . tr( "SUBSCRIPTION_TITLE" ) . '</h4></header>';
						if ( !$row_config_globale[ 'sub_validation' ] ) {
							$add = addSubscriberDirect( $cnx, $row_config_globale[ 'table_email' ], $list_id, $email_addr, 
								$row_config_globale[ 'table_email_deleted' ] );
							if ( $add ) {
								$body = $news[ 'welcome_body' ];
								$body .= "\n\n" . tr( "UNSUBSCRIPTION_MAIL_BODY" ) . ":\n";
								$body .= "<a href='" . $row_config_globale[ 'base_url' ] . $tPath . "subscription.php?op=confirm_leave&email_addr=" 
									. urlencode( $email_addr ) . "&hash=$add&list_id=$list_id'>" . tr( "SUBSCRIPTION_UN_SUB" ) . "</a>";
								$subj = ( strtoupper( $row_config_globale[ 'charset' ] ) == "UTF-8" 
									? $news[ 'welcome_subject' ] 
									: iconv( "UTF-8", $row_config_globale[ 'charset' ], $news[ 'welcome_subject' ] ) );
								$body = ( strtoupper( $row_config_globale[ 'charset' ] ) == "UTF-8" 
									? $body 
									: iconv( "UTF-8", $row_config_globale[ 'charset' ], $body ) );
								sendEmail( $row_config_globale[ 'sending_method' ], $email_addr, $news[ 'from_addr' ], $news[ 'from_name' ], 
									$subj, $body, $row_config_globale[ 'smtp_auth' ], $row_config_globale[ 'smtp_host' ], $row_config_globale[ 'smtp_login' ],
									$row_config_globale[ 'smtp_pass' ], $row_config_globale[ 'charset' ] );
								if ( $row_config_globale[ 'alert_sub' ] == 1 ) {
									$rapport_sujet = tr( "SUBSCRIPTION_TITLE" );
									$subj          = ( strtoupper( $row_config_globale[ 'charset' ] ) == "UTF-8" ? $rapport_sujet 
										: iconv( "UTF-8", $row_config_globale[ 'charset' ], $rapport_sujet ) );
									$rapport       = '<br /><br /><br /><br /><br />
										<table style="height: 217px; margin-left: auto; margin-right: auto;" width="660">
										<tbody>
										<tr><td style="text-align: center;" colspan="2"><span style="color: #2446a2;font-size: 14pt;">
											<img src="https://www.phpmynewsletter.com/css/images/phpmynewsletter_v2.png" 
											alt="" width="123" height="72" /><br />' 
											. tr( "SUBSCRIPTION_TITLE" ) . ' !</td></tr>
										<tr><td><span style="color: #2446a2;">' . tr( "LIST_NUMBER" ) . ' :</span></td>
											<td><span style="color: #2446a2;">' . $list_id . '</span></td></tr>
										<tr><td><span style="color: #2446a2;">' . tr( "EMAIL_ADDRESS" ) . ' :</span></td>
											<td><span style="color: #2446a2;">' . $email_addr . '</td></tr>
										</tbody>
										</table>';
									sendEmail( $row_config_globale[ 'sending_method' ], $row_config_globale[ 'admin_email' ], 
										$row_config_globale[ 'admin_email' ], $row_config_globale[ 'admin_name' ], 
										$subj, $rapport, $row_config_globale[ 'smtp_auth' ], $row_config_globale[ 'smtp_host' ], 
										$row_config_globale[ 'smtp_login' ], $row_config_globale[ 'smtp_pass' ], 
										$row_config_globale[ 'charset' ] );
								}
								if ( $sub_validation_sms == 1 )
									send_sms( $free_id, $free_pass, "Un nouvel abonné sur la liste " . $list_id . " : " 
									. $email_addr . ". Bonne journée ;-)" );
								echo "<h4 class='alert alert-success'>" . tr( "SUBSCRIPTION_FINISHED" ) . "</h4>";
							} else {
								echo "<h4 class='alert alert-danger'>" . tr( "SUBSCRIPTION_ALREADY_SUBSCRIBER" ) . "</h4>";
							}
						}
						echo '<h4 class="alert alert-info">' . tr( "CLOSE_WINDOW" ) . '</h4>';
						
						break;
					case "leave_direct":
						echo '<header><h4>' . tr( "UNSUBSCRIPTION_TITLE" ) . '</h4></header>';
						if ( !$row_config_globale[ 'unsub_validation' ] ) {
							$rm = removeSubscriberDirect( $cnx, $row_config_globale[ 'table_email' ], $row_config_globale[ 'table_send' ], $list_id, $email_addr, 
								$h, $i, $row_config_globale[ 'table_email_deleted' ] );
							sendEmail( $row_config_globale[ 'sending_method' ], $news[ 'from_addr' ], $news[ 'from_addr' ], 
								$news[ 'from_name' ], 'Désinscription', 'Liste : ' . $list_id . '<br />Désinscrit : ' 
								. $email_addr, $row_config_globale[ 'smtp_auth' ], 
								$row_config_globale[ 'smtp_host' ], $row_config_globale[ 'smtp_login' ], 
								$row_config_globale[ 'smtp_pass' ], $row_config_globale[ 'charset' ] );
							if ( $rm ) {
								echo "<h4 class='alert alert-success'>" . tr( "UNSUBSCRIPTION_FINISHED" ) . ".</h4>";
							} else if ( $rm == -1 ) {
								echo "<h4 class='alert alert-danger'>" . tr( "UNSUBSCRIPTION_UNKNOWN_EMAIL_ADDRESS" ) . "</h4>";
							} else {
								echo "<h4 class='alert alert-danger'>" . tr( "ERROR_UNKNOWN" ) . "</h4>";
							}
						}
						if ( $unsub_validation_sms == 1 )
							send_sms( $free_id, $free_pass, "Une désinscription sur la liste " . $list_id 
							. " : " . $email_addr . ". Bonne journée" );
						echo '<h4 class="alert alert-info">' . tr( "CLOSE_WINDOW" ) . '</h4>';
						break;
					default:
						echo '<h4 class="alert alert-info">' . tr( "CLOSE_WINDOW" ) . '</h4>';
						break;
				}
			}
			?>
			</div>
		</div>
	</body>
</html>
tracklinks.php
wget 'https://lists2.roe3.org/pmnl3/tracklinks.php'
View Content
<?php
if(!file_exists("include/config.php")) {
    header("Location:install.php");
    exit;
} else {
    include("_loader.php");
    if(isset($_POST['token'])){$token=$_POST['token'];}elseif(isset($_GET['token'])){$token=$_GET['token'];}else{$token='';}
    if(!tok_val($token)){
        header("Location:login.php?error=2");
        exit;
    }
}
$row_config_globale = $cnx->SqlRow("SELECT * FROM $table_global_config");
(count($row_config_globale)>0)?$r='SUCCESS':$r='';
if($r != 'SUCCESS') {
    include("include/lang/english.php");
    echo "<div class='error'>".tr($r)."<br>";
    echo "</div>";
    exit;
}
if(empty($row_config_globale['language']))$row_config_globale['language']="english";
include("include/lang/".$row_config_globale['language'].".php");
$id_mail = (!empty($_GET['id_mail'])) ? intval($_GET['id_mail']) : '';
$list_id = (!empty($_GET['list_id'])) ? intval($_GET['list_id']) : '';
if(empty($id_mail)&&empty($list_id)){
    header("Location:login.php?error=2");
    exit;
}
?>
<div class="modal-header"><button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button></div>
<div class="modal-body">
<script type="text/javascript">$(document).ready(function() { $(".tablesorter").tablesorter(); } );</script>
<script type="text/javascript" src="js/amcharts/pie.js"></script>
<script type="text/javascript" src="js/amcharts/themes/light.js"></script>
<script type="text/javascript" src="js/amcharts/themes/none.js"></script>
<header>
    <h4> <?php echo tr("CLICKED_LINK_REPORT");?></h4>
</header>
<?php
$count_clicked_links = $cnx->query("SELECT SUM(cpt) AS CPT 
                    FROM ".$row_config_globale['table_track_links']." 
                        WHERE list_id=$list_id 
                            AND msg_id=$id_mail 
                        ORDER BY CPT DESC")->fetch();
if($count_clicked_links['CPT']>0){
    echo '<table class="tablesorter table table-striped" cellspacing="0"> 
        <thead> 
            <tr>
                <th style="text-align:left">'.tr("CLICKED_LINK").'</th>
                <th style="text-align:right">'.tr("CLICKED_COUNT").'</th>
                <th style="text-align:right">%</th> 
            </tr> 
        </thead> 
        <tbody>';
    $links = $cnx->query("SELECT link,sum(cpt) AS CPT_PER_LINK
                    FROM ".$row_config_globale['table_track_links']." 
                        WHERE list_id=$list_id
                            AND msg_id=$id_mail
                        GROUP BY substr(link,1,25)
                            ORDER BY cpt DESC")->fetchAll(PDO::FETCH_ASSOC);
    $chart_data='';
    $datalinks = '';
    @(int)$cptlinks='';
    @(int)$totalAffiche = 0;
    foreach($links as $row){
        echo '<tr>';
        $percent = number_format(($row['CPT_PER_LINK']/$count_clicked_links['CPT']*100), 2, ',', '');
        $percentcss = number_format(($row['CPT_PER_LINK']/$count_clicked_links['CPT']*100),0, ',', '');
        (intval(strlen($row['link']))>30)?$clicked_link=substr($row['link'], 0, 30).'[...]':$clicked_link=$row['link'];
        echo '<td style="text-align:left">'. $row['link'] . '</td>';
        echo '<td style="text-align:right">'.$row['CPT_PER_LINK'].'</td>';
        echo '<td style="text-align:right">'. $percent . '%</td>';
        echo '</tr>';
        $cptlinks .= $row['CPT_PER_LINK'].',' ;
        $datalinks .= '"' . $clicked_link . '",';
    }
    ?></table>
    <header>
        <h4> <?php echo tr("CLICKED_LINK_REPORT_GRAPHIC");?></h4>
    </header>
    <div style="text-align:center; width:300px; height:150px;padding: 0; margin: auto; display: block;margin-bottom:20px;"><canvas id="DchartLinks"></canvas></div>
    <?php
} else {
    echo '<h4 class="alert alert-warning">'.tr("CLICKED_LINK_NO_LINK").'</h4>';
}
$count_open = $cnx->query("SELECT SUM(open_count) AS total 
                    FROM ".$row_config_globale['table_tracking']." 
                        WHERE subject=".$id_mail)->fetch();
$total = $count_open['total'];
$results_stat_browser = $cnx->query('SELECT DISTINCT(CONCAT(browser,\' \',SUBSTRING_INDEX(version,\'.\',1))) AS browser,
                    COALESCE(SUM(open_count),0) AS data
                FROM ' . $row_config_globale['table_tracking'] . ' 
                    WHERE subject='.$id_mail.' 
                       AND browser!=\'\'
                       AND version!=\'unknown\'
                       AND browser NOT IN (\'iPhone\',\'iPad\',\'Android\')
                GROUP BY CONCAT(browser,\' \',SUBSTRING_INDEX(version,\'.\',1))
                HAVING COUNT(*)>'.($total/100).'
                    ORDER BY data DESC;');
if (count($results_stat_browser) >0) {
    $databrowser = '';
    @(int)$cptbrowser = '';
    @(int)$totalAffiche = '';
    foreach ($results_stat_browser as $tab) {
        $cptbrowser .= $tab['data'] .',' ;
        $databrowser .= '"' . $tab['browser'] . ' ('.round(((int)$tab['data']/$total*100),2).'%) ",';
        @$totalAffiche = $totalAffiche+(int)$tab['data'];
    }
    
    if ( $total-$totalAffiche > 0 ) {
        $cptbrowser .= $total-$totalAffiche ;
        $databrowser .= '"Autres ('.round((( $total-$totalAffiche )/$total*100),2).'%) "';
    }
}
$results_stat_platform = $cnx->query('SELECT DISTINCT(platform) AS platform,
                                    COALESCE(SUM(open_count),0) AS data
                                FROM ' . $row_config_globale['table_tracking'] . ' 
                                    WHERE subject='.$id_mail.' 
                                       AND platform!=\'\' 
                                       AND platform!=\'unknown\'
                                GROUP BY platform
                                HAVING COUNT(*)>'.($total/100).'
                                    ORDER BY data DESC;');
if (count($results_stat_platform) >0) {
    $dataplatform = '';
    @(int)$cptplatform = '';
    @(int)$totalAffiche = '';
    foreach ($results_stat_platform as $tab) {
        $cptplatform .=  $tab['data'] . ',';
        $dataplatform .= '"' . $tab['platform'] . ' ('.round(((int)$tab['data']/$total*100),2).'%) ",';
        @$totalAffiche = $totalAffiche+(int)$tab['data'];
    }
    if ( $total-$totalAffiche > 0 ) {
        $cptplatform .= $total-$totalAffiche ;
        $dataplatform .= '"Autres ('.round((($total-$totalAffiche )/$total*100),2).'%) "';
    }
}
$results_stat_devicetype= $cnx->query('SELECT DISTINCT(devicetype) AS devicetype,
                            COALESCE(SUM(open_count),0) AS data
                        FROM ' . $row_config_globale['table_tracking'] . ' 
                            WHERE subject='.$id_mail.' 
                               AND devicetype!=\'\'
                        GROUP BY devicetype
                        HAVING COUNT(*)>'.($total/100).'
                            ORDER BY data DESC;'
                    );
if (count($results_stat_devicetype) >0) {
    $datadevicetype = '';
    @(int)$cptdevicetype='';
    @(int)$totalAffiche ='';
    foreach ($results_stat_devicetype as $tab) {
        $cptdevicetype .= $tab['data'] . ',';
        $datadevicetype .= '"' . $tab['devicetype'] . ' ('.round(((int)$tab['data']/$total*100),2).'%) ",';
        @$totalAffiche = $totalAffiche+(int)$tab['data'];
    }
    if ( $total-$totalAffiche > 0 ) {
        $cptdevicetype .= $total-$totalAffiche ;
        $datadevicetype .= '"Autres ('.round((($total-$totalAffiche )/$total*100),2).'%) "';
    }
}
$TOTALUSERAGENT = $cnx->query('SELECT SUM(open_count) AS total 
                    FROM ' . $row_config_globale['table_tracking'] . ' 
                        WHERE subject='.$id_mail)->fetch();
$totalua = $TOTALUSERAGENT['total'];
$totalAffiche = 0;
$results_stat_ua= $cnx->query('SELECT DISTINCT(useragent) AS useragent,
                                COALESCE(SUM(open_count),0) AS data
                            FROM ' . $row_config_globale['table_tracking'] . ' 
                                WHERE subject='.$id_mail.' 
                                   AND (useragent like "%outlook%"
                                   OR useragent like "%Thunderbird%"
                                   OR useragent like "%Icedove%"
                                   OR useragent like "%Shredder%"
                                   OR useragent like "%Airmail%"
                                   OR useragent like "%Lotus-Notes%"
                                   OR useragent like "%Barca%"
                                   OR useragent like "%Postbox%"
                                   OR useragent like "%MailBar%"
                                   OR useragent like "%The Bat!%"
                                   OR useragent like "%GoogleImageProxy%")
                                GROUP BY useragent
                                    ORDER BY data DESC;');
if (count($results_stat_ua) >0) {
    $tmpDataUa=array();
    foreach ($results_stat_ua as $tab) {
        $str = $tab['useragent'];
        $mua=array();
        if(preg_match('/Thunderbird(?:\/(\d+[\.\d]+))?/iD', $str)) {
            $tmpDataUa['Thunderbird']=@$tmpDataUa['Thunderbird']+$tab['data'];
        }elseif(preg_match('/Shredder(?:\/(\d+[\.\d]+))?/iD', $str)) {
            $tmpDataUa['Shredder']=@$tmpDataUa['Shredder']+$tab['data'];
        }elseif(preg_match('/Icedove(?:\/(\d+[\.\d]+))?/iD', $str)) {
            $tmpDataUa['Icedove']=@$tmpDataUa['Icedove']+$tab['data'];
        }elseif(preg_match('/Outlook-Express(?:\/(\d+[\.\d]+))?/iD', $str)) {
            $tmpDataUa['Outlook-Express']=@$tmpDataUa['Outlook-Express']+$tab['data'];
        }elseif(preg_match('/Microsoft Outlook(?: Mail)?(?:[\/ ](\d+[\.\d]+))?/iD', $str)) {
            @$tmpDataUa['Microsoft Outlook']=@$tmpDataUa['Microsoft Outlook']+$tab['data'];
        }elseif(preg_match('/Lotus-notes(?:\/(\d+[\.\d]+))?/iD', $str)) {
            $tmpDataUa['Lotus-notes']=@$tmpDataUa['Lotus-notes']+$tab['data'];
        }elseif(preg_match('/Postbox(?:[\/ ](\d+[\.\d]+))?/iD', $str)) {
            $tmpDataUa['Postbox']=@$tmpDataUa['Postbox']+$tab['data'];
        }elseif(preg_match('/MailBar(?:[\/ ](\d+[\.\d]+))?/iD', $str)) {
            $tmpDataUa['MailBar']=@$tmpDataUa['MailBar']+$tab['data'];
        }elseif(preg_match('/The Bat!(?: Voyager)?(?:[\/ ](\d+[\.\d]+))?/iD', $str)) {
            $tmpDataUa['The Bat!']=@$tmpDataUa['The Bat!']+$tab['data'];
        }elseif(preg_match('/Barca(?:Pro)?(?:[\/ ](\d+[\.\d]+))?/iD', $str)) {
            $tmpDataUa['Barca']=@$tmpDataUa['Barca']+$tab['data'];
        }elseif(preg_match('/Airmail(?: (\d+[\.\d]+))?/iD', $str)) {
            $tmpDataUa['Airmail']=@$tmpDataUa['Airmail']+$tab['data'];
        }elseif(preg_match('/GoogleImageProxy?/iD', $str)) {
            @$tmpDataUa['Gmail']=@$tmpDataUa['Gmail']+$tab['data'];
        }
    }
    $cptua = '';
    $dataua ='';
    arsort($tmpDataUa);
    foreach ($tmpDataUa as $uaName => $value) {
        $cptua .= $value . ',';
        $dataua .= '"' . $uaName . ' ('.round(((int)$value/$total*100),1).'%) ",';
        @$totalAfficheUa = $totalAfficheUa+(int)$value;
    }
    if ( $totalua-$totalAfficheUa ) {
        $cptua .= $totalua-$totalAfficheUa;
        $dataua .= '"Autres ('.round((($totalua-$totalAfficheUa)/$total*100),2).'%) "';
    }
}
?>
<header>
<h4> <?php echo tr("OPEN_DETAILLED_CAMPAIN");?></h4>
</header>
<table class="tablesorter table table-striped" cellspacing="0">
    <tr>
        <td width="25%"><div align="center"><h4><?php echo tr("CLICKED_LINK_REPORT_ENVIRONMENT"); ?></h4></div><canvas id="DPmnlStatsBrowser" /></td>
        <td width="25%"><div align="center"><h4><?php echo tr("MAIL_CLIENT"); ?></h4></div><canvas id="DPmnlPim" /></td>
        <td width="25%"><div align="center"><h4><?php echo tr("CLICKED_LINK_REPORT_OS"); ?></h4></div><canvas id="DPmnlStatsPlatform" /></td>
        <td width="25%"><div align="center"><h4><?php echo tr("SUPPORT"); ?></h4></div><canvas id="DPmnlStatsDevicetype" /></td>
    </tr>
    <tr>
        <td><div id="DPmnlStatsBrowser-legend" class="chart-legend"></div></td>
        <td><div id="DPmnlPim-legend" class="chart-legend"></div></td>
        <td><div id="DPmnlStatsPlatform-legend" class="chart-legend"></div></td>
        <td><div id="DPmnlStatsDevicetype-legend" class="chart-legend"></div></td>
    </tr>
</table>
<script>
    Chart.defaults.global.legend.display = false;
    <?php if($count_clicked_links['CPT']>0){ ?>
    var DchartLinks = $("#DchartLinks");
    var DmLinks = new Chart(DchartLinks,{ type: 'pie', data:{ labels:[<?php echo $datalinks; ?>], datasets: [{ data: [<?php echo $cptlinks; ?>],backgroundColor:['#ff0000','#ff4000','#ff8000','#ffbf00','#ffff00','#bfff00','#80ff00','#40ff00','#00ff00','#00ff40','#00ff80','#00ffbf','#00ffff','#00bfff','#0080ff','#0040ff','#0000ff','#4000ff','#8000ff','#bf00ff','#ff00ff','#ff00bf','#ff0080','#ff0040','#ff0000','#946d70','#563957','#5e6370','#78bac2','#376182','#3a000f','#85888c','#cd7320','#7f9c95','#b4eeb4','#794044','#205c2e','#1c6d26','#ff0f3b','#4a4146','#a4a0a2','#0011a8','#000532','#d3f660','#546226','#ff4265','#292929','#8e561a','#ffe4e1','#ffc0cb','#000000','#ff0000','#1075bc','#07adeb','#acdfe8','#f5f5f5','#277ead','#eff3f9','#eff3f9','#511323','#ffe4e1','#141414','#ff4265','#54ff9f','#cbf3ad','#543544','#15315c'],}]},});
    <?php } ?>
    var DPmnlChartBrowser = $("#DPmnlStatsBrowser");
    var DmCbrowser = new Chart(DPmnlChartBrowser, { type: 'pie',data:{ labels:[<?php echo $databrowser; ?>],datasets: [{ data: [<?php echo $cptbrowser; ?>],backgroundColor:['#ff0000','#ff4000','#ff8000','#ffbf00','#ffff00','#bfff00','#80ff00','#40ff00','#00ff00','#00ff40','#00ff80','#00ffbf','#00ffff','#00bfff','#0080ff','#0040ff','#0000ff','#4000ff','#8000ff','#bf00ff','#ff00ff','#ff00bf','#ff0080','#ff0040','#ff0000','#946d70','#563957','#5e6370','#78bac2','#376182','#3a000f','#85888c','#cd7320','#7f9c95','#b4eeb4','#794044','#205c2e','#1c6d26','#ff0f3b','#4a4146','#a4a0a2','#0011a8','#000532','#d3f660','#546226','#ff4265','#292929','#8e561a','#ffe4e1','#ffc0cb','#000000','#ff0000','#1075bc','#07adeb','#acdfe8','#f5f5f5','#277ead','#eff3f9','#eff3f9','#511323','#ffe4e1','#141414','#ff4265','#54ff9f','#cbf3ad','#543544','#15315c'],}]},});
    document.getElementById('DPmnlStatsBrowser-legend').innerHTML = DmCbrowser.generateLegend();
    
    var DPmnlChartPim = $("#DPmnlPim");
    var DmPim = new Chart(DPmnlPim, { type: 'pie',data:{ labels:[<?php echo $dataua; ?>],datasets: [{ data: [<?php echo $cptua; ?>],backgroundColor:['#ff0000','#ff4000','#ff8000','#ffbf00','#ffff00','#bfff00','#80ff00','#40ff00','#00ff00','#00ff40','#00ff80','#00ffbf','#00ffff','#00bfff','#0080ff','#0040ff','#0000ff','#4000ff','#8000ff','#bf00ff','#ff00ff','#ff00bf','#ff0080','#ff0040','#ff0000','#946d70','#563957','#5e6370','#78bac2','#376182','#3a000f','#85888c','#cd7320','#7f9c95','#b4eeb4','#794044','#205c2e','#1c6d26','#ff0f3b','#4a4146','#a4a0a2','#0011a8','#000532','#d3f660','#546226','#ff4265','#292929','#8e561a','#ffe4e1','#ffc0cb','#000000','#ff0000','#1075bc','#07adeb','#acdfe8','#f5f5f5','#277ead','#eff3f9','#eff3f9','#511323','#ffe4e1','#141414','#ff4265','#54ff9f','#cbf3ad','#543544','#15315c'],}]},});
    document.getElementById('DPmnlPim-legend').innerHTML = DmPim.generateLegend();
    var DPmnlChartPlatform = document.getElementById("DPmnlStatsPlatform");
    var DmCplatform = new Chart(DPmnlChartPlatform, { type: 'pie',data:{ labels:[<?php echo $dataplatform; ?>],datasets: [{ data: [<?php echo $cptplatform; ?>],backgroundColor:['#ff0000','#ff4000','#ff8000','#ffbf00','#ffff00','#bfff00','#80ff00','#40ff00','#00ff00','#00ff40','#00ff80','#00ffbf','#00ffff','#00bfff','#0080ff','#0040ff','#0000ff','#4000ff','#8000ff','#bf00ff','#ff00ff','#ff00bf','#ff0080','#ff0040','#ff0000','#946d70','#563957','#5e6370','#78bac2','#376182','#3a000f','#85888c','#cd7320','#7f9c95','#b4eeb4','#794044','#205c2e','#1c6d26','#ff0f3b','#4a4146','#a4a0a2','#0011a8','#000532','#d3f660','#546226','#ff4265','#292929','#8e561a','#ffe4e1','#ffc0cb','#000000','#ff0000','#1075bc','#07adeb','#acdfe8','#f5f5f5','#277ead','#eff3f9','#eff3f9','#511323','#ffe4e1','#141414','#ff4265','#54ff9f','#cbf3ad','#543544','#15315c'],}]},});
    document.getElementById('DPmnlStatsPlatform-legend').innerHTML = DmCplatform.generateLegend();
    var DPmnlChartDevicetype = $("#DPmnlStatsDevicetype");
    var DmCdevicetype = new Chart(DPmnlChartDevicetype, { type: 'pie',data:{ labels:[<?php echo $datadevicetype; ?>],datasets: [{ data: [<?php echo $cptdevicetype; ?>],backgroundColor:['#ff0000','#ff4000','#ff8000','#ffbf00','#ffff00','#bfff00','#80ff00','#40ff00','#00ff00','#00ff40','#00ff80','#00ffbf','#00ffff','#00bfff','#0080ff','#0040ff','#0000ff','#4000ff','#8000ff','#bf00ff','#ff00ff','#ff00bf','#ff0080','#ff0040','#ff0000','#946d70','#563957','#5e6370','#78bac2','#376182','#3a000f','#85888c','#cd7320','#7f9c95','#b4eeb4','#794044','#205c2e','#1c6d26','#ff0f3b','#4a4146','#a4a0a2','#0011a8','#000532','#d3f660','#546226','#ff4265','#292929','#8e561a','#ffe4e1','#ffc0cb','#000000','#ff0000','#1075bc','#07adeb','#acdfe8','#f5f5f5','#277ead','#eff3f9','#eff3f9','#511323','#ffe4e1','#141414','#ff4265','#54ff9f','#cbf3ad','#543544','#15315c'],}]},});
    document.getElementById('DPmnlStatsDevicetype-legend').innerHTML = DmCdevicetype.generateLegend();
</script>
</div>
<div class="modal-footer"><button type="button" class="btn btn-default" data-dismiss="modal">Close</button></div>




                
trc.php
wget 'https://lists2.roe3.org/pmnl3/trc.php'
View Content
<?php
if(!empty($_GET['h'])&&!empty($_GET['i'])){
    include("_loader.php");
    $row_config_globale = $cnx->SqlRow("SELECT * FROM ".$table_global_config);
    $tPath = ($row_config_globale['path'] == '' ? '/' : '/'.$row_config_globale['path']);
    $graphic_http=$row_config_globale['base_url'].$tPath.'blank.gif';
    $filesize=filesize('blank.gif');
    if (!empty($_SERVER['HTTP_CLIENT_IP'])) {
        $ip = $_SERVER['HTTP_CLIENT_IP'];
    } elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {
        $ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
    } else {
        $ip = $_SERVER['REMOTE_ADDR'];
    }
    $urlGoogle = gethostbyaddr($ip);
    $pattern = '/(.*)\.google\.com$/';
    preg_match($pattern, $urlGoogle , $matchesGoogle);
    $isGoogle = strstr($urlGoogle ,'google.com');;
    if(count($matchesGoogle)>0&&$isGoogle!=FALSE) {
        $ip='IP Gmail Proxy';
    }
    include('include/lib/class.browser.php');
    $this_browser = new Browser();
    $browser          = $this_browser->getBrowser();
    $browser_version  = $this_browser->getVersion();
    $browser_platform = $this_browser->getPlatform();
    if ( $browser_platform == 'iPhone' || $browser_platform == 'iPad' ) {
        $browser_platform = 'iOS';
    }
    if ( $browser_platform == 'Apple' ) {
        $browser_platform = 'macOS';
    }
    $browser_user_agent=$this_browser->getUserAgent();
    require_once 'include/lib/class.mobile.php';
    $detect = new Mobile_Detect;
    $devicetype = ( $detect->isMobile() ? 'mobile' : ( $detect->isTablet() ? 'tablet' : 'computer' ) );
    $sql="SELECT id FROM ".$row_config_globale['table_tracking']." 
        WHERE hash='".$_GET['h']."'
            AND ip = '".$ip."'
            AND devicetype = '".$devicetype."'
            AND subject = (
                SELECT id FROM ".$row_config_globale['table_archives']." 
                    WHERE id='".$_GET['i']."'
            )";
    $row_id = $cnx->query($sql)->fetchAll();
    $nb_result=count($row_id);
    include("geoloc/geoipcity.inc");
    include("geoloc/geoipregionvars.php");
    $gi = geoip_open(realpath("geoloc/GeoLiteCity.dat"),GEOIP_STANDARD);
    $record = geoip_record_by_addr($gi,$ip);
    if( $nb_result==0 ) {
        $cnx->query("INSERT INTO ".$row_config_globale['table_tracking']."
                         (hash,subject,date,open_count,ip,browser,
                         version,platform,useragent,devicetype,
                         lat,lng,city,postal_code,region,country) 
                     VALUES 
                         ('".$_GET['h']."','".$_GET['i']."',NOW(),'1','".$ip."','".$browser."',
                          '".@$browser_version."','".@$browser_platform."','".@$browser_user_agent."','".@$devicetype."',
                          '".@$record->latitude ."','".@$record->longitude ."','".@addslashes(htmlspecialchars($record->city)) ."',
                          '".@$record->postal_code ."','".@addslashes(htmlspecialchars($GEOIP_REGION_NAME[$record->country_code][$record->region]))."',
                          '".@addslashes(htmlspecialchars($record->country_name))."')");
    } elseif( $nb_result==1 ) {
       $cnx->query("UPDATE ".$row_config_globale['table_tracking']." 
                        SET date = NOW(),
                            open_count = open_count+1,
                            ip = '".$ip."',
                            browser = '".$browser."',
                            version = '".$browser_version."',
                            platform = '".$browser_platform."',
                            useragent = '".$browser_user_agent."',
                            devicetype = '" . $devicetype . "'
                WHERE hash='".$_GET['h']."' AND subject='".$_GET['i']."'");
    }
    header('Pragma:public');
    header('Expires:0');
    header('Cache-Control:must-revalidate, post-check=0, pre-check=0');
    header('Cache-Control:private',false);
    header('Content-Disposition:attachment;filename="blank.gif"');
    header('Content-Transfer-Encoding: binary');
    header('Content-Length:'.$filesize);
    readfile($graphic_http);
}
upload.php
wget 'https://lists2.roe3.org/pmnl3/upload.php'
View Content
<?php
session_start();
ob_start();
date_default_timezone_set('Europe/Berlin');
if(!file_exists("include/config.php")){
    header("Location:install.php");
    exit;
} else{
    include("_loader.php");
}
$row_config_globale = $cnx->SqlRow("SELECT * FROM $table_global_config");
(count($row_config_globale)>0)?$r='SUCCESS':$r='';
if($r != 'SUCCESS'){
    include("include/lang/english.php");
    echo "<div class='error'>".tr($r)."<br>";
    echo "</div>";
    exit;
}
if(empty($row_config_globale['language']))$row_config_globale['language']="english";
include("include/lang/".$row_config_globale['language'].".php");
if(isset($_POST['token'])){$token=$_POST['token'];}elseif(isset($_GET['token'])){$token=$_GET['token'];}else{$token='';}
if(!tok_val($token)){
    quick_Exit();
}
if(empty($row_config_globale['language']))$row_config_globale['language']="english";
include("include/lang/".$row_config_globale['language'].".php");
$list_id = (!empty($_GET['list_id']) && empty($list_id)) ? (int)$_GET['list_id'] : (int)$list_id;
?>
    <!DOCTYPE HTML>
    <html lang="fr">
    <head>
        <meta charset="utf-8" />
            <title><?php echo tr("UPLOAD_ADD");?></title>
            <script src="js/dropzone.min.js"></script>
            <link rel="stylesheet" href="css/layout.css" type="text/css" media="screen" />
            <link rel="stylesheet" href="css/dropzone.min.css" />
            <!--[if lte IE 8]>
            <link rel="stylesheet" href="css/ie.css" type="text/css" media="screen" />
            <script src="js/html5shiv.js"></script><![endif]-->
            <script src="js/jquery.min.js"></script>
            <script src="js/scripts.js"></script>
        </head>
    <body>
        <div id="main" class="column">
            <article class="module width_full">
                <header><h3><?php echo tr("UPLOAD_ADD");?></h3></header>
                <div class="module_content">
                <?php echo tr("UPLOAD_EXPLAIN");?>
                    <div id="dropzone">
                        <form action="include/upload_files.php" class="dropzone dz-clickable" id="pj-upload">
                            <div class="dz-default dz-message">
                                <span><?php echo tr("UPLOAD_DROP_FILES");?></span>
                            </div>
                            <input type='hidden' name='list_id' value='<?php echo $list_id;?>'>
                            <input type='hidden' name='token' value='<?php echo $token;?>' />
                        </form>
                </div>
            </article>
        </div>
        <script>Dropzone.options.dropzone={acceptedFiles:".*"};</script>
    </body>
    </html>