From e6d1c7edf7be72017877fb9f5b77229afbea29f0 Mon Sep 17 00:00:00 2001 From: Jogi Hofmüller Date: Sun, 31 Jul 2011 16:38:40 +0000 Subject: - have a confirmation request sent by email for registration now * still trouble with unicode/utf-8 characters entered in form ... git-svn-id: https://svn.spreadspace.org/mur.sat@86 7de4ea59-55d0-425e-a1af-a3118ea81d4c --- tools/mmd/MmdCommands.py | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) (limited to 'tools/mmd/MmdCommands.py') diff --git a/tools/mmd/MmdCommands.py b/tools/mmd/MmdCommands.py index 19a5968..0ac98da 100644 --- a/tools/mmd/MmdCommands.py +++ b/tools/mmd/MmdCommands.py @@ -41,12 +41,32 @@ def register (session): confirm = session.getQsConfirm () if password != confirm: - error_message = {'error': 'Password', 'description': 'Passwords do not match'} + error_message = {'error': 'Password', 'description': 'Passwords do not match.'} return indexWidget (dataWidget (), errorWidget (error_message), statusWidget (session.session_id, session.email)) user = User () - user.create (session.session_id, firstname, lastname, email, callsign, longitude, latitude, password) + confreg = user.create (session.session_id, firstname, lastname, email, callsign, longitude, latitude, password) + user.email = email + message = '''From: noreply +To: {0} +Subject: MMD registration confirmation request +Good day! + +Someone (probably you) has registered at the MURSAT1 Mission Dashbaord +(MMD) at http://sat.mur.at/dashboard. Please confirm the registration +using the link below: + + + http://hofos.at/mmd/mmd?cmd=confirmRegistration&code={1} + +Regards, +MURSAT1 team +'''.format (user.email, confreg) + + if not user.sendEmail (message): + error_message = {'error': 'Email', 'description': 'Email could not be sent.'} + return indexWidget (dataWidget (), errorWidget (error_message), statusWidget (session.session_id, session.email)) return indexWidget (dataWidget (), registerWidget (), statusWidget (session.session_id, session.email)) -- cgit v1.2.3