source: subversion/branches/devel-addressbook/program/steps/addressbook/search.inc @ 499

Last change on this file since 499 was 499, checked in by thomasb, 6 years ago

devel-addressbook: interface to public ldap directories with drag & drop copying

File size: 1.8 KB
Line 
1<?php
2
3/*
4 +-----------------------------------------------------------------------+
5 | program/steps/addressbook/search.inc                                  |
6 |                                                                       |
7 | This file is part of the RoundCube Webmail client                     |
8 | Copyright (C) 2005-2007, RoundCube Dev. - Switzerland                 |
9 | Licensed under the GNU GPL                                            |
10 |                                                                       |
11 | PURPOSE:                                                              |
12 |   Search step for address book contacts                               |
13 |                                                                       |
14 +-----------------------------------------------------------------------+
15 | Author: Thomas Bruederli <roundcube@gmail.com>                        |
16 +-----------------------------------------------------------------------+
17
18 $Id: search.inc 456 2007-01-10 12:34:33Z thomasb $
19
20*/
21
22$search = trim(get_input_value('_search', RCUBE_INPUT_GET));
23$search_request = md5('addr'.$search);
24
25// get contacts for this user
26$result = $CONTACTS->search(array('name','email'), $search);
27
28if ($result->count > 0)
29{
30  // save search settings in session
31  $_SESSION['search'][$search_request] = $CONTACTS->get_search_set();
32 
33  // create javascript list
34  rcmail_js_contacts_list($result);
35}
36else
37{
38  $OUTPUT->show_message('nocontactsfound', 'warning');
39  $search_request = -1;
40}
41
42// update message count display
43$OUTPUT->set_env('search_request', $search_request);
44$OUTPUT->set_env('pagecount', ceil($result['count'] / $CONTACTS->page_size));
45$OUTPUT->command('set_rowcount', rcmail_get_rowcount_text());
46 
47// send response
48$OUTPUT->send();
49
50?>
Note: See TracBrowser for help on using the repository browser.