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