/** * Get all the authentication methods parameters for a specific authtype * and auths_id and return it as an array * * @param $authtype Authentication method * @param $auths_id Authentication method ID **/ static function getMethodsByID($authtype, $auths_id) { global $CFG_GLPI; switch ($authtype) { case self::X509: case self::EXTERNAL: case self::CAS: case self::LDAP: $auth = new AuthLdap(); if ($auths_id > 0 && $auth->getFromDB($auths_id)) { return $auth->fields; } break; case self::MAIL: $auth = new AuthMail(); if ($auths_id > 0 && $auth->getFromDB($auths_id)) { return $auth->fields; } break; } return array(); }
<?php include '../../../inc/includes.php'; Session::checkRight("config", "w"); $authldap = new AuthLdap(); $authldap->getFromDB($_POST['value']); $filter = "(" . $authldap->getField("login_field") . "=*)"; $ldap_condition = $authldap->getField('condition'); echo "(& {$filter} {$ldap_condition})";