source: sandbox/2.2.0.2/contactcenter/inc/hook_config_validate.inc.php @ 4500

Revision 4500, 2.0 KB checked in by airton, 13 years ago (diff)

Ticket #1926 - Permitir configurar mais atributos cadastrados de um contato para exibição

  • Property svn:eol-style set to native
  • Property svn:executable set to *
Line 
1<?php
2  /***************************************************************************\
3  * eGroupWare - Contacts Center                                              *
4  * http://www.egroupware.org                                                 *
5  * Written by:                                                               *
6  *  - Raphael Derosso Pereira <raphaelpereira@users.sourceforge.net>         *
7  *  sponsored by Thyamad - http://www.thyamad.com
8  * ------------------------------------------------------------------------- *
9  *  This program is free software; you can redistribute it and/or modify it  *
10  *  under the terms of the GNU General Public License as published by the    *
11  *  Free Software Foundation; either version 2 of the License, or (at your   *
12  *  option) any later version.                                               *
13  \***************************************************************************/
14
15        /*
16          Set a global flag to indicate this file was found by admin/config.php.
17          config.php will unset it after parsing the form values.
18        */
19        $GLOBALS['phpgw_info']['server']['found_validation_hook'] = True;
20
21        /* Check all settings to validate input.  Name must be 'final_validation' */
22        function final_validation($value='')
23        {
24                $error = false;
25               
26                if($value['cc_global_source0'] == 'ldap')
27                {
28                        if (!$value['cc_ldap_host0'])
29                        {
30                                $error[] = '<br>LDAP host must be set!';
31                        }
32                       
33                        if(!$value['cc_ldap_context0'])
34                        {
35                                $error[] = '<br>There must be a Context';
36                        }
37                       
38                        if(!$value['cc_ldap_browse_dn0'])
39                        {
40                                $error[] = '<br>The Browse Account must be set';
41                        }       
42                }
43               
44                if ($error)
45                {
46                        $GLOBALS['config_error'] = implode("\n", $error);
47                }
48        }
49
50       
51        /*
52         * @function cc_allow_details
53         * @abstract Recebe o valor do checkbox e forï¿œa a saï¿œda para TRUE ou FALSE
54         * @author Prognus software livre - http://www.prognus.com.br | prognus@prognus.com.br
55         * @param $value
56         */
57        function cc_allow_details(&$value) {
58                if ($value == 'details') {
59                        $value = "true";
60                } else {
61                        $value = "false";
62                }
63        }
64?>
Note: See TracBrowser for help on using the repository browser.