Beispiel #1
0
 def mark(self, cve, **args):
   user = args["current_user"].get_id()
   if db.p_readUserSetting(self.collectionName, user, "mark") == "show":
     color = db.p_readUserSetting(self.collectionName, user, "markcolor")
     userdata = db.p_queryOne(self.collectionName, {'user': user})
     if userdata and 'cves' in  userdata and cve in userdata['cves']:
       return (None, color)
Beispiel #2
0
 def mark(self, cve, **args):
     user = args["current_user"].get_id()
     if db.p_readUserSetting(self.collectionName, user, "mark") == "show":
         color = db.p_readUserSetting(self.collectionName, user,
                                      "markcolor")
         userdata = db.p_queryOne(self.collectionName, {'user': user})
         if userdata and 'cves' in userdata and cve in userdata['cves']:
             return (None, color)
Beispiel #3
0
 def onCVEOpen(self, cve, **args):
     if args["current_user"].is_authenticated():
         if db.p_readUserSetting(self.collectionName,
                                 args["current_user"].get_id(),
                                 "mode") == "auto":
             query = {'user': args["current_user"].get_id()}
             db.p_addToList(self.collectionName, query, "cves", cve)
Beispiel #4
0
 def getCVEActions(self, cve, **args):
   if db.p_readUserSetting(self.collectionName, args["current_user"].get_id(), "buttons") == "show":
     userdata = db.p_queryOne(self.collectionName, {'user': args["current_user"].get_id()})
     if userdata and 'cves' in  userdata and cve in userdata['cves']:
       return [{'text': 'Unsee', 'action': 'unsee', 'icon': 'eye-close'}]
     else:
       return [{'text': 'See',   'action': 'see',   'icon': 'eye-open'}]
Beispiel #5
0
 def getFilters(self, **args):
   if self._userAlowed(args["current_user"]):
     if db.p_readUserSetting(self.collectionName, args["current_user"].get_id(), "filters") == "show":
       shortname = self.shortName + " " if self.shortName else ""
       return [{'id': shortname+'Checked', 'filters': [{'id': self.uid+"_"+'hidechecked', 'type': 'select',
                                                             'values':[{'id':'show', 'text': 'Show'},
                                                                       {'id':'hide', 'text': 'Hide'}]}]}]
   return []
Beispiel #6
0
 def getCVEActions(self, cve, **args):
   if self._userAlowed(args["current_user"]):
     if db.p_readUserSetting(self.collectionName, args["current_user"].get_id(), "buttons") == "show":
       userdata = db.p_queryOne(self.collectionName, {})
       shortname = self.shortName + " " if self.shortName else ""
       if userdata and 'cves' in  userdata and cve in userdata['cves']:
         return [{'text': shortname+'Uncheck', 'action': 'uncheck', 'icon': 'check'}]
       else:
         return [{'text': shortname+'Check',   'action': 'check',   'icon': 'unchecked'}]
Beispiel #7
0
 def getCVEActions(self, cve, **args):
     if db.p_readUserSetting(self.collectionName,
                             args["current_user"].get_id(),
                             "buttons") == "show":
         userdata = db.p_queryOne(self.collectionName,
                                  {'user': args["current_user"].get_id()})
         if userdata and 'cves' in userdata and cve in userdata['cves']:
             return [{
                 'text': 'Unsee',
                 'action': 'unsee',
                 'icon': 'eye-close'
             }]
         else:
             return [{'text': 'See', 'action': 'see', 'icon': 'eye-open'}]
Beispiel #8
0
 def getCVEActions(self, cve, **args):
     if self._userAlowed(args["current_user"]):
         if db.p_readUserSetting(self.collectionName,
                                 args["current_user"].get_id(),
                                 "buttons") == "show":
             userdata = db.p_queryOne(self.collectionName, {})
             shortname = self.shortName + " " if self.shortName else ""
             if userdata and 'cves' in userdata and cve in userdata['cves']:
                 return [{
                     'text': shortname + 'Uncheck',
                     'action': 'uncheck',
                     'icon': 'check'
                 }]
             else:
                 return [{
                     'text': shortname + 'Check',
                     'action': 'check',
                     'icon': 'unchecked'
                 }]
Beispiel #9
0
 def getFilters(self, **args):
     if db.p_readUserSetting(self.collectionName,
                             args["current_user"].get_id(),
                             "filters") == "show":
         return [{
             'id':
             'Seen CVEs',
             'filters': [{
                 'id':
                 'hideSeen',
                 'type':
                 'select',
                 'values': [{
                     'id': 'show',
                     'text': 'Show'
                 }, {
                     'id': 'hide',
                     'text': 'Hide'
                 }]
             }]
         }]
Beispiel #10
0
 def getFilters(self, **args):
     if self._userAlowed(args["current_user"]):
         if db.p_readUserSetting(self.collectionName,
                                 args["current_user"].get_id(),
                                 "filters") == "show":
             shortname = self.shortName + " " if self.shortName else ""
             return [{
                 'id':
                 shortname + 'Checked',
                 'filters': [{
                     'id':
                     self.uid + "_" + 'hidechecked',
                     'type':
                     'select',
                     'values': [{
                         'id': 'show',
                         'text': 'Show'
                     }, {
                         'id': 'hide',
                         'text': 'Hide'
                     }]
                 }]
             }]
     return []
Beispiel #11
0
 def _getUserSetting(self, user, setting, default):
     s = db.p_readUserSetting(self.collectionName, user, setting)
     if not s:
         db.p_writeUserSetting(self.collectionName, user, setting, default)
         s = default
     return s
Beispiel #12
0
 def _getUserSetting(self, user, setting, default):
   s = db.p_readUserSetting(self.collectionName, user, setting)
   if not s:
     db.p_writeUserSetting(self.collectionName, user, setting, default)
     s = default
   return s
Beispiel #13
0
 def getFilters(self, **args):
   if db.p_readUserSetting(self.collectionName, args["current_user"].get_id(), "filters") == "show":
     return [{'id': 'Seen CVEs', 'filters': [{'id': 'hideSeen', 'type': 'select', 'values':[{'id':'show', 'text': 'Show'},
                                                                                            {'id':'hide', 'text': 'Hide'}]}]}]
Beispiel #14
0
 def onCVEOpen(self, cve, **args):
   if args["current_user"].is_authenticated():
     if db.p_readUserSetting(self.collectionName, args["current_user"].get_id(), "mode") == "auto":
       query = {'user': args["current_user"].get_id()}
       db.p_addToList(self.collectionName, query, "cves", cve)
Beispiel #15
0
 def onCVEOpen(self, cve, **args):
   if self._userAlowed(args["current_user"]):
     if db.p_readUserSetting(self.collectionName, args["current_user"].get_id(), "mode") == "auto":
       db.p_addToList(self.collectionName, {}, "cves", cve)
Beispiel #16
0
 def onCVEOpen(self, cve, **args):
     if self._userAlowed(args["current_user"]):
         if db.p_readUserSetting(self.collectionName,
                                 args["current_user"].get_id(),
                                 "mode") == "auto":
             db.p_addToList(self.collectionName, {}, "cves", cve)