* @package Turba */ class Turba_Test extends Horde_Test { /** * The module list * * @var array */ protected $_moduleList = array(); /** * PHP settings list. * * @var array */ protected $_settingsList = array(); /** * PEAR modules list. * * @var array */ protected $_pearList = array(); /** * Inter-Horde application dependencies. * * @var array */ protected $_appList = array(); /** */ public function __construct() { parent::__construct(); $this->_fileList += array( 'config/attributes.php' => null, 'config/backends.php' => null, 'config/mime_drivers.php' => null, 'config/prefs.php' => null ); } /** * Any application specific tests that need to be done. * * @return string HTML output. */ public function appTests() { $ret = '
unable to bind as ' . htmlspecialchars($params['user']) . ' to LDAP server
'; ldap_close($ldap); $ldap = ''; } elseif (empty($params['user']) && !ldap_bind($ldap)) { $ret .= "unable to bind anonymously to LDAP server
\n"; ldap_close($ldap); $ldap = ''; } if ($ldap) { $result = ldap_search($ldap, $params['basedn'], $params['filter']); if ($result) { $ret .= 'search returned ' . ldap_count_entries($ldap, $result) . " entries
\n"; $info = ldap_get_entries($ldap, $result); for ($i = 0; $i < $info['count']; ++$i) { $ret .= 'dn is: ' . $info[$i]['dn'] . '
' .
'first cn entry is: ' . $info[$i]['cn'][0] . '
' .
'first mail entry is: ' . $info[$i]['mail'][0] . '
(only first 10 entries displayed)
'; break; } } } else { $ret .= 'unable to search LDAP server
'; } } } else { $ret .= 'unable to connect to LDAP server
'; } return $ret; } }