[2] | 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 | ?> |
---|