File: expand.php

package info (click to toggle)
imp4 4.1.3-4
  • links: PTS
  • area: main
  • in suites: etch-m68k
  • size: 14,988 kB
  • ctags: 3,720
  • sloc: xml: 17,038; php: 16,350; makefile: 64
file content (33 lines) | stat: -rw-r--r-- 1,088 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<?php
/**
 * $Horde: imp/expand.php,v 1.16.10.4 2006/01/01 21:28:50 jan Exp $
 *
 * Copyright 2002-2006 Jan Schneider <jan@horde.org>
 *
 * See the enclosed file COPYING for license information (GPL).  If you
 * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
 */

$no_compress = true;
$authentication = 'horde';

@define('IMP_BASE', dirname(__FILE__));
require_once IMP_BASE . '/lib/base.php';

$actionID = Util::getFormData('actionID');

if ($actionID == 'expand_addresses') {
    $form_name = Util::getFormData('form_name');
    $field_name = Util::getFormData('field_name');
    $field_value = Util::getFormData('field_value');

    $address = IMP::expandAddresses($field_value, true);
    if (is_a($address, 'PEAR_Error') &&
        $conf['compose']['add_maildomain_to_unexpandable']) {
        $addrString = preg_replace('/,\s+/', ',', $field_value);
        $addrString = preg_replace('/\s+/', '.', $addrString);
        $address = MIME::encodeAddress($addrString, null, $_SESSION['imp']['maildomain']);
    }
}

require IMP_TEMPLATES . '/compose/expand.inc';