b2evolution PHP Cross Reference Blogging Systems

Source: /skins_email/account_password_reset.html.php - 103 lines - 4040 bytes - Text - Print

Description: This is sent to a ((User)) when he requested a password reset. Typically includes an link to access the password reset/change screen. For more info about email skins, see: http://b2evolution.net/man/themes-templates-skins/email-skins/

   1  <?php
   2  /**
   3   * This is sent to a ((User)) when he requested a password reset. Typically includes an link to access the password reset/change screen.
   4   *
   5   * For more info about email skins, see: http://b2evolution.net/man/themes-templates-skins/email-skins/
   6   *
   7   * b2evolution - {@link http://b2evolution.net/}
   8   * Released under GNU GPL License - {@link http://b2evolution.net/about/license.html}
   9   * @copyright (c)2003-2014 by Francois Planque - {@link http://fplanque.com/}
  10   *
  11   * @version $Id: account_password_reset.html.php 6136 2014-03-08 07:59:48Z manuel $
  12   */
  13  if( !defined('EVO_MAIN_INIT') ) die( 'Please, do not access this page directly.' );
  14  
  15  // ---------------------------- EMAIL HEADER INCLUDED HERE ----------------------------
  16  emailskin_include( '_email_header.inc.html.php', $params );
  17  // ------------------------------- END OF EMAIL HEADER --------------------------------
  18  
  19  /**
  20   * @var Session
  21   */
  22  global $Session;
  23  
  24  global $secure_htsrv_url, $dummy_fields;
  25  
  26  // Default params:
  27  $params = array_merge( array(
  28          'user_count'     => '',
  29          'request_id'     => '',
  30          'blog_param'     => '',
  31      ), $params );
  32  
  33  
  34  $UserCache = & get_UserCache();
  35  
  36  $message_content = '';
  37  // Iterate through the User Cache
  38  while( ( $iterator_User = & $UserCache->get_next() ) != NULL )
  39  {
  40      // Note: we don't want to display the avatar in this specific case.
  41      if( $params['user_count'] > 1 )
  42      { // Several accounts with the given email address, display last used date for each
  43          $message_content .= '<div style="margin: 1em 0; border: 1px solid #ccc; border-radius: 4px; padding: 1em 1em 1ex;">';
  44  
  45          $message_content .= '<p>'.T_( 'Login:' ).' '.$iterator_User->get_colored_login( array( 'mask' => '$login$' ) )."</p>\n";
  46          $user_lastseen_ts = $iterator_User->get( 'lastseen_ts' );
  47          if( empty( $user_lastseen_ts ) )
  48          { // user has never logged in
  49              $message_content .=  T_( 'Never used.' )."\n";
  50          }
  51          else
  52          {
  53              $message_content .= T_( 'Last used on' ).': <b>'.format_to_output( mysql2localedatetime( $user_lastseen_ts ) )."</b>\n";
  54          }
  55      }
  56      else
  57      {
  58          $message_content .= '<p>'.T_( 'Login:' ).' '.$iterator_User->get_colored_login( array( 'mask' => '$login$' ) )."</p>\n";
  59      }
  60  
  61      $url_change_password = $secure_htsrv_url.'login.php?action=changepwd'
  62          .'&'.$dummy_fields[ 'login' ].'='.rawurlencode( $iterator_User->login )
  63          .'&reqID='.$params['request_id']
  64          .'&sessID='.$Session->ID  // used to detect cookie problems
  65          .$params['blog_param'];
  66  
  67      // Restrict the password change url to be saved in the email logs
  68      $url_change_password = '$secret_content_start$'.$url_change_password.'$secret_content_end$';
  69  
  70      // Buttons:
  71      $message_content .= '<div class="buttons">'."\n";
  72      $message_content .= get_link_tag( $url_change_password, T_( 'Change your password NOW' ), 'button_yellow' )."\n";
  73      $message_content .= "</div>\n";
  74  
  75      if( $params['user_count'] > 1 )
  76      { // Several accounts with the given email address, display last used date for each
  77          $message_content .= '</div>';
  78      }
  79  }
  80  
  81  if( $params['user_count'] > 1 )
  82  { // exists more account with the given email address
  83      $message_content = '<p>'.T_( 'It seems you have multiple accounts associated to this email address. Choose the one you want to use below:' ).'</p>'.$message_content;
  84  
  85      $message_note = T_( 'For security reasons the links are only valid for your current session (by means of your session cookie).' );
  86  }
  87  else
  88  {
  89      $message_note = T_( 'For security reasons the link is only valid for your current session (by means of your session cookie).' );
  90  }
  91  
  92  echo '<p>'.T_( 'Somebody (presumably you) has requested a password change for your account.' )."</p>\n";
  93  
  94  echo $message_content;
  95  
  96  echo '<p class="note">'.T_('Please note:').' '.$message_note."</p>\n";
  97  
  98  echo '<p><i class="note">'.T_('If you did not request this password change, simply ignore this mail.').'</i></p>';
  99  
 100  // ---------------------------- EMAIL FOOTER INCLUDED HERE ----------------------------
 101  emailskin_include( '_email_footer.inc.html.php', $params );
 102  // ------------------------------- END OF EMAIL FOOTER --------------------------------
 103  ?>

title

Description

title

Description

title

Description

title

title

Body