diff --git a/cgi-bin/add.py b/cgi-bin/add.py index 24337ca4..77e0e0d6 100644 --- a/cgi-bin/add.py +++ b/cgi-bin/add.py @@ -277,7 +277,7 @@ print('' 'IP and Port:' '' ':' - '' + '' '
IP for bind listner, if empty will be assignet on all IPs. Start typing ip, or press down.
' '' '' diff --git a/cgi-bin/funct.py b/cgi-bin/funct.py index 6ed402d9..81fe32d8 100644 --- a/cgi-bin/funct.py +++ b/cgi-bin/funct.py @@ -37,9 +37,8 @@ def logging(serv, action): now_utc = datetime.now(timezone(time_zone)) IP = cgi.escape(os.environ["REMOTE_ADDR"]) cookie = http.cookies.SimpleCookie(os.environ.get("HTTP_COOKIE")) - firstName = cookie.get('FirstName') - lastName = cookie.get('LastName') - mess = now_utc.strftime(dateFormat) + " from " + IP + " user: " + firstName.value + " " + lastName.value + " " + action + " for: " + serv + "\n" + login = cookie.get('login') + mess = now_utc.strftime(dateFormat) + " from " + IP + " user: " + login.value + " " + action + " for: " + serv + "\n" log = open(fullpath + "log/config_edit.log", "a") log.write(mess) log.close @@ -57,11 +56,15 @@ def telegram_send_mess(mess): bot = telegram.Bot(token=token_bot, request=pp) bot.send_message(chat_id=channel_name, text=mess) -def check_login(): +def check_login(**kwargs): cookie = http.cookies.SimpleCookie(os.environ.get("HTTP_COOKIE")) login = cookie.get('login') + role = cookie.get('role') ref = os.environ.get("SCRIPT_NAME") - + + if kwargs.get("admins_area") == "1" and role.value != "admin": + print('') + if login is None: print('' % ref) @@ -161,8 +164,8 @@ def footer(): print('' '
' '

' - 'UP' - '

' + 'UP' + '
' '
' '