Changeset 2564


Ignore:
Timestamp:
10/01/09 19:06:42 (4 years ago)
Author:
mlutfy
Message:

members: support multi-domain mailman patch, otherwise member list is always empty

File:
1 edited

Legend:

Unmodified
Added
Removed
  • alternc-mailman/trunk/bureau/class/m_mailman.php

    r2561 r2564  
    265265 
    266266  /* ----------------------------------------------------------------- */ 
    267   /** Echoes the list's members as a text file, one subscriber per 
    268    *  line. 
     267  /** Echoes the list's members as a text file, one subscriber per line. 
     268   *  
     269   *  Assumes that you are using the Mailman multi-domain patch, 
     270   *  but will fallback to check only the list name (without domain) 
     271   *  to support also installations without the patch. 
     272   * 
    269273   * @param $id integer The list whose members we want to dump 
    270274   * @return void : this function ECHOES the result ! 
    271275   */ 
    272  function members($id) { 
     276  function members($id) { 
    273277    global $err,$db,$cuid; 
    274278    $err->log("mailman","members"); 
    275     $db->query("SELECT * FROM mailman WHERE uid='$cuid' AND id='$id';"); 
     279    $db->query("SELECT CONCAT(list, '-', domain) as list FROM mailman WHERE 
     280uid='$cuid' AND id='$id';"); 
     281                           
    276282    if (!$db->num_rows()) { 
    277       $err->raise("mailman",1); 
    278       return false; 
    279     } 
     283      // fallback 
     284      $db->query("SELECT list FROM mailman WHERE uid='$cuid' AND id='$id';"); 
     285 
     286      if (!$db->num_rows()) { 
     287        $err->raise("mailman",1); 
     288        return false; 
     289      } 
     290    } 
     291 
    280292    $db->next_record(); 
    281293    passthru("/usr/lib/alternc/mailman.list ".$db->Record["list"]); 
Note: See TracChangeset for help on using the changeset viewer.