Beispiel #1
0
def admin():
    if Configuration.loginRequired():
        if not current_user.is_authenticated():
            return render_template('login.html')
    else:
        person = User.get("_dummy_", auth_handler)
        login_user(person)
    output = None
    if os.path.isfile(Configuration.getUpdateLogFile()):
        with open(Configuration.getUpdateLogFile()) as updateFile:
            separator = "==========================\n"
            output = updateFile.read().split(separator)[-2:]
            output = separator + separator.join(output)
    return render_template('admin.html', status="default", **adminInfo(output))
Beispiel #2
0
def admin():
    if Configuration.loginRequired():
        if not current_user.is_authenticated():
            return render_template('login.html')
    else:
        person = User.get("_dummy_")
        login_user(person)
    output = None
    if os.path.isfile(Configuration.getUpdateLogFile()):
        with open(Configuration.getUpdateLogFile()) as updateFile:
            separator="==========================\n"
            output=updateFile.read().split(separator)[-2:]
            output=separator+separator.join(output)
    return render_template('admin.html', status="default", stats=adminStats(), updateOutput=filterUpdateField(output))
Beispiel #3
0
def log(message=""):
    if args.o:
        with open(Configuration.getUpdateLogFile(), "a") as log:
            log.write(message + "\n")
    if args.v:
        print(message)
    else:
        logging.info(message)
Beispiel #4
0
def log(message=""):
    if args.o:
        with open(Configuration.getUpdateLogFile(), "a") as log:
            log .write(message + "\n")
    if args.v:
        print (message)
    else:
        logging.info(message)
Beispiel #5
0
def admin():
    status = ["default", "none"]
    if Configuration.loginRequired():
        if not current_user.is_authenticated():
            return render_template('login.html', status=status)
    else:
        person = User.get("_dummy_")
        login_user(person)
    output = None
    if os.path.isfile(Configuration.getUpdateLogFile()):
        with open(Configuration.getUpdateLogFile()) as updateFile:
            separator = "==========================\n"
            output = updateFile.read().split(separator)[-2:]
            output = separator + separator.join(output)
    return render_template('admin.html',
                           status=status,
                           stats=adminStats(),
                           updateOutput=filterUpdateField(output))
Beispiel #6
0
 def admin(self):
     if Configuration.loginRequired():
         if not current_user.is_authenticated():
             return render_template('login.html')
     else:
         person = User.get("_dummy_", self.auth_handler)
         login_user(person)
     output = None
     master = db.isMasterAccount(current_user.get_id())
     checked = ct.checkCronJobExists('cve_search')
     if os.path.isfile(Configuration.getUpdateLogFile()):
         with open(Configuration.getUpdateLogFile()) as updateFile:
             separator = "==========================\n"
             output = updateFile.read().split(separator)[-2:]
             output = separator + separator.join(output)
     return render_template('admin.html',
                            status="default",
                            master=master,
                            checked=checked,
                            **self.adminInfo(output))