[ Index ]

MailPress 7.2

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

title

Body

[close]

/mp-includes/class/options/privacy/exporters/ -> _mailpress.php (source)

   1  <?php /* mailpress */
   2  class MP_WP_Privacy_exporter_mailpress extends MP_WP_privacy_exporter_
   3  {
   4      var $priority = 40;
   5  
   6  	function exporter( $email, $page = 1 )
   7      {
   8          $mp_user = $this->get_user( $email );
   9          if ( !$mp_user ) return $this->export;
  10  
  11          $properties = array(
  12              'id'                 => __( 'Id', 'MailPress' ),
  13              'email'             => __( 'Email', 'MailPress' ),
  14              'name'             => __( 'Name', 'MailPress' ),
  15              'confkey'             => __( 'Internal Key', 'MailPress' ),
  16              'created'             => __( 'Registration Date', 'MailPress' ),
  17              'created_IP'         => __( 'Registration Ip', 'MailPress' ),
  18              'created_agent'     => __( 'Registration UserAgent', 'MailPress' ),
  19              'created_user_id'     => __( 'Registration WP ID', 'MailPress' ),
  20              'laststatus'         => __( 'Last Status Date', 'MailPress' ),
  21              'laststatus_IP'     => __( 'Last Status Ip', 'MailPress' ),
  22              'laststatus_agent'     => __( 'Last Status UserAgent', 'MailPress' ),
  23              'laststatus_user_id'     => __( 'Last Status WP ID', 'MailPress' ),
  24          );
  25  
  26          $data = array();
  27  
  28          foreach ( $properties as $key => $name )
  29          {
  30              $value = '';
  31  
  32              switch ( $key )
  33              {
  34                  case 'id':
  35                  case 'email':
  36                  case 'name':
  37                  case 'confkey':
  38                  case 'created':
  39                  case 'created_IP':
  40                  case 'created_user_id':
  41                  case 'laststatus':
  42                  case 'laststatus_IP':
  43                  case 'laststatus_agent':
  44                  case 'laststatus_user_id':
  45                      $value = $mp_user->{$key};
  46                  break;
  47              }
  48  
  49              if ( empty( $value ) ) continue;
  50  
  51              $data[] = array( 'name'  => $name, 'value' => $value, );
  52          }
  53  
  54          $this->export['data'][] = array(
  55              'group_id'    => 'mp_user',
  56              'group_label' => __( 'Subscriber', 'MailPress' ),
  57              'item_id'     => "mp_user-{$mp_user->id}",
  58              'data'        => $data,
  59          );
  60  
  61          if ( class_exists( 'MailPress_sync_wordpress_user' ) )
  62          {
  63              $wp_users = MailPress_sync_wordpress_user::get_wp_users_by_mp_user_id( $mp_user->id );
  64              if ( $wp_users )
  65              {
  66                  $extra_info = array(
  67                      'ID'            => __( 'WP User ID synch',  'MailPress' ),
  68                      'user_email'    => __( 'WP User Email (reminder)', 'MailPress' ),
  69                      'display_name'    => __( 'WP User Name  (reminder)', 'MailPress' ),
  70                  );
  71  
  72                  foreach ( (array) $wp_users as $wp_user )
  73                  {
  74                      $data = array();
  75  
  76                      foreach ( $extra_info as $key => $name )
  77                      {
  78                          $value = '';
  79  
  80                          switch ( $key )
  81                          {
  82                              case 'ID':
  83                              case 'user_email':
  84                              case 'display_name':
  85                                  $value = $wp_user->{$key};
  86                              break;
  87                          }
  88  
  89                          if ( empty( $value ) ) continue;
  90  
  91                          $data[] = array( 'name'  => $name, 'value' => $value, );
  92                      }
  93  
  94                      $this->export['data'][] = array(
  95                          'group_id'    => 'mp_user',
  96                          'group_label' => __( 'Subscriber', 'MailPress' ),
  97                          'group_description' => __( 'Subscriber&#8217;s informations.', 'MailPress' ),
  98                          'item_id'     => "mp_user-{$mp_user->id}-{$wp_user->ID}",
  99                          'data'        => $data,
 100                      );
 101                  }
 102              }
 103          }
 104  
 105          return $this->export;    
 106      }
 107  }
 108  new MP_WP_Privacy_exporter_mailpress( __( 'MailPress core', 'MailPress' ) );


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