aboutsummaryrefslogtreecommitdiffstats
path: root/lib/AdminPanel/LogViewer/init.pm
diff options
context:
space:
mode:
authorAngelo Naselli <anaselli@linux.it>2014-01-27 18:20:30 +0100
committerAngelo Naselli <anaselli@linux.it>2014-01-27 18:20:30 +0100
commit1624ce382eb033c2cf3ef1fe6b9c41beb0b0a91b (patch)
tree1363e3d3bdcfa5b2ff3111a41b2c700a5a922140 /lib/AdminPanel/LogViewer/init.pm
parentf519e47d15103514585a272c6308467ac41ce551 (diff)
downloadcolin-keep-1624ce382eb033c2cf3ef1fe6b9c41beb0b0a91b.tar
colin-keep-1624ce382eb033c2cf3ef1fe6b9c41beb0b0a91b.tar.gz
colin-keep-1624ce382eb033c2cf3ef1fe6b9c41beb0b0a91b.tar.bz2
colin-keep-1624ce382eb033c2cf3ef1fe6b9c41beb0b0a91b.tar.xz
colin-keep-1624ce382eb033c2cf3ef1fe6b9c41beb0b0a91b.zip
Project structure change
Diffstat (limited to 'lib/AdminPanel/LogViewer/init.pm')
-rw-r--r--lib/AdminPanel/LogViewer/init.pm31
1 files changed, 31 insertions, 0 deletions
diff --git a/lib/AdminPanel/LogViewer/init.pm b/lib/AdminPanel/LogViewer/init.pm
new file mode 100644
index 0000000..1c96171
--- /dev/null
+++ b/lib/AdminPanel/LogViewer/init.pm
@@ -0,0 +1,31 @@
+package AdminPanel::LogViewer::init;
+
+use strict;
+use warnings;
+use diagnostics;
+use English;
+use lib qw(/usr/lib/libDrakX);
+use common;
+use AdminPanel::Shared;
+use base qw(Exporter);
+
+our @EXPORT = qw(warn_about_user_mode
+ interactive_msg);
+
+sub interactive_msg {
+ my ($title, $contents) = @_;
+ return ask_YesOrNo($title, $contents);
+}
+
+sub warn_about_user_mode() {
+ my $title = N("Running in user mode");
+ my $msg = N("You are launching this program as a normal user.\n".
+ "You will not be able to read system logs which you do not have rights to,\n".
+ "but you may still browse all the others.");
+ if(($EUID != 0) and (!interactive_msg($title, $msg))) {
+ return 0;
+ }
+ return 1;
+}
+
+1;