aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatteo Pasotti <matteo@mageia.org>2013-01-03 14:52:29 +0000
committerMatteo Pasotti <matteo@mageia.org>2013-01-03 14:52:29 +0000
commit47bc60dc1f348b50dd6ee44ca7817caaec76d778 (patch)
tree0ddfdc2d2ec57d7eeb560926c7659c3957a21e39
parentf0e218ec8c1dcb3721a93e6a425778cc1567be79 (diff)
downloadmanatools-47bc60dc1f348b50dd6ee44ca7817caaec76d778.tar
manatools-47bc60dc1f348b50dd6ee44ca7817caaec76d778.tar.gz
manatools-47bc60dc1f348b50dd6ee44ca7817caaec76d778.tar.bz2
manatools-47bc60dc1f348b50dd6ee44ca7817caaec76d778.tar.xz
manatools-47bc60dc1f348b50dd6ee44ca7817caaec76d778.zip
- rename Auth.pm --> Privileges.pm
- moved Privileges module to a dedicated namespace (AdminPanel) - Privileges module now use English (for readability)
-rw-r--r--AdminPanel/Privileges.pm (renamed from Auth.pm)13
-rwxr-xr-xapanel.pl2
2 files changed, 7 insertions, 8 deletions
diff --git a/Auth.pm b/AdminPanel/Privileges.pm
index 7a269ec7..48a482b8 100644
--- a/Auth.pm
+++ b/AdminPanel/Privileges.pm
@@ -1,5 +1,5 @@
# vim: set et ts=4 sw=4:
-# Copyright 2012 Matteo Pasotti
+# Copyright 2012-2013 Matteo Pasotti
#
# This file is part of AdminPanel
#
@@ -16,21 +16,20 @@
# You should have received a copy of the GNU General Public License
# along with AdminPanel. If not, see <http://www.gnu.org/licenses/>.
-package Auth;
+package AdminPanel::Privileges;
-require Exporter;
-use base qw(Exporter);
use strict;
use warnings;
use diagnostics;
-use Data::Dumper;
+require Exporter;
+use base qw(Exporter);
+use English qw(-no_match_vars);
our @EXPORT = qw(require_root_capability
ask_for_authentication);
sub require_root_capability {
- return 0 if(!$>);
- return 1;
+ return $EUID != 0;
}
sub ask_for_authentication {
diff --git a/apanel.pl b/apanel.pl
index 9c6c4de2..c0a7a837 100755
--- a/apanel.pl
+++ b/apanel.pl
@@ -20,9 +20,9 @@
use strict;
use warnings;
use diagnostics;
+use AdminPanel::Privileges;
use FindBin;
use lib "$FindBin::RealBin";
-use Auth;
use MainDisplay;
use yui;