Browse Source

Petite modif

master
Dark-Storm 8 months ago
parent
commit
89e64cd48f
Signed by: Dark-Storm <l.gatin@neuf.fr> GPG Key ID: F61F10FA138E797C
5 changed files with 46 additions and 15 deletions
  1. 3
    1
      app/forms.py
  2. 9
    9
      app/routes.py
  3. 5
    5
      app/templates/base/navbar/account.html
  4. BIN
      assets/diagramme_1.dia
  5. 29
    0
      references.md

+ 3
- 1
app/forms.py View File

@@ -28,6 +28,8 @@ def verify_authentication(form, old_password):
if not current_user.check_password(old_password.data):
raise ValidationError('Mot de passe erroné')

def login_form(f):
pass

class LoginForm(FlaskForm):
username = StringField('Pseudonyme :', validators=[DataRequired()])
@@ -54,4 +56,4 @@ class UpdateAccountForm(FlaskForm):
biography = TextAreaField('Présentation', validators=[Optional()])
newsletter = BooleanField('Inscription à la newsletter', description='Un mail par trimestre environ, pour être prévenu des concours, évènements et nouveautés.')
old_password = PasswordField('Ancien mot de passe :', validators=[DataRequired(), verify_authentication])
submit = SubmitField('Mettre à jour')
submit = SubmitField('Mettre à jour')

+ 9
- 9
app/routes.py View File

@@ -8,14 +8,14 @@ from app.models.users import Member

@app.route('/')
def index():
form = LoginForm()
return render_template('index.html', form=form)
login_form = LoginForm()
return render_template('index.html', login_form=login_form)

@app.route('/login', methods=['GET', 'POST'])
def login():
if request.method == 'GET':
return redirect(url_for('index'))
form = LoginForm()
login_form = LoginForm()
if form.validate_on_submit():
member = Member.query.filter_by(username=form.username.data).first()
if member is None or not member.check_password(form.password.data):
@@ -37,7 +37,7 @@ def account():
if not current_user.is_authenticated:
flash('Veuillez vous authentifier', 'warning')
return redirect(url_for('index'))
form = LoginForm()
login_form = LoginForm()
form2 = UpdateAccountForm()
if request.method == "POST":
if form2.validate_on_submit():
@@ -53,13 +53,13 @@ def account():
flash('Modifications effectuées', 'ok')
else:
flash('Erreur lors de la modification', 'error')
return render_template('account.html', form=form, form2=form2)
return render_template('account.html', login_form=login_form, form2=form2)

@app.route('/register', methods=['GET', 'POST'])
def register():
if current_user.is_authenticated:
return redirect(url_for('index'))
form = LoginForm()
login_form = LoginForm()
form2 = RegistrationForm()
if form2.validate_on_submit():
member = Member(form2.username.data, form2.email.data, form2.password.data)
@@ -69,11 +69,11 @@ def register():
db.session.commit()
flash('Inscription réussie', 'ok')
return redirect(url_for('validation'))
return render_template('register.html', title='Register', form=form, form2=form2)
return render_template('register.html', title='Register', login_form=login_form, form2=form2)

@app.route('/register/validation/')
def validation():
if current_user.is_authenticated :
return redirect(url_for('index'))
form = LoginForm()
return render_template('validation.html', form=form)
login_form = LoginForm()
return render_template('validation.html', login_form=login_form)

+ 5
- 5
app/templates/base/navbar/account.html View File

@@ -50,11 +50,11 @@
Invité
</h2>
<form method="post" action="/login" class="login">
{{ form.hidden_tag() }}
{{ form.username(size=32, placeholder="Identifiant") }}
{{ form.password(size=32, placeholder="Mot de passe") }}
{{ form.submit(class_="bg-green") }}
{{ form.remember_me.label }} {{ form.remember_me() }}
{{ login_form.hidden_tag() }}
{{ login_form.username(size=32, placeholder="Identifiant") }}
{{ login_form.password(size=32, placeholder="Mot de passe") }}
{{ login_form.submit(class_="bg-green") }}
{{ login_form.remember_me.label }} {{ login_form.remember_me() }}
</form>
<hr />
<a href="{{ url_for('register') }}">Mot de passe oublié ?</a>

BIN
assets/diagramme_1.dia View File


+ 29
- 0
references.md View File

@@ -0,0 +1,29 @@
[^1]: https://fr.wikipedia.org/wiki/GAFAM
[^2]: http://sebsauvage.net/wiki/doku.php?id=microsoft
[^3]: https://www.networkworld.com/article/2956574/microsoft-subnet/windows-10-privacy-spyware-settings-user-agreement.html (en)
[^4]: https://www.laquadrature.net/
[^5]: https://www.facebook.com/dan.ariely/posts/904383595868
[^6]: https://fr.wikipedia.org/wiki/Internet
[^7]: https://home.cern/fr/topics/birth-web
[^8]: https://www.youtube.com/watch?v=NNEGQjwcq98
[^9]: https://www.universalis.fr/encyclopedie/utilite-publique/
[^10]: https://fr.wikipedia.org/wiki/Equifax#Piratage_de_2017
[^11]: https://www.zdnet.fr/actualites/le-cloud-en-forte-croissance-aws-seul-au-monde-39859376.htm
[^12]: https://aws.amazon.com/fr/about-aws/global-infrastructure/
[^13]: https://fr.wikipedia.org/wiki/R%C3%A9seau_de_diffusion_de_contenu
[^14]: www.liberation.fr/medias/2009/11/12/google-vous-connait-mieux-que-vous-meme_593141
[^15]: https://fr.wikipedia.org/wiki/Transactions_à_haute_fréquence
[^16]: https://fr.wikipedia.org/wiki/Hippie
[^17]: https://www.journaldunet.com/ebusiness/le-net/1132110-en-images-un-entrepot-de-minage-de-bitcoins-a-hong-kong/
[^18]: https://www.youtube.com/watch?v=bBC-nXj3Ng4
[^19]: https://fr.wikipedia.org/wiki/Démocratie_athénienne
[^20]: https://fr.wikipedia.org/wiki/Protocole
[^21]: http://www.carrefour.com/sites/default/files/cp_carrefour_blockchain_alimentaire_06032018_vf.pdf
[^22]: http://trm.creationmonetaire.info/
[^23]: https://fr.wikipedia.org/wiki/Contrat_intelligent
[^24]: https://fr.wikipedia.org/wiki/Stellar_(protocole_de_paiement)
[^25]: https://tools.wordtothewise.com/rfc/rfc4843
[^26]: https://filecoin.io/
[^27]:
[^28]:
[^29]:

Loading…
Cancel
Save