[geeklog-cvs] geeklog-1.3/plugins/spamx Import.Admin.class.php,1.2,1.3 MailAdmin.Action.class.php,1.1,1.2 ViewBlacklist.Admin.class.php,1.1,1.2 config.php,1.2,1.3

dhaun at iowaoutdoors.org dhaun at iowaoutdoors.org
Thu Sep 16 04:19:22 EDT 2004


Update of /var/cvs/geeklog-1.3/plugins/spamx
In directory www:/tmp/cvs-serv5907/plugins/spamx

Modified Files:
	Import.Admin.class.php MailAdmin.Action.class.php 
	ViewBlacklist.Admin.class.php config.php 
Log Message:
Introduced $_SPX_CONF[] array for the SpamX plugin configuration options.


Index: config.php
===================================================================
RCS file: /var/cvs/geeklog-1.3/plugins/spamx/config.php,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** config.php	14 Sep 2004 13:15:29 -0000	1.2
--- config.php	16 Sep 2004 08:19:19 -0000	1.3
***************
*** 13,33 ****
  
  // URL blacklist changes RSS feed (currently only RSS v1.0 is supported)
! $rss_url = 'http://www.jayallen.org/comment_spam/feeds/blacklist-changes.rdf';
  
  // Entire MT-Blacklist (for inital import)
! $mtblacklist_url = 'http://www.jayallen.org/comment_spam/blacklist.txt';
  
! // Spamx urls
! $rss_spamx_url = 'http://www.pigstye.net/backend/spamx_users.rdf';
! $spamx_submit_url = 'http://www.pigstye.net/gplugs/spamx/submit.php';
  
  // address which mail admin module will use
! $spamx_notification_email = $_CONF['site_mail'];
  
  // This sets Ban Plugin Table Prefix the Same as Geeklog
! $_BAN_table_prefix = $_DB_table_prefix;
  
  // DO NOT CHANGE THE STUFF BELOW UNLESS YOU KNOW WHAT YOU ARE DOING
! // Add Spamx Plugin table to $_TABLES array
! $_TABLES['spamx']      = $_BAN_table_prefix . 'spamx';
  ?>
--- 13,34 ----
  
  // URL blacklist changes RSS feed (currently only RSS v1.0 is supported)
! $_SPX_CONF['rss_url'] = 'http://www.jayallen.org/comment_spam/feeds/blacklist-changes.rdf';
  
  // Entire MT-Blacklist (for inital import)
! $_SPX_CONF['mtblacklist_url'] = 'http://www.jayallen.org/comment_spam/blacklist.txt';
  
! // SpamX urls
! $_SPX_CONF['spamx_rss_url'] = 'http://www.pigstye.net/backend/spamx_users.rdf';
! $_SPX_CONF['spamx_submit_url'] = 'http://www.pigstye.net/gplugs/spamx/submit.php';
  
  // address which mail admin module will use
! $_SPX_CONF['notification_email'] = $_CONF['site_mail'];
  
  // This sets Ban Plugin Table Prefix the Same as Geeklog
! $_SPX_table_prefix = $_DB_table_prefix;
  
  // DO NOT CHANGE THE STUFF BELOW UNLESS YOU KNOW WHAT YOU ARE DOING
! // Add SpamX Plugin table to $_TABLES array
! $_TABLES['spamx']      = $_SPX_table_prefix . 'spamx';
! 
  ?>

Index: MailAdmin.Action.class.php
===================================================================
RCS file: /var/cvs/geeklog-1.3/plugins/spamx/MailAdmin.Action.class.php,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** MailAdmin.Action.class.php	3 Sep 2004 19:59:55 -0000	1.1
--- MailAdmin.Action.class.php	16 Sep 2004 08:19:19 -0000	1.2
***************
*** 33,42 ****
  	function execute()
  	{
! 		global $result, $_CONF, $LANG_SX00, $comment, $spamx_notification_email;
  		$msg = 'A new comment has been posted at ' . $_CONF['site_name'] . ":\n";
  		$msg .= "Title: {$comment['title']}\n";
  		$msg .= "UID: {$comment['uid']}\n";
  		$msg .= "Content: {$comment['comment']}";
! 		COM_mail($spamx_notification_email, 'Spam Comment at ' . $_CONF['site_name'], $msg);
  		$result = '';
  		SPAMX_log('Mail Sent to Admin');
--- 33,43 ----
  	function execute()
  	{
! 		global $result, $_CONF, $LANG_SX00, $_SPX_CONF, $comment;
! 
  		$msg = 'A new comment has been posted at ' . $_CONF['site_name'] . ":\n";
  		$msg .= "Title: {$comment['title']}\n";
  		$msg .= "UID: {$comment['uid']}\n";
  		$msg .= "Content: {$comment['comment']}";
! 		COM_mail($_SPX_CONF['notification_email'], 'Spam Comment at ' . $_CONF['site_name'], $msg);
  		$result = '';
  		SPAMX_log('Mail Sent to Admin');
***************
*** 44,46 ****
  	}
  }
! ?>
\ No newline at end of file
--- 45,47 ----
  	}
  }
! ?>

Index: Import.Admin.class.php
===================================================================
RCS file: /var/cvs/geeklog-1.3/plugins/spamx/Import.Admin.class.php,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** Import.Admin.class.php	14 Sep 2004 12:27:09 -0000	1.2
--- Import.Admin.class.php	16 Sep 2004 08:19:19 -0000	1.3
***************
*** 59,68 ****
      function _update_blacklist ()
      {
!         global $_CONF, $_TABLES, $LANG_SX00, $rss_url;
  
          require_once($_CONF['path'] . 'plugins/spamx/magpierss/rss_fetch.inc');
          require_once($_CONF['path'] . 'plugins/spamx/magpierss/rss_utils.inc');
  
!         $rss = fetch_rss($rss_url);
          // entries to add and delete, according to the blacklist changes feed
          $to_add = array();
--- 59,68 ----
      function _update_blacklist ()
      {
!         global $_CONF, $_TABLES, $LANG_SX00, $_SPX_CONF;
  
          require_once($_CONF['path'] . 'plugins/spamx/magpierss/rss_fetch.inc');
          require_once($_CONF['path'] . 'plugins/spamx/magpierss/rss_utils.inc');
  
!         $rss = fetch_rss($_SPX_CONF['rss_url']);
          // entries to add and delete, according to the blacklist changes feed
          $to_add = array();
***************
*** 115,123 ****
      function _initial_import ()
      {
!         global $_CONF, $_TABLES, $LANG_SX00, $mtblacklist_url;
  
          if (ini_get ('allow_url_fopen')) {
  
!             $blacklist = file ($mtblacklist_url);
              $count = $this->_do_import ($blacklist);
  
--- 115,123 ----
      function _initial_import ()
      {
!         global $_CONF, $_TABLES, $LANG_SX00, $_SPX_CONF;
  
          if (ini_get ('allow_url_fopen')) {
  
!             $blacklist = file ($_SPX_CONF['mtblacklist_url']);
              $count = $this->_do_import ($blacklist);
  
***************
*** 150,155 ****
                  $display = sprintf ($LANG_SX00['allow_url_fopen'],
                                      $_CONF['path_data']);
!                 $display .= '<p><a href="' . $mtblacklist_url . '">'
!                          . $mtblacklist_url . '</a>';
              }
          }
--- 150,155 ----
                  $display = sprintf ($LANG_SX00['allow_url_fopen'],
                                      $_CONF['path_data']);
!                 $display .= '<p><a href="' . $_SPX_CONF['mtblacklist_url']
!                          . '">' . $_SPX_CONF['mtblacklist_url'] . '</a>';
              }
          }

Index: ViewBlacklist.Admin.class.php
===================================================================
RCS file: /var/cvs/geeklog-1.3/plugins/spamx/ViewBlacklist.Admin.class.php,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** ViewBlacklist.Admin.class.php	3 Sep 2004 19:59:55 -0000	1.1
--- ViewBlacklist.Admin.class.php	16 Sep 2004 08:19:19 -0000	1.2
***************
*** 20,30 ****
  	*/
  	function display(){
! 		global $_CONF, $rss_spamx_url, $HTTP_GET_VARS, $HTTP_POST_VARS, $_TABLES, $spamx_submit_url, $LANG_SX00;
! 		
  		require_once($_CONF['path'] . 'plugins/spamx/magpierss/rss_fetch.inc');
  		require_once($_CONF['path'] . 'plugins/spamx/magpierss/rss_utils.inc');
  		require_once($_CONF['path'] . 'plugins/spamx/rss.inc.php');
  		
! 		$result = DB_query("SELECT * FROM {$_TABLES['spamx']} where name='Personal'");
  		$nrows=DB_numRows($result);
  		for($i=1;$i<=$nrows;$i++) {
--- 20,31 ----
  	*/
  	function display(){
!         global $_CONF, $_TABLES, $HTTP_GET_VARS, $HTTP_POST_VARS,
!                $LANG_SX00, $_SPX_CONF;
! 
  		require_once($_CONF['path'] . 'plugins/spamx/magpierss/rss_fetch.inc');
  		require_once($_CONF['path'] . 'plugins/spamx/magpierss/rss_utils.inc');
  		require_once($_CONF['path'] . 'plugins/spamx/rss.inc.php');
  		
! 		$result = DB_query("SELECT * FROM {$_TABLES['spamx']} WHERE name='Personal'");
  		$nrows=DB_numRows($result);
  		for($i=1;$i<=$nrows;$i++) {
***************
*** 35,39 ****
  		$paction = SPAMX_applyFilter($HTTP_POST_VARS['paction']);
  		$site = SPAMX_applyFilter($HTTP_GET_VARS['site']);
! 		$rss = fetch_rss($rss_spamx_url);
  		if ($action == 'import') {
  			$rdf='';
--- 36,40 ----
  		$paction = SPAMX_applyFilter($HTTP_POST_VARS['paction']);
  		$site = SPAMX_applyFilter($HTTP_GET_VARS['site']);
! 		$rss = fetch_rss($_SPX_CONF['spamx_rss_url']);
  		if ($action == 'import') {
  			$rdf='';
***************
*** 79,83 ****
  			$display .= $LANG_SX00['impinst2c'] . '</p>';
  			$display .= $LANG_SX00['impinst3'];
! 			$display .= '<form method="post" action="' . $spamx_submit_url . '">';
  			$display .= '<table>';
  			$display .= '<tr><td>' . $LANG_SX00['sitename'] . '</td><td><input type="text" size="45" name="site" value="' . $_CONF['site_name'] . '"></td></tr>';
--- 80,84 ----
  			$display .= $LANG_SX00['impinst2c'] . '</p>';
  			$display .= $LANG_SX00['impinst3'];
! 			$display .= '<form method="post" action="' . $_SPX_CONF['spamx_submit_url'] . '">';
  			$display .= '<table>';
  			$display .= '<tr><td>' . $LANG_SX00['sitename'] . '</td><td><input type="text" size="45" name="site" value="' . $_CONF['site_name'] . '"></td></tr>';
***************
*** 107,109 ****
  }
  
! ?>
\ No newline at end of file
--- 108,110 ----
  }
  
! ?>




More information about the geeklog-cvs mailing list