[ Index ]

MailPress 7.1

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

title

Body

[close]

/mp-admin/includes/ -> user.php (source)

   1  <?php
   2  
   3  if ( !( function_exists( 'current_user_can' ) && current_user_can( MP_AdminPage::capability ) ) ) die( 'Access denied' );
   4  
   5  global $mp_user;
   6  
   7  $url_parms = MP_AdminPage::get_url_parms( array( 'mode', 'status', 's', 'paged', 'author', 'mailinglist', 'newsletter', 'startwith' ) );
   8  
   9  //
  10  // MANAGING RESULTS
  11  //
  12  
  13  if ( !isset( MP_AdminPage::$get_['id'] ) ) MP_AdminPage::mp_redirect( MP_AdminPage::url( MailPress_users, $url_parms ) );
  14  
  15  $mp_user = MP_User::get( MP_AdminPage::$get_['id'] );
  16  $active  = ( 'active' == $mp_user->status ) ? true : false;
  17  
  18  //
  19  // MANAGING H1
  20  //
  21  
  22  $h1 = sprintf( __( 'Edit MailPress User # %1$s', 'MailPress' ), $mp_user->id );
  23  
  24  // messages
  25  $message = ''; $err = 0;
  26  if ( isset( MP_AdminPage::$get_['saved'] ) )     {$err += 0; if ( !empty( $message ) ) $message .= '<br />'; $message .= __( 'User saved', 'MailPress' ); }
  27  
  28  $HTTP_REFERER = filter_input( INPUT_SERVER, 'HTTP_REFERER' );
  29  ?>
  30  <div class="wrap">
  31      <h1>
  32          <?php echo esc_html( $h1 ); ?>
  33      </h1>
  34  <?php if ( $message ) MP_AdminPage::message( $message, ( $err ) ? false : true ); ?>
  35      <form id="mp_user" name="mp_user_form" method="post">
  36  
  37          <input type="hidden" name="action" value="save" />
  38          <input type="hidden" name="id" value="<?php echo $mp_user->id ?>"  id='mp_user_id' />
  39          <input type="hidden" name="referredby" value="<?php if( isset( $HTTP_REFERER ) ) echo esc_url( $HTTP_REFERER ); ?>" />
  40          <?php wp_nonce_field( 'closedpostboxes', 'closedpostboxesnonce', false ); ?>
  41          <?php wp_nonce_field( 'meta-box-order',  'meta-box-order-nonce', false ); ?>
  42  
  43          <div id="poststuff" class="metabox-holder has-right-sidebar">
  44              <div id="side-info-column" class="inner-sidebar">
  45  <?php $side_meta_boxes = do_meta_boxes( MP_AdminPage::screen, 'side', $mp_user ); ?>
  46              </div>
  47  
  48              <div id="post-body" class="<?php echo $side_meta_boxes ? 'has-sidebar' : ''; ?>">
  49                  <div id="post-body-content" class="has-sidebar-content">
  50                      <table class="form-table">
  51                          <tbody>
  52                              <tr>
  53                                  <th class="h1em">
  54                                      <?php _e( 'Email', 'MailPress' ); ?>
  55                                  </th>
  56                                  <td class="h1em">
  57                                      <input type="text" size="30" value="<?php echo $mp_user->email; ?>" disabled="disabled" />
  58                                  </td>
  59                                  <td class="mp_avatar" rowspan="2">
  60  <?php if ( get_option( 'show_avatars' ) ) echo get_avatar( $mp_user->email, 64 ) . '<br /><br />'; ?>
  61  <?php echo MP_User::get_flag_IP(); ?>
  62                                  </td>
  63                              </tr>
  64                              <tr>
  65                                  <th class="h1em">
  66                                      <?php _e( 'Name', 'MailPress' ); ?>
  67                                  </th>
  68                                  <td class="h1em">
  69                                      <input type="text" name="mp_user_name" size="30" value="<?php echo esc_attr( $mp_user->name ); ?>" />
  70                                      <input type="hidden" name="mp_user_old_name" value="<?php echo esc_attr( $mp_user->name ); ?>" />
  71                                  </td>
  72                              </tr>
  73                          </tbody>
  74                      </table>
  75                      <br />
  76  <?php do_meta_boxes( MP_AdminPage::screen, 'normal', $mp_user ); ?>
  77                  </div>
  78              </div>
  79          </div>
  80      </form>
  81  </div>


Generated: Mon Mar 11 18:33:33 2019 Cross-referenced by PHPXref 0.7.1