forked from Wavyzz/dolibarr
Scrutinizer Auto-Fixes
This commit consists of patches automatically generated for this project on https://scrutinizer-ci.com
This commit is contained in:
@@ -35,7 +35,7 @@ function ldap_prepare_head()
|
||||
$langs->load("ldap");
|
||||
|
||||
// Onglets
|
||||
$head=array();
|
||||
$head = array();
|
||||
$h = 0;
|
||||
|
||||
$head[$h][0] = DOL_URL_ROOT."/admin/ldap.php";
|
||||
@@ -43,7 +43,7 @@ function ldap_prepare_head()
|
||||
$head[$h][2] = 'ldap';
|
||||
$h++;
|
||||
|
||||
if (! empty($conf->global->LDAP_SYNCHRO_ACTIVE))
|
||||
if (!empty($conf->global->LDAP_SYNCHRO_ACTIVE))
|
||||
{
|
||||
$head[$h][0] = DOL_URL_ROOT."/admin/ldap_users.php";
|
||||
$head[$h][1] = $langs->trans("LDAPUsersSynchro");
|
||||
@@ -51,7 +51,7 @@ function ldap_prepare_head()
|
||||
$h++;
|
||||
}
|
||||
|
||||
if (! empty($conf->global->LDAP_SYNCHRO_ACTIVE))
|
||||
if (!empty($conf->global->LDAP_SYNCHRO_ACTIVE))
|
||||
{
|
||||
$head[$h][0] = DOL_URL_ROOT."/admin/ldap_groups.php";
|
||||
$head[$h][1] = $langs->trans("LDAPGroupsSynchro");
|
||||
@@ -59,7 +59,7 @@ function ldap_prepare_head()
|
||||
$h++;
|
||||
}
|
||||
|
||||
if (! empty($conf->societe->enabled) && ! empty($conf->global->LDAP_CONTACT_ACTIVE))
|
||||
if (!empty($conf->societe->enabled) && !empty($conf->global->LDAP_CONTACT_ACTIVE))
|
||||
{
|
||||
$head[$h][0] = DOL_URL_ROOT."/admin/ldap_contacts.php";
|
||||
$head[$h][1] = $langs->trans("LDAPContactsSynchro");
|
||||
@@ -67,7 +67,7 @@ function ldap_prepare_head()
|
||||
$h++;
|
||||
}
|
||||
|
||||
if (! empty($conf->adherent->enabled) && ! empty($conf->global->LDAP_MEMBER_ACTIVE))
|
||||
if (!empty($conf->adherent->enabled) && !empty($conf->global->LDAP_MEMBER_ACTIVE))
|
||||
{
|
||||
$head[$h][0] = DOL_URL_ROOT."/admin/ldap_members.php";
|
||||
$head[$h][1] = $langs->trans("LDAPMembersSynchro");
|
||||
@@ -75,7 +75,7 @@ function ldap_prepare_head()
|
||||
$h++;
|
||||
}
|
||||
|
||||
if (! empty($conf->adherent->enabled) && ! empty($conf->global->LDAP_MEMBER_TYPE_ACTIVE))
|
||||
if (!empty($conf->adherent->enabled) && !empty($conf->global->LDAP_MEMBER_TYPE_ACTIVE))
|
||||
{
|
||||
$head[$h][0] = DOL_URL_ROOT."/admin/ldap_members_types.php";
|
||||
$head[$h][1] = $langs->trans("LDAPMembersTypesSynchro");
|
||||
@@ -109,7 +109,7 @@ function show_ldap_test_button($butlabel, $testlabel, $key, $dn, $objectclass)
|
||||
//print 'key='.$key.' dn='.$dn.' objectclass='.$objectclass;
|
||||
|
||||
print '<br>';
|
||||
if (! function_exists("ldap_connect"))
|
||||
if (!function_exists("ldap_connect"))
|
||||
{
|
||||
print '<a class="butActionRefused classfortooltip" href="#" title="'.$langs->trans('LDAPFunctionsNotAvailableOnPHP').'">'.$butlabel.'</a>';
|
||||
}
|
||||
@@ -146,35 +146,35 @@ function show_ldap_content($result, $level, $count, $var, $hide = 0, $subcount =
|
||||
global $bc, $conf;
|
||||
|
||||
$count--;
|
||||
if ($count == 0) return -1; // To stop loop
|
||||
if (! is_array($result)) return -1;
|
||||
if ($count == 0) return -1; // To stop loop
|
||||
if (!is_array($result)) return -1;
|
||||
|
||||
foreach($result as $key => $val)
|
||||
foreach ($result as $key => $val)
|
||||
{
|
||||
if ("$key" == "objectclass") continue;
|
||||
if ("$key" == "count") continue;
|
||||
if ("$key" == "dn") continue;
|
||||
if ("$val" == "objectclass") continue;
|
||||
|
||||
$lastkey[$level]=$key;
|
||||
$lastkey[$level] = $key;
|
||||
|
||||
if (is_array($val))
|
||||
{
|
||||
$hide=0;
|
||||
if (! is_numeric($key))
|
||||
$hide = 0;
|
||||
if (!is_numeric($key))
|
||||
{
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>';
|
||||
print $key;
|
||||
print '</td><td>';
|
||||
if (strtolower($key) == 'userpassword') $hide=1;
|
||||
if (strtolower($key) == 'userpassword') $hide = 1;
|
||||
}
|
||||
show_ldap_content($val, $level+1, $count, $var, $hide, $val["count"]);
|
||||
show_ldap_content($val, $level + 1, $count, $var, $hide, $val["count"]);
|
||||
}
|
||||
elseif ($subcount)
|
||||
{
|
||||
$subcount--;
|
||||
$newstring=dol_htmlentitiesbr($val);
|
||||
$newstring = dol_htmlentitiesbr($val);
|
||||
if ($hide) print preg_replace('/./i', '*', $newstring);
|
||||
else print $newstring;
|
||||
print '<br>';
|
||||
|
||||
Reference in New Issue
Block a user