Exemple #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
Exemple #4
0
 def get_notification_by_id(cls, notiId):
     data = base.find_one("notification", {"notiId": reportId})
     if data is not None:
         return data
Exemple #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
Exemple #6
0
 def get_id_by_email(cls, email):
     data = Database.find_one("users", {"email": email})
     return data["_id"]
Exemple #7
0
 def get_by_id(cls, _id):
     data = Database.find_one("users", {"_id": _id})
     if data is not None:
         return data
Exemple #8
0
 def get_password_hash(cls, email):
     data = Database.find_one("users", {"email": email})
     if data is not None:
         return data["password"]
Exemple #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
Exemple #10
0
 def get_report(cls, reportId):
     data = base.find_one("reports", {"reportId": reportId})
     if data is not None:
         return data
Exemple #11
0
 def get_report_level(cls, reportId):
     data = base.find_one("reports", {"reportId": reportId})
     if data is not None:
         return data['reportLevel']
Exemple #12
0
 def get_priviliges(cls, reportId):
     data = base.find_one("reports", {"reportId": reportId})
     if data is not None:
         return data['getprivilege']
Exemple #13
0
 def get_attack_complexity(cls, reportId):
     data = base.find_one("reports", {"reportId": reportId})
     if data is not None:
         return data['AttackComplexity']
Exemple #14
0
 def get_attack_vector(cls, reportId):
     data = base.find_one("reports", {"reportId": reportId})
     if data is not None:
         return data['AttackVector']