b2evolution PHP Cross Reference Blogging Systems

Source: /inc/antispam/views/_antispam_settings.form.php - 111 lines - 5010 bytes - Text - Print

Description: This file implements the UI view for the antispam settings. This file is part of the evoCore framework - {@link http://evocore.net/} See also {@link http://sourceforge.net/projects/evocms/}.

   1  <?php
   2  /**
   3   * This file implements the UI view for the antispam settings.
   4   *
   5   * This file is part of the evoCore framework - {@link http://evocore.net/}
   6   * See also {@link http://sourceforge.net/projects/evocms/}.
   7   *
   8   * @copyright (c)2003-2014 by Francois Planque - {@link http://fplanque.com/}
   9   * Parts of this file are copyright (c)2004-2006 by Daniel HAHLER - {@link http://thequod.de/contact}.
  10   *
  11   * {@internal License choice
  12   * - If you have received this file as part of a package, please find the license.txt file in
  13   *   the same folder or the closest folder above for complete license terms.
  14   * - If you have received this file individually (e-g: from http://evocms.cvs.sourceforge.net/)
  15   *   then you must choose one of the following licenses before using the file:
  16   *   - GNU General Public License 2 (GPL) - http://www.opensource.org/licenses/gpl-license.php
  17   *   - Mozilla Public License 1.1 (MPL) - http://www.opensource.org/licenses/mozilla1.1.php
  18   * }}
  19   *
  20   * {@internal Open Source relicensing agreement:
  21   * Daniel HAHLER grants Francois PLANQUE the right to license
  22   * Daniel HAHLER's contributions to this file and the b2evolution project
  23   * under any OSI approved OSS license (http://www.opensource.org/licenses/).
  24   * }}
  25   *
  26   * @package admin
  27   *
  28   * {@internal Below is a list of authors who have contributed to design/coding of this file: }}
  29   * @author blueyed: Daniel HAHLER
  30   *
  31   * @version $Id: _antispam_settings.form.php 6136 2014-03-08 07:59:48Z manuel $
  32   */
  33  if( !defined('EVO_MAIN_INIT') ) die( 'Please, do not access this page directly.' );
  34  
  35  
  36  /**
  37   * @var GeneralSettings
  38   */
  39  global $Settings;
  40  
  41  global $Plugins;
  42  
  43  
  44  $Form = new Form( NULL, 'antispam_checkchanges' );
  45  
  46  $Form->begin_form( 'fform' );
  47  
  48  $Form->add_crumb( 'antispam' );
  49  $Form->hiddens_by_key( get_memorized() );
  50  $Form->hidden( 'action', 'update' );
  51  
  52  $Form->begin_fieldset( T_('Comments/Feedback').get_manual_link('antispam-settings-comments') );
  53      $Form->text( 'antispam_threshold_publish', $Settings->get('antispam_threshold_publish'), 3, T_('Publishing threshold'), T_("(-100 to 100). Automatically publish feedbacks with a spam karma below this value.") );
  54      $Form->text( 'antispam_threshold_delete', $Settings->get('antispam_threshold_delete'), 3, T_('Deletion threshold'), T_("(-100 to 100). Automatically delete feedbacks with a spam karma over this value.") );
  55  
  56      $Form->info( '', sprintf( /* TRANS: %s gets replaced by the translation for this setting */ T_('Feedbacks with a spam karma between these two thresholds will get the default status of the blog ("%s").'), T_('New feedback status') ) );
  57  $Form->end_fieldset();
  58  
  59  
  60  $Form->begin_fieldset( T_('Misc').get_manual_link('antispam-settings-misc') );
  61      $Form->checkbox( 'antispam_block_spam_referers', $Settings->get('antispam_block_spam_referers'),
  62          T_('Block spam referers'), T_('If a referrer has been detected as spam, should we block the request with a "403 Forbidden" page?') );
  63      $Form->checkbox( 'antispam_report_to_central', $Settings->get('antispam_report_to_central'),
  64          T_('Report to central blacklist'), T_('When banning a keyword, offer an option to report to the central blacklist.')
  65          .' [<a href="http://b2evolution.net/about/terms.html">'.T_('Terms of service').'</a>]' );
  66  $Form->end_fieldset();
  67  
  68  
  69  $Form->begin_fieldset( T_('Spam detection relevance weight').get_manual_link('antispam-settings-detection-relevance-weight') );
  70  
  71  echo '<p>'.T_('This defines the weight of the plugin, in relation to the others.').'</p>';
  72  
  73  $karma_plugins = $Plugins->get_list_by_events( array('GetSpamKarmaForComment') );
  74  
  75  if( empty($karma_plugins) )
  76  {
  77      echo '<p>'.T_('There are no spam karma plugins enabled.').'</p>';
  78  }
  79  else foreach( $karma_plugins as $loop_Plugin )
  80  {
  81      $Form->text( 'antispam_plugin_spam_weight['.$loop_Plugin->ID.']', $Plugins->index_ID_rows[$loop_Plugin->ID]['plug_spam_weight'], 2, $loop_Plugin->name );
  82  }
  83  
  84  $Form->end_fieldset();
  85  
  86  $Form->begin_fieldset( T_('Suspect users').get_manual_link('antispam-settings-suspect-users') );
  87  
  88      $GroupCache = & get_GroupCache( true, T_('Don\'t move suspect users') );
  89      $Form->select_object( 'antispam_suspicious_group', $Settings->get('antispam_suspicious_group'), $GroupCache, T_('Move suspect users to'), '', true );
  90  
  91      $trust_groups = $Settings->get('antispam_trust_groups') != '' ? explode( ',', $Settings->get('antispam_trust_groups') ) : array();
  92      $groups_options = array();
  93      $groups = $GroupCache->get_option_array();
  94      foreach( $groups as $group_ID => $group_name )
  95      {
  96          $groups_options[] = array( 'antispam_trust_groups[]', $group_ID, $group_name, in_array( $group_ID, $trust_groups ) );
  97      }
  98      $Form->checklist( $groups_options, 'antispam_trust_groups', T_('Never touch users from these groups') );
  99  
 100  $Form->end_fieldset();
 101  
 102  if( $current_User->check_perm( 'options', 'edit' ) )
 103  {
 104      $Form->end_form( array(
 105          array( 'submit', 'submit', T_('Update'), 'SaveButton' ),
 106          array( 'reset', '', T_('Reset'), 'ResetButton' ),
 107          array( 'submit', 'submit[restore_defaults]', T_('Restore defaults'), 'ResetButton' ),
 108          ) );
 109  }
 110  
 111  ?>

title

Description

title

Description

title

Description

title

title

Body