diff --git a/scripts/cgi-bin/info.py b/scripts/cgi-bin/info.py index b27395fcb..61ea28dab 100755 --- a/scripts/cgi-bin/info.py +++ b/scripts/cgi-bin/info.py @@ -130,14 +130,16 @@ def Save(custid, Password): ShowInfo(custid, Password) # Display("Noch nicht implementiert", "Daten speichern für Kunde #"+str(custid)) -def SendPass(custid): +def SendPass(email): try: db = MySQLdb.connect(db=dbname) cursor=db.cursor() # print custid - cursor.execute('select email, password from users where id='+str(custid)) - email, password = cursor.fetchone() - Msg="From: "+From+"\nTo: "+email+"\nSubject: Vinambar Passwort\n\nDein Vinyambar-Passwort lautet: "+password+"\n" + cursor.execute("select id, email, password from users where email='"+email+"'") + custid, email, password = cursor.fetchone() + Msg="From: "+From+"\nTo: "+email+"\nSubject: Vinambar Passwort\n\n" + Msg=Msg+"Deine Kundennummer ist: "+str(int(custid))+"\n" + Msg=Msg+"Dein Vinyambar-Passwort lautet: "+password+"\n" Msg=Msg+"\nDiese Mail wurde an Dich versandt, weil Du (oder jemand anders) \n" Msg=Msg+"es im Formular auf http://www.vinyambar.de/accounts.shtml angefordert hat.\n" server=smtplib.SMTP(smtpserver) @@ -146,7 +148,7 @@ def SendPass(custid): db.close() Display('