diff options
| author | Meik Sievertsen <acydburn@phpbb.com> | 2004-10-13 19:30:02 +0000 |
|---|---|---|
| committer | Meik Sievertsen <acydburn@phpbb.com> | 2004-10-13 19:30:02 +0000 |
| commit | c941f666cf5184b508589fc151772f42f1a2d4c5 (patch) | |
| tree | 88d74b4c9ac57e16682b93878885d6f809fe55a5 /phpBB/includes/ucp/ucp_activate.php | |
| parent | 4804c05bca3e49a62a3fb91a988364024e745a5c (diff) | |
| download | forums-c941f666cf5184b508589fc151772f42f1a2d4c5.tar forums-c941f666cf5184b508589fc151772f42f1a2d4c5.tar.gz forums-c941f666cf5184b508589fc151772f42f1a2d4c5.tar.bz2 forums-c941f666cf5184b508589fc151772f42f1a2d4c5.tar.xz forums-c941f666cf5184b508589fc151772f42f1a2d4c5.zip | |
- ucp register/remind/activate fixes mostly regarding account activation
- general ucp fixing (profile and ucp_main)
- created three new functions (return correct topic author string, generate topic related pagination and get topic type/status...). These general bits are used on several pages (subscribed topics, bookmarks, viewforum).
- config basic schema fix
- commented out inline fix for unread topic tracking in viewforum, instead tried another method (hopefully working as well)
git-svn-id: file:///svn/phpbb/trunk@5001 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes/ucp/ucp_activate.php')
| -rw-r--r-- | phpBB/includes/ucp/ucp_activate.php | 31 |
1 files changed, 21 insertions, 10 deletions
diff --git a/phpBB/includes/ucp/ucp_activate.php b/phpBB/includes/ucp/ucp_activate.php index d50b87bf52..0892ebbb08 100644 --- a/phpBB/includes/ucp/ucp_activate.php +++ b/phpBB/includes/ucp/ucp_activate.php @@ -42,23 +42,34 @@ class ucp_activate extends module trigger_error($user->lang['WRONG_ACTIVATION']); } - $sql_update_pass = ($row['user_newpasswd']) ? ", user_password = '" . $db->sql_escape($row['user_newpasswd']) . "', user_newpasswd = ''" : ''; + $update_password = ($row['user_newpasswd']) ? true : false; - $sql = 'UPDATE ' . USERS_TABLE . ' - SET user_type = ' . USER_NORMAL . ", user_actkey = '$sql_update_pass' - WHERE user_id = {$row['user_id']}"; + $sql_ary = array( + 'user_type' => USER_NORMAL, + 'user_actkey' => '' + ); + + if ($update_password) + { + $sql_ary += array( + 'user_password' => $row['user_newpasswd'], + 'user_newpasswd' => '' + ); + } + + $sql = 'UPDATE ' . USERS_TABLE . ' SET ' . $db->sql_build_array('UPDATE', $sql_ary) . ' + WHERE user_id = ' . $row['user_id']; $result = $db->sql_query($sql); - if ($config['require_activation'] == USER_ACTIVATION_ADMIN && $sql_update_pass) + if ($config['require_activation'] == USER_ACTIVATION_ADMIN && !$update_password) { include_once($phpbb_root_path . 'includes/functions_messenger.'.$phpEx); $messenger = new messenger(); $messenger->template('admin_welcome_activated', $row['user_lang']); - $messenger->subject($subject); - $messenger->replyto($user->data['board_contact']); + $messenger->replyto($config['board_contact']); $messenger->to($row['user_email'], $row['username']); $messenger->headers('X-AntiAbuse: Board servername - ' . $config['server_name']); @@ -69,7 +80,7 @@ class ucp_activate extends module $messenger->assign_vars(array( 'SITENAME' => $config['sitename'], 'USERNAME' => $row['username'], - 'PASSWORD' => $password_confirm, + 'EMAIL_SIG' => str_replace('<br />', "\n", "-- \n" . $config['board_email_sig'])) ); @@ -80,10 +91,10 @@ class ucp_activate extends module } else { - $message = (!$sql_update_pass) ? 'ACCOUNT_ACTIVE' : 'PASSWORD_ACTIVATED'; + $message = (!$update_password) ? 'ACCOUNT_ACTIVE' : 'PASSWORD_ACTIVATED'; } - if (!$sql_update_pass) + if (!$update_password) { set_config('newest_user_id', $row['user_id']); set_config('newest_username', $row['username']); |
