diff options
author | Meik Sievertsen <acydburn@phpbb.com> | 2006-07-01 19:11:52 +0000 |
---|---|---|
committer | Meik Sievertsen <acydburn@phpbb.com> | 2006-07-01 19:11:52 +0000 |
commit | 6df6eb0e601d459544b0cbcee063cf19c01bb37d (patch) | |
tree | c99b89abfafe03c69d5e0852abda5f4c0b98f155 /phpBB/memberlist.php | |
parent | 7ad5db1856f18edb5fb8e2cd784b1eb22d3dcbc1 (diff) | |
download | forums-6df6eb0e601d459544b0cbcee063cf19c01bb37d.tar forums-6df6eb0e601d459544b0cbcee063cf19c01bb37d.tar.gz forums-6df6eb0e601d459544b0cbcee063cf19c01bb37d.tar.bz2 forums-6df6eb0e601d459544b0cbcee063cf19c01bb37d.tar.xz forums-6df6eb0e601d459544b0cbcee063cf19c01bb37d.zip |
- add additional auth check to the permission roles modules
- added new function to return globally used expressions (get_preg_expression($mode)). This should be very helpful in getting wide spread similar checks (regular expressions) to one place reducing the risk of forgetting to change every location if you fix one. ;) We will add additional ones later, at the moment only the email check is retrieved...
- added "active module" var to the module class returning the current active module
- changed call to image magick
- add administrator to global moderators group by default
- extend auth_option column a little bit
- other bugfixes
git-svn-id: file:///svn/phpbb/trunk@6135 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/memberlist.php')
-rw-r--r-- | phpBB/memberlist.php | 106 |
1 files changed, 71 insertions, 35 deletions
diff --git a/phpBB/memberlist.php b/phpBB/memberlist.php index 63d8342040..c656a0431d 100644 --- a/phpBB/memberlist.php +++ b/phpBB/memberlist.php @@ -397,6 +397,21 @@ switch ($mode) $profile_fields = (isset($profile_fields[$user_id])) ? $cp->generate_profile_fields_template('show', false, $profile_fields[$user_id]) : array(); } + // We need to check if the module 'zebra' is accessible + $zebra_enabled = false; + + if ($user->data['user_id'] != $user_id && $user->data['is_registered']) + { + include_once($phpbb_root_path . 'includes/functions_module.' . $phpEx); + $module = new p_master(); + $module->list_modules('ucp'); + $module->set_active('zebra'); + + $zebra_enabled = ($module->active_module === false) ? false : true; + + unset($module); + } + $template->assign_vars(array( 'POSTS_DAY' => sprintf($user->lang['POST_DAY'], $posts_per_day), 'POSTS_PCT' => sprintf($user->lang['POST_PCT'], $percentage), @@ -424,7 +439,7 @@ switch ($mode) 'U_USER_ADMIN' => ($auth->acl_get('a_user')) ? append_sid("{$phpbb_root_path}adm/index.$phpEx", 'i=users&mode=overview&u=' . $user_id, true, $user->session_id) : '', 'U_SWITCH_PERMISSIONS' => ($auth->acl_get('a_switchperm') && $user->data['user_id'] != $user_id) ? append_sid("{$phpbb_root_path}ucp.$phpEx", "mode=switch_perm&u={$user_id}") : '', - 'S_ZEBRA' => ($user->data['user_id'] != $user_id && $user->data['is_registered']) ? true : false, + 'S_ZEBRA' => ($user->data['user_id'] != $user_id && $user->data['is_registered'] && $zebra_enabled) ? true : false, 'U_ADD_FRIEND' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=zebra&add=' . urlencode($member['username'])), 'U_ADD_FOE' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=zebra&mode=foes&add=' . urlencode($member['username']))) ); @@ -598,53 +613,74 @@ switch ($mode) include_once($phpbb_root_path . 'includes/functions_messenger.' . $phpEx); $messenger = new messenger(false); - $email_tpl = ($user_id) ? 'profile_send_email' : 'email_notify'; - $messenger->template($email_tpl, $email_lang); + $mail_to_users = array(); - $messenger->replyto($user->data['user_email']); - $messenger->to($email, $name); + $mail_to_users[] = array( + 'email_lang' => $email_lang, + 'email' => $email, + 'name' => $name, + 'username' => $row['username'], + 'to_name' => $name, + 'user_jabber' => $row['user_jabber'], + 'user_notify_type' => $row['user_notify_type'], + ); - if ($user_id) - { - $messenger->subject(html_entity_decode($subject)); - $messenger->im($row['user_jabber'], $row['username']); - $notify_type = $row['user_notify_type']; - } - else + // Ok, now the same email if CC specified, but without exposing the users email address + if ($cc) { - $notify_type = NOTIFY_EMAIL; + $mail_to_users[] = array( + 'email_lang' => $user->data['user_lang'], + 'email' => $user->data['user_email'], + 'name' => $user->data['username'], + 'username' => $user->data['username'], + 'to_name' => $name, + 'user_jabber' => $user->data['user_jabber'], + 'user_notify_type' => ($user_id) ? $user->data['user_notify_type'] : NOTIFY_EMAIL, + ); } - if ($cc) + foreach ($mail_to_users as $row) { - $messenger->cc($user->data['user_email'], $user->data['username']); - } + $messenger->template($email_tpl, $row['email_lang']); + $messenger->replyto($user->data['user_email']); + $messenger->to($row['email'], $row['name']); - $messenger->headers('X-AntiAbuse: Board servername - ' . $config['server_name']); - $messenger->headers('X-AntiAbuse: User_id - ' . $user->data['user_id']); - $messenger->headers('X-AntiAbuse: Username - ' . $user->data['username']); - $messenger->headers('X-AntiAbuse: User IP - ' . $user->ip); - - $messenger->assign_vars(array( - 'SITENAME' => $config['sitename'], - 'BOARD_EMAIL' => $config['board_contact'], - 'TO_USERNAME' => html_entity_decode($name), - 'FROM_USERNAME' => html_entity_decode($user->data['username']), - 'MESSAGE' => html_entity_decode($message)) - ); + if ($user_id) + { + $messenger->subject(html_entity_decode($subject)); + $messenger->im($row['user_jabber'], $row['username']); + $notify_type = $row['user_notify_type']; + } + else + { + $notify_type = NOTIFY_EMAIL; + } + + $messenger->headers('X-AntiAbuse: Board servername - ' . $config['server_name']); + $messenger->headers('X-AntiAbuse: User_id - ' . $user->data['user_id']); + $messenger->headers('X-AntiAbuse: Username - ' . $user->data['username']); + $messenger->headers('X-AntiAbuse: User IP - ' . $user->ip); - if ($topic_id) - { $messenger->assign_vars(array( - 'TOPIC_NAME' => html_entity_decode($row['topic_title']), - 'U_TOPIC' => generate_board_url() . "/viewtopic.$phpEx?f=" . $row['forum_id'] . "&t=$topic_id") + 'SITENAME' => $config['sitename'], + 'BOARD_EMAIL' => $config['board_contact'], + 'TO_USERNAME' => html_entity_decode($row['to_name']), + 'FROM_USERNAME' => html_entity_decode($user->data['username']), + 'MESSAGE' => html_entity_decode($message)) ); - } - $messenger->send($notify_type); - $messenger->save_queue(); + if ($topic_id) + { + $messenger->assign_vars(array( + 'TOPIC_NAME' => html_entity_decode($row['topic_title']), + 'U_TOPIC' => generate_board_url() . "/viewtopic.$phpEx?f=" . $row['forum_id'] . "&t=$topic_id") + ); + } + + $messenger->send($notify_type); + } meta_refresh(3, append_sid("{$phpbb_root_path}index.$phpEx")); $message = ($user_id) ? sprintf($user->lang['RETURN_INDEX'], '<a href="' . append_sid("{$phpbb_root_path}index.$phpEx") . '">', '</a>') : sprintf($user->lang['RETURN_TOPIC'], '<a href="' . append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f={$row['forum_id']}&t=$topic_id") . '">', '</a>'); |