Fix bug #20625 - Do not display birthdays of banned users

Authorised by: acydburn

git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9604 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
Joas Schilling 2009-06-17 10:01:54 +00:00
parent ac72c7e049
commit 2b020c6327
2 changed files with 7 additions and 4 deletions

View file

@ -113,6 +113,7 @@
<li>[Fix] Template cache error for files of template-subfolders (Bug #46145 - Patch by nickvergessen)</li> <li>[Fix] Template cache error for files of template-subfolders (Bug #46145 - Patch by nickvergessen)</li>
<li>[Fix] Display user's Jabber address in popup when Jabber functionality is disabled (Bug #20775 - Patch by nickvergessen)</li> <li>[Fix] Display user's Jabber address in popup when Jabber functionality is disabled (Bug #20775 - Patch by nickvergessen)</li>
<li>[Fix] Exclude forum from active topics option is ignored (Bug #19135 - Patch by nickvergessen)</li> <li>[Fix] Exclude forum from active topics option is ignored (Bug #19135 - Patch by nickvergessen)</li>
<li>[Fix] Do not display birthdays of banned users (Bug #20625 - Patch by nickvergessen)</li>
<li>[Change] Change the data format of the default file ACM to be more secure from tampering and have better performance.</li> <li>[Change] Change the data format of the default file ACM to be more secure from tampering and have better performance.</li>
<li>[Change] Add index on log_time to the log table to prevent slowdown on boards with many log entries. (Bug #44665 - Patch by bantu)</li> <li>[Change] Add index on log_time to the log table to prevent slowdown on boards with many log entries. (Bug #44665 - Patch by bantu)</li>
<li>[Change] Template engine now permits to a limited extent variable includes.</li> <li>[Change] Template engine now permits to a limited extent variable includes.</li>

View file

@ -84,10 +84,12 @@ $birthday_list = '';
if ($config['load_birthdays'] && $config['allow_birthdays']) if ($config['load_birthdays'] && $config['allow_birthdays'])
{ {
$now = getdate(time() + $user->timezone + $user->dst - date('Z')); $now = getdate(time() + $user->timezone + $user->dst - date('Z'));
$sql = 'SELECT user_id, username, user_colour, user_birthday $sql = 'SELECT u.user_id, u.username, u.user_colour, u.user_birthday, b.ban_id
FROM ' . USERS_TABLE . " FROM ' . USERS_TABLE . ' u
WHERE user_birthday LIKE '" . $db->sql_escape(sprintf('%2d-%2d-', $now['mday'], $now['mon'])) . "%' LEFT JOIN ' . BANLIST_TABLE . " b ON (u.user_id = b.ban_userid)
AND user_type IN (" . USER_NORMAL . ', ' . USER_FOUNDER . ')'; WHERE b.ban_id IS NULL
AND u.user_birthday LIKE '" . $db->sql_escape(sprintf('%2d-%2d-', $now['mday'], $now['mon'])) . "%'
AND u.user_type IN (" . USER_NORMAL . ', ' . USER_FOUNDER . ')';
$result = $db->sql_query($sql); $result = $db->sql_query($sql);
while ($row = $db->sql_fetchrow($result)) while ($row = $db->sql_fetchrow($result))