aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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;