27 if (!defined(
'NOSESSION')) {
28 define(
'NOSESSION',
'1');
31 $sapi_type = php_sapi_name();
32 $script_file = basename(__FILE__);
36 if (substr($sapi_type, 0, 3) ==
'cgi') {
37 echo
"Error: You are using PHP for CGI. To execute ".$script_file.
" from command line, you must use PHP for CLI mode.\n";
41 if (!isset($argv[1]) || !$argv[1]) {
42 print
"Usage: $script_file now\n";
47 require_once $path.
"../../htdocs/master.inc.php";
48 require_once DOL_DOCUMENT_ROOT.
"/core/class/ldap.class.php";
49 require_once DOL_DOCUMENT_ROOT.
"/user/class/user.class.php";
52 $version = DOL_VERSION;
60 print
"***** ".$script_file.
" (".$version.
") pid=".
dol_getmypid().
" *****\n";
61 dol_syslog($script_file.
" launched with arg ".join(
',', $argv));
71 $sql =
"SELECT rowid";
72 $sql .=
" FROM ".MAIN_DB_PREFIX.
"user";
76 $num = $db->num_rows(
$resql);
80 $ldap->connect_bind();
85 $obj = $db->fetch_object(
$resql);
87 $fuser =
new User($db);
88 $fuser->fetch($obj->rowid);
90 print $langs->trans(
"UpdateUser").
" rowid=".$fuser->id.
" ".$fuser->getFullName($langs);
94 $oldinfo = $oldobject->_load_ldap_info();
95 $olddn = $oldobject->_load_ldap_dn($oldinfo);
97 $info = $fuser->_load_ldap_info();
98 $dn = $fuser->_load_ldap_dn($info);
100 $result = $ldap->add($dn, $info, $user);
101 $result = $ldap->update($dn, $info, $user, $olddn);
103 print
" - ".$langs->trans(
"OK");
106 print
" - ".$langs->trans(
"KO").
' - '.$ldap->error;
Class to manage LDAP features.
Class to manage Dolibarr users.
if(isModEnabled('facture') &&!empty($user->rights->facture->lire)) if((isModEnabled('fournisseur') &&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && $user->hasRight("fournisseur", "facture", "lire"))||(isModEnabled('supplier_invoice') && $user->hasRight("supplier_invoice", "lire"))) if(isModEnabled('don') &&!empty($user->rights->don->lire)) if(isModEnabled('tax') &&!empty($user->rights->tax->charges->lire)) if(isModEnabled('facture') &&isModEnabled('commande') && $user->hasRight("commande", "lire") &&empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER)) $resql
Social contributions to pay.
dol_getmypid()
Return getmypid() or random PID when function is disabled Some web hosts disable this php function fo...
dol_print_error($db='', $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename='', $restricttologhandler='', $logcontext=null)
Write log message into outputs.