27 if (!defined(
'NOSESSION')) define(
'NOSESSION',
'1');
29 $sapi_type = php_sapi_name();
30 $script_file = basename(__FILE__);
34 if (substr($sapi_type, 0, 3) ==
'cgi') {
35 echo
"Error: You are using PHP for CGI. To execute ".$script_file.
" from command line, you must use PHP for CLI mode.\n";
39 if (!isset($argv[1]) || !$argv[1]) {
40 print "Usage: $script_file now\n";
45 require_once $path.
"../../htdocs/master.inc.php";
46 require_once DOL_DOCUMENT_ROOT.
"/core/class/ldap.class.php";
47 require_once DOL_DOCUMENT_ROOT.
"/user/class/user.class.php";
50 $version = DOL_VERSION;
59 dol_syslog($script_file.
" launched with arg ".join(
',', $argv));
69 $sql =
"SELECT rowid";
70 $sql .=
" FROM ".MAIN_DB_PREFIX.
"user";
74 $num = $db->num_rows(
$resql);
78 $ldap->connect_bind();
83 $obj = $db->fetch_object(
$resql);
85 $fuser =
new User($db);
86 $fuser->fetch($obj->rowid);
88 print $langs->trans(
"UpdateUser").
" rowid=".$fuser->id.
" ".$fuser->getFullName($langs);
92 $oldinfo = $oldobject->_load_ldap_info();
93 $olddn = $oldobject->_load_ldap_dn($oldinfo);
95 $info = $fuser->_load_ldap_info();
96 $dn = $fuser->_load_ldap_dn($info);
98 $result = $ldap->add($dn, $info, $user);
99 $result = $ldap->update($dn, $info, $user, $olddn);
101 print " - ".$langs->trans(
"OK");
104 print " - ".$langs->trans(
"KO").
' - '.$ldap->error;
Class to manage Dolibarr users.
dol_getmypid()
Return getmypid() or random PID when function is disabled Some web hosts disable this php function fo...
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename= '', $restricttologhandler= '', $logcontext=null)
Write log message into outputs.
Class to manage LDAP features.
print
Draft customers invoices.
if(!empty($conf->facture->enabled)&&$user->rights->facture->lire) if((!empty($conf->fournisseur->enabled)&&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)||!empty($conf->supplier_invoice->enabled))&&$user->rights->fournisseur->facture->lire) if(!empty($conf->don->enabled)&&$user->rights->don->lire) if(!empty($conf->tax->enabled)&&$user->rights->tax->charges->lire) if(!empty($conf->facture->enabled)&&!empty($conf->commande->enabled)&&$user->rights->commande->lire &&empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER)) if(!empty($conf->facture->enabled)&&$user->rights->facture->lire) if((!empty($conf->fournisseur->enabled)&&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)||!empty($conf->supplier_invoice->enabled))&&$user->rights->fournisseur->facture->lire) $resql
Social contributions to pay.
dol_print_error($db= '', $error= '', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...