Beehive PHP Cross Reference Discussion Forums

Source: /confirm_email.php - 86 lines - 3150 bytes - Summary - Text - Print

   1  <?php
   2  
   3  /*======================================================================
   4  Copyright Project Beehive Forum 2002
   5  
   6  This file is part of Beehive Forum.
   7  
   8  Beehive Forum is free software; you can redistribute it and/or modify
   9  it under the terms of the GNU General Public License as published by
  10  the Free Software Foundation; either version 3 of the License, or
  11  (at your option) any later version.
  12  
  13  Beehive Forum is distributed in the hope that it will be useful,
  14  but WITHOUT ANY WARRANTY; without even the implied warranty of
  15  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  16  GNU General Public License for more details.
  17  
  18  You should have received a copy of the GNU General Public License
  19  along with Beehive; if not, write to the Free Software
  20  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
  21  USA
  22  ======================================================================*/
  23  
  24  // Bootstrap
  25  require_once  'boot.php';
  26  
  27  // Required includes
  28  require_once  BH_INCLUDE_PATH . 'constants.inc.php';
  29  require_once  BH_INCLUDE_PATH . 'email.inc.php';
  30  require_once  BH_INCLUDE_PATH . 'html.inc.php';
  31  require_once  BH_INCLUDE_PATH . 'perm.inc.php';
  32  require_once  BH_INCLUDE_PATH . 'user.inc.php';
  33  // End Required includes
  34  
  35  $uid = null;
  36  $key = null;
  37  
  38  if (isset($_GET['uid']) && is_numeric($_GET['uid'])) {
  39      $uid = $_GET['uid'];
  40  } else if (isset($_GET['u']) && is_numeric($_GET['u'])) {
  41      $uid = $_GET['u'];
  42  }
  43  
  44  if (isset($_GET['h']) && is_string($_GET['h'])) {
  45      $key = $_GET['h'];
  46  }
  47  
  48  if (isset($_GET['resend']) && isset($uid)) {
  49  
  50      if (email_send_user_confirmation($uid)) {
  51  
  52          html_draw_top(sprintf('title=%s', gettext("Email confirmation")), 'class=window_title');
  53          html_display_msg(gettext("Email confirmation"), gettext("Confirmation email has been resent."));
  54          html_draw_bottom();
  55          exit;
  56      }
  57      html_draw_error(gettext("Confirmation email failed to send. Please contact the forum owner to rectify this."));
  58  }
  59  
  60  if (!isset($uid) || !isset($key)) {
  61      html_draw_error(gettext("Required information not found"));
  62  }
  63  
  64  $frame_top_target = html_get_top_frame_name();
  65  
  66  if (($user = user_get_by_passhash($uid, $key)) !== false) {
  67  
  68      if (perm_user_cancel_email_confirmation($uid)) {
  69  
  70          html_draw_top(sprintf('title=%s', gettext("Email confirmation")), 'class=window_title');
  71          html_display_msg(gettext("Email confirmation"), gettext("Thank you for confirming your email address. You may now login and start posting immediately."), 'index.php', 'post', array('submit' => gettext("Continue")), array(), $frame_top_target, 'center');
  72          html_draw_bottom();
  73  
  74      } else {
  75  
  76          html_draw_top(sprintf("title=%s", gettext("Error")));
  77          html_display_msg(gettext("Email confirmation"), gettext("Email confirmation has failed, please try again later. If you encounter this error multiple times please contact the forum owner or a moderator for assistance."), 'index.php', 'post', array('submit' => gettext("Continue")), array(), $frame_top_target, 'center');
  78          html_draw_bottom();
  79      }
  80  
  81      html_draw_bottom();
  82  
  83  } else {
  84  
  85      html_draw_error(gettext("Required information not found"));
  86  }

title

Description

title

Description

title

Description

title

title

Body