[ Index ]

MailPress 7.2

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

title

Body

[close]

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

   1  <?php // privacy => 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 ( isset( MP_AdminPage::$pst_['privacy'] ) ) 
   4  {
   5      $privacy    = MP_AdminPage::$pst_['privacy'];
   6  
   7      $word_export = MailPress_privacy::one_word( $privacy['export_word'] );
   8      $word_erase  = MailPress_privacy::one_word( $privacy['erase_word']  );
   9  
  10      switch ( true )
  11      {
  12          case ( empty( $privacy['pop3']['server'] ) ) :
  13              MP_AdminPage::$err_mess['privacy_pop3_server'] = __( 'field should not be empty', 'MailPress' );
  14          break;
  15          case ( empty( $privacy['pop3']['port'] ) ) :
  16              MP_AdminPage::$err_mess['privacy_pop3_port'] = __( 'field should not be empty', 'MailPress' );
  17          break;
  18          case ( !is_numeric( $privacy['pop3']['port'] ) ) : 
  19              MP_AdminPage::$err_mess['privacy_pop3_port'] = __( 'field should be a number', 'MailPress' );
  20          break;
  21          case ( empty( $privacy['pop3']['username'] ) && !empty( $privacy['pop3']['password'] ) ) :
  22              MP_AdminPage::$err_mess['privacy_pop3_username'] = __( 'field should not be empty', 'MailPress' );
  23          break;
  24          case ( empty( $privacy['export_word'] ) ) :
  25              MP_AdminPage::$err_mess['privacy_export_word'] = __( 'field should not be empty', 'MailPress' );
  26          break;
  27                  case ( !$word_export ) :
  28              MP_AdminPage::$err_mess['privacy_export_word'] = __( 'only one word please !', 'MailPress' );
  29          break;
  30          case ( empty( $privacy['erase_word'] ) ) :
  31              MP_AdminPage::$err_mess['privacy_erase_word'] = __( 'field should not be empty', 'MailPress' );
  32          break;
  33                  case ( !$word_erase ) :
  34              MP_AdminPage::$err_mess['privacy_erase_word'] = __( 'only one word please !', 'MailPress' );
  35          break;
  36  
  37          default :
  38              $old_privacy = get_option( MailPress_privacy::option_name );
  39  
  40              $privacy['export_word'] = $word_export;
  41              $privacy['erase_word']  = $word_erase;
  42  
  43              update_option( MailPress_privacy::option_name, $privacy );
  44              $message = __( "'Privacy' settings saved", 'MailPress' );
  45  
  46              if ( !isset( $old_privacy['batch_mode'] ) ) 
  47              {
  48                  $old_privacy['batch_mode'] = '';
  49              }
  50  
  51              if ( $old_privacy['batch_mode'] != $privacy['batch_mode'] )
  52              {
  53                  if ( 'wpcron' != $privacy['batch_mode'] )
  54                  {
  55                      wp_clear_scheduled_hook( MailPress_privacy::process_name );
  56                  }
  57                  else
  58                  {
  59                      MailPress_privacy::schedule();
  60                  }
  61              }
  62          break;
  63      }
  64  }


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