From b46217c78c28d80757294388b6803b762e799fdd Mon Sep 17 00:00:00 2001 From: iliajie Date: Mon, 24 Jul 2023 00:58:50 +0300 Subject: [PATCH] Add check if user allowed to use terminal based on set shell --- xterm/webmin_menu_link.pl | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 xterm/webmin_menu_link.pl diff --git a/xterm/webmin_menu_link.pl b/xterm/webmin_menu_link.pl new file mode 100644 index 00000000..96c64f00 --- /dev/null +++ b/xterm/webmin_menu_link.pl @@ -0,0 +1,14 @@ +# Checks if Terminal link should be printed in Webmin menu + +require "xterm-lib.pl"; + +sub allow_menu_link +{ +my @uinfo = @remote_user_info; +@uinfo = getpwnam($remote_user) if (!@uinfo); +return 0 if (!$uinfo[8]); +return 0 if ($uinfo[8] =~ /(nologin|false|null|sync)$/); +return 1; +} + +1; \ No newline at end of file