23require_once DOL_DOCUMENT_ROOT.
'/core/class/html.form.class.php';
43 public $errors = array();
55 if (!is_object($form)) {
56 $form =
new Form($this->db);
59 $langs->loadLangs(array(
"admin",
"ldap"));
76 if (empty($selected)) {
79 if (empty($htmlname)) {
80 $htmlname =
'ldaphashtype';
85 "ssha512" =>
"SSHA-512",
86 "ssha384" =>
"SSHA-384",
87 "ssha256" =>
"SSHA-256",
89 "sha512" =>
"SHA-512",
90 "sha384" =>
"SHA-384",
91 "sha256" =>
"SHA-256",
103 return $form->selectarray($htmlname, $arraylist, $selected, $showempty);
116 public function selectLdapDnSynchroActive($selected = 0, $htmlname =
'activesynchro', $exclude = array(), $scriptonly = 0, $showempty = 0)
118 global $langs, $form;
120 if (empty($selected)) {
123 if (empty($htmlname)) {
124 $htmlname =
'activesynchro';
127 $dolibarr2ldaplabel = $langs->trans(
"DolibarrToLDAP") . (($scriptonly == 1 || $scriptonly == 3) ?
" (".$langs->trans(
"SupportedForLDAPExportScriptOnly").
")" :
"");
128 $ldap2dolibarrlabel = $langs->trans(
"LDAPToDolibarr") . (($scriptonly == 2 || $scriptonly == 3) ?
" (".$langs->trans(
"SupportedForLDAPImportScriptOnly").
")" :
"");
136 if (is_array($exclude) && !empty($exclude)) {
137 foreach ($exclude as $value) {
138 if (array_key_exists($value, $arraylist)) {
139 unset($arraylist[$value]);
144 return $form->selectarray($htmlname, $arraylist, $selected, $showempty);
159 if (empty($selected)) {
160 $selected =
'openldap';
162 if (empty($htmlname)) {
167 'activedirectory' =>
'Active Directory',
168 'openldap' =>
'OpenLdap',
169 'egroupware' =>
'Egroupware'
172 return $form->selectarray($htmlname, $arraylist, $selected, $showempty);
187 if (empty($selected)) {
190 if (empty($htmlname)) {
191 $htmlname =
'ldapprotocolversion';
199 return $form->selectarray($htmlname, $arraylist, $selected, $showempty);
const SYNCHRO_NONE
No Ldap synchronization.
const SYNCHRO_LDAP_TO_DOLIBARR
Ldap to Dolibarr synchronization.
const SYNCHRO_DOLIBARR_TO_LDAP
Dolibarr to Ldap synchronization.