Beispiel #1
0
 def set_score(cls, reportId, score):
     data = base.find_one("reports", {"reportId": reportId})
     if data is not None:
         query = {
             "filter": {
                 "reportId": reportId
             },
             "update": {
                 "$set": {
                     "reportScore": score
                 }
             }
         }
         base.update("reports", query)
         return True
     else:
         return False
 def get_message(cls, messageId):
     data = Database.find_one("chat", {"messageId": messageId})
     if data is not None:
         return data
 def get_user_message_by_replymessageId(cls, messageId):
     data = Database.find_one("chat", {"replymessageId": messageId})
     if data is not None:
         return data
Beispiel #4
0
 def get_notification_by_id(cls, notiId):
     data = base.find_one("notification", {"notiId": reportId})
     if data is not None:
         return data
Beispiel #5
0
 def get_only_email(self, email):
     data = Database.find_one("users", {"email": email})
     if data is not None:
         return data['email']
     else:
         return None
Beispiel #6
0
 def get_id_by_email(cls, email):
     data = Database.find_one("users", {"email": email})
     return data["_id"]
Beispiel #7
0
 def get_by_id(cls, _id):
     data = Database.find_one("users", {"_id": _id})
     if data is not None:
         return data
Beispiel #8
0
 def get_password_hash(cls, email):
     data = Database.find_one("users", {"email": email})
     if data is not None:
         return data["password"]
Beispiel #9
0
 def get_by_email(cls, email):
     # get user by filling email
     data = Database.find_one("users", {"email": email})
     if data is not None:
         return data
Beispiel #10
0
 def get_report(cls, reportId):
     data = base.find_one("reports", {"reportId": reportId})
     if data is not None:
         return data
Beispiel #11
0
 def get_report_level(cls, reportId):
     data = base.find_one("reports", {"reportId": reportId})
     if data is not None:
         return data['reportLevel']
Beispiel #12
0
 def get_priviliges(cls, reportId):
     data = base.find_one("reports", {"reportId": reportId})
     if data is not None:
         return data['getprivilege']
Beispiel #13
0
 def get_attack_complexity(cls, reportId):
     data = base.find_one("reports", {"reportId": reportId})
     if data is not None:
         return data['AttackComplexity']
Beispiel #14
0
 def get_attack_vector(cls, reportId):
     data = base.find_one("reports", {"reportId": reportId})
     if data is not None:
         return data['AttackVector']