Esempio n. 1
0
def updateProfile():
    try:
        registerDAO = RegisterDAO()
        registerVO = RegisterVO()

        loginDAO = LoginDAO()
        loginVO = LoginVO()

        registerVO.registerFirstName = request.form['registerFirstName']
        registerVO.registerLastName = request.form['registerLastName']
        registerVO.registerGender = request.form['registerGender']
        registerVO.registerAddress = request.form['registerAddress']
        registerVO.registerPincode = request.form['registerPincode']
        registerVO.registerContact = request.form['registerContact']

        loginVO.loginEmailId = request.form['registerEmailId']
        loginVO.loginPassword = request.form['loginPassword']
        loginVO.loginId = registerVO.register_LoginId = request.form['loginId']

        loginDict = loginDAO.searchLoginIddata(loginVO)

        if loginVO.loginPassword == loginDict[0]['loginPassword']:
            loginDAO.updateProfile(loginVO)
            registerDAO.updateProfile(registerVO)
            return redirect(url_for('loadProfile'))
        else:
            session['error'] = "*wrong password Please enter again"
            return redirect(url_for('loadEditprofile'))
    except:
        return render_template('admin/login.html')
Esempio n. 2
0
def updatePassword():
    try:
        if session['loginRole'] == 'user':
            loginDAO = LoginDAO()
            loginVO = LoginVO()

            loginVO.loginId = session['loginId']
            loginpassword = request.form['loginpassword']
            loginVO.loginPassword = request.form['loginPassword']

            loginDict = loginDAO.searchLoginIddata(loginVO)
            # print loginDict

            if loginpassword == loginDict[0]['loginPassword']:
                loginDAO.changePassword(loginVO)
                return redirect(url_for('loadProfile'))
            else:
                session['error'] = "*wrong password Please enter again"
                return redirect(url_for('loadChangepassword'))
        else:
            return render_template('admin/login.html')
    except:
        return render_template('admin/login.html')