modules/echo.php
changeset 51 508400fc5282
parent 42 c24a2311f232
--- a/modules/echo.php	Sat Jan 10 14:12:36 2009 -0500
+++ b/modules/echo.php	Tue Jan 20 22:08:07 2009 -0500
@@ -7,7 +7,7 @@
 {
   global $privileged_list;
   
-  if ( preg_match('/^\!echo /', $message['message']) && in_array($message['nick'], $privileged_list) )
+  if ( preg_match('/^\!echo /', $message['message']) && check_permissions($message['nick'], array('context' => 'echo')) )
   {
     $chan->msg(eb_censor_words(preg_replace('/^\!echo /', '', $message['message'])), true);
   }
@@ -17,7 +17,7 @@
 {
   global $privileged_list;
   
-  if ( in_array($message['nick'], $privileged_list) && preg_match("/^(?:\!echo-|\/msg )([^\007, \r\n\a\t]+) (.+)/", $message['message'], $match) )
+  if ( preg_match("/^(?:\!echo-|\/msg )([#&][^\007, \r\n\a\t]+) (.+)/", $message['message'], $match) && check_permissions($message['nick'], array('context' => 'echo')) )
   {
     global $libirc_channels;
     $channel_name =& $match[1];
@@ -26,7 +26,7 @@
       $libirc_channels[$channel_name]->msg(eb_censor_words($match[2]), true);
     }
   }
-  else if ( in_array($message['nick'], $privileged_list) && preg_match("/^(?:\!pm|\/msg) ([^\007, \r\n\a\t]+) (.+)/", $message['message'], $match) )
+  else if ( preg_match("/^(?:\!pm|\/msg) ([^\007, \r\n\a\t]+) (.+)/", $message['message'], $match) && check_permissions($message['nick'], array('context' => 'pm'), false) )
   {
     global $irc;
     $irc->privmsg($match[1], eb_censor_words($match[2]));