Changeset 1539

Show
Ignore:
Timestamp:
03/02/08 17:19:55 (2 months ago)
Author:
Neal
Message:

Fixed user deletion not removing moderators/administrators from the bans cache (as ban creators) or from the list of forum moderators. Noticed by lie2815.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/punbb-1.3-dev/upload/include/functions.php

    r1536 r1539  
    891891        $user = $db->fetch_assoc($result); 
    892892 
    893         // If the user is a moderator or an administrator, we remove him/her from the moderator list in all forums 
    894         // and regenerate the bans cache 
    895         if ($user['group_id'] == PUN_ADMIN || $user['g_moderator'] == '1') 
    896         { 
    897                 clean_forum_moderators(); 
    898  
    899                 // Regenerate the bans cache 
    900                 require_once PUN_ROOT.'include/cache.php'; 
    901                 generate_bans_cache(); 
    902         } 
    903  
    904893        // Delete any subscriptions 
    905894        $query = array( 
     
    977966        if (file_exists($pun_config['o_avatars_dir'].'/'.$user_id.'.png')) 
    978967                @unlink($pun_config['o_avatars_dir'].'/'.$user_id.'.png'); 
     968 
     969        // If the user is a moderator or an administrator, we remove him/her from the moderator list in all forums 
     970        // and regenerate the bans cache (in case he/she created any bans) 
     971        if ($user['group_id'] == PUN_ADMIN || $user['g_moderator'] == '1') 
     972        { 
     973                clean_forum_moderators(); 
     974 
     975                // Regenerate the bans cache 
     976                require_once PUN_ROOT.'include/cache.php'; 
     977                generate_bans_cache(); 
     978        } 
    979979 
    980980        ($hook = get_hook('fn_delete_user_end')) ? eval($hook) : null;