aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/ucp/ucp_remind.php
diff options
context:
space:
mode:
authorPaul S. Owen <psotfx@users.sourceforge.net>2003-05-19 15:23:04 +0000
committerPaul S. Owen <psotfx@users.sourceforge.net>2003-05-19 15:23:04 +0000
commit094ab7e1896435ca9c964245430186346a0eaf53 (patch)
tree630c7763693b8edc14cb54371b7f913b7e852e92 /phpBB/includes/ucp/ucp_remind.php
parent7097d53af2048ebd28c601d2274e536c6ffbee04 (diff)
downloadforums-094ab7e1896435ca9c964245430186346a0eaf53.tar
forums-094ab7e1896435ca9c964245430186346a0eaf53.tar.gz
forums-094ab7e1896435ca9c964245430186346a0eaf53.tar.bz2
forums-094ab7e1896435ca9c964245430186346a0eaf53.tar.xz
forums-094ab7e1896435ca9c964245430186346a0eaf53.zip
Hello!
git-svn-id: file:///svn/phpbb/trunk@4018 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes/ucp/ucp_remind.php')
-rw-r--r--phpBB/includes/ucp/ucp_remind.php106
1 files changed, 106 insertions, 0 deletions
diff --git a/phpBB/includes/ucp/ucp_remind.php b/phpBB/includes/ucp/ucp_remind.php
new file mode 100644
index 0000000000..25ee678b07
--- /dev/null
+++ b/phpBB/includes/ucp/ucp_remind.php
@@ -0,0 +1,106 @@
+<?php
+/***************************************************************************
+ * ucp_remind.php
+ * -------------------
+ * begin : Saturday, Feb 13, 2001
+ * copyright : (C) 2001 The phpBB Group
+ * email : support@phpbb.com
+ *
+ * $Id$
+ *
+ ***************************************************************************/
+
+/***************************************************************************
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ ***************************************************************************/
+
+class ucp_remind extends ucp
+{
+ function main($id)
+ {
+ global $censors, $config, $db, $user, $auth, $SID, $template, $phpbb_root_path, $phpEx;
+
+ if (isset($_POST['submit']))
+ {
+ $username = (!empty($_POST['username'])) ? trim(strip_tags($_POST['username'])) : '';
+ $email = (!empty($_POST['email'])) ? trim(strip_tags(htmlspecialchars($_POST['email']))) : '';
+
+ $sql = "SELECT user_id, username, user_email, user_active, user_lang
+ FROM " . USERS_TABLE . "
+ WHERE user_email = '" . $db->sql_escape($email) . "'
+ AND username = '" . . $db->sql_escape($username) . "'";
+ if ($result = $db->sql_query($sql))
+ {
+ if ($row = $db->sql_fetchrow($result))
+ {
+ if (!$row['user_active'])
+ {
+ trigger_error($lang['ACCOUNT_INACTIVE']);
+ }
+
+ $server_url = generate_board_url();
+ $username = $row['username'];
+
+ $user_actkey = $this->gen_rand_string(10);
+ $key_len = 54 - strlen($server_url);
+ $key_len = ($str_len > 6) ? $key_len : 6;
+ $user_actkey = substr($user_actkey, 0, $key_len);
+ $user_password = $this->gen_rand_string(false);
+
+ $sql = 'UPDATE ' . USERS_TABLE . "
+ SET user_newpasswd = '" . md5($user_password) . "', user_actkey = '$user_actkey'
+ WHERE user_id = " . $row['user_id'];
+ $db->sql_query($sql);
+
+ include($phpbb_root_path . 'includes/emailer.'.$phpEx);
+ $emailer = new emailer($config['smtp_delivery']);
+
+ $emailer->use_template('user_activate_passwd', $row['user_lang']);
+ $emailer->to($row['user_email']);
+
+ $emailer->assign_vars(array(
+ 'SITENAME' => $config['sitename'],
+ 'USERNAME' => $username,
+ 'PASSWORD' => $user_password,
+ 'EMAIL_SIG' => str_replace('<br />', "\n", "-- \n" . $config['board_email_sig']),
+
+ 'U_ACTIVATE' => $server_url . "/ucp.$phpEx?mode=activate&k=$user_actkey")
+ );
+ $emailer->send();
+ $emailer->reset();
+
+ meta_refresh(3, "index.$phpEx$SID");
+
+ $message = $lang['PASSWORD_UPDATED'] . '<br /><br />' . sprintf($lang['RETURN_INDEX'], '<a href="' . "index.$phpEx$SID" . '">', '</a>');
+
+ trigger_error($message);
+ }
+ else
+ {
+ trigger_error($lang['NO_EMAIL']);
+ }
+ }
+ else
+ {
+ trigger_error('Could not obtain user information for sendpassword', E_USER_ERROR);
+ }
+ }
+ else
+ {
+ $username = '';
+ $email = '';
+ }
+
+ $template->assign_vars(array(
+ 'USERNAME' => $username,
+ 'EMAIL' => $email)
+ );
+ }
+}
+
+?> \ No newline at end of file