commit | author | age
|
f11541
|
1 |
<?php |
T |
2 |
|
|
3 |
/* |
|
4 |
+-----------------------------------------------------------------------+ |
|
5 |
| program/steps/addressbook/mailto.inc | |
|
6 |
| | |
|
7 |
| This file is part of the RoundCube Webmail client | |
|
8 |
| Copyright (C) 2007, RoundCube Dev. - Switzerland | |
|
9 |
| Licensed under the GNU GPL | |
|
10 |
| | |
|
11 |
| PURPOSE: | |
|
12 |
| Compose a recipient list with all selected contacts | |
|
13 |
| | |
|
14 |
+-----------------------------------------------------------------------+ |
|
15 |
| Author: Thomas Bruederli <roundcube@gmail.com> | |
|
16 |
+-----------------------------------------------------------------------+ |
|
17 |
|
|
18 |
$Id: copy.inc 471 2007-02-09 21:25:50Z thomasb $ |
|
19 |
|
|
20 |
*/ |
|
21 |
|
|
22 |
$cid = get_input_value('_cid', RCUBE_INPUT_GET); |
|
23 |
$recipients = null; |
|
24 |
$mailto = array(); |
|
25 |
|
|
26 |
if ($cid && preg_match('/^[a-z0-9\-_=]+(,[a-z0-9\-_=]+)*$/i', $cid) && $CONTACTS->ready) |
|
27 |
{ |
fc7374
|
28 |
$CONTACTS->set_page(1); |
T |
29 |
$CONTACTS->set_pagesize(100); |
f11541
|
30 |
$recipients = $CONTACTS->search($CONTACTS->primary_key, $cid); |
T |
31 |
|
|
32 |
while (is_object($recipients) && ($rec = $recipients->iterate())) |
|
33 |
$mailto[] = format_email_recipient($rec['email'], $rec['name']); |
|
34 |
} |
|
35 |
|
|
36 |
if (!empty($mailto)) |
|
37 |
{ |
|
38 |
$mailto_str = join(', ', $mailto); |
|
39 |
$mailto_id = substr(md5($mailto_str), 0, 16); |
fde466
|
40 |
$_SESSION['mailto'][$mailto_id] = urlencode($mailto_str); |
T |
41 |
$OUTPUT->redirect(array('task' => 'mail', '_action' => 'compose', '_mailto' => $mailto_id)); |
f11541
|
42 |
} |
T |
43 |
else |
|
44 |
$OUTPUT->show_message('nocontactsfound', 'warning'); |
|
45 |
|
|
46 |
|
|
47 |
// send response |
|
48 |
$OUTPUT->send(); |
|
49 |
|
|
50 |
?> |