Privilege to use a command is now handled by the priv arg of cmd_add.

This commit is contained in:
Elijah Perrault committed 2011-02-04 16:25:56 -07:00
1 parent d24452d0dd
commit 3b1aba6195
3 files changed
+24 -29

No files matched your search

-27
View File
@@ -34,11 +34,6 @@ sub cmd_modload
my (%data) = @_;
my @argv = @{ $data{args} };
# Check for the appropriate privilege.
if (!has_priv(match_user(%data), "cfunc.modules")) {
notice($data{svr}, $data{nick}, trans("Permission denied").".");
return 0;
}
# Check for the needed parameters.
if (!defined $argv[0]) {
notice($data{svr}, $data{nick}, trans("Not enough parameters").".");
@@ -78,11 +73,6 @@ sub cmd_modunload
my (%data) = @_;
my @argv = @{ $data{args} };
# Check for the appropriate privilege.
if (!has_priv(match_user(%data), "cfunc.modules")) {
notice($data{svr}, $data{nick}, trans("Permission denied").".");
return 0;
}
# Check for the needed parameters.
if (!defined $argv[0]) {
notice($data{svr}, $data{nick}, trans("Not enough parameters").".");
@@ -122,11 +112,6 @@ sub cmd_modreload
my (%data) = @_;
my @argv = @{ $data{args} };
# Check for the appropriate privilege.
if (!has_priv(match_user(%data), "cfunc.modules")) {
notice($data{svr}, $data{nick}, trans("Permission denied").".");
return 0;
}
# Check for the needed parameters.
if (!defined $argv[0]) {
notice($data{svr}, $data{nick}, trans("Not enough parameters").".");
@@ -167,12 +152,6 @@ sub cmd_shutdown
{
my (%data) = @_;
# Check for the appropriate privilege.
if (!has_priv(match_user(%data), "cmd.shutdown")) {
notice($data{svr}, $data{nick}, trans("Permission denied").".");
return 0;
}
# Goodbye world!
notice($data{svr}, $data{nick}, "Shutting down.");
dbug "Got SHUTDOWN from ".$data{nick}."!".$data{user}."@".$data{host}."/".$data{svr}."! Shutting down. . .";
@@ -195,12 +174,6 @@ sub cmd_restart
{
my (%data) = @_;
# Check for the appropriate privilege.
if (!has_priv(match_user(%data), "cmd.restart")) {
notice($data{svr}, $data{nick}, trans("Permission denied").".");
return 0;
}
# Goodbye world!
notice($data{svr}, $data{nick}, "Restarting.");
dbug "Got RESTART from ".$data{nick}."!".$data{user}."@".$data{host}."/".$data{svr}."! Restarting. . .";