Suppression du blog par les post-it
This commit is contained in:
parent
c37b974fe7
commit
6b264cd46b
@ -1,5 +1,8 @@
|
||||
# Pywallter est un projet pour partager des fichiers avec ses potes.
|
||||
# Pywallter est un projet de portail communautaire pour les utilisateur d'un serveur.
|
||||
Ça demande juste un identifiant et un mot de passe et voila.
|
||||
On peut y importer des fichiers que l'on pourra rendre accéssible en public par la suite.
|
||||
Je voulais testé cette idée de post-it pour que les utilisateur puisse s'échanger des messages
|
||||
ou que les admins puisse faire des annonces... On verra
|
||||
on pourrait ajoute de la double authentification mais bon ...
|
||||
|
||||
|
||||
|
14
Todo
14
Todo
@ -3,7 +3,7 @@ Bugs:
|
||||
|
||||
Liste d'améliorations à coder
|
||||
|
||||
- Vérifier et valider les requêtes envoyées via les formulaires avec WTForms
|
||||
|
||||
|
||||
- Réorganiser le code en utilisant Blueprint
|
||||
|
||||
@ -14,12 +14,16 @@ Liste d'améliorations à coder
|
||||
/<user>/files/
|
||||
/<user>/images/
|
||||
/<user>/posts/
|
||||
/<user>/public/image/
|
||||
/<user>/public/file/
|
||||
|
||||
Il faudrait aussi limiter la taille du dossier /<user>/ à 1 ou 2 Go maxi par exemple.
|
||||
- Faire un fichier de config.
|
||||
|
||||
Mais du coup, si les fichiers, images, et posts sont stockés dans ces dossiers,
|
||||
il faut stocker leurs chemins respectifs dans la bdd ? Et la consulter quand on veut afficher
|
||||
ces fichiers dans des vues ?
|
||||
- Faire un compte admin (Ajout d'un champ role dans la BDD)
|
||||
|
||||
- Il faudrait aussi limiter la taille du dossier /<user>/ à 1 ou 2 Go maxi par exemple. (Plus tard)
|
||||
|
||||
|
||||
|
||||
Quand on aura fait ça déjà on sera pas mal.
|
||||
|
||||
|
19
pywallter.py
19
pywallter.py
@ -8,7 +8,7 @@ from flask_bcrypt import Bcrypt
|
||||
|
||||
|
||||
|
||||
from views.blog import blog
|
||||
from views.blog import postit
|
||||
from views.filesupload import filesupload
|
||||
from views.inscription import inscription
|
||||
from views.profil import profil
|
||||
@ -46,7 +46,7 @@ extensionimg = {'.jpg', '.JPG', '.png', '.PNG', '.gif', '.GIF', '.bmp', '.BMP',
|
||||
##################################################################################################
|
||||
|
||||
app.register_blueprint(inscription)
|
||||
app.register_blueprint(blog)
|
||||
app.register_blueprint(postit)
|
||||
app.register_blueprint(filesupload)
|
||||
app.register_blueprint(profil)
|
||||
app.register_blueprint(logs)
|
||||
@ -69,19 +69,6 @@ def parametres() :
|
||||
else:
|
||||
return redirect(url_for('loginlogout.login'))
|
||||
|
||||
@app.route('/up/view/<nom>')
|
||||
def download(nom):
|
||||
if 'username' in session :
|
||||
UTILISATEUR='%s' % escape(session['username'])
|
||||
nom = secure_filename(nom)
|
||||
if os.path.isfile(DOSSIER_PERSO + UTILISATEUR + '/files/' + nom): # si le fichier existe
|
||||
return send_file(DOSSIER_PERSO + UTILISATEUR + '/files/' + nom, as_attachment=True) # on l'envoie
|
||||
else:
|
||||
flash(u'Fichier {nom} inexistant.'.format(nom=nom), 'error')
|
||||
return redirect(url_for('list')) # sinon on redirige vers la liste, avec un message d'erreur
|
||||
else :
|
||||
return redirect(url_for('loginlogout.login'))
|
||||
|
||||
@app.route('/remove/<nom>')
|
||||
def remove(nom):
|
||||
if 'username' in session :
|
||||
@ -134,7 +121,7 @@ def mythumbnails(filename):
|
||||
@app.route( '/' )
|
||||
def index():
|
||||
if 'username' in session :
|
||||
return redirect(url_for('filesupload.uploadfiles'))
|
||||
return redirect(url_for('profil.profile'))
|
||||
else :
|
||||
return redirect(url_for('loginlogout.login', _external=True))
|
||||
|
||||
|
@ -8,7 +8,7 @@
|
||||
<meta name="author" content="">
|
||||
<link rel="icon" href="../../favicon.ico">
|
||||
|
||||
<title>MaPagePerso</title>
|
||||
<title>Un serveur et des ...</title>
|
||||
|
||||
<!-- Bootstrap core CSS -->
|
||||
<link href="{{ url_for('static', filename='bootstrap.min.css') }}" rel="stylesheet">
|
||||
@ -36,7 +36,7 @@
|
||||
<h3 class="masthead-brand">Pywallter</h3>
|
||||
<ul class="nav masthead-nav">
|
||||
<li class="active"><a href="/filesupload/"></a></li>
|
||||
<li><a href="#">Inscription</a></li>
|
||||
<li><a href="/inscription/">Inscription</a></li>
|
||||
<li><a href="#">Contact</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
@ -44,8 +44,14 @@
|
||||
|
||||
<div class="inner cover">
|
||||
<h1 class="cover-heading">Restez libres</h1>
|
||||
<p class="lead">Bienvenue sur Olala, hébergeur de fichier libre basé sur Flask et hébergé sur une simple petit ordinateur.
|
||||
Bientôt disponible, gallerie d'images, blog et d'autres. Site en construction permanente.</p>
|
||||
<p class="lead">Bienvenue sur Olala, un portail utilisateurs libre basé sur Flask et hébergé sur un petit ordinateur.
|
||||
Tu peux importer des fichiers pour ton site, consulter ou participer
|
||||
au tableau des post-its pour communiquer avec les autres membres ou
|
||||
simplement savoir ce qu'il se passe sur le serveur.<br/>
|
||||
A venir: tu pourras gérer ton compte MAIL et XMPP bientôt si les programmes
|
||||
sont configurés.
|
||||
<br/>
|
||||
<strong>Site en construction permanente. </strong></p>
|
||||
<br>
|
||||
<p class="lead">
|
||||
<form method="POST" action="{{ url_for('loginlogout.login') }}">
|
||||
|
@ -15,7 +15,7 @@
|
||||
</div>
|
||||
<div class="navbar-collapse collapse">
|
||||
<ul class="nav navbar-nav">
|
||||
<li class="active"><a href="/blog/"><span class="glyphicon glyphicon-globe" aria-hidden="true"></span> Blog</a></li>
|
||||
<li class="active"><a href="/post-it/"><span class="glyphicon glyphicon-globe" aria-hidden="true"></span> Blog</a></li>
|
||||
<li><a href="/filesupload/"><span class="glyphicon glyphicon-cloud-upload" aria-hidden="true"></span> Upload</a></li>
|
||||
<li><a href="/view/"><span class="glyphicon glyphicon-cloud-download" aria-hidden="true"></span> Fichiers</a></li>
|
||||
<li><a href="/gallery/"><span class="glyphicon glyphicon-eye-open" aria-hidden="true"></span> Gallerie</a></li>
|
||||
@ -23,7 +23,7 @@
|
||||
<li class="dropdown">
|
||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown"><span class="glyphicon glyphicon-home" aria-hidden="true"></span> <span id="majuscule">{{ session['username'] }} </span><span class="caret"></span></a>
|
||||
<ul class="dropdown-menu" role="menu">
|
||||
<li><a href="/profil/{{ session['username'] }}"><span class="glyphicon glyphicon-user" aria-hidden="true"></span> Profil</a></li>
|
||||
<li><a href="/profil/"><span class="glyphicon glyphicon-user" aria-hidden="true"></span> Profil</a></li>
|
||||
<li><a href="/parametres/"><span class="glyphicon glyphicon-cog" aria-hidden="true"></span> Paramètres</a></li>
|
||||
<li class="divider"></li>
|
||||
<!--<li class="dropdown-header">Nav header</li>-->
|
||||
@ -32,7 +32,7 @@
|
||||
</li>
|
||||
</ul>
|
||||
<ul class="nav navbar-nav navbar-right">
|
||||
<li><a href="/logout/"><span class="glyphicon glyphicon-off" aria-hidden="true"></span> Exit</a></li>
|
||||
<li><a href="/logout/"><span class="glyphicon glyphicon-off" aria-hidden="true"></span> Se déconnecter</a></li>
|
||||
</ul>
|
||||
</div><!--/.nav-collapse -->
|
||||
</div>
|
||||
@ -51,13 +51,20 @@
|
||||
<div class="col-sm-1"></div>
|
||||
<div class="col-sm-10">
|
||||
<br />
|
||||
<div class="well"> Hello <span id="majuscule">{{ session['username'] }} ! </span>Bienvenue sur ce blog communautaire. Il vous est possible de poster des articles en tout genre sur cette page. Vous disposez pour cela d'un éditeur de type Markdown. Une page <a href="/blog/{{ session['username'] }}"><span class="glyphicon glyphicon-star" aria-hidden="true"></span> Page publique</a> et une <a href="/privateblog/"><span class="glyphicon glyphicon-star" aria-hidden="true"></span> Page privée</a> vous sont attribuées.<br>Ayez bien conscience que ce site est une expérience est qu'il est indispensable d'avoir une sauvegarde de tous vos articles. Nous ne pourrons, en aucun cas, être tenu responsable de la perte de vos données. Merci de votre compréhension.</div>
|
||||
<div class="well"> Hello <span id="majuscule">{{ session['username'] }} ! </span>
|
||||
Bienvenue sur le tableau de post-it communautaire.
|
||||
Il vous est possible de laisser des post-its en tout genre sur cette page.
|
||||
Vous disposez pour cela d'un éditeur de type Markdown.
|
||||
Une page <a href="/postit/publicblog"><span class="glyphicon glyphicon-star" aria-hidden="true"></span>
|
||||
est là pour consulter le tableau public du serveur</a>.
|
||||
Celui-ci regroupe tout les post-it public des utilisateurs inscrits sur le serveur.<br>
|
||||
Vous pouvez aussi écrire des post-its privé que vous seul pourrait consulter.</div>
|
||||
</div>
|
||||
</div>
|
||||
<br />
|
||||
|
||||
|
||||
<form method="POST" action="{{ url_for('blog.racine_blog') }}" id="postform">
|
||||
<form method="POST" action="{{ url_for('post-it.racine_blog') }}" id="postform">
|
||||
<!--<input type="text" name="category" id="category" placeholder="Catégorie" class="form-control"><br />-->
|
||||
<input type="text" name="title" id="title" placeholder="Titre" class="form-control"><br />
|
||||
<textarea class="form-control" form="postform" name="content" id="content" placeholder="Contenu" style="height:30vw;"></textarea><br />
|
||||
@ -79,7 +86,7 @@
|
||||
|
||||
<div class="col-sm-2">
|
||||
<img src="/static/usersprofil/{{ post.avatar }}" class="img-rounded" alt=""/><br><br>
|
||||
<p>{{ post.nom }}<br>{{ post.prenom }}<br>{{ post.age }} ans<br>{{ post.profession }}<br></p>
|
||||
<p>{{ post.nom }}<br>{{ post.prenom }}<br>{{ post.age }} ans<br></p>
|
||||
</div>
|
||||
|
||||
<div class="col-sm-9">
|
||||
@ -100,8 +107,8 @@
|
||||
<h4><span class="label label-success">Public</span></h4>
|
||||
{% endif %}
|
||||
<br /><br>
|
||||
<a href="{{ url_for('blog.edit', post=post.title) }}"><button type="button" class="btn btn-sm btn-primary"><span class="glyphicon glyphicon-edit" aria-hidden="true"></span></button></a><br /><br>
|
||||
<a href="{{ url_for('blog.delete', post=post.title) }}"><button type="button" class="btn btn-sm btn-danger"><span class="glyphicon glyphicon-trash" aria-hidden="true"></span></button></a><br /><br>
|
||||
<a href="{{ url_for('post-it.edit', post=post.title) }}"><button type="button" class="btn btn-sm btn-primary"><span class="glyphicon glyphicon-edit" aria-hidden="true"></span></button></a><br /><br>
|
||||
<a href="{{ url_for('post-it.delete', post=post.title) }}"><button type="button" class="btn btn-sm btn-danger"><span class="glyphicon glyphicon-trash" aria-hidden="true"></span></button></a><br /><br>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
|
@ -15,7 +15,7 @@
|
||||
</div>
|
||||
<div class="navbar-collapse collapse">
|
||||
<ul class="nav navbar-nav">
|
||||
<li><a href="/blog"><span class="glyphicon glyphicon-globe" aria-hidden="true"></span> Blog</a></li>
|
||||
<li><a href="/post-it/"><span class="glyphicon glyphicon-globe" aria-hidden="true"></span> Blog</a></li>
|
||||
<li><a href="/filesupload/"><span class="glyphicon glyphicon-cloud-upload" aria-hidden="true"></span> Upload</a></li>
|
||||
<li><a href="/view/"><span class="glyphicon glyphicon-cloud-download" aria-hidden="true"></span> Fichiers</a></li>
|
||||
<li class="active"><a href="/gallery/"><span class="glyphicon glyphicon-eye-open" aria-hidden="true"></span> Gallerie</a></li>
|
||||
@ -23,7 +23,7 @@
|
||||
<li class="dropdown">
|
||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown"><span class="glyphicon glyphicon-home" aria-hidden="true"></span> <span id="majuscule">{{ session['username'] }} <span class="caret"></span></a>
|
||||
<ul class="dropdown-menu" role="menu">
|
||||
<li><a href="/profil/{{ session['username'] }}"><span class="glyphicon glyphicon-user" aria-hidden="true"></span> Profil</a></li>
|
||||
<li><a href="/profil/"><span class="glyphicon glyphicon-user" aria-hidden="true"></span> Profil</a></li>
|
||||
<li><a href="/parametres/"><span class="glyphicon glyphicon-cog" aria-hidden="true"></span> Paramètres</a></li>
|
||||
<li class="divider"></li>
|
||||
<!--<li class="dropdown-header">Nav header</li>-->
|
||||
|
@ -10,9 +10,9 @@
|
||||
|
||||
<div class="masthead clearfix">
|
||||
<div class="inner">
|
||||
<h3 class="masthead-brand">OpenBlogStock</h3>
|
||||
<h3 class="masthead-brand">Pywallter</h3>
|
||||
<ul class="nav masthead-nav">
|
||||
<li><a href="/filesupload/">Login</a></li>
|
||||
<li><a href="/login/">Login</a></li>
|
||||
<li class="active"><a href="/inscription/">Inscription</a></li>
|
||||
<li><a href="#">Contact</a></li>
|
||||
</ul>
|
||||
|
@ -14,8 +14,8 @@
|
||||
<!--<a class="navbar-brand" href="/blog/">Blog</a>-->
|
||||
</div>
|
||||
<div class="navbar-collapse collapse">
|
||||
<ul class="nav navbar-nav">
|
||||
<li><a href="/blog"><span class="glyphicon glyphicon-globe" aria-hidden="true"></span> Blog</a></li>
|
||||
<ul class="nav navbar-nav">
|
||||
<li><a href="/post-it/"><span class="glyphicon glyphicon-globe" aria-hidden="true"></span> Tableau des post-it !</a></li>
|
||||
<li><a href="/filesupload/"><span class="glyphicon glyphicon-cloud-upload" aria-hidden="true"></span> Upload</a></li>
|
||||
<li><a href="/view/"><span class="glyphicon glyphicon-cloud-download" aria-hidden="true"></span> Fichiers</a></li>
|
||||
<li><a href="/gallery/"><span class="glyphicon glyphicon-eye-open" aria-hidden="true"></span> Gallerie</a></li>
|
||||
@ -23,7 +23,7 @@
|
||||
<li class="dropdown">
|
||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown"><span class="glyphicon glyphicon-home" aria-hidden="true"></span> <span id="majuscule">{{ session['username'] }} <span class="caret"></span></a>
|
||||
<ul class="dropdown-menu" role="menu">
|
||||
<li><a href="/profil/{{ session['username'] }}"><span class="glyphicon glyphicon-user" aria-hidden="true"></span> Profil</a></li>
|
||||
<li><a href="/profil/"><span class="glyphicon glyphicon-user" aria-hidden="true"></span> Profil</a></li>
|
||||
<li><a href="/parametres/"><span class="glyphicon glyphicon-cog" aria-hidden="true"></span> Paramètres</a></li>
|
||||
<li class="divider"></li>
|
||||
<!--<li class="dropdown-header">Nav header</li>-->
|
||||
|
@ -14,8 +14,8 @@
|
||||
<!--<li class="active"><a href="/blog/">Blog</a></li>-->
|
||||
</div>
|
||||
<div class="navbar-collapse collapse">
|
||||
<ul class="nav navbar-nav">
|
||||
<li><a href="/blog"><span class="glyphicon glyphicon-globe" aria-hidden="true"></span> Blog</a></li>
|
||||
<ul class="nav navbar-nav">
|
||||
<li><a href="/post-it/"><span class="glyphicon glyphicon-globe" aria-hidden="true"></span> Tableau des post-it !</a></li>
|
||||
<li><a href="/upload/"><span class="glyphicon glyphicon-cloud-upload" aria-hidden="true"></span> Upload</a></li>
|
||||
<li><a href="/view/"><span class="glyphicon glyphicon-cloud-download" aria-hidden="true"></span> Fichiers</a></li>
|
||||
<li><a href="/gallery/"><span class="glyphicon glyphicon-eye-open" aria-hidden="true"></span> Gallerie</a></li>
|
||||
@ -23,7 +23,7 @@
|
||||
<li class="dropdown">
|
||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown"><span class="glyphicon glyphicon-home" aria-hidden="true"></span> {{ session['username'] }} <span class="caret"></span></a>
|
||||
<ul class="dropdown-menu" role="menu">
|
||||
<li><a href="/profil/{{ session['username'] }}"><span class="glyphicon glyphicon-user" aria-hidden="true"></span> Profil</a></li>
|
||||
<li><a href="/profil/"><span class="glyphicon glyphicon-user" aria-hidden="true"></span> Profil</a></li>
|
||||
<li><a href="/parametres/"><span class="glyphicon glyphicon-cog" aria-hidden="true"></span> Paramètres</a></li>
|
||||
<li class="divider"></li>
|
||||
<!--<li class="dropdown-header">Nav header</li>-->
|
||||
|
@ -14,8 +14,8 @@
|
||||
<!--<li class="active"><a href="/blog/">Blog</a></li>-->
|
||||
</div>
|
||||
<div class="navbar-collapse collapse">
|
||||
<ul class="nav navbar-nav">
|
||||
<li class="active"><a href="/blog"><span class="glyphicon glyphicon-globe" aria-hidden="true"></span> Blog</a></li>
|
||||
<ul class="nav navbar-nav">
|
||||
<li class="active"><a href="/post-it/"><span class="glyphicon glyphicon-globe" aria-hidden="true"></span> Tableau des post-it !</a></li>
|
||||
<li><a href="/upload/"><span class="glyphicon glyphicon-cloud-upload" aria-hidden="true"></span> Upload</a></li>
|
||||
<li><a href="/view/"><span class="glyphicon glyphicon-cloud-download" aria-hidden="true"></span> Fichiers</a></li>
|
||||
<li><a href="/gallery/"><span class="glyphicon glyphicon-eye-open" aria-hidden="true"></span> Gallerie</a></li>
|
||||
@ -23,7 +23,7 @@
|
||||
<li class="dropdown">
|
||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown"><span class="glyphicon glyphicon-home" aria-hidden="true"></span> <span id="majuscule">{{ session['username'] }} </span><span class="caret"></span></a>
|
||||
<ul class="dropdown-menu" role="menu">
|
||||
<li><a href="/profil/{{ session['username'] }}"><span class="glyphicon glyphicon-user" aria-hidden="true"></span> Profil</a></li>
|
||||
<li><a href="/profil/"><span class="glyphicon glyphicon-user" aria-hidden="true"></span> Profil</a></li>
|
||||
<li><a href="/parametres/"><span class="glyphicon glyphicon-cog" aria-hidden="true"></span> Paramètres</a></li>
|
||||
<li class="divider"></li>
|
||||
<!--<li class="dropdown-header">Nav header</li>-->
|
||||
|
@ -7,7 +7,7 @@
|
||||
<div class="col-sm-4">
|
||||
<p id="majuscule" class="text-center"><h3>Articles privés de <span id="majuscule">{{ UTILISATEUR }}</span></h3>
|
||||
<br />
|
||||
<h5>Articles visibles par vous seul ...</h5></p>
|
||||
<h5> Articles visibles par vous uniquement </h5></p>
|
||||
</div>
|
||||
<div class="col-sm-6">
|
||||
</div>
|
||||
|
@ -14,23 +14,23 @@
|
||||
<!--<li class="active"><a href="/blog/">Blog</a></li>-->
|
||||
</div>
|
||||
<div class="navbar-collapse collapse">
|
||||
<ul class="nav navbar-nav">
|
||||
<li><a href="/blog"><span class="glyphicon glyphicon-globe" aria-hidden="true"></span> Blog</a></li>
|
||||
<li><a href="/filesupload/"><span class="glyphicon glyphicon-cloud-upload" aria-hidden="true"></span> Upload</a></li>
|
||||
<li><a href="/view/"><span class="glyphicon glyphicon-cloud-download" aria-hidden="true"></span> Fichiers</a></li>
|
||||
<li><a href="/gallery/"><span class="glyphicon glyphicon-eye-open" aria-hidden="true"></span> Gallerie</a></li>
|
||||
<li><a href="/logs/"><span class="glyphicon glyphicon-floppy-disk" aria-hidden="true"></span> Logs</a></li>
|
||||
<li class="dropdown">
|
||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown"><span class="glyphicon glyphicon-home" aria-hidden="true"></span> <span id="majuscule">{{ session['username'] }} <span class="caret"></span></a>
|
||||
<ul class="dropdown-menu" role="menu">
|
||||
<li><a href="/profil/{{ session['username'] }}"><span class="glyphicon glyphicon-user" aria-hidden="true"></span> Profil</a></li>
|
||||
<li><a href="/parametres/"><span class="glyphicon glyphicon-cog" aria-hidden="true"></span> Paramètres</a></li>
|
||||
<li class="divider"></li>
|
||||
<ul class="nav navbar-nav">
|
||||
<li><a href="/post-it/"><span class="glyphicon glyphicon-globe" aria-hidden="true"></span> Tableau des post-it !</a></li>
|
||||
<li><a href="/filesupload/"><span class="glyphicon glyphicon-cloud-upload" aria-hidden="true"></span> Upload</a></li>
|
||||
<li><a href="/view/"><span class="glyphicon glyphicon-cloud-download" aria-hidden="true"></span> Fichiers</a></li>
|
||||
<li><a href="/gallery/"><span class="glyphicon glyphicon-eye-open" aria-hidden="true"></span> Gallerie</a></li>
|
||||
<li><a href="/logs/"><span class="glyphicon glyphicon-floppy-disk" aria-hidden="true"></span> Logs</a></li>
|
||||
<li class="dropdown">
|
||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown"><span class="glyphicon glyphicon-home" aria-hidden="true"></span> <span id="majuscule">{{ session['username'] }} <span class="caret"></span></a>
|
||||
<ul class="dropdown-menu" role="menu">
|
||||
<li><a href="/profil/{{ session['username'] }}"><span class="glyphicon glyphicon-user" aria-hidden="true"></span> Profil</a></li>
|
||||
<li><a href="/parametres/"><span class="glyphicon glyphicon-cog" aria-hidden="true"></span> Paramètres</a></li>
|
||||
<li class="divider"></li>
|
||||
<!--<li class="dropdown-header">Nav header</li>-->
|
||||
<li><a href="/logout/"><span class="glyphicon glyphicon-off" aria-hidden="true"></span> Déconnexion</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
<li><a href="/logout/"><span class="glyphicon glyphicon-off" aria-hidden="true"></span> Déconnexion</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
<ul class="nav navbar-nav navbar-right">
|
||||
<li><a href="/logout/"><span class="glyphicon glyphicon-off" aria-hidden="true"></span> Exit</a></li>
|
||||
</ul>
|
||||
@ -46,41 +46,7 @@
|
||||
</div>-->
|
||||
|
||||
<div class="row">
|
||||
<!-- <div class="col-sm-6">
|
||||
<div class="panel panel-primary">
|
||||
<div class="panel-heading">
|
||||
<h3 class="panel-title">Image de profil</h3>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
|
||||
<form method="post" action="" enctype="multipart/form-data">
|
||||
<label for="fic">Choisissez une image de profil :</label><input type="file" name="fic" id="fic"/>
|
||||
<br>
|
||||
<button type="submit" id="tada" class="btn btn btn-success">Envoyer</button>
|
||||
</form>
|
||||
|
||||
<div>
|
||||
<img src="/static/usersprofil/{{ imageprofil[0] }}" class="img-rounded" alt=""/>
|
||||
</div>
|
||||
|
||||
<div class="msginfo">
|
||||
{# on affiche les messages d'erreur puis les messages de succes #}
|
||||
{% for categorie in ['error', 'succes'] %}
|
||||
{% with msgs = get_flashed_messages(category_filter=[categorie]) %}
|
||||
{% if msgs %}
|
||||
<div class="flashed {{ categorie }}">
|
||||
{% for m in msgs %}
|
||||
<p>{{ m|safe }}</p>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endwith %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>-->
|
||||
<div class="col-sm-3"></div>
|
||||
<div class="col-sm-6">
|
||||
<div class="panel panel-primary">
|
||||
@ -89,14 +55,20 @@
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<form method="POST" action="" enctype="multipart/form-data">
|
||||
<div id="fic"><input type="file" name="fic" id="fic"/><br>
|
||||
<img id="fic" src="/static/usersprofil/{{ imageprofil[0] }}" class="img-rounded" alt=""/>
|
||||
</div>
|
||||
<br>
|
||||
<input type="text" name="nom" id="nom" placeholder="Nom" class="form-control"><br />
|
||||
<input type="text" name="prenom" id="prenom" placeholder="Prénom" class="form-control"><br />
|
||||
<input type="text" name="age" id="age" placeholder="Âge" class="form-control"><br />
|
||||
<input type="text" name="profession" id="profession" placeholder="Profession" class="form-control"><br />
|
||||
<div id="fic">
|
||||
<label> Photo de profil </label>
|
||||
<input type="file" name="fic" id="fic"/><br>
|
||||
<img id="fic" src="/static/usersprofil/{{ profil['avatar'] }}" class="img-rounded" alt=""/>
|
||||
</div>
|
||||
<br>
|
||||
<label>Nom </label>
|
||||
<input type="text" name="nom" id="nom" value="{{ profil['nom'] }}" class="form-control"><br />
|
||||
<label>Prenom </label>
|
||||
<input type="text" name="prenom" id="prenom" value="{{ profil['prenom'] }}" class="form-control"><br />
|
||||
<label> Age </label>
|
||||
<input type="text" name="age" value="{{ profil['age'] }}" class="form-control"><br />
|
||||
<label> Mail de secours </label>
|
||||
<input type="text" name="mail_rescue" id="mail_rescue" value="{{ profil['mail_rescue'] }}" class="form-control"><br />
|
||||
<button id="tada" class="btn btn-default btn-primary" type="submit">Envoyer</button>
|
||||
</form>
|
||||
{# on affiche les messages d'erreur puis les messages de succes #}
|
||||
|
@ -4,14 +4,10 @@
|
||||
|
||||
<div class="jumbotron">
|
||||
<div class="row">
|
||||
<div class="col-sm-4">
|
||||
<p id="majuscule" class="text-center"><h3>Blog de <span id="majuscule">{{ username }}</span></h3></p>
|
||||
</div>
|
||||
<div class="col-sm-6">
|
||||
</div>
|
||||
<div class="col-sm-2">
|
||||
<img src="/static/usersprofil/{{ usersinfos[0] }}" class="img-rounded" alt=""/>
|
||||
</div>
|
||||
<p id="majuscule" class="text-center"><h3>Blog du serveur</h3>
|
||||
Ici vous retourvez tous les post-it que les membres du serveur veulent
|
||||
patrtager avec les autres membres du même serveur.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<br>
|
||||
|
@ -15,7 +15,7 @@
|
||||
</div>
|
||||
<div class="navbar-collapse collapse">
|
||||
<ul class="nav navbar-nav">
|
||||
<li><a href="/blog"><span class="glyphicon glyphicon-globe" aria-hidden="true"></span> Blog</a></li>
|
||||
<li><a href="/post-it/"><span class="glyphicon glyphicon-globe" aria-hidden="true"></span> Tableau des post-it !</a></li>
|
||||
<li><a href="/filesupload/"><span class="glyphicon glyphicon-cloud-upload" aria-hidden="true"></span> Upload</a></li>
|
||||
<li class="active"><a href="/view/"><span class="glyphicon glyphicon-cloud-download" aria-hidden="true"></span> Fichiers</a></li>
|
||||
<li><a href="/gallery/"><span class="glyphicon glyphicon-eye-open" aria-hidden="true"></span> Gallerie</a></li>
|
||||
|
@ -14,8 +14,8 @@
|
||||
<!--<a class="navbar-brand" href="/blog/">Blog</a>-->
|
||||
</div>
|
||||
<div class="navbar-collapse collapse">
|
||||
<ul class="nav navbar-nav">
|
||||
<li><a href="/blog/"><span class="glyphicon glyphicon-globe" aria-hidden="true"></span> Blog</a></li>
|
||||
<ul class="nav navbar-nav">
|
||||
<li><a href="/post-it/"><span class="glyphicon glyphicon-globe" aria-hidden="true"></span> Tableau des post-it !</a></li>
|
||||
<li class="active"><a href="/uploadfiles/"><span class="glyphicon glyphicon-cloud-upload" aria-hidden="true"></span> Upload</a></li>
|
||||
<li><a href="/view/"><span class="glyphicon glyphicon-cloud-download" aria-hidden="true"></span> Fichiers</a></li>
|
||||
<li><a href="/gallery/"><span class="glyphicon glyphicon-eye-open" aria-hidden="true"></span> Gallerie</a></li>
|
||||
@ -23,7 +23,7 @@
|
||||
<li class="dropdown">
|
||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown"><span class="glyphicon glyphicon-home" aria-hidden="true"></span> <span id="majuscule">{{ session['username'] }} <span class="caret"></span></a>
|
||||
<ul class="dropdown-menu" role="menu">
|
||||
<li><a href="/profil/{{ session['username'] }}"><span class="glyphicon glyphicon-user" aria-hidden="true"></span> Profil</a></li>
|
||||
<li><a href="/profil/"><span class="glyphicon glyphicon-user" aria-hidden="true"></span> Profil</a></li>
|
||||
<li><a href="/parametres/"><span class="glyphicon glyphicon-cog" aria-hidden="true"></span> Paramètres</a></li>
|
||||
<li class="divider"></li>
|
||||
<!--<li class="dropdown-header">Nav header</li>-->
|
||||
|
21
tools/databaseinit.py
Normal file → Executable file
21
tools/databaseinit.py
Normal file → Executable file
@ -1,27 +1,29 @@
|
||||
#!venv/bin/python
|
||||
|
||||
import sqlite3
|
||||
import sqlite3
|
||||
import os.path
|
||||
|
||||
def init_db():
|
||||
if os.path.isfile('base.db'):
|
||||
return False
|
||||
else:
|
||||
else:
|
||||
conn = sqlite3.connect('base.db')
|
||||
cursor = conn.cursor()
|
||||
cursor.execute("""
|
||||
CREATE TABLE IF NOT EXISTS users(
|
||||
id INTEGER PRIMARY KEY AUTOINCREMENT UNIQUE,
|
||||
Mail CHAR(80) PRIMARY KEY UNIQUE NOT NULL,
|
||||
name TEXT,
|
||||
mail TEXT,
|
||||
alias TEXT,
|
||||
xmpp TEXT,
|
||||
passwd TEXT,
|
||||
avatar TEXT,
|
||||
nom, TEXT,
|
||||
nom TEXT,
|
||||
prenom TEXT,
|
||||
age TEXT,
|
||||
profession TEXT
|
||||
)
|
||||
""")
|
||||
website TEXT,
|
||||
Token CHAR(30),
|
||||
Mail_rescue TEXT )
|
||||
""")
|
||||
conn.commit()
|
||||
print ('table users OK')
|
||||
|
||||
@ -40,10 +42,9 @@ def init_db():
|
||||
conn.close()
|
||||
print ('table posts OK')
|
||||
return True
|
||||
|
||||
|
||||
def init_dir():
|
||||
if os.path.isdir('users'):
|
||||
return False
|
||||
else:
|
||||
os.makedirs('./users/')
|
||||
|
||||
|
@ -5,15 +5,10 @@ from flask import Blueprint, escape, render_template, session, redirect, url_for
|
||||
import time
|
||||
import sqlite3
|
||||
from markdown import markdown
|
||||
blog = Blueprint('blog', __name__, template_folder='templates')
|
||||
postit = Blueprint('post-it', __name__, template_folder='templates')
|
||||
|
||||
# Un bon gros bug de flask il ne faut pas mettre le meme nom d'une parti ici
|
||||
# a une fonction sinon ca fait une erreur
|
||||
# k/app.py", line 958, in register_blueprint
|
||||
# if blueprint.name in self.blueprints:
|
||||
#https://github.com/pallets/flask/issues/1327
|
||||
|
||||
@blog.route('/blog/', methods=['GET', 'POST'])
|
||||
@postit.route('/post-it/', methods=['GET', 'POST'])
|
||||
def racine_blog():
|
||||
if 'username' in session:
|
||||
UTILISATEUR='%s'% escape(session['username'])
|
||||
@ -25,49 +20,30 @@ def racine_blog():
|
||||
TIME=time.strftime("%A %d %B %Y %H:%M:%S")
|
||||
conn = sqlite3.connect('base.db') # Connexion la base de donne
|
||||
cursor = conn.cursor() # Création de l'objet "curseur"
|
||||
cursor.execute("""INSERT INTO posts(title, content, time, author, status) VALUES(?, ?, ?, ?, ?)""", (title, content, TIME, UTILISATEUR, status)) # Insérer des valeurs
|
||||
cursor.execute("""INSERT INTO posts(title, content, time, author, status) VALUES(?, ?, ?, ?, ?)""",
|
||||
(title, content, TIME, UTILISATEUR, status)) # Insérer des valeurs
|
||||
conn.commit()
|
||||
cursor.execute("""SELECT title, content, time, author, status, avatar, nom, prenom, age, profession FROM posts INNER JOIN users ON author = name AND status='public'""")
|
||||
posts = [dict(title=row[0], content=row[1], time=row[2], author=row[3], status=row[4], avatar=row[5], nom=row[6], prenom=row[7], age=row[8], profession=row[9]) for row in reversed(cursor.fetchall())]
|
||||
cursor.execute("""SELECT title, content, time, author, status, avatar, nom, prenom, age FROM posts INNER JOIN users ON author = name""")
|
||||
posts = [dict(title=row[0], content=row[1], time=row[2], author=row[3],
|
||||
status=row[4], avatar=row[5], nom=row[6], prenom=row[7], age=row[8])
|
||||
for row in reversed(cursor.fetchall())]
|
||||
conn.close()
|
||||
return render_template('blog.html', posts=posts)
|
||||
else:
|
||||
conn = sqlite3.connect('base.db') # Connexion à la base de donnée
|
||||
cursor = conn.cursor() # Création de l'objet "curseur"
|
||||
cursor.execute("""SELECT title, content, time, author, status, avatar, nom, prenom, age, profession FROM posts INNER JOIN users ON author = name AND status='public'""")
|
||||
posts = [dict(title=row[0], content=row[1], time=row[2], author=row[3], status=row[4], avatar=row[5], nom=row[6], prenom=row[7], age=row[8], profession=row[9]) for row in reversed(cursor.fetchall())]
|
||||
cursor.execute("""SELECT title, content, time, author, status, avatar, nom, prenom, age FROM posts INNER JOIN users ON author = name""")
|
||||
posts = [dict(title=row[0], content=row[1], time=row[2], author=row[3],
|
||||
status=row[4], avatar=row[5], nom=row[6], prenom=row[7], age=row[8])
|
||||
for row in reversed(cursor.fetchall())]
|
||||
conn.close()
|
||||
return render_template('blog.html', posts=posts)
|
||||
else:
|
||||
return redirect(url_for('loginlogout.login', _external=True))
|
||||
|
||||
@blog.route('/blog/<username>')
|
||||
def members(username):
|
||||
conn = sqlite3.connect('base.db') # Connexion à la base de donnée
|
||||
cursor = conn.cursor() # Création de l'objet "curseur"
|
||||
cursor.execute("""SELECT title, content, time, author, status FROM posts WHERE author=? AND status='public'""", (username,))
|
||||
posts = [dict(title=row[0], content=row[1], time=row[2], author=row[3], status=row[4]) for row in reversed(cursor.fetchall())]
|
||||
cursor.execute("""SELECT avatar, nom, prenom, age, profession FROM users WHERE name=?""", (username,))
|
||||
usersinfos = (cursor.fetchone())
|
||||
conn.close()
|
||||
return render_template('publicblog.html', username=username, posts=posts, usersinfos=usersinfos)
|
||||
|
||||
@blog.route('/privateblog/')
|
||||
def privateblog():
|
||||
UTILISATEUR='%s'% escape(session['username'])
|
||||
if 'username' in session :
|
||||
conn = sqlite3.connect('base.db') # Connexion à la base de donnée
|
||||
cursor = conn.cursor() # Création de l'objet "curseur"
|
||||
cursor.execute("""SELECT title, content, time, author, status FROM posts WHERE author=? AND status='prive'""", (UTILISATEUR,))
|
||||
posts = [dict(title=row[0], content=row[1], time=row[2], author=row[3], status=row[4]) for row in reversed(cursor.fetchall())]
|
||||
cursor.execute("""SELECT avatar, nom, prenom, age, profession FROM users WHERE name=?""", (UTILISATEUR,))
|
||||
usersinfos = (cursor.fetchone())
|
||||
conn.close()
|
||||
return render_template('privateblog.html', UTILISATEUR=UTILISATEUR, posts=posts, usersinfos=usersinfos)
|
||||
else:
|
||||
return redirect(url_for('loginlogout.login', _external=True)) # sinon on redirige vers login
|
||||
|
||||
@blog.route('/delete/<post>')
|
||||
@postit.route('/delete/<post>')
|
||||
def delete(post):
|
||||
if 'username' in session :
|
||||
conn = sqlite3.connect('base.db') # Connexion à la base de donnée
|
||||
@ -75,11 +51,11 @@ def delete(post):
|
||||
cursor.execute("""DELETE FROM posts WHERE title=?""", (post,))
|
||||
conn.commit()
|
||||
conn.close()
|
||||
return redirect(url_for('blog.racine_blog'))
|
||||
return redirect(url_for('post-it.racine_blog'))
|
||||
else:
|
||||
return redirect(url_for('loginlogout.login', _external=True)) # sinon on redirige vers login
|
||||
|
||||
@blog.route('/edit/<post>', methods=['GET', 'POST'])
|
||||
@postit.route('/edit/<post>', methods=['GET', 'POST'])
|
||||
def edit(post):
|
||||
if 'username' in session :
|
||||
if request.method == 'POST' :
|
||||
@ -92,7 +68,7 @@ def edit(post):
|
||||
(newtitle, newcontent, newstatus, post,))
|
||||
conn.commit()
|
||||
conn.close()
|
||||
return redirect(url_for('blog.racine_blog'))
|
||||
return redirect(url_for('post-it.racine_blog'))
|
||||
else:
|
||||
conn = sqlite3.connect('base.db') # Connexion à la base de donnée
|
||||
cursor = conn.cursor() # Création de l'objet "curseur"
|
||||
|
@ -19,13 +19,16 @@ def login() :
|
||||
users = cursor.fetchall()
|
||||
conn.close()
|
||||
password = request.form['passwd']
|
||||
for i in users:
|
||||
if i[0] == request.form['user'] and bcrypt.check_password_hash(i[1], password) is True:
|
||||
for user in users:
|
||||
print (user[0])
|
||||
passwd = str(user[1] )
|
||||
print ( passwd[2:(len(passwd)-1 )] )
|
||||
if user[0] == request.form['user'] and bcrypt.check_password_hash(user[1], password) is True:
|
||||
session['username'] = request.form['user']
|
||||
return redirect(url_for('filesupload.uploadfiles', _external=True))
|
||||
return redirect(url_for('profil.profile', _external=True))
|
||||
return redirect(url_for('loginlogout.login', _external=True))
|
||||
else:
|
||||
return render_template('login.html')
|
||||
return render_template('accueil.html')
|
||||
|
||||
@loginlogout.route( '/logout/' )
|
||||
def logout():
|
||||
|
127
views/profil.py
127
views/profil.py
@ -10,71 +10,68 @@ profil = Blueprint('profil', __name__, template_folder='templates')
|
||||
DOSSIER_PERSO='users/'
|
||||
extensionimg = {'.jpg', '.JPG', '.png', '.PNG', '.gif', '.GIF', '.bmp', '.BMP', '.jpeg', '.JPEG' }
|
||||
|
||||
@profil.route('/profil/<username>/', methods=['GET','POST'] )
|
||||
def profile(username=None) :
|
||||
@profil.route('/profil/', methods=['GET','POST'] )
|
||||
def profile() :
|
||||
if 'username' in session :
|
||||
UTILISATEUR='%s' % escape(session['username'])
|
||||
conn = sqlite3.connect('base.db') # Connexion à la base de donnée
|
||||
cursor = conn.cursor() # Création de l'objet "curseur"
|
||||
cursor.execute("""SELECT avatar FROM users WHERE name=?""", (username,))
|
||||
imageprofil = cursor.fetchone()
|
||||
conn.close()
|
||||
if request.method == 'POST' :
|
||||
f = request.files['fic']
|
||||
nom = request.form['nom']
|
||||
prenom = request.form['prenom']
|
||||
age = request.form['age']
|
||||
profession = request.form['profession']
|
||||
if f: # On vérifie qu'un fichier a bien été envoyé
|
||||
nom = secure_filename(f.filename)
|
||||
f.save(DOSSIER_PERSO + UTILISATEUR + '/profile/' + nom)
|
||||
image = DOSSIER_PERSO + UTILISATEUR + '/profile/' + nom
|
||||
with Image.open(image) as img:
|
||||
img.tumbnails(resize='80x80')
|
||||
img.save(filename = DOSSIER_PERSO + UTILISATEUR + '/profile/' + nom)
|
||||
imagelocation = DOSSIER_PERSO + UTILISATEUR + '/profile/' + nom
|
||||
conn = sqlite3.connect('base.db') # Connexion à la base de donnée
|
||||
cursor = conn.cursor() # Création de l'objet "curseur"
|
||||
cursor.execute("UPDATE users SET avatar=? WHERE name=?", (imagelocation, username))
|
||||
conn.commit()
|
||||
cursor.execute("""SELECT avatar FROM users WHERE name=?""", (username,))
|
||||
imageprofil = cursor.fetchone()
|
||||
conn.close()
|
||||
flash(u'Image de profil mise à jour', 'succes')
|
||||
return render_template('profil.html', imageprofil=imageprofil, username=username)
|
||||
else:
|
||||
# return render_template('profil.html', imageprofil=imageprofil, username=username)
|
||||
####### Informations personnelles #######
|
||||
if nom:
|
||||
if prenom:
|
||||
if age:
|
||||
if profession:
|
||||
conn = sqlite3.connect('base.db') # Connexion à la base de donnée
|
||||
cursor = conn.cursor() # Création de l'objet "curseur"
|
||||
cursor.execute("UPDATE users SET nom=?, prenom=?, age=?, profession=? WHERE name=?""", (nom, prenom, age, profession, username,))
|
||||
conn.commit()
|
||||
conn.close()
|
||||
flash(u'Informations transmisent à la base', 'succes')
|
||||
return render_template('profil.html', imageprofil=imageprofil, username=username)
|
||||
else:
|
||||
flash(u'Veuillez renseigner une profession', 'error')
|
||||
return render_template('profil.html', imageprofil=imageprofil, username=username)
|
||||
else:
|
||||
flash(u'Veuillez renseigner votre âge', 'error')
|
||||
return render_template('profil.html', imageprofil=imageprofil, username=username)
|
||||
else:
|
||||
flash(u'Veuillez renseigner votre prénom', 'error')
|
||||
return render_template('profil.html', imageprofil=imageprofil, username=username)
|
||||
else:
|
||||
flash(u'Veuillez renseigner votre nom', 'error')
|
||||
return render_template('profil.html', imageprofil=imageprofil, username=username)
|
||||
else:
|
||||
conn = sqlite3.connect('base.db') # Connexion à la base de donnée
|
||||
cursor = conn.cursor() # Création de l'objet "curseur"
|
||||
cursor.execute("""SELECT avatar FROM users WHERE name=?""", (username,))
|
||||
imageprofil = cursor.fetchone()
|
||||
conn.close()
|
||||
return render_template('profil.html', imageprofil=imageprofil, username=username)
|
||||
UTILISATEUR='%s' % escape(session['username'])
|
||||
conn = sqlite3.connect('base.db') # Connexion à la base de donnée
|
||||
cursor = conn.cursor() # Création de l'objet "curseur"
|
||||
cursor.execute("""SELECT avatar, nom, prenom, age, mail_rescue FROM users WHERE name=?""", (UTILISATEUR,))
|
||||
tmp = (cursor.fetchone())
|
||||
profil_user = dict()
|
||||
profil_user['avatar'] = tmp[0]
|
||||
profil_user['nom'] = tmp[1]
|
||||
profil_user['prenom'] = tmp[2]
|
||||
profil_user['age'] = tmp[3]
|
||||
profil_user['mail_rescue'] = tmp[4]
|
||||
conn.close()
|
||||
|
||||
if request.method == 'POST' :
|
||||
|
||||
f = request.files['fic']
|
||||
if request.form['nom']:
|
||||
profil_user['nom'] = request.form['nom']
|
||||
if request.form['prenom']:
|
||||
profil_user['prenom'] = request.form['prenom']
|
||||
if request.form['age']:
|
||||
profil_user['age'] = request.form['age']
|
||||
if '@' in request.form['mail_rescue']:
|
||||
if len(request.form['mail_rescue']) > 4:
|
||||
profil_user['mail_rescue'] = request.form['mail_rescue']
|
||||
else:
|
||||
flash(u'Adresse de courriel invalide', 'error')
|
||||
else:
|
||||
flash(u'Adresse de courriel invalide', 'error')
|
||||
if f: # On vérifie qu'un fichier a bien été envoyé
|
||||
nom = secure_filename(f.filename)
|
||||
f.save(DOSSIER_PERSO + UTILISATEUR + '/profile/' + nom)
|
||||
image = DOSSIER_PERSO + UTILISATEUR + '/profile/' + nom
|
||||
with Image.open(image) as img:
|
||||
img.tumbnails(resize='80x80')
|
||||
img.save(filename = DOSSIER_PERSO + UTILISATEUR + '/profile/' + nom)
|
||||
imagelocation = DOSSIER_PERSO + UTILISATEUR + '/profile/' + nom
|
||||
conn = sqlite3.connect('base.db') # Connexion à la base de donnée
|
||||
cursor = conn.cursor() # Création de l'objet "curseur"
|
||||
cursor.execute("UPDATE users SET avatar=? WHERE name=?",
|
||||
(imagelocation, UTILISATEUR))
|
||||
conn.commit()
|
||||
cursor = conn.cursor() # Création de l'objet "curseur"
|
||||
conn.close()
|
||||
flash(u'Image de profil mise à jour', 'succes')
|
||||
|
||||
else:
|
||||
conn = sqlite3.connect('base.db') # Connexion à la base de donnée
|
||||
cursor = conn.cursor() # Création de l'objet "curseur"
|
||||
cursor.execute("UPDATE users SET nom=?, prenom=?, age=?, mail_rescue=? WHERE name=?",
|
||||
(profil_user['nom'], profil_user['prenom'], profil_user['age'], profil_user['mail_rescue'],
|
||||
UTILISATEUR))
|
||||
conn.commit()
|
||||
flash(u'Le profil a été mis à jour', 'succes')
|
||||
|
||||
|
||||
|
||||
|
||||
return render_template('profil.html', profil=profil_user, username=UTILISATEUR)
|
||||
|
||||
else :
|
||||
return redirect(url_for('loginlogout.login', _external=True))
|
||||
return redirect(url_for('loginlogout.login', _external=True))
|
||||
|
Loading…
Reference in New Issue
Block a user