From 502b6a813a6f90c2e7adb5781b1beecd559014d9 Mon Sep 17 00:00:00 2001 From: Jogi Hofmüller Date: Wed, 3 Aug 2011 11:19:44 +0000 Subject: - added functionality for location - user's default location is save - map centers on user's location iff available git-svn-id: https://svn.spreadspace.org/mur.sat@96 7de4ea59-55d0-425e-a1af-a3118ea81d4c --- tools/mmd/MmdCommands.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'tools/mmd/MmdCommands.py') diff --git a/tools/mmd/MmdCommands.py b/tools/mmd/MmdCommands.py index 5355783..c1dbeb9 100644 --- a/tools/mmd/MmdCommands.py +++ b/tools/mmd/MmdCommands.py @@ -46,6 +46,7 @@ def register (session): callsign = session.getQsCallsign () longitude = session.getQsLongitude () latitude = session.getQsLatitude () + location_name = session.getQsLocationName () password = session.getQsPassword () confirm = session.getQsConfirm () @@ -54,7 +55,11 @@ def register (session): return indexWidget (dataWidget (), errorWidget (error_message), statusWidget (session), session) user = User () - code = user.create (session.session_id, firstname, lastname, email, callsign, longitude, latitude, password) + code = user.create (session.session_id, firstname, lastname, email, callsign, password) + + if longitude != '' and latitude != '' and location_name != '': + user.addLocation (location_name, longitude, latitude, 'yes') + message = '''From: noreply To: "{0} {1}" <{2}> Subject: MMD registration confirmation request @@ -124,7 +129,8 @@ def index (session): """ display the index page """ - return indexWidget (dataWidget (), osmWidget (), statusWidget (session), session) + satellite = {'longitude': 15.4426, 'latitude': 47.06576} + return indexWidget (dataWidget (), osmWidget (satellite, session.user), statusWidget (session), session) def mmdtest (env, cookie): body = '' -- cgit v1.2.3