예제 #1
0
파일: code.py 프로젝트: break123/CodeShare
 def post(self):
     password = self.get_argument("password")
     id = self.get_argument("id")
     e = self.db.get("SELECT * FROM entries WHERE id = %s", int(id))
     if checkuserpass(password, e["password"]):
         self.set_secure_cookie("codeid", str(id))
         self.redirect("/update/" + str(id))
     else:
         self.redirect("/" + str(id))
예제 #2
0
 def post(self):
     password = self.get_argument("password")
     id = self.get_argument("id")
     e = self.db.get("SELECT * FROM entries WHERE id = %s", int(id))
     if checkuserpass(password, e["password"]):
         self.set_secure_cookie("codeid", str(id))
         self.redirect("/update/" + str(id))
     else:
         self.redirect("/" + str(id))
예제 #3
0
파일: code.py 프로젝트: break123/CodeShare
    def post(self):
        password = self.get_argument("password")
        id = self.get_argument("id")
        e = self.db.get("SELECT * FROM entries WHERE id = %s", int(id))

        if checkuserpass(password, e["password"]):
            self.db.execute("DELETE FROM entries WHERE id=%s", int(id))
            self.redirect("/")
        else:
            self.redirect("/" + str(id))
예제 #4
0
    def post(self):
        password = self.get_argument("password")
        id = self.get_argument("id")
        e = self.db.get("SELECT * FROM entries WHERE id = %s", int(id))

        if checkuserpass(password, e["password"]):
            self.db.execute("DELETE FROM entries WHERE id=%s", int(id))
            self.redirect("/")
        else:
            self.redirect("/" + str(id))
예제 #5
0
파일: code.py 프로젝트: ky0ncheng/codeu
 def post(self, codeid):
     title = xhtml_escape(self.get_argument("title"))
     tep = self.get_argument("info")
     code = xhtml_escape(self.get_argument("code"))
     pswd = self.get_argument("password")
     info = md.convert(tep)
     codes = self.db.get("SELECT * FROM entries WHERE id = %s", int(codeid))
     if checkuserpass(pswd, codes["password"]):
         self.db.execute("""
             UPDATE entries SET title = %s, info = %s, code = %s, markdown = %s
             WHERE id = %s""", title, info, code, tep,  int(codeid))
         self.clear_cookie("codeid")
         self.redirect("/" + str(codeid))
     else:
         self.redirect("/" + str(codeid))
예제 #6
0
 def post(self, codeid):
     title = xhtml_escape(self.get_argument("title"))
     tep = self.get_argument("info")
     code = xhtml_escape(self.get_argument("code"))
     pswd = self.get_argument("password")
     info = md.convert(tep)
     codes = self.db.get("SELECT * FROM entries WHERE id = %s", int(codeid))
     if checkuserpass(pswd, codes["password"]):
         self.db.execute(
             """
             UPDATE entries SET title = %s, info = %s, code = %s, markdown = %s
             WHERE id = %s""", title, info, code, tep, int(codeid))
         self.clear_cookie("codeid")
         self.redirect("/" + str(codeid))
     else:
         self.redirect("/" + str(codeid))