From 5b97980dd59e47ebf1d6f8ca37b7cafb48410bf6 Mon Sep 17 00:00:00 2001 From: Matteo Pasotti Date: Wed, 9 Jan 2013 16:40:23 +0000 Subject: - rpmdragora: fixed warn_about_user_mode call - rpmdragora.pm: interactive_msg now returns ask_YesOrOk() return value - Shared.pm: ask_ routines now return boolean rather than string - Shared.pm: added missing module requirement (common from libDrakX) - init.pm: warn_about_user_mode rewritten to return boolean --- AdminPanel/Rpmdragora/init.pm | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'AdminPanel/Rpmdragora') diff --git a/AdminPanel/Rpmdragora/init.pm b/AdminPanel/Rpmdragora/init.pm index 06e0398..776ee4c 100644 --- a/AdminPanel/Rpmdragora/init.pm +++ b/AdminPanel/Rpmdragora/init.pm @@ -29,6 +29,7 @@ use strict; use MDK::Common::Func 'any'; use lib qw(/usr/lib/libDrakX); use common; +use English; BEGIN { $::no_global_argv_parsing = 1 } require urpm::args; @@ -155,11 +156,14 @@ our $changelog_first = $rpmdragora::changelog_first_config->[0]; $changelog_first = 1 if $rpmdragora_options{'changelog-first'}; sub warn_about_user_mode() { - $> and (AdminPanel::rpmdragora::interactive_msg(N("Running in user mode"), - N("You are launching this program as a normal user. -You will not be able to perform modifications on the system, -but you may still browse the existing database."), yesno => 1, text => { no => N("Cancel"), yes => N("Ok") }) - or AdminPanel::rpmdragora::myexit(0)); + my $title = N("Running in user mode"); + my $msg = N("You are launching this program as a normal user. + You will not be able to perform modifications on the system, + but you may still browse the existing database."); + if(($EUID != 0) and (!AdminPanel::rpmdragora::interactive_msg($title, $msg))) { + return 0; + } + return 1; } sub init() { -- cgit v1.2.1