Example #1
0
def register():
    if (request.method == 'POST'):
        if (request.form['type'] == "vendeur"):
            mdp = hashlib.pbkdf2_hmac('sha256', request.form['mdp'].encode(),
                                      b'5gz', 100000)
            prog.regist_vendeur_bd(request.form['pseudo'],
                                   request.form['email'],
                                   binascii.hexlify(mdp).decode())
            session['username'] = request.form['pseudo']
            session['logged'] = True
            session['type'] = True
            return render_template('page_accueil.html',
                                   message="Requête d'adhésion soumise")

        if (request.form['type'] == "client"):
            mdp = hashlib.pbkdf2_hmac('sha256', request.form['mdp'].encode(),
                                      b'5gz', 100000)
            prog.regist_client_bd(request.form['pseudo'],
                                  request.form['email'],
                                  binascii.hexlify(mdp).decode())
            session['username'] = request.form['pseudo']
            session['logged'] = True
            session['type'] = False
            return render_template('page_accueil.html',
                                   logged=session['logged'],
                                   message="Bonjour " + session['username'])

    else:
        return render_template('sign_up.html')
Example #2
0
def register():
    if (request.method == 'POST'):
        prog.regist_vendeur_bd(request.form['pseudo'], request.form['email'],
                               request.form['mdp'])
        return render_template('offre.html',
                               nom_vendeur=request.form['pseudo'],
                               message="Bonjour")
Example #3
0
def register():
    if(request.method=='POST'):
        prog.regist_vendeur_bd(request.form['nom_vendeur'],request.form['email'],request.form['mdp']);
        return render_template('page_offreur.html',nom_vendeur=request.form['nom_vendeur']);