forked from Wavyzz/dolibarr
Change the way parameters are provides to scripts
sync_xxx_ldap2dolibarr.php
This commit is contained in:
@@ -70,16 +70,19 @@ $required_fields = array(
|
||||
// Remove from required_fields all entries not configured in LDAP (empty) and duplicated
|
||||
$required_fields=array_unique(array_values(array_filter($required_fields, "dolValidElement")));
|
||||
|
||||
if ($argv[2]) $conf->global->LDAP_SERVER_HOST=$argv[2];
|
||||
|
||||
if (! isset($argv[1])) {
|
||||
//print "Usage: $script_file (nocommitiferror|commitiferror) [id_group]\n";
|
||||
print "Usage: $script_file (nocommitiferror|commitiferror) [ldapserverhost]\n";
|
||||
print "Usage: $script_file (nocommitiferror|commitiferror) [--server=ldapserverhost] [--excludeuser=user1,user2...]\n";
|
||||
exit(-1);
|
||||
}
|
||||
$groupid=$argv[3];
|
||||
if ($argv[1] == 'commitiferror') $forcecommit=1;
|
||||
|
||||
foreach($argv as $key => $val)
|
||||
{
|
||||
if ($val == 'commitiferror') $forcecommit=1;
|
||||
if (preg_match('/--server=([^\s]+)$/',$val,$reg)) $conf->global->LDAP_SERVER_HOST=$reg[1];
|
||||
if (preg_match('/--excludeuser=([^\s]+)$/',$val,$reg)) $excludeuser=explode(',',$reg[1]);
|
||||
}
|
||||
|
||||
print "Mails sending disabled (useless in batch mode)\n";
|
||||
$conf->global->MAIN_DISABLE_ALL_MAILS=1; // On bloque les mails
|
||||
|
||||
Reference in New Issue
Block a user