aboutsummaryrefslogtreecommitdiffstats
path: root/AdminPanel/LogViewer
diff options
context:
space:
mode:
authorMatteo Pasotti <matteo@mageia.org>2013-01-09 17:41:32 +0000
committerMatteo Pasotti <matteo@mageia.org>2013-01-09 17:41:32 +0000
commit2e0f9b70beecb7bdd27e74088368936cdb718c72 (patch)
tree7b58619637be6669478b790c0acd93d7ee9f9f09 /AdminPanel/LogViewer
parent5b97980dd59e47ebf1d6f8ca37b7cafb48410bf6 (diff)
downloadcolin-keep-2e0f9b70beecb7bdd27e74088368936cdb718c72.tar
colin-keep-2e0f9b70beecb7bdd27e74088368936cdb718c72.tar.gz
colin-keep-2e0f9b70beecb7bdd27e74088368936cdb718c72.tar.bz2
colin-keep-2e0f9b70beecb7bdd27e74088368936cdb718c72.tar.xz
colin-keep-2e0f9b70beecb7bdd27e74088368936cdb718c72.zip
- added LogViewer namespace
- added init module for logviewer - Rpmdragora/init.pm: fixed warn_about_user_mode message alignment - logviewer.pl: added call to LogViewer::warn_about_user_mode
Diffstat (limited to 'AdminPanel/LogViewer')
-rw-r--r--AdminPanel/LogViewer/init.pm31
1 files changed, 31 insertions, 0 deletions
diff --git a/AdminPanel/LogViewer/init.pm b/AdminPanel/LogViewer/init.pm
new file mode 100644
index 0000000..1c96171
--- /dev/null
+++ b/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;