本文整理汇总了PHP中Adherent::_load_ldap_dn方法的典型用法代码示例。如果您正苦于以下问题:PHP Adherent::_load_ldap_dn方法的具体用法?PHP Adherent::_load_ldap_dn怎么用?PHP Adherent::_load_ldap_dn使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Adherent
的用法示例。
在下文中一共展示了Adherent::_load_ldap_dn方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: exit
$result = $member->fetch($obj->rowid);
if ($result < 0) {
dol_print_error($db, $member->error);
exit(-1);
}
$result = $member->fetch_subscriptions();
if ($result < 0) {
dol_print_error($db, $member->error);
exit(-1);
}
print $langs->transnoentities("UpdateMember") . " rowid=" . $member->id . " " . $member->getFullName($langs);
$oldobject = $member;
$oldinfo = $oldobject->_load_ldap_info();
$olddn = $oldobject->_load_ldap_dn($oldinfo);
$info = $member->_load_ldap_info();
$dn = $member->_load_ldap_dn($info);
$result = $ldap->add($dn, $info, $user);
// Wil fail if already exists
$result = $ldap->update($dn, $info, $user, $olddn);
if ($result > 0) {
print " - " . $langs->transnoentities("OK");
} else {
$error++;
print " - " . $langs->transnoentities("KO") . ' - ' . $ldap->error;
}
print "\n";
$i++;
}
$ldap->unbind();
$ldap->close();
} else {
示例2: Adherent
$key = $conf->global->LDAP_KEY_MEMBERS;
$dn = $conf->global->LDAP_MEMBER_DN;
$objectclass = $conf->global->LDAP_MEMBER_OBJECT_CLASS;
show_ldap_test_button($butlabel, $testlabel, $key, $dn, $objectclass);
}
if (function_exists("ldap_connect")) {
if ($_GET["action"] == 'testmember') {
// Creation objet
$object = new Adherent($db);
$object->initAsSpecimen();
// Test synchro
$ldap = new Ldap();
$result = $ldap->connect_bind();
if ($result > 0) {
$info = $object->_load_ldap_info();
$dn = $object->_load_ldap_dn($info);
$result1 = $ldap->delete($dn);
// To be sure to delete existing records
$result2 = $ldap->add($dn, $info, $user);
// Now the test
$result3 = $ldap->delete($dn);
// Clean what we did
if ($result2 > 0) {
print img_picto('', 'info') . ' ';
print '<font class="ok">' . $langs->trans("LDAPSynchroOK") . '</font><br>';
} else {
print img_picto('', 'error') . ' ';
print '<font class="error">' . $langs->trans("LDAPSynchroKOMayBePermissions");
print ': ' . $ldap->error;
print '</font><br>';
print $langs->trans("ErrorLDAPMakeManualTest", $conf->ldap->dir_temp) . '<br>';
示例3: Adherent
$adh = new Adherent($db);
$adh->id = $rowid;
$result = $adh->fetch($rowid);
if (!$result) {
dol_print_error($db, "Failed to get adherent: " . $adh->error);
exit;
}
/*
* Actions
*/
if ($action == 'dolibarr2ldap') {
$db->begin();
$ldap = new Ldap();
$result = $ldap->connect_bind();
$info = $adh->_load_ldap_info();
$dn = $adh->_load_ldap_dn($info);
$olddn = $dn;
// We can say that old dn = dn as we force synchro
$result = $ldap->update($dn, $info, $user, $olddn);
if ($result >= 0) {
setEventMessage($langs->trans("MemberSynchronized"));
$db->commit();
} else {
setEventMessage($ldap->error, 'errors');
$db->rollback();
}
}
/*
* View
*/
llxHeader('', $langs->trans("Member"), 'EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros');