[ Index ]

MailPress 7.2

[ Index ]     [ Classes ]     [ Functions ]     [ Variables ]     [ Constants ]     [ Statistics ]    

title

Body

[close]

/mp-admin/includes/settings/bounce_handling_II/ -> update.php (source)

   1  <?php // bounce_handling_II => no sanitize here, selects and radio buttons + email is checked with email validator (RFC822,2822,5321,5322,6530,6531,6532) those RFC are not supported by Wp
   2  
   3  if ( !( function_exists( 'current_user_can' ) && current_user_can( MP_AdminPage::capability ) ) ) die( 'Access denied' );
   4  
   5  if ( isset( MP_AdminPage::$pst_['bounce_handling_II'] ) ) 
   6  {
   7      $bounce_handling_II    = MP_AdminPage::$pst_['bounce_handling_II'];
   8  
   9      switch ( true )
  10      {
  11          case ( empty( $bounce_handling_II['pop3']['server'] ) ) :
  12              MP_AdminPage::$err_mess['bounce_handling_II_pop3_server'] = __( 'field should not be empty', 'MailPress' );
  13          break;
  14          case ( empty( $bounce_handling_II['pop3']['port'] ) ) :
  15              MP_AdminPage::$err_mess['bounce_handling_II_pop3_port'] = __( 'field should not be empty', 'MailPress' );
  16          break;
  17          case ( !is_numeric( $bounce_handling_II['pop3']['port'] ) ) : 
  18              MP_AdminPage::$err_mess['bounce_handling_II_pop3_port'] = __( 'field should be a number', 'MailPress' );
  19          break;
  20          case ( empty( $bounce_handling_II['pop3']['username'] ) && !empty( $bounce_handling_II['pop3']['password'] ) ) :
  21              MP_AdminPage::$err_mess['bounce_handling_II_pop3_username'] = __( 'field should not be empty', 'MailPress' );
  22          break;
  23          case ( !empty( $bounce_handling_II['Return-Path'] ) && !MailPress::is_email( $bounce_handling_II['Return-Path'] ) ) :
  24              MP_AdminPage::$err_mess['Return-Path'] = __( 'field should be an email', 'MailPress' );
  25          break;
  26          default :
  27              $old_bounce_handling_II = get_option( MailPress_bounce_handling_II::option_name );
  28  
  29              update_option( MailPress_bounce_handling_II::option_name, $bounce_handling_II );
  30              $message = __( "'Bounce_II' settings saved", 'MailPress' );
  31  
  32              if ( !isset( $old_bounce_handling_II['batch_mode'] ) ) 
  33              {
  34                  $old_bounce_handling_II['batch_mode'] = '';
  35              }
  36  
  37              if ( $old_bounce_handling_II['batch_mode'] != $bounce_handling_II['batch_mode'] )
  38              {
  39                  if ( 'wpcron' != $bounce_handling_II['batch_mode'] )
  40                  {
  41                      wp_clear_scheduled_hook( MailPress_bounce_handling_II::process_name );
  42                  }
  43                  else
  44                  {
  45                      MailPress_bounce_handling_II::schedule();
  46                  }
  47              }
  48          break;
  49      }
  50  }


Generated: Tue May 19 15:55:14 2020 Cross-referenced by PHPXref 0.7.1