source: branches/1.2/contactcenter/inc/class.ldap_assync.inc.php @ 284

Revision 284, 2.0 KB checked in by rafaelraymundo, 16 years ago (diff)

Vide Trac - #197, #166, #198, #199

  1. Correção de problema na leitura do arquivo configuração.
  2. Permissão do click2dial também no contactcenter.
  3. Visualização de matricula, e nro celular no resultado da pesquisa(se estiverem populados)
  4. Adicionada a leitura a Catálogos Externos
Line 
1<?php
2        /***********************************************************************************\
3        * eGroupWare - Contacts Center                                                          *
4        * http://www.egroupware.org                                                             *
5        * Written by:                                                                           *
6        *  - Mário César Kolling <mario.kolling@serpro.gov.br>                                                          *
7        * Based on:                                                                                                                                                     *
8        * - Multi-threading strategies in PHP from                                                                                      *
9        * http://www.alternateinterior.com/2007/05/multi-threading-strategies-in-php.html       *
10        * ----------------------------------------------------------------------------------*
11        *  This program is free software; you can redistribute it and/or modify it              *
12        *  under the terms of the GNU General Public License as published by the                *
13        *  Free Software Foundation; either version 2 of the License, or (at your               *
14        *  option) any later version.                                                           *
15        \***********************************************************************************/
16
17        require_once('class.ThreadInstance.inc.php');
18
19        /*
20         * This is the Main Class that will be called in a new php process to test a bind in an ldap source
21         */
22
23        class ldap_assync extends ThreadInstance
24        {
25
26                var $ldap;
27                var $account;
28                var $password;
29                var $host;
30
31                function ldap_assync($host, $account = false, $password = false)
32                {
33                        $this->host = $host;
34                        $this->account = $account;
35                        $this->password = $password;
36                        $this->ldap = ldap_connect($this->host);
37
38                        $this->setup();
39                        $this->go();
40                }
41
42                function go ()
43                {
44                        if (ldap_bind($this->ldap, $this->account, $this->password))
45                        {
46                                $this->response("ok", ldap_error($this->ldap));
47                        }
48                        else
49                        {
50                                $this->response("no", ldap_error($this->ldap));
51                        }
52
53                }
54
55        }
56
57        /*
58         * Here is where we instantiate the new class. All the parameters are passed to the php process
59         * as environment variables
60         */
61        $search_ldap = new ldap_assync($_ENV['host'], $_ENV['account'], $_ENV['password']);
62
63?>
Note: See TracBrowser for help on using the repository browser.