modified: SRC/config/mail.php

This commit is contained in:
www 2015-03-16 14:20:24 +01:00
parent f9251c68f9
commit b69f8c03b6
4 changed files with 236 additions and 227 deletions

View File

@ -451,3 +451,32 @@ git status
git status git status
git status git status
git pull git pull
ls
rm
rm --help
rm ./*
rmdir ./*
rm -rf *
ls
ls
cd ..
ls
ls
sudo chmod -R gu+w
chmod -R gu+w
chmod -R gu+w ./
php artisan migrate
ls
cd SRC
ls
php artisan migrate
cd ;;
CD ..
cd ..
ls
cd initbase
cd INITBASE
ls
python loader
python loader.py
python loader.py

View File

@ -1,203 +1,203 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
import xml.etree.ElementTree as ET import xml.etree.ElementTree as ET
import MySQLdb as mdb import MySQLdb as mdb
import sys import sys
import re import re
def insert (cur, table, dict) : def insert (cur, table, dict) :
keys = "" keys = ""
datas = "" datas = ""
for key , data in dict.items() : for key , data in dict.items() :
keys += key + "," keys += key + ","
datas += "\"" + str(data) + "\"," datas += "\"" + str(data) + "\","
req = "INSERT INTO " + table + "(" + keys[:-1] + ")" + " VALUES (" + datas[:-1] + ")" req = "INSERT INTO " + table + "(" + keys[:-1] + ")" + " VALUES (" + datas[:-1] + ")"
#print(req) #print(req)
cur.execute(req) cur.execute(req)
return cur.lastrowid return cur.lastrowid
try : try :
listeTechnique = {} listeTechnique = {}
listeMatiere= {} listeMatiere= {}
listeDomaine = {} listeDomaine = {}
listeDesignation = {} listeDesignation = {}
listeAuteur = {} listeAuteur = {}
listeDatation = {} listeDatation = {}
con = mdb.connect('127.0.0.1', 'root', '', 'moduleweb',charset='utf8') con = mdb.connect('127.0.0.1', 'root', 'l3miashs2015', 'moduleweb',charset='utf8')
cur = con.cursor() cur = con.cursor()
# Suppresion des données existantes dan la bd # Suppresion des données existantes dan la bd
cur.execute("TRUNCATE table auteurs") cur.execute("TRUNCATE table auteurs")
cur.execute("TRUNCATE table matieres") cur.execute("TRUNCATE table matieres")
cur.execute("TRUNCATE table techniques") cur.execute("TRUNCATE table techniques")
cur.execute("TRUNCATE table domaines") cur.execute("TRUNCATE table domaines")
cur.execute("TRUNCATE table datations") cur.execute("TRUNCATE table datations")
cur.execute("TRUNCATE table oeuvres") cur.execute("TRUNCATE table oeuvres")
# On parcourt le fichier xml # On parcourt le fichier xml
tree = ET.parse('inventaire.xml') tree = ET.parse('inventaire.xml')
root = tree.getroot() root = tree.getroot()
# Pour chaque oeuvre # Pour chaque oeuvre
for o in root.iter('oeuvre'): for o in root.iter('oeuvre'):
idtechnique = "NULL" idtechnique = "NULL"
idmatiere = "NULL" idmatiere = "NULL"
iddomaine= "NULL" iddomaine= "NULL"
iddesignation = "NULL" iddesignation = "NULL"
iddesignation2 = "NULL" iddesignation2 = "NULL"
iddesignation3 = "NULL" iddesignation3 = "NULL"
idauteur = "NULL" idauteur = "NULL"
idauteur2 = "NULL" idauteur2 = "NULL"
image = "NULL" image = "NULL"
iddatation = "NULL" iddatation = "NULL"
technique = None technique = None
matiere = None matiere = None
domaine = None domaine = None
designation = None designation = None
designation2 = None designation2 = None
designation3 = None designation3 = None
auteur = None auteur = None
auteur2 = None auteur2 = None
datation = None datation = None
datation2 = None datation2 = None
# On parcourt tout les tags # On parcourt tout les tags
for child in o : for child in o :
if child.tag == 'auteur1' : if child.tag == 'auteur1' :
auteur = child.text.encode('utf-8') auteur = child.text.encode('utf-8')
elif child.tag == 'auteur2' : elif child.tag == 'auteur2' :
auteur2 = child.text.encode('utf-8') auteur2 = child.text.encode('utf-8')
elif child.tag == 'datation1': elif child.tag == 'datation1':
datation = child.text.encode('utf-8') datation = child.text.encode('utf-8')
elif child.tag == 'datation2': elif child.tag == 'datation2':
datation2 = child.text.encode('utf-8') datation2 = child.text.encode('utf-8')
elif child.tag == 'designation': elif child.tag == 'designation':
designation1 = child.text.encode('utf-8') designation1 = child.text.encode('utf-8')
elif child.tag == 'designation2': elif child.tag == 'designation2':
designation2 = child.text.encode('utf-8') designation2 = child.text.encode('utf-8')
elif child.tag == 'designation3': elif child.tag == 'designation3':
designation3 = child.text.encode('utf-8') designation3 = child.text.encode('utf-8')
elif child.tag == 'domaine': elif child.tag == 'domaine':
domaine = child.text.encode('utf-8') domaine = child.text.encode('utf-8')
elif child.tag == 'matiere': elif child.tag == 'matiere':
matiere = child.text.encode('utf-8') matiere = child.text.encode('utf-8')
elif child.tag == 'technique': elif child.tag == 'technique':
technique = child.text.encode('utf-8') technique = child.text.encode('utf-8')
elif child.tag == 'image' : elif child.tag == 'image' :
image = child.text.encode('utf-8') image = child.text.encode('utf-8')
# On s'interesee qu'aux oeuvres ayant une image # On s'interesee qu'aux oeuvres ayant une image
if image != "NULL" : if image != "NULL" :
if str(datation)+str(datation2) in listeDatation : if str(datation)+str(datation2) in listeDatation :
iddatation = listeDatation[str(datation)+str(datation2)] iddatation = listeDatation[str(datation)+str(datation2)]
else : else :
if datation is not None and datation2 is not None : if datation is not None and datation2 is not None :
if re.compile("vers").search(datation.lower()) or re.compile("avant").search(datation.lower()): if re.compile("vers").search(datation.lower()) or re.compile("avant").search(datation.lower()):
try: try:
datas = {"dateDebut" : datation2.split("-")[0] + "-01-01", "dateFin" : datation2.split("-")[1] + "-12-31"} datas = {"dateDebut" : datation2.split("-")[0] + "-01-01", "dateFin" : datation2.split("-")[1] + "-12-31"}
iddatation = insert(cur,"datations",datas) iddatation = insert(cur,"datations",datas)
except Exception, e: except Exception, e:
if re.compile("^[0-9]{4}[ ]").match(datation.lower()) : if re.compile("^[0-9]{4}[ ]").match(datation.lower()) :
datas = {"dateDebut" : datation.split(" ")[0] + "-01-01", "dateFin" : datation.split(" ")[0] + "-12-31"} datas = {"dateDebut" : datation.split(" ")[0] + "-01-01", "dateFin" : datation.split(" ")[0] + "-12-31"}
iddatation = insert(cur,"datations",datas) iddatation = insert(cur,"datations",datas)
elif re.compile("^[0-9]{4}-[0-9]{4}$").search(datation.lower()) and re.compile("^[0-9]{4}-[0-9]{4}$").search(datation2.lower()) : elif re.compile("^[0-9]{4}-[0-9]{4}$").search(datation.lower()) and re.compile("^[0-9]{4}-[0-9]{4}$").search(datation2.lower()) :
datas = {"dateDebut" : datation.split("-")[0] + "-01-01", "dateFin" : datation2.split("-")[1] + "-12-31"} datas = {"dateDebut" : datation.split("-")[0] + "-01-01", "dateFin" : datation2.split("-")[1] + "-12-31"}
iddatation = insert(cur,"datations",datas) iddatation = insert(cur,"datations",datas)
elif re.compile("^[0-9]{4}[ ]").match(datation.lower()) and re.compile("^[0-9]{4}[ ]").match(datation2.lower()) : elif re.compile("^[0-9]{4}[ ]").match(datation.lower()) and re.compile("^[0-9]{4}[ ]").match(datation2.lower()) :
datas = {"dateDebut" : datation.split(" ")[0] + "-01-01", "dateFin" : datation2.split(" ")[0] + "-12-31"} datas = {"dateDebut" : datation.split(" ")[0] + "-01-01", "dateFin" : datation2.split(" ")[0] + "-12-31"}
iddatation = insert(cur,"datations",datas) iddatation = insert(cur,"datations",datas)
elif re.compile("^[0-9]{4}-[0-9]{4}[ ]").match(datation.lower()) and re.compile("^[0-9]{4}-[0-9]{4}[ ]").match(datation2.lower()) : elif re.compile("^[0-9]{4}-[0-9]{4}[ ]").match(datation.lower()) and re.compile("^[0-9]{4}-[0-9]{4}[ ]").match(datation2.lower()) :
datas = {"dateDebut" : datation.split("-")[0] + "-01-01", "dateFin" : datation2.split("-")[1].split(" ")[0] + "-12-31"} datas = {"dateDebut" : datation.split("-")[0] + "-01-01", "dateFin" : datation2.split("-")[1].split(" ")[0] + "-12-31"}
iddatation = insert(cur,"datations",datas) iddatation = insert(cur,"datations",datas)
elif re.compile("^[0-9]{4}-[0-9]{4}[ ]").match(datation.lower()) and re.compile("^[0-9]{4}-[0-9]{4}").match(datation2.lower()) : elif re.compile("^[0-9]{4}-[0-9]{4}[ ]").match(datation.lower()) and re.compile("^[0-9]{4}-[0-9]{4}").match(datation2.lower()) :
datas = {"dateDebut" : datation.split("-")[0] + "-01-01", "dateFin" : datation2.split("-")[1].split(" ")[0] + "-12-31"} datas = {"dateDebut" : datation.split("-")[0] + "-01-01", "dateFin" : datation2.split("-")[1].split(" ")[0] + "-12-31"}
iddatation = insert(cur,"datations",datas) iddatation = insert(cur,"datations",datas)
if datation is not None and datation2 is None : if datation is not None and datation2 is None :
if re.compile("^[0-9]{4}[ ]").match(datation.lower()) : if re.compile("^[0-9]{4}[ ]").match(datation.lower()) :
datas = {"dateDebut" : datation.split(" ")[0] + "-01-01", "dateFin" : datation.split(" ")[0] + "-12-31"} datas = {"dateDebut" : datation.split(" ")[0] + "-01-01", "dateFin" : datation.split(" ")[0] + "-12-31"}
iddatation = insert(cur,"datations",datas) iddatation = insert(cur,"datations",datas)
elif re.compile("^[0-9]{4}$").match(datation.lower()) : elif re.compile("^[0-9]{4}$").match(datation.lower()) :
datas = {"dateDebut" : datation + "-01-01", "dateFin" : datation + "-12-31"} datas = {"dateDebut" : datation + "-01-01", "dateFin" : datation + "-12-31"}
iddatation = insert(cur,"datations",datas) iddatation = insert(cur,"datations",datas)
elif re.compile("^[0-9]{4}-[0-9]{4}$").match(datation.lower()) : elif re.compile("^[0-9]{4}-[0-9]{4}$").match(datation.lower()) :
datas = {"dateDebut" : datation.split("-")[0] + "-01-01", "dateFin" : datation.split("-")[1] + "-12-31"} datas = {"dateDebut" : datation.split("-")[0] + "-01-01", "dateFin" : datation.split("-")[1] + "-12-31"}
iddatation = insert(cur,"datations",datas) iddatation = insert(cur,"datations",datas)
if iddatation != "NULL" : if iddatation != "NULL" :
listeDatation[str(datation)+str(datation2) ] = iddatation listeDatation[str(datation)+str(datation2) ] = iddatation
if technique is not None : if technique is not None :
if not technique in listeTechnique : if not technique in listeTechnique :
datas = { "nom" : technique} datas = { "nom" : technique}
idtechnique = insert(cur,"techniques",datas) idtechnique = insert(cur,"techniques",datas)
listeTechnique[technique] = idtechnique listeTechnique[technique] = idtechnique
else : else :
idtechnique = listeTechnique[technique] idtechnique = listeTechnique[technique]
if matiere is not None : if matiere is not None :
if not matiere in listeMatiere : if not matiere in listeMatiere :
datas = { "nom" : matiere} datas = { "nom" : matiere}
idmatiere = insert(cur,"matieres",datas) idmatiere = insert(cur,"matieres",datas)
listeMatiere[matiere] = idmatiere listeMatiere[matiere] = idmatiere
else : else :
idmatiere = listeMatiere[matiere] idmatiere = listeMatiere[matiere]
if domaine is not None : if domaine is not None :
if not domaine in listeDomaine : if not domaine in listeDomaine :
datas = { "nom" : domaine} datas = { "nom" : domaine}
iddomaine = insert(cur,"domaines",datas) iddomaine = insert(cur,"domaines",datas)
listeDomaine[domaine] = iddomaine listeDomaine[domaine] = iddomaine
else : else :
iddomaine = listeDomaine[domaine] iddomaine = listeDomaine[domaine]
if auteur is not None : if auteur is not None :
if not auteur in listeAuteur : if not auteur in listeAuteur :
datas = { "nom" : auteur} datas = { "nom" : auteur}
idauteur = insert(cur,"auteurs", datas) idauteur = insert(cur,"auteurs", datas)
listeAuteur[auteur] = idauteur listeAuteur[auteur] = idauteur
else : else :
idauteur = listeAuteur[auteur] idauteur = listeAuteur[auteur]
datas = {"technique_id" : idtechnique, "domaine_id" : iddomaine, "matiere_id" : idmatiere, datas = {"technique_id" : idtechnique, "domaine_id" : iddomaine, "matiere_id" : idmatiere,
"image" : image, "designation" : con.escape_string(designation1), "auteur_id" : idauteur} "image" : image, "designation" : con.escape_string(designation1), "auteur_id" : idauteur}
for key , data in datas.items() : for key , data in datas.items() :
if data == "NULL" : if data == "NULL" :
del datas[key] del datas[key]
idoeuvre = insert(cur,"oeuvres",datas) idoeuvre = insert(cur,"oeuvres",datas)
con.commit() con.commit()
except mdb.Error, e: except mdb.Error, e:
if con: if con:
con.rollback() con.rollback()
print("Error %d: %s" % (e.args[0],e.args[1])) print("Error %d: %s" % (e.args[0],e.args[1]))
sys.exit(1) sys.exit(1)
finally: finally:
if con: if con:
con.close() con.close()

View File

@ -1,7 +1,5 @@
<?php <?php
return [ return [
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| Mail Driver | Mail Driver
@ -14,9 +12,7 @@ return [
| Supported: "smtp", "mail", "sendmail", "mailgun", "mandrill", "log" | Supported: "smtp", "mail", "sendmail", "mailgun", "mandrill", "log"
| |
*/ */
'driver' => 'smtp', 'driver' => 'smtp',
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| SMTP Host Address | SMTP Host Address
@ -27,9 +23,7 @@ return [
| the Mailgun mail service which will provide reliable deliveries. | the Mailgun mail service which will provide reliable deliveries.
| |
*/ */
'host' => 'smtp.gmail.com',
'host' => 'smtp.mailgun.org',
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| SMTP Host Port | SMTP Host Port
@ -40,9 +34,7 @@ return [
| stay compatible with the Mailgun e-mail application by default. | stay compatible with the Mailgun e-mail application by default.
| |
*/ */
'port' => 587, 'port' => 587,
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| Global "From" Address | Global "From" Address
@ -53,9 +45,7 @@ return [
| used globally for all e-mails that are sent by your application. | used globally for all e-mails that are sent by your application.
| |
*/ */
'from' => ['address' => "modulewebl3miashs@gmail.com", 'name' => "moduleWeb"],
'from' => ['address' => null, 'name' => null],
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| E-Mail Encryption Protocol | E-Mail Encryption Protocol
@ -66,9 +56,7 @@ return [
| transport layer security protocol should provide great security. | transport layer security protocol should provide great security.
| |
*/ */
'encryption' => 'tls', 'encryption' => 'tls',
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| SMTP Server Username | SMTP Server Username
@ -79,9 +67,7 @@ return [
| connection. You may also set the "password" value below this one. | connection. You may also set the "password" value below this one.
| |
*/ */
'username' => "modulewebl3miashs@gmail.com",
'username' => null,
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| SMTP Server Password | SMTP Server Password
@ -92,9 +78,7 @@ return [
| connection so that the application will be able to send messages. | connection so that the application will be able to send messages.
| |
*/ */
'password' => env('MAIL_PASSWD', ''),
'password' => null,
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| Sendmail System Path | Sendmail System Path
@ -105,9 +89,7 @@ return [
| been provided here, which will work well on most of your systems. | been provided here, which will work well on most of your systems.
| |
*/ */
'sendmail' => '/usr/sbin/sendmail -bs', 'sendmail' => '/usr/sbin/sendmail -bs',
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| Mail "Pretend" | Mail "Pretend"
@ -118,7 +100,5 @@ return [
| you may inspect the message. This is great for local development. | you may inspect the message. This is great for local development.
| |
*/ */
'pretend' => false, 'pretend' => false,
]; ];

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB