Fix: UTF8 support for LDAP module
This commit is contained in:
parent
ddd8102a47
commit
6abe23f15c
@ -346,7 +346,7 @@ class Adherent extends CommonObject
|
|||||||
$nbrowsaffected=0;
|
$nbrowsaffected=0;
|
||||||
$error=0;
|
$error=0;
|
||||||
|
|
||||||
dolibarr_syslog("Adherent::update notrigger=".$notrigger.", nosyncuser=".$nosyncuser);
|
dolibarr_syslog("Adherent::update notrigger=".$notrigger.", nosyncuser=".$nosyncuser.", email=".$this->email);
|
||||||
|
|
||||||
// Verification parametres
|
// Verification parametres
|
||||||
if ($conf->global->ADHERENT_MAIL_REQUIRED && ! ValidEMail($this->email))
|
if ($conf->global->ADHERENT_MAIL_REQUIRED && ! ValidEMail($this->email))
|
||||||
|
|||||||
@ -125,26 +125,26 @@ if ($_REQUEST["action"] == 'update' && ! $_POST["cancel"])
|
|||||||
if ($result > 0)
|
if ($result > 0)
|
||||||
{
|
{
|
||||||
// Modifie valeures
|
// Modifie valeures
|
||||||
$adh->prenom = $_POST["prenom"];
|
$adh->prenom = trim($_POST["prenom"]);
|
||||||
$adh->nom = $_POST["nom"];
|
$adh->nom = trim($_POST["nom"]);
|
||||||
$adh->fullname = trim($adh->prenom.' '.$adh->nom);
|
$adh->fullname = trim($adh->prenom.' '.$adh->nom);
|
||||||
$adh->login = $_POST["login"];
|
$adh->login = trim($_POST["login"]);
|
||||||
$adh->pass = $_POST["pass"];
|
$adh->pass = trim($_POST["pass"]);
|
||||||
|
|
||||||
$adh->societe = $_POST["societe"];
|
$adh->societe = trim($_POST["societe"]);
|
||||||
$adh->adresse = $_POST["adresse"];
|
$adh->adresse = trim($_POST["adresse"]);
|
||||||
$adh->cp = $_POST["cp"];
|
$adh->cp = trim($_POST["cp"]);
|
||||||
$adh->ville = $_POST["ville"];
|
$adh->ville = trim($_POST["ville"]);
|
||||||
$adh->pays_id = $_POST["pays"];
|
$adh->pays_id = $_POST["pays"];
|
||||||
|
|
||||||
$adh->phone = $_POST["phone"];
|
$adh->phone = trim($_POST["phone"]);
|
||||||
$adh->phone_perso = $_POST["phone_perso"];
|
$adh->phone_perso = trim($_POST["phone_perso"]);
|
||||||
$adh->phone_mobile= $_POST["phone_mobile"];
|
$adh->phone_mobile= trim($_POST["phone_mobile"]);
|
||||||
$adh->email = $_POST["email"];
|
$adh->email = trim($_POST["email"]);
|
||||||
$adh->naiss = $datenaiss;
|
$adh->naiss = $datenaiss;
|
||||||
|
|
||||||
$adh->typeid = $_POST["type"];
|
$adh->typeid = $_POST["type"];
|
||||||
$adh->note = $_POST["comment"];
|
$adh->note = trim($_POST["comment"]);
|
||||||
$adh->morphy = $_POST["morphy"];
|
$adh->morphy = $_POST["morphy"];
|
||||||
|
|
||||||
$adh->amount = $_POST["amount"];
|
$adh->amount = $_POST["amount"];
|
||||||
|
|||||||
@ -50,6 +50,7 @@ if ($_GET["action"] == 'setvalue' && $user->admin)
|
|||||||
|
|
||||||
if (! dolibarr_set_const($db, 'LDAP_CONTACT_DN',$_POST["contactdn"])) $error++;
|
if (! dolibarr_set_const($db, 'LDAP_CONTACT_DN',$_POST["contactdn"])) $error++;
|
||||||
if (! dolibarr_set_const($db, 'LDAP_CONTACT_OBJECT_CLASS',$_POST["objectclass"])) $error++;
|
if (! dolibarr_set_const($db, 'LDAP_CONTACT_OBJECT_CLASS',$_POST["objectclass"])) $error++;
|
||||||
|
|
||||||
if (! dolibarr_set_const($db, 'LDAP_FIELD_FULLNAME',$_POST["fieldfullname"])) $error++;
|
if (! dolibarr_set_const($db, 'LDAP_FIELD_FULLNAME',$_POST["fieldfullname"])) $error++;
|
||||||
if (! dolibarr_set_const($db, 'LDAP_FIELD_NAME',$_POST["fieldname"])) $error++;
|
if (! dolibarr_set_const($db, 'LDAP_FIELD_NAME',$_POST["fieldname"])) $error++;
|
||||||
if (! dolibarr_set_const($db, 'LDAP_FIELD_FIRSTNAME',$_POST["fieldfirstname"])) $error++;
|
if (! dolibarr_set_const($db, 'LDAP_FIELD_FIRSTNAME',$_POST["fieldfirstname"])) $error++;
|
||||||
@ -252,17 +253,13 @@ print info_admin($langs->trans("LDAPDescValues"));
|
|||||||
/*
|
/*
|
||||||
* Test de la connexion
|
* Test de la connexion
|
||||||
*/
|
*/
|
||||||
print '<br>';
|
$butlabel=$langs->trans("LDAPTestSynchroContact");
|
||||||
if (! function_exists("ldap_connect"))
|
$testlabel='test';
|
||||||
{
|
$key=$conf->global->LDAP_KEY_CONTACTS;
|
||||||
print '<a class="butActionRefused" href="#" title="'.$langs->trans('LDAPFunctionsNotAvailableOnPHP').'">'.$langs->trans("LDAPTestSynchroContact").'</a>';
|
$dn=$conf->global->LDAP_CONTACT_DN;
|
||||||
}
|
$objectclass=$conf->global->LDAP_CONTACT_OBJECT_CLASS;
|
||||||
else if (empty($conf->global->LDAP_SERVER_HOST))
|
|
||||||
{
|
show_ldap_test_button($butlabel,$testlabel,$key,$dn,$objectclass);
|
||||||
print '<a class="butActionRefused" href="#" title="'.$langs->trans('SetupNotComplete').'">'.$langs->trans("LDAPTestSynchroContact").'</a>';
|
|
||||||
}
|
|
||||||
else print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=test">'.$langs->trans("LDAPTestSynchroContact").'</a>';
|
|
||||||
print '<br><br>';
|
|
||||||
|
|
||||||
|
|
||||||
if (function_exists("ldap_connect"))
|
if (function_exists("ldap_connect"))
|
||||||
@ -270,8 +267,8 @@ if (function_exists("ldap_connect"))
|
|||||||
if ($_GET["action"] == 'test')
|
if ($_GET["action"] == 'test')
|
||||||
{
|
{
|
||||||
// Creation objet
|
// Creation objet
|
||||||
$contact=new Contact($db);
|
$object=new Contact($db);
|
||||||
$contact->initAsSpecimen();
|
$object->initAsSpecimen();
|
||||||
|
|
||||||
// Test synchro
|
// Test synchro
|
||||||
$ldap=new Ldap();
|
$ldap=new Ldap();
|
||||||
@ -279,8 +276,8 @@ if (function_exists("ldap_connect"))
|
|||||||
|
|
||||||
if ($result > 0)
|
if ($result > 0)
|
||||||
{
|
{
|
||||||
$info=$contact->_load_ldap_info();
|
$info=$object->_load_ldap_info();
|
||||||
$dn=$contact->_load_ldap_dn($info);
|
$dn=$object->_load_ldap_dn($info);
|
||||||
|
|
||||||
$result2=$ldap->update($dn,$info,$user);
|
$result2=$ldap->update($dn,$info,$user);
|
||||||
$result3=$ldap->delete($dn);
|
$result3=$ldap->delete($dn);
|
||||||
@ -296,6 +293,7 @@ if (function_exists("ldap_connect"))
|
|||||||
print '<font class="error">'.$langs->trans("LDAPSynchroKOMayBePermissions");
|
print '<font class="error">'.$langs->trans("LDAPSynchroKOMayBePermissions");
|
||||||
print ': '.$ldap->error;
|
print ': '.$ldap->error;
|
||||||
print '</font><br>';
|
print '</font><br>';
|
||||||
|
print $langs->trans("ErrorLDAPMakeManualTest",$conf->ldap->dir_temp).'<br>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -304,8 +302,13 @@ if (function_exists("ldap_connect"))
|
|||||||
print '<font class="error">'.$langs->trans("LDAPSynchroKO");
|
print '<font class="error">'.$langs->trans("LDAPSynchroKO");
|
||||||
print ': '.$ldap->error;
|
print ': '.$ldap->error;
|
||||||
print '</font><br>';
|
print '</font><br>';
|
||||||
|
print $langs->trans("ErrorLDAPMakeManualTest",$conf->ldap->dir_temp).'<br>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
print "<br>\n";
|
||||||
|
print "LDAP input file used for test:<br><br>\n";
|
||||||
|
print nl2br($ldap->dump_content($dn,$info));
|
||||||
|
print "\n<br>";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -51,6 +51,7 @@ if ($_GET["action"] == 'setvalue' && $user->admin)
|
|||||||
|
|
||||||
if (! dolibarr_set_const($db, 'LDAP_GROUP_DN',$_POST["group"])) $error++;
|
if (! dolibarr_set_const($db, 'LDAP_GROUP_DN',$_POST["group"])) $error++;
|
||||||
if (! dolibarr_set_const($db, 'LDAP_GROUP_OBJECT_CLASS',$_POST["objectclass"])) $error++;
|
if (! dolibarr_set_const($db, 'LDAP_GROUP_OBJECT_CLASS',$_POST["objectclass"])) $error++;
|
||||||
|
|
||||||
if (! dolibarr_set_const($db, 'LDAP_FIELD_FULLNAME',$_POST["fieldfullname"])) $error++;
|
if (! dolibarr_set_const($db, 'LDAP_FIELD_FULLNAME',$_POST["fieldfullname"])) $error++;
|
||||||
if (! dolibarr_set_const($db, 'LDAP_FIELD_NAME',$_POST["fieldname"])) $error++;
|
if (! dolibarr_set_const($db, 'LDAP_FIELD_NAME',$_POST["fieldname"])) $error++;
|
||||||
if (! dolibarr_set_const($db, 'LDAP_FIELD_DESCRIPTION',$_POST["fielddescription"])) $error++;
|
if (! dolibarr_set_const($db, 'LDAP_FIELD_DESCRIPTION',$_POST["fielddescription"])) $error++;
|
||||||
@ -172,19 +173,15 @@ print info_admin($langs->trans("LDAPDescValues"));
|
|||||||
/*
|
/*
|
||||||
* Test de la connexion
|
* Test de la connexion
|
||||||
*/
|
*/
|
||||||
print '<br>';
|
|
||||||
if ($conf->global->LDAP_SYNCHRO_ACTIVE == 'dolibarr2ldap')
|
if ($conf->global->LDAP_SYNCHRO_ACTIVE == 'dolibarr2ldap')
|
||||||
{
|
{
|
||||||
if (! function_exists("ldap_connect"))
|
$butlabel=$langs->trans("LDAPTestSynchroGroup");
|
||||||
{
|
$testlabel='testgroup';
|
||||||
print '<a class="butActionRefused" href="#" title="'.$langs->trans('LDAPFunctionsNotAvailableOnPHP').'">'.$langs->trans("LDAPTestSynchroGroup").'</a>';
|
$key=$conf->global->LDAP_KEY_GROUPS;
|
||||||
}
|
$dn=$conf->global->LDAP_GROUP_DN;
|
||||||
else if (empty($conf->global->LDAP_SERVER_HOST))
|
$objectclass=$conf->global->LDAP_GROUP_OBJECT_CLASS;
|
||||||
{
|
|
||||||
print '<a class="butActionRefused" href="#" title="'.$langs->trans('SetupNotComplete').'">'.$langs->trans("LDAPTestSynchroGroup").'</a>';
|
show_ldap_test_button($butlabel,$testlabel,$key,$dn,$objectclass);
|
||||||
}
|
|
||||||
else print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=testgroup">'.$langs->trans("LDAPTestSynchroGroup").'</a>';
|
|
||||||
print '<br><br>';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (function_exists("ldap_connect"))
|
if (function_exists("ldap_connect"))
|
||||||
@ -192,8 +189,8 @@ if (function_exists("ldap_connect"))
|
|||||||
if ($_GET["action"] == 'testgroup')
|
if ($_GET["action"] == 'testgroup')
|
||||||
{
|
{
|
||||||
// Creation objet
|
// Creation objet
|
||||||
$fgroup=new UserGroup($db);
|
$object=new UserGroup($db);
|
||||||
$fgroup->initAsSpecimen();
|
$object->initAsSpecimen();
|
||||||
|
|
||||||
// Test synchro
|
// Test synchro
|
||||||
$ldap=new Ldap();
|
$ldap=new Ldap();
|
||||||
@ -201,8 +198,8 @@ if (function_exists("ldap_connect"))
|
|||||||
|
|
||||||
if ($result > 0)
|
if ($result > 0)
|
||||||
{
|
{
|
||||||
$info=$fgroup->_load_ldap_info();
|
$info=$object->_load_ldap_info();
|
||||||
$dn=$fgroup->_load_ldap_dn($info);
|
$dn=$object->_load_ldap_dn($info);
|
||||||
|
|
||||||
$result2=$ldap->update($dn,$info,$user);
|
$result2=$ldap->update($dn,$info,$user);
|
||||||
$result3=$ldap->delete($dn);
|
$result3=$ldap->delete($dn);
|
||||||
@ -218,6 +215,7 @@ if (function_exists("ldap_connect"))
|
|||||||
print '<font class="error">'.$langs->trans("LDAPSynchroKOMayBePermissions");
|
print '<font class="error">'.$langs->trans("LDAPSynchroKOMayBePermissions");
|
||||||
print ': '.$ldap->error;
|
print ': '.$ldap->error;
|
||||||
print '</font><br>';
|
print '</font><br>';
|
||||||
|
print $langs->trans("ErrorLDAPMakeManualTest",$conf->ldap->dir_temp).'<br>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -226,12 +224,17 @@ if (function_exists("ldap_connect"))
|
|||||||
print '<font class="error">'.$langs->trans("LDAPSynchroKO");
|
print '<font class="error">'.$langs->trans("LDAPSynchroKO");
|
||||||
print ': '.$ldap->error;
|
print ': '.$ldap->error;
|
||||||
print '</font><br>';
|
print '</font><br>';
|
||||||
|
print $langs->trans("ErrorLDAPMakeManualTest",$conf->ldap->dir_temp).'<br>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
print "<br>\n";
|
||||||
|
print "LDAP input file used for test:<br><br>\n";
|
||||||
|
print nl2br($ldap->dump_content($dn,$info));
|
||||||
|
print "\n<br>";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$db->close();
|
$db->close();
|
||||||
|
|
||||||
llxFooter('$Date$ - $Revision$');
|
llxFooter('$Date$ - $Revision$');
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|||||||
@ -48,6 +48,7 @@ if ($_GET["action"] == 'setvalue' && $user->admin)
|
|||||||
{
|
{
|
||||||
$error=0;
|
$error=0;
|
||||||
if (! dolibarr_set_const($db, 'LDAP_KEY_MEMBERS',$_POST["key"])) $error++;
|
if (! dolibarr_set_const($db, 'LDAP_KEY_MEMBERS',$_POST["key"])) $error++;
|
||||||
|
|
||||||
if (! dolibarr_set_const($db, 'LDAP_MEMBER_DN',$_POST["user"])) $error++;
|
if (! dolibarr_set_const($db, 'LDAP_MEMBER_DN',$_POST["user"])) $error++;
|
||||||
if (! dolibarr_set_const($db, 'LDAP_MEMBER_OBJECT_CLASS',$_POST["objectclass"])) $error++;
|
if (! dolibarr_set_const($db, 'LDAP_MEMBER_OBJECT_CLASS',$_POST["objectclass"])) $error++;
|
||||||
// Members
|
// Members
|
||||||
@ -366,17 +367,13 @@ print info_admin($langs->trans("LDAPDescValues"));
|
|||||||
*/
|
*/
|
||||||
if ($conf->global->LDAP_MEMBER_ACTIVE)
|
if ($conf->global->LDAP_MEMBER_ACTIVE)
|
||||||
{
|
{
|
||||||
print '<br>';
|
$butlabel=$langs->trans("LDAPTestSynchroMember");
|
||||||
if (! function_exists("ldap_connect"))
|
$testlabel='testmember';
|
||||||
{
|
$key=$conf->global->LDAP_KEY_MEMBERS;
|
||||||
print '<a class="butActionRefused" href="#" title="'.$langs->trans('LDAPFunctionsNotAvailableOnPHP').'">'.$langs->trans("LDAPTestSynchroMember").'</a>';
|
$dn=$conf->global->LDAP_MEMBER_DN;
|
||||||
}
|
$objectclass=$conf->global->LDAP_MEMBER_OBJECT_CLASS;
|
||||||
else if (empty($conf->global->LDAP_SERVER_HOST))
|
|
||||||
{
|
show_ldap_test_button($butlabel,$testlabel,$key,$dn,$objectclass);
|
||||||
print '<a class="butActionRefused" href="#" title="'.$langs->trans('SetupNotComplete').'">'.$langs->trans("LDAPTestSynchroMember").'</a>';
|
|
||||||
}
|
|
||||||
else print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=testmember">'.$langs->trans("LDAPTestSynchroMember").'</a>';
|
|
||||||
print '<br><br>';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (function_exists("ldap_connect"))
|
if (function_exists("ldap_connect"))
|
||||||
@ -384,8 +381,8 @@ if (function_exists("ldap_connect"))
|
|||||||
if ($_GET["action"] == 'testmember')
|
if ($_GET["action"] == 'testmember')
|
||||||
{
|
{
|
||||||
// Creation objet
|
// Creation objet
|
||||||
$adherent=new Adherent($db);
|
$object=new Adherent($db);
|
||||||
$adherent->initAsSpecimen();
|
$object->initAsSpecimen();
|
||||||
|
|
||||||
// Test synchro
|
// Test synchro
|
||||||
$ldap=new Ldap();
|
$ldap=new Ldap();
|
||||||
@ -393,8 +390,8 @@ if (function_exists("ldap_connect"))
|
|||||||
|
|
||||||
if ($result > 0)
|
if ($result > 0)
|
||||||
{
|
{
|
||||||
$info=$adherent->_load_ldap_info();
|
$info=$object->_load_ldap_info();
|
||||||
$dn=$adherent->_load_ldap_dn($info);
|
$dn=$object->_load_ldap_dn($info);
|
||||||
|
|
||||||
$result2=$ldap->update($dn,$info,$user);
|
$result2=$ldap->update($dn,$info,$user);
|
||||||
$result3=$ldap->delete($dn);
|
$result3=$ldap->delete($dn);
|
||||||
@ -410,6 +407,7 @@ if (function_exists("ldap_connect"))
|
|||||||
print '<font class="error">'.$langs->trans("LDAPSynchroKOMayBePermissions");
|
print '<font class="error">'.$langs->trans("LDAPSynchroKOMayBePermissions");
|
||||||
print ': '.$ldap->error;
|
print ': '.$ldap->error;
|
||||||
print '</font><br>';
|
print '</font><br>';
|
||||||
|
print $langs->trans("ErrorLDAPMakeManualTest",$conf->ldap->dir_temp).'<br>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -418,6 +416,7 @@ if (function_exists("ldap_connect"))
|
|||||||
print '<font class="error">'.$langs->trans("LDAPSynchroKO");
|
print '<font class="error">'.$langs->trans("LDAPSynchroKO");
|
||||||
print ': '.$ldap->error;
|
print ': '.$ldap->error;
|
||||||
print '</font><br>';
|
print '</font><br>';
|
||||||
|
print $langs->trans("ErrorLDAPMakeManualTest",$conf->ldap->dir_temp).'<br>';
|
||||||
}
|
}
|
||||||
|
|
||||||
print "<br>\n";
|
print "<br>\n";
|
||||||
|
|||||||
@ -51,6 +51,7 @@ if ($_GET["action"] == 'setvalue' && $user->admin)
|
|||||||
|
|
||||||
if (! dolibarr_set_const($db, 'LDAP_USER_DN',$_POST["user"])) $error++;
|
if (! dolibarr_set_const($db, 'LDAP_USER_DN',$_POST["user"])) $error++;
|
||||||
if (! dolibarr_set_const($db, 'LDAP_USER_OBJECT_CLASS',$_POST["objectclass"])) $error++;
|
if (! dolibarr_set_const($db, 'LDAP_USER_OBJECT_CLASS',$_POST["objectclass"])) $error++;
|
||||||
|
|
||||||
if (! dolibarr_set_const($db, 'LDAP_FILTER_CONNECTION',$_POST["filterconnection"])) $error++;
|
if (! dolibarr_set_const($db, 'LDAP_FILTER_CONNECTION',$_POST["filterconnection"])) $error++;
|
||||||
if (! dolibarr_set_const($db, 'LDAP_FIELD_FULLNAME',$_POST["fieldfullname"])) $error++;
|
if (! dolibarr_set_const($db, 'LDAP_FIELD_FULLNAME',$_POST["fieldfullname"])) $error++;
|
||||||
if (! dolibarr_set_const($db, 'LDAP_FIELD_LOGIN',$_POST["fieldlogin"])) $error++;
|
if (! dolibarr_set_const($db, 'LDAP_FIELD_LOGIN',$_POST["fieldlogin"])) $error++;
|
||||||
@ -266,17 +267,13 @@ print info_admin($langs->trans("LDAPDescValues"));
|
|||||||
*/
|
*/
|
||||||
if ($conf->global->LDAP_SYNCHRO_ACTIVE == 'dolibarr2ldap')
|
if ($conf->global->LDAP_SYNCHRO_ACTIVE == 'dolibarr2ldap')
|
||||||
{
|
{
|
||||||
print '<br>';
|
$butlabel=$langs->trans("LDAPTestSynchroUser");
|
||||||
if (! function_exists("ldap_connect"))
|
$testlabel='testuser';
|
||||||
{
|
$key=$conf->global->LDAP_KEY_USERS;
|
||||||
print '<a class="butActionRefused" href="#" title="'.$langs->trans('LDAPFunctionsNotAvailableOnPHP').'">'.$langs->trans("LDAPTestSynchroUser").'</a>';
|
$dn=$conf->global->LDAP_USER_DN;
|
||||||
}
|
$objectclass=$conf->global->LDAP_USER_OBJECT_CLASS;
|
||||||
else if (empty($conf->global->LDAP_SERVER_HOST))
|
|
||||||
{
|
show_ldap_test_button($butlabel,$testlabel,$key,$dn,$objectclass);
|
||||||
print '<a class="butActionRefused" href="#" title="'.$langs->trans('SetupNotComplete').'">'.$langs->trans("LDAPTestSynchroUser").'</a>';
|
|
||||||
}
|
|
||||||
else print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=testuser">'.$langs->trans("LDAPTestSynchroUser").'</a>';
|
|
||||||
print '<br><br>';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (function_exists("ldap_connect"))
|
if (function_exists("ldap_connect"))
|
||||||
@ -284,17 +281,19 @@ if (function_exists("ldap_connect"))
|
|||||||
if ($_GET["action"] == 'testuser')
|
if ($_GET["action"] == 'testuser')
|
||||||
{
|
{
|
||||||
// Creation objet
|
// Creation objet
|
||||||
$fuser=new User($db);
|
$object=new User($db);
|
||||||
$fuser->initAsSpecimen();
|
$object->initAsSpecimen();
|
||||||
|
|
||||||
|
// TODO Mutualize code following with other ldap_xxxx.php pages
|
||||||
|
|
||||||
// Test synchro
|
// Test synchro
|
||||||
$ldap=new Ldap();
|
$ldap=new Ldap();
|
||||||
$result=$ldap->connect_bind();
|
$result=$ldap->connect_bind();
|
||||||
|
|
||||||
if ($result > 0)
|
if ($result > 0)
|
||||||
{
|
{
|
||||||
$info=$fuser->_load_ldap_info();
|
$info=$object->_load_ldap_info();
|
||||||
$dn=$fuser->_load_ldap_dn($info);
|
$dn=$object->_load_ldap_dn($info);
|
||||||
|
|
||||||
$result2=$ldap->update($dn,$info,$user);
|
$result2=$ldap->update($dn,$info,$user);
|
||||||
$result3=$ldap->delete($dn);
|
$result3=$ldap->delete($dn);
|
||||||
@ -310,6 +309,7 @@ if (function_exists("ldap_connect"))
|
|||||||
print '<font class="error">'.$langs->trans("LDAPSynchroKOMayBePermissions");
|
print '<font class="error">'.$langs->trans("LDAPSynchroKOMayBePermissions");
|
||||||
print ': '.$ldap->error;
|
print ': '.$ldap->error;
|
||||||
print '</font><br>';
|
print '</font><br>';
|
||||||
|
print $langs->trans("ErrorLDAPMakeManualTest",$conf->ldap->dir_temp).'<br>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -318,8 +318,13 @@ if (function_exists("ldap_connect"))
|
|||||||
print '<font class="error">'.$langs->trans("LDAPSynchroKO");
|
print '<font class="error">'.$langs->trans("LDAPSynchroKO");
|
||||||
print ': '.$ldap->error;
|
print ': '.$ldap->error;
|
||||||
print '</font><br>';
|
print '</font><br>';
|
||||||
|
print $langs->trans("ErrorLDAPMakeManualTest",$conf->ldap->dir_temp).'<br>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
print "<br>\n";
|
||||||
|
print "LDAP input file used for test:<br><br>\n";
|
||||||
|
print nl2br($ldap->dump_content($dn,$info));
|
||||||
|
print "\n<br>";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -327,5 +332,4 @@ if (function_exists("ldap_connect"))
|
|||||||
$db->close();
|
$db->close();
|
||||||
|
|
||||||
llxFooter('$Date$ - $Revision$');
|
llxFooter('$Date$ - $Revision$');
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|||||||
@ -38,18 +38,19 @@ class Conf
|
|||||||
{
|
{
|
||||||
/** \public */
|
/** \public */
|
||||||
//! Object with database handler
|
//! Object with database handler
|
||||||
var $db;
|
var $db;
|
||||||
//! Charset for HTML output
|
|
||||||
var $character_set_client; // UTF8, ISO-8859-1
|
//! Charset for HTML output and for storing data in memory
|
||||||
|
var $character_set_client='UTF-8'; // UTF-8, ISO-8859-1
|
||||||
|
|
||||||
var $dol_document_root;
|
var $dol_document_root;
|
||||||
|
|
||||||
var $monnaie; // Used to store current currency
|
var $monnaie; // Used to store current currency
|
||||||
var $css; // Used to store current css (from theme)
|
var $css; // Used to store current css (from theme)
|
||||||
|
|
||||||
var $css_modules=array();
|
var $css_modules=array();
|
||||||
var $tabs_modules=array();
|
var $tabs_modules=array();
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Positionne toutes les variables de configuration
|
* \brief Positionne toutes les variables de configuration
|
||||||
|
|||||||
@ -36,4 +36,6 @@ WarningBuildScriptNotRunned=Script <b>%s</b> was not yet ran to build graphics,
|
|||||||
WarningBookmarkAlreadyExists=A bookmark with this title or this target (URL) already exists.
|
WarningBookmarkAlreadyExists=A bookmark with this title or this target (URL) already exists.
|
||||||
WarningPassIsEmpty=Warning, database password is empty. This is a security hole. You should add a password to your database and change your conf.php file to reflect this.
|
WarningPassIsEmpty=Warning, database password is empty. This is a security hole. You should add a password to your database and change your conf.php file to reflect this.
|
||||||
ErrorNoAccountancyModuleLoaded=No accountancy module activated
|
ErrorNoAccountancyModuleLoaded=No accountancy module activated
|
||||||
ErrorExportDuplicateProfil=This profil name already exists for this export set.
|
ErrorExportDuplicateProfil=This profil name already exists for this export set.
|
||||||
|
ErrorLDAPSetupNotComplete=Dolibarr-LDAP matching is not complete.
|
||||||
|
ErrorLDAPMakeManualTest=A .ldif file has been generated in directory %s. Try to load it manually from command line to have more informations on errors.
|
||||||
|
|||||||
@ -37,3 +37,5 @@ WarningBookmarkAlreadyExists=Un marque-page avec ce titre ou cette destination (
|
|||||||
WarningPassIsEmpty=Attention, le mot de passe de la base de donnée Dolibarr est vide. Cela représente une faille de sécurité. Il est recommandé d'ajouter manuellement un mot de passe à la base et de modifier le fichier conf.php pour refléter ce changement.
|
WarningPassIsEmpty=Attention, le mot de passe de la base de donnée Dolibarr est vide. Cela représente une faille de sécurité. Il est recommandé d'ajouter manuellement un mot de passe à la base et de modifier le fichier conf.php pour refléter ce changement.
|
||||||
ErrorNoAccountancyModuleLoaded=Aucun module de comptabilité activé
|
ErrorNoAccountancyModuleLoaded=Aucun module de comptabilité activé
|
||||||
ErrorExportDuplicateProfil=Ce nom de profil existe déjà pour ce lot d'export.
|
ErrorExportDuplicateProfil=Ce nom de profil existe déjà pour ce lot d'export.
|
||||||
|
ErrorLDAPSetupNotComplete=Le matching Dolibarr-LDAP est incomplet.
|
||||||
|
ErrorLDAPMakeManualTest=Un fichier .ldif a été généré dans le répertoire %s. Essayer de charger ce fichier en manuel depuis la ligne de commande pour plus de détail sur l'erreur.
|
||||||
@ -419,5 +419,4 @@ function security_prepare_head()
|
|||||||
return $head;
|
return $head;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
?>
|
?>
|
||||||
@ -44,10 +44,10 @@ if (! defined('ADODB_DATE_VERSION')) include_once(DOL_DOCUMENT_ROOT."/includes/a
|
|||||||
*/
|
*/
|
||||||
function ValidEmail($address)
|
function ValidEmail($address)
|
||||||
{
|
{
|
||||||
if (ereg( ".*<(.+)>", $address, $regs)) {
|
if (eregi(".*<(.+)>", $address, $regs)) {
|
||||||
$address = $regs[1];
|
$address = $regs[1];
|
||||||
}
|
}
|
||||||
if (ereg( "^[^@ ]+@([a-zA-Z0-9\-]+\.)+([a-zA-Z0-9\-]{2}|coop|aero|biz|com|edu|gov|info|int|mil|name|net|org)\$",$address))
|
if (eregi("^[^@ ]+@([a-zA-Z0-9\-]+\.)+([a-zA-Z0-9\-]{2}|coop|aero|biz|com|edu|gov|info|int|mil|name|net|org)\$",$address))
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@ -79,6 +79,46 @@ function ldap_prepare_head()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Show button test LDAP synchro
|
||||||
|
*/
|
||||||
|
function show_ldap_test_button($butlabel,$testlabel,$key,$dn,$objectclass)
|
||||||
|
{
|
||||||
|
global $langs, $conf, $user;
|
||||||
|
//print 'key='.$key.' dn='.$dn.' objectclass='.$objectclass;
|
||||||
|
|
||||||
|
print '<br>';
|
||||||
|
if (! function_exists("ldap_connect"))
|
||||||
|
{
|
||||||
|
print '<a class="butActionRefused" href="#" title="'.$langs->trans('LDAPFunctionsNotAvailableOnPHP').'">'.$butlabel.'</a>';
|
||||||
|
}
|
||||||
|
else if (empty($conf->global->LDAP_SERVER_HOST))
|
||||||
|
{
|
||||||
|
print '<a class="butActionRefused" href="#" title="'.$langs->trans('SetupNotComplete').'">'.$butlabel.'</a>';
|
||||||
|
}
|
||||||
|
else if (empty($key) || empty($dn) || empty($objectclass))
|
||||||
|
{
|
||||||
|
$langs->load("errors");
|
||||||
|
print '<a class="butActionRefused" href="#" title="'.$langs->trans('ErrorLDAPSetupNotComplete').'">'.$butlabel.'</a>';
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action='.$testlabel.'">'.$butlabel.'</a>';
|
||||||
|
}
|
||||||
|
print '<br><br>';
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Show an LDAP array in an HTML to records.
|
||||||
|
*
|
||||||
|
* @param unknown_type $result Array to show. This array is already encoded into charset_output
|
||||||
|
* @param unknown_type $level
|
||||||
|
* @param unknown_type $count
|
||||||
|
* @param unknown_type $var
|
||||||
|
* @param unknown_type $hide
|
||||||
|
* @return unknown
|
||||||
|
*/
|
||||||
function show_ldap_content($result,$level,$count,$var,$hide=0)
|
function show_ldap_content($result,$level,$count,$var,$hide=0)
|
||||||
{
|
{
|
||||||
global $bc, $conf;
|
global $bc, $conf;
|
||||||
@ -113,8 +153,8 @@ function show_ldap_content($result,$level,$count,$var,$hide=0)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if ($hide) print eregi_replace('.','*',utf8_decode("$val"));
|
if ($hide) print eregi_replace('.','*',$val);
|
||||||
else print utf8_decode($val);
|
else print $val;
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -42,8 +42,8 @@ class Translate {
|
|||||||
|
|
||||||
var $cache_labels=array(); // Cache for labels
|
var $cache_labels=array(); // Cache for labels
|
||||||
|
|
||||||
var $charset_inputfile='ISO-8859-1'; // Codage used by default to encode lang files (used if CHARSET not found in file)
|
var $charset_inputfile='ISO-8859-1'; // Codage used by default to encode/decode lang files (used if CHARSET not found in file)
|
||||||
var $charset_output='UTF-8'; // Codage used by default for "trans" method output if $conf->character_set_client not defined (character_set_client in conf.php)
|
var $charset_output='UTF-8'; // Codage used by default for "trans" method output if $conf->character_set_client not defined (should never happen)
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user