aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMeik Sievertsen <acydburn@phpbb.com>2006-06-11 18:13:52 +0000
committerMeik Sievertsen <acydburn@phpbb.com>2006-06-11 18:13:52 +0000
commit01b41453812dc7b990f03b81f85dcfb9a18076fd (patch)
treed12e93524fa7625d1220088d34a5a957cd618624 /phpBB/includes/ucp/ucp_resend.php
parent;-) (diff)
downloadphpbb-01b41453812dc7b990f03b81f85dcfb9a18076fd.tar.gz
phpbb-01b41453812dc7b990f03b81f85dcfb9a18076fd.tar.bz2
phpbb-01b41453812dc7b990f03b81f85dcfb9a18076fd.zip
- fixed a few bugs
- added user_add() function - check posted images ([img]) for same domain/scipt and php files - auth_api.html updated to the coding guidelines look&feel - introduced ability to force non page-updates (cron is using it) - correctly resend coppa email git-svn-id: file:///svn/phpbb/trunk@6048 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes/ucp/ucp_resend.php')
-rw-r--r--phpBB/includes/ucp/ucp_resend.php76
1 files changed, 34 insertions, 42 deletions
diff --git a/phpBB/includes/ucp/ucp_resend.php b/phpBB/includes/ucp/ucp_resend.php
index a18eb14e0d..51dd2ea4f2 100644
--- a/phpBB/includes/ucp/ucp_resend.php
+++ b/phpBB/includes/ucp/ucp_resend.php
@@ -19,61 +19,57 @@ class ucp_resend
function main($id, $mode)
{
- global $config, $db, $user, $auth, $template, $phpbb_root_path, $phpEx;
+ global $config, $phpbb_root_path, $phpEx;
+ global $db, $user, $auth, $template;
- $submit = (isset($_POST['submit'])) ? true : false;
+ $username = request_var('username', '', true);
+ $email = request_var('email', '');
+ $submit = (isset($_POST['submit'])) ? true : false;
if ($submit)
{
- $username = request_var('username', '', true);
- $email = request_var('email', '');
-
- $sql = 'SELECT user_id, username, user_email, user_type, user_lang, user_actkey
+ $sql = 'SELECT user_id, group_id, username, user_email, user_type, user_lang, user_actkey
FROM ' . USERS_TABLE . "
WHERE user_email = '" . $db->sql_escape($email) . "'
- AND username = '" . $db->sql_escape($username) . "'";
+ AND LOWER(username) = '" . $db->sql_escape(strtolower($username)) . "'";
$result = $db->sql_query($sql);
+ $user_row = $db->sql_fetchrow($result);
+ $db->sql_freeresult($result);
- if (!($row = $db->sql_fetchrow($result)))
+ if (!$user_row)
{
trigger_error('NO_EMAIL_USER');
}
- $db->sql_freeresult($result);
- if (!$row['user_actkey'])
+ if (!$user_row['user_actkey'])
{
trigger_error('ACCOUNT_ALREADY_ACTIVATED');
}
- $server_url = generate_board_url();
- $username = $row['username'];
- $user_id = $row['user_id'];
+ // Determine coppa status on group (INACTIVE(_COPPA))
+ $sql = 'SELECT group_name, group_type
+ FROM ' . GROUPS_TABLE . '
+ WHERE group_id = ' . $user_row['group_id'];
+ $result = $db->sql_query($sql);
+ $row = $db->sql_fetchrow($result);
+ $db->sql_freeresult($result);
-/* if ($coppa)
- {
- $email_template = 'coppa_welcome_inactive';
- }*/
-/*
- if ($config['require_activation'] == USER_ACTIVATION_ADMIN)
- {
- $email_template = 'admin_welcome_inactive';
- }
- else
+ if (!$row)
{
- $email_template = 'user_welcome_inactive';
+ trigger_error('NO_GROUP');
}
-*/
- include_once($phpbb_root_path . 'includes/functions_messenger.'.$phpEx);
+ $coppa = ($row['group_name'] == 'INACTIVE_COPPA' && $row['group_type'] == GROUP_SPECIAL) ? true : false;
+ include_once($phpbb_root_path . 'includes/functions_messenger.' . $phpEx);
$messenger = new messenger(false);
if ($config['require_activation'] == USER_ACTIVATION_SELF || $coppa)
{
- $messenger->template('user_resend_inactive', $row['user_lang']);
+ $messenger->template(($coppa) ? 'coppa_resend_inactive' : 'user_resend_inactive', $user_row['user_lang']);
$messenger->replyto($config['board_contact']);
- $messenger->to($row['user_email'], $row['username']);
+ $messenger->to($user_row['user_email'], $user_row['username']);
$messenger->headers('X-AntiAbuse: Board servername - ' . $config['server_name']);
$messenger->headers('X-AntiAbuse: User_id - ' . $user->data['user_id']);
@@ -83,10 +79,10 @@ class ucp_resend
$messenger->assign_vars(array(
'SITENAME' => $config['sitename'],
'WELCOME_MSG' => sprintf($user->lang['WELCOME_SUBJECT'], $config['sitename']),
- 'USERNAME' => html_entity_decode($row['username']),
+ 'USERNAME' => html_entity_decode($user_row['username']),
'EMAIL_SIG' => str_replace('<br />', "\n", "-- \n" . $config['board_email_sig']),
- 'U_ACTIVATE' => "$server_url/ucp.$phpEx?mode=activate&u={$row['user_id']}&k={$row['user_actkey']}")
+ 'U_ACTIVATE' => generate_board_url() . "/ucp.$phpEx?mode=activate&u={$user_row['user_id']}&k={$user_row['user_actkey']}")
);
if ($coppa)
@@ -94,7 +90,7 @@ class ucp_resend
$messenger->assign_vars(array(
'FAX_INFO' => $config['coppa_fax'],
'MAIL_INFO' => $config['coppa_mail'],
- 'EMAIL_ADDRESS' => $row['user_email'],
+ 'EMAIL_ADDRESS' => $user_row['user_email'],
'SITENAME' => $config['sitename'])
);
}
@@ -104,8 +100,7 @@ class ucp_resend
if ($config['require_activation'] == USER_ACTIVATION_ADMIN)
{
- // Grab an array of user_id's with a_user permissions ... these users
- // can activate a user
+ // Grab an array of user_id's with a_user permissions ... these users can activate a user
$admin_ary = $auth->acl_get_list(false, 'a_user', false);
$sql = 'SELECT user_id, username, user_email, user_lang, user_jabber, user_notify_type
@@ -121,10 +116,10 @@ class ucp_resend
$messenger->im($row['user_jabber'], $row['username']);
$messenger->assign_vars(array(
- 'USERNAME' => html_entity_decode($row['username']),
+ 'USERNAME' => html_entity_decode($user_row['username']),
'EMAIL_SIG' => str_replace('<br />', "\n", "-- \n" . $config['board_email_sig']),
- 'U_ACTIVATE' => "$server_url/ucp.$phpEx?mode=activate&u={$row['user_id']}&k={$row['user_actkey']}")
+ 'U_ACTIVATE' => generate_board_url() . "/ucp.$phpEx?mode=activate&u={$user_row['user_id']}&k={$user_row['user_actkey']}")
);
$messenger->send($row['user_notify_type']);
@@ -137,18 +132,15 @@ class ucp_resend
$message = $user->lang['ACTIVATION_EMAIL_SENT'] . '<br /><br />' . sprintf($user->lang['RETURN_INDEX'], '<a href="' . append_sid("{$phpbb_root_path}index.$phpEx") . '">', '</a>');
trigger_error($message);
}
- else
- {
- $username = $email = '';
- }
$template->assign_vars(array(
- 'USERNAME' => $username,
- 'EMAIL' => $email)
+ 'USERNAME' => $username,
+ 'EMAIL' => $email,
+ 'S_PROFILE_ACTION' => append_sid($phpbb_root_path . 'ucp.' . $phpEx, 'mode=resend_act'))
);
$this->tpl_name = 'ucp_resend';
}
}
-?>
+?> \ No newline at end of file