Show
Ignore:
Timestamp:
12/15/10 03:01:14 (2 years ago)
Author:
Whiler
Message:

Parameters labels weren't good... (opposite from what we are expecting) - fixed
Second tab only show users who are duplicated with the chosen options

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • extensions/LCAS/trunk/include/functions.inc.php

    r8141 r8143  
    807807} 
    808808 
     809// Fonctionnel mais optimisable 
     810function LCAS_GetDuplicates($source) { 
     811        $users      = array(); 
     812        $duplicates = array(); 
     813         
     814        // Liste des utilisateurs uniques 
     815        foreach($source as $user) { 
     816                if (isset($users[$user['transformed']])) { 
     817                        $users[$user['transformed']] += 1; 
     818                } 
     819                else { 
     820                        $users[$user['transformed']] = 1; 
     821                } 
     822        } 
     823         
     824        // On récupère les doublons 
     825        foreach($source as $user) { 
     826                if ($users[$user['transformed']] > 1) { 
     827                        array_push($duplicates, $user); 
     828                } 
     829        } 
     830         
     831        return $duplicates; 
     832} 
     833 
    809834/* Function called from UserAdvManager.php - Get all users to display the number of days since their last visit */ 
    810 function LCAS_get_user_list() 
     835function LCAS_get_user_list($rule) 
    811836{ 
    812837        global $conf, $page; 
     
    820845                u.'.$conf['user_fields']['email'].' AS email 
    821846FROM '.USERS_TABLE.' AS u 
    822 WHERE u.'.$conf['user_fields']['id'].' >= 3 
    823847;'; 
    824848 
     
    828852  { 
    829853        $user = $row; 
    830     $user['groups'] = array(); 
    831  
     854        $user['transformed'] = LCAS_change_case($user['username'], $rule);  
    832855    array_push($users, $user); 
    833856        } 
    834857 
    835         /* add group lists */ 
    836   $user_ids = array(); 
    837   foreach ($users as $i => $user) 
    838   { 
    839         $user_ids[$i] = $user['id']; 
    840         } 
    841  
    842         return $users; 
     858        return LCAS_GetDuplicates($users); 
    843859} 
    844860