by Iñaki Arenaza.
You can edit ldapname.php and remove some lines and modify a couple of others. But if you do this, make really sure you use a valid plugin name for your LDAP clone (the lines we are going to remove specifically check for this). Otherwise, it may have an erratic behaviour (i.e., some things working while other not).
So look for these lines in ldapname.php and comment/delete them:
try {
require(dirname(__FILE__).'/config.php');
} catch (dml_connection_exception $e) {
// Just continue, we don't need the database for this to work.
echo "Continuing, even if database is not available\n";
}
try {
$ldapname = validate_param($_SERVER['argv'][1], PARAM_PLUGIN);
} catch (invalid_parameter_exception $e) {
usage();
exit;
}
Then change these lines:
$ldapnew = $CFG->dirroot.'/auth/'.$ldapname;
$patchfileorig = $CFG->dirroot.'/ldapname.diff';
to these:
$ldapname = $_SERVER['argv'][1];
$ldapnew = './auth/'.$ldapname;
$patchfileorig = './ldapname.diff';
Then make absolutely sure you put both ldapname.php and ldapname.diff in the root directory of your moodle site.
That should do the trick.
Saludos. Iñaki.