Exemple #1
0
function mailman_sites()
{
    $users = new usersMenus();
    if (is_object($GLOBALS["CLASS_USER"])) {
        $user = $GLOBALS["CLASS_USER"];
    } else {
        $user = new user($_SESSION["uid"]);
    }
    $mailman = new mailman_control($user->ou);
    $sock = new sockets();
    $ApacheGroupWarePort = $sock->GET_INFO("ApacheGroupWarePort");
    if (!$users->MAILMAN_INSTALLED) {
        return null;
    }
    if ($sock->GET_INFO('MailManEnabled') != 1) {
        return null;
    }
    $array = $mailman->GetLists_array();
    if (!is_array($array)) {
        return null;
    }
    $text = "<table>";
    while (list($liste, $www) = each($array)) {
        $text = $text . "\n\t\t\t<tr>\n\t\t\t\t<td width=1%><img src='img/3.gif'></td>\n\t\t\t\t<td><span  OnClick=\"javascript:s_PopUp('http://{$www}:{$ApacheGroupWarePort}/',1024,800);\" style='color:black;text-decoration:underline'>{$liste} ({$www})</span></td>\n\t\t\t</tr>";
    }
    $html = iconTable("", "{your_distributions_lists}", "{$text}</table>");
    $tpl = new templates();
    return $tpl->_ENGINE_parse_body($html);
}
function del_list()
{
    if ($_SESSION["uid"] == -100) {
        if (isset($_GET["ou"])) {
            $ou = base64_decode($_GET["ou"]);
        }
    } else {
        $ct = new user($_SESSION["uid"]);
        $ou = $ct->ou;
    }
    if (!preg_match("#(.+?)@(.+)#", $_GET["list-delete"], $re)) {
        echo "unable to preg_match {$_GET["list-delete"]}\n";
        return;
    }
    $mailman = new mailman_control($ou, $_GET["list-delete"]);
    $mailman->delete();
}