diff options
-rw-r--r-- | AdminPanel/Privileges.pm (renamed from Auth.pm) | 13 | ||||
-rwxr-xr-x | apanel.pl | 2 |
2 files changed, 7 insertions, 8 deletions
diff --git a/Auth.pm b/AdminPanel/Privileges.pm index 7a269ec..48a482b 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 { @@ -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; |