/** * tests the specified connection * @param string $configID * @return int */ protected function testConfig($configID) { $lw = new \OCA\User_LDAP\LDAP(); $connection = new Connection($lw, $configID); //ensure validation is run before we attempt the bind $connection->getConfiguration(); if (!$connection->setConfiguration(array('ldap_configuration_active' => 1))) { return 1; } if ($connection->bind()) { return 0; } return 2; }