Esempio n. 1
0
 def get(self, *args, **kwargs):
     if options.team_sharing:
         """ AJAX // Retrieves a paste from the database """
         paste_uuid = self.get_argument("paste_uuid")
         user = self.get_current_user()
         paste = PasteBin.by_uuid(paste_uuid)
         if user.is_admin():
             self.render("pastebin/display.html",
                         errors=None,
                         paste=paste,
                         nocreate=True)
         elif paste is None or paste not in user.team.pastes:
             self.render(
                 "pastebin/display.html",
                 errors=["Paste does not exist."],
                 paste=None,
                 nocreate=None,
             )
         else:
             self.render("pastebin/display.html",
                         errors=None,
                         paste=paste,
                         nocreate=False)
     else:
         self.redirect("/404")
Esempio n. 2
0
 def post(self, *args, **kwargs):
     ''' AJAX // Delete a paste object from the database '''
     paste = PasteBin.by_uuid(self.get_argument("uuid", ""))
     user = self.get_current_user()
     if paste is not None and paste in user.team.pastes:
         self.dbsession.delete(paste)
         self.dbsession.commit()
     self.redirect("/user/share/pastebin")
Esempio n. 3
0
 def post(self, *args, **kwargs):
     ''' AJAX // Delete a paste object from the database '''
     paste = PasteBin.by_uuid(self.get_argument("uuid", ""))
     user = self.get_current_user()
     if paste is not None and paste in user.team.pastes:
         self.dbsession.delete(paste)
         self.dbsession.commit()
     self.redirect("/user/share/pastebin")
 def get(self, *args, **kwargs):
     ''' AJAX // Retrieves a paste from the database '''
     paste_uuid = self.get_argument("paste_uuid")
     user = self.get_current_user()
     paste = PasteBin.by_uuid(paste_uuid)
     if paste is None or paste not in user.team.pastes:
         self.render("pastebin/display.html", errors=["Paste does not exist."], paste=None)
     else:
         self.render("pastebin/display.html", errors=None, paste=paste)
Esempio n. 5
0
 def get(self, *args, **kwargs):
     ''' AJAX // Retrieves a paste from the database '''
     paste_uuid = self.get_argument("paste_uuid")
     user = self.get_current_user()
     paste = PasteBin.by_uuid(paste_uuid)
     if paste is None or paste not in user.team.pastes:
         self.render("pastebin/display.html",
                     errors=["Paste does not exist."],
                     paste=None)
     else:
         self.render("pastebin/display.html", errors=None, paste=paste)
Esempio n. 6
0
 def get(self, *args, **kwargs):
     ''' AJAX // Retrieves a paste from the database '''
     paste_uuid = self.get_argument("paste_uuid")
     user = self.get_current_user()
     paste = PasteBin.by_uuid(paste_uuid)
     if user.has_permission(ADMIN_PERMISSION):
         self.render("pastebin/display.html", errors=None, paste=paste, nocreate=True)
     elif paste is None or paste not in user.team.pastes:
         self.render("pastebin/display.html",
                     errors=["Paste does not exist."],
                     paste=None, nocreate=None
                     )
     else:
         self.render("pastebin/display.html", errors=None, paste=paste, nocreate=False)
Esempio n. 7
0
 def post(self, *args, **kwargs):
     if options.team_sharing:
         """ AJAX // Delete a paste object from the database """
         paste = PasteBin.by_uuid(self.get_argument("uuid", ""))
         user = self.get_current_user()
         if user.is_admin():
             self.dbsession.delete(paste)
             self.dbsession.commit()
             self.redirect("/admin/view/pastebin")
             return
         if paste is not None and paste in user.team.pastes:
             self.dbsession.delete(paste)
             self.dbsession.commit()
         self.redirect("/user/share/pastebin")
     else:
         self.redirect("/404")
Esempio n. 8
0
 def post(self, *args, **kwargs):
     if options.team_sharing:
         ''' AJAX // Delete a paste object from the database '''
         paste = PasteBin.by_uuid(self.get_argument("uuid", ""))
         user = self.get_current_user()
         if user.is_admin():
             self.dbsession.delete(paste)
             self.dbsession.commit()
             self.redirect("/admin/view/pastebin")
             return
         if paste is not None and paste in user.team.pastes:
             self.dbsession.delete(paste)
             self.dbsession.commit()
         self.redirect("/user/share/pastebin")
     else:
         self.redirect("/404")
Esempio n. 9
0
 def get(self, *args, **kwargs):
     if options.team_sharing:
         ''' AJAX // Retrieves a paste from the database '''
         paste_uuid = self.get_argument("paste_uuid")
         user = self.get_current_user()
         paste = PasteBin.by_uuid(paste_uuid)
         if user.is_admin():
             self.render("pastebin/display.html", errors=None, paste=paste, nocreate=True)
         elif paste is None or paste not in user.team.pastes:
             self.render("pastebin/display.html",
                         errors=["Paste does not exist."],
                         paste=None, nocreate=None
                         )
         else:
             self.render("pastebin/display.html", errors=None, paste=paste, nocreate=False)
     else:
         self.redirect("/404")