Beehive PHP Cross Reference Discussion Forums

Source: /forgot_pw.php - 114 lines - 4385 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 . 'form.inc.php';
  31  require_once  BH_INCLUDE_PATH . 'format.inc.php';
  32  require_once  BH_INCLUDE_PATH . 'html.inc.php';
  33  // End Required includes
  34  
  35  // Array for holding error messages
  36  $error_msg_array = array();
  37  
  38  if (isset($_POST['request'])) {
  39  
  40      if (isset($_POST['logon'])) {
  41  
  42          $logon = mb_strtoupper($_POST['logon']);
  43  
  44          if (email_send_pw_reminder($logon)) {
  45  
  46              html_draw_top(sprintf('title=%s', gettext("Password reset e-mail sent")), 'class=window_title');
  47              html_display_msg(gettext("Password reset e-mail sent"), gettext("You should shortly receive an e-mail containing instructions for resetting your password."), 'logon.php', 'get', array('back' => gettext("Back")), array(), '_self', 'center');
  48              html_draw_bottom();
  49              exit;
  50  
  51          } else {
  52  
  53              $error_msg_array[] = gettext("Could not send password reminder. Please contact the forum owner.");
  54          }
  55  
  56      } else {
  57  
  58          $error_msg_array[] = gettext("A valid username is required");
  59      }
  60  }
  61  
  62  html_draw_top(sprintf('title=%s', gettext("Forgot password")), 'class=window_title');
  63  
  64  echo "<h1>", gettext("Forgot password"), "</h1>";
  65  
  66  if (isset($error_msg_array) && sizeof($error_msg_array) > 0) {
  67      html_display_error_array($error_msg_array, '450', 'center');
  68  }
  69  
  70  echo "<br />\n";
  71  echo "<div align=\"center\">\n";
  72  echo "  <form accept-charset=\"utf-8\" name=\"forgot_pw\" action=\"forgot_pw.php\" method=\"post\">\n";
  73  echo "  ", form_input_hidden('webtag', htmlentities_array($webtag)), "\n";
  74  echo "  <table cellpadding=\"0\" cellspacing=\"0\" width=\"450\">\n";
  75  echo "      <tr>\n";
  76  echo "        <td align=\"center\">\n";
  77  echo "          <table class=\"box\" width=\"450\">\n";
  78  echo "            <tr>\n";
  79  echo "              <td align=\"left\" class=\"posthead\">\n";
  80  echo "                <table class=\"posthead\" width=\"100%\">\n";
  81  echo "                  <tr>\n";
  82  echo "                    <td align=\"left\" class=\"subhead\" colspan=\"2\">", gettext("Forgot password"), "</td>\n";
  83  echo "                  </tr>\n";
  84  echo "                  <tr>\n";
  85  echo "                    <td align=\"center\">\n";
  86  echo "                      <table class=\"posthead\" width=\"95%\">\n";
  87  echo "                        <tr>\n";
  88  echo "                          <td align=\"left\">", gettext("Username"), ":</td>\n";
  89  echo "                          <td align=\"left\">", form_input_text("logon", (isset($logon) ? htmlentities_array($logon) : ''), 37, 15), "</td>\n";
  90  echo "                        </tr>\n";
  91  echo "                      </table>\n";
  92  echo "                    </td>\n";
  93  echo "                  </tr>\n";
  94  echo "                  <tr>\n";
  95  echo "                    <td align=\"left\">&nbsp;</td>\n";
  96  echo "                    <td align=\"left\">&nbsp;</td>\n";
  97  echo "                  </tr>\n";
  98  echo "                </table>\n";
  99  echo "              </td>\n";
 100  echo "            </tr>\n";
 101  echo "          </table>\n";
 102  echo "        </td>\n";
 103  echo "      </tr>\n";
 104  echo "      <tr>\n";
 105  echo "        <td align=\"left\">&nbsp;</td>\n";
 106  echo "      </tr>\n";
 107  echo "      <tr>\n";
 108  echo "        <td align=\"center\">", form_submit('request', gettext("Request")), "</td>\n";
 109  echo "      </tr>\n";
 110  echo "    </table>\n";
 111  echo "  </form>\n";
 112  echo "</div>\n";
 113  
 114  html_draw_bottom();

title

Description

title

Description

title

Description

title

title

Body