def get(self):
     cuser = UserMgmt()
     userkey = cuser.getid()
     if not userkey:
         logging.info('toroam.com: not logged in')
         raise Exception("Not logged in")
     
     user = ToroamUsers.get(userkey)
     self.render_template('mytracks.html', {'gpxheadings': user.gpxuser})
Exemple #2
0
 def get(self):
     user = users.get_current_user()
     cuser = UserMgmt()
     if user:
         reglist = None
         logouturl = cuser.getlogouturl()
     else:
         reglist = cuser.getloginlist()
         logouturl = None
     self.render_template('login.html', {'user': user, 'reglist' : reglist, 'logout' : logouturl})
 def post(self):
     cuser = UserMgmt()
     user = cuser.get()
     n = GPXheader(creator=self.request.get('creator'),
             title=self.request.get('title'),
             description=self.request.get('description'),
             owner=user,
             priority=self.request.get('priority'))
     n.status = utils.status_draft
     n.version = utils.version_new
     n.privacy = utils.privacy_private
     n.put()
     logging.info('toroam.com: GPX created with id %s', n.key().id())
     return webapp2.redirect('/edit/%s' % n.key().id())
Exemple #4
0
 def get(self):
     cuser = UserMgmt()
     user = cuser.get()
     if user:
         logging.info("toroam.com: logged in as %s", user.userid)
         username = user.userid
     else:
         username = None
         logging.info("toroam.com: not logged in")
     query = db.Query(GPXheader)
     query.order("-gpxdate")
     query.filter("status =", utils.status_ok)
     query.filter("privacy =", utils.privacy_public)
     gpxheadings = query.run(limit=5, offset=0)
     self.render_template("index.html", {"gpxheadings": gpxheadings, "username": username})
Exemple #5
0
 def get(self):
     cuser = UserMgmt()
     user = cuser.get()
     if user:
         if user.gpxuser:
             gpxs = user.gpxuser
         else:
             gpxs = None
         if user.admin:
             allusers = ToroamUsers.all()
         else:
             allusers = None
         self.render_template('settings.html', {'dbuser': user, 'gpxs': gpxs, 'allusers': allusers})
     else:
         return webapp2.redirect('/login')