Exemple #1
0
 function handler_admin_annuaire($page)
 {
     global $globals;
     $this->load('mail.inc.php');
     $page->changeTpl('xnetgrp/annuaire-admin.tpl');
     $user = S::user();
     $mmlist = new MMList($user, $globals->asso('mail_domain'));
     $lists = $mmlist->get_lists();
     if (!$lists) {
         $lists = array();
     }
     $listes = array_map(create_function('$arr', 'return $arr["list"];'), $lists);
     $subscribers = array();
     foreach ($listes as $list) {
         list(, $members) = $mmlist->get_members($list);
         $mails = array_map(create_function('$arr', 'return $arr[1];'), $members);
         $subscribers = array_unique(array_merge($subscribers, $mails));
     }
     $not_in_group_x = array();
     $not_in_group_ext = array();
     foreach ($subscribers as $mail) {
         $uf = new UserFilter(new PFC_And(new UFC_Group($globals->asso('id')), new UFC_Email($mail)));
         if ($uf->getTotalCount() == 0) {
             if (User::isForeignEmailAddress($mail)) {
                 $not_in_group_ext[] = $mail;
             } else {
                 $not_in_group_x[] = $mail;
             }
         }
     }
     $page->assign('not_in_group_ext', $not_in_group_ext);
     $page->assign('not_in_group_x', $not_in_group_x);
     $page->assign('lists', $lists);
 }