Пример #1
0
 def post(self):
     email = self.get_argument('email', '')
     doc = User.find_one({'user_email': email})
     if doc:
         emailverify = str(utils.make_emailverify())
         doc.emailverify = emailverify
         doc.save()
         self.send_resetpass_email(emailverify, email)
     self.render('forgotpass_sent.html')
Пример #2
0
 def post(self):
     email = self.get_argument("email", "")
     doc = User.find_one({"user_email": email})
     if doc:
         emailverify = str(utils.make_emailverify())
         doc.emailverify = emailverify
         doc.save()
         self.send_resetpass_email(emailverify, email)
     self.render("forgotpass_sent.html")
Пример #3
0
 def post(self):
     email = self.get_argument('email', '')
     doc = User.find_one({'user_email': email})
     if doc:
         emailverify = str(utils.make_emailverify())
         doc.emailverify = emailverify
         doc.save()
         self.send_resetpass_email(emailverify, email)
     self.render('forgotpass_sent.html')
Пример #4
0
 def get(self):
     user_id = self.current_user['user_id']
     user_name = self.current_user['user_name']
     u = self.get_argument("u", None)
     k = self.get_argument("k", None)
     s = self.get_argument("s", None)
     if u and k:
         result = admin.add_admin(u, k, s)
         if result:
             self.render('admin/become_admin_success.html')
         return
     else:
         key = utils.make_emailverify()
         admin.apply_admin(user_id, key)
         send_become_admin_email(user_id, user_name, key)
         self.render('admin/become_admin_sent.html')
Пример #5
0
 def get(self):
     user_id = self.current_user['user_id']
     user_name = self.current_user['user_name']
     u = self.get_argument("u", None)
     k = self.get_argument("k", None)
     s = self.get_argument("s", None)
     if u and k:
         result = admin.add_admin(u, k, s)
         if result:
             self.render('admin/admin/become_success.html')
         return
     else:
         key = utils.make_emailverify()
         admin.apply_admin(user_id, key)
         send_become_admin_email(user_id, user_name, key)
         self.render('admin/admin/become_sent.html')
Пример #6
0
 def get(self):
     if self.get_argument("openid.mode", None):
         user = yield self.get_authenticated_user()
         doc = User.by_email(user["email"])
         if not doc:
             doc = User
             doc["id"] = doc.find().count() + 1
             doc["user_name"] = user["name"]
             doc["user_pass"] = utils.make_emailverify()
             doc["user_email"] = user["email"]
             doc["user_domain"] = user["name"]
             doc.new(doc)
             send_joinus_email(user["email"], user["name"])
         user_info = {
             "user_id": doc.id,
             "user_name": doc.user_name,
             "user_email": doc.user_email,
             "user_domain": doc.user_domain,
         }
         self.set_secure_cookie("user", tornado.escape.json_encode(user_info))
         self.redirect("/")
         return
     self.authenticate_redirect()
Пример #7
0
 def get(self):
     if self.get_argument("openid.mode", None):
         user = yield self.get_authenticated_user()
         doc = User.by_email(user['email'])
         if not doc:
             doc = User
             doc['id'] = doc.find().count() + 1
             doc['user_name'] = user['name']
             doc['user_pass'] = utils.make_emailverify()
             doc['user_email'] = user['email']
             doc['user_domain'] = user['name']
             doc.new(doc)
             send_joinus_email(user['email'], user['name'])
         user_info = {
             'user_id': doc.id,
             'user_name': doc.user_name,
             'user_email': doc.user_email,
             'user_domain': doc.user_domain}
         self.set_secure_cookie("user",
                                tornado.escape.json_encode(user_info))
         self.redirect("/")
         return
     self.authenticate_redirect()
Пример #8
0
 def get(self):
     if self.get_argument("openid.mode", None):
         user = yield self.get_authenticated_user()
         doc = User.by_email(user['email'])
         if not doc:
             doc = User
             doc['id'] = doc.find().count() + 1
             doc['user_name'] = user['name']
             doc['user_pass'] = utils.make_emailverify()
             doc['user_email'] = user['email']
             doc['user_domain'] = user['name']
             doc.new(doc)
             send_joinus_email(user['email'], user['name'])
         user_info = {
             'user_id': doc.id,
             'user_name': doc.user_name,
             'user_email': doc.user_email,
             'user_domain': doc.user_domain
         }
         self.set_secure_cookie("user",
                                tornado.escape.json_encode(user_info))
         self.redirect("/")
         return
     self.authenticate_redirect()