Verzeichnisstruktur phpBB-3.2.0
- Veröffentlicht
- 06.01.2017
So funktioniert es
|
Auf das letzte Element klicken. Dies geht jeweils ein Schritt zurück |
Auf das Icon klicken, dies öffnet das Verzeichnis. Nochmal klicken schließt das Verzeichnis. |
|
(Beispiel Datei-Icons)
|
Auf das Icon klicken um den Quellcode anzuzeigen |
ucp_resend.php
001 <?php
002 /**
003 *
004 * This file is part of the phpBB Forum Software package.
005 *
006 * @copyright (c) phpBB Limited <https://www.phpbb.com>
007 * @license GNU General Public License, version 2 (GPL-2.0)
008 *
009 * For full copyright and license information, please see
010 * the docs/CREDITS.txt file.
011 *
012 */
013
014 /**
015 * @ignore
016 */
017 if (!defined('IN_PHPBB'))
018 {
019 exit;
020 }
021
022 /**
023 * ucp_resend
024 * Resending activation emails
025 */
026 class ucp_resend
027 {
028 var $u_action;
029
030 function main($id, $mode)
031 {
032 global $config, $phpbb_root_path, $phpEx;
033 global $db, $user, $auth, $template, $request;
034
035 $username = $request->variable('username', '', true);
036 $email = strtolower($request->variable('email', ''));
037 $submit = (isset($_POST['submit'])) ? true : false;
038
039 add_form_key('ucp_resend');
040
041 if ($submit)
042 {
043 if (!check_form_key('ucp_resend'))
044 {
045 trigger_error('FORM_INVALID');
046 }
047
048 $sql = 'SELECT user_id, group_id, username, user_email, user_type, user_lang, user_actkey, user_inactive_reason
049 FROM ' . USERS_TABLE . "
050 WHERE user_email_hash = '" . $db->sql_escape(phpbb_email_hash($email)) . "'
051 AND username_clean = '" . $db->sql_escape(utf8_clean_string($username)) . "'";
052 $result = $db->sql_query($sql);
053 $user_row = $db->sql_fetchrow($result);
054 $db->sql_freeresult($result);
055
056 if (!$user_row)
057 {
058 trigger_error('NO_EMAIL_USER');
059 }
060
061 if ($user_row['user_type'] == USER_IGNORE)
062 {
063 trigger_error('NO_USER');
064 }
065
066 if (!$user_row['user_actkey'] && $user_row['user_type'] != USER_INACTIVE)
067 {
068 trigger_error('ACCOUNT_ALREADY_ACTIVATED');
069 }
070
071 if (!$user_row['user_actkey'] || ($user_row['user_type'] == USER_INACTIVE && $user_row['user_inactive_reason'] == INACTIVE_MANUAL))
072 {
073 trigger_error('ACCOUNT_DEACTIVATED');
074 }
075
076 // Determine coppa status on group (REGISTERED(_COPPA))
077 $sql = 'SELECT group_name, group_type
078 FROM ' . GROUPS_TABLE . '
079 WHERE group_id = ' . $user_row['group_id'];
080 $result = $db->sql_query($sql);
081 $row = $db->sql_fetchrow($result);
082 $db->sql_freeresult($result);
083
084 if (!$row)
085 {
086 trigger_error('NO_GROUP');
087 }
088
089 $coppa = ($row['group_name'] == 'REGISTERED_COPPA' && $row['group_type'] == GROUP_SPECIAL) ? true : false;
090
091 include_once($phpbb_root_path . 'includes/functions_messenger.' . $phpEx);
092 $messenger = new messenger(false);
093
094 if ($config['require_activation'] == USER_ACTIVATION_SELF || $coppa)
095 {
096 $messenger->template(($coppa) ? 'coppa_resend_inactive' : 'user_resend_inactive', $user_row['user_lang']);
097 $messenger->set_addresses($user_row);
098
099 $messenger->anti_abuse_headers($config, $user);
100
101 $messenger->assign_vars(array(
102 'WELCOME_MSG' => htmlspecialchars_decode(sprintf($user->lang['WELCOME_SUBJECT'], $config['sitename'])),
103 'USERNAME' => htmlspecialchars_decode($user_row['username']),
104 'U_ACTIVATE' => generate_board_url() . "/ucp.$phpEx?mode=activate&u={$user_row['user_id']}&k={$user_row['user_actkey']}")
105 );
106
107 if ($coppa)
108 {
109 $messenger->assign_vars(array(
110 'FAX_INFO' => $config['coppa_fax'],
111 'MAIL_INFO' => $config['coppa_mail'],
112 'EMAIL_ADDRESS' => $user_row['user_email'])
113 );
114 }
115
116 $messenger->send(NOTIFY_EMAIL);
117 }
118
119 if ($config['require_activation'] == USER_ACTIVATION_ADMIN)
120 {
121 // Grab an array of user_id's with a_user permissions ... these users can activate a user
122 $admin_ary = $auth->acl_get_list(false, 'a_user', false);
123
124 $sql = 'SELECT user_id, username, user_email, user_lang, user_jabber, user_notify_type
125 FROM ' . USERS_TABLE . '
126 WHERE ' . $db->sql_in_set('user_id', $admin_ary[0]['a_user']);
127 $result = $db->sql_query($sql);
128
129 while ($row = $db->sql_fetchrow($result))
130 {
131 $messenger->template('admin_activate', $row['user_lang']);
132 $messenger->set_addresses($row);
133
134 $messenger->anti_abuse_headers($config, $user);
135
136 $messenger->assign_vars(array(
137 'USERNAME' => htmlspecialchars_decode($user_row['username']),
138 'U_USER_DETAILS' => generate_board_url() . "/memberlist.$phpEx?mode=viewprofile&u={$user_row['user_id']}",
139 'U_ACTIVATE' => generate_board_url() . "/ucp.$phpEx?mode=activate&u={$user_row['user_id']}&k={$user_row['user_actkey']}")
140 );
141
142 $messenger->send($row['user_notify_type']);
143 }
144 $db->sql_freeresult($result);
145 }
146
147 meta_refresh(3, append_sid("{$phpbb_root_path}index.$phpEx"));
148
149 $message = ($config['require_activation'] == USER_ACTIVATION_ADMIN) ? $user->lang['ACTIVATION_EMAIL_SENT_ADMIN'] : $user->lang['ACTIVATION_EMAIL_SENT'];
150 $message .= '<br /><br />' . sprintf($user->lang['RETURN_INDEX'], '<a href="' . append_sid("{$phpbb_root_path}index.$phpEx") . '">', '</a>');
151 trigger_error($message);
152 }
153
154 $template->assign_vars(array(
155 'USERNAME' => $username,
156 'EMAIL' => $email,
157 'S_PROFILE_ACTION' => append_sid($phpbb_root_path . 'ucp.' . $phpEx, 'mode=resend_act'))
158 );
159
160 $this->tpl_name = 'ucp_resend';
161 $this->page_title = 'UCP_RESEND';
162 }
163 }
164