forked from Wavyzz/dolibarr
Change the way parameters are provides to scripts
sync_xxx_ldap2dolibarr.php
This commit is contained in:
@@ -93,14 +93,17 @@ $required_fields = array(
|
||||
$required_fields=array_unique(array_values(array_filter($required_fields, "dolValidElement")));
|
||||
|
||||
|
||||
if ($argv[3]) $conf->global->LDAP_SERVER_HOST=$argv[2];
|
||||
|
||||
if (! isset($argv[2]) || ! is_numeric($argv[2])) {
|
||||
print "Usage: $script_file (nocommitiferror|commitiferror) id_member_type [ldapserverhost]\n";
|
||||
print "Usage: $script_file (nocommitiferror|commitiferror) id_member_type [--server=ldapserverhost]\n";
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
$typeid=$argv[2];
|
||||
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];
|
||||
}
|
||||
|
||||
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