Skip to content
This repository has been archived by the owner on Dec 13, 2022. It is now read-only.

Commit

Permalink
set default value to variables
Browse files Browse the repository at this point in the history
  • Loading branch information
sc979 committed Oct 29, 2019
1 parent 1742c38 commit f7d2e79
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions cron/centAcl.php
Original file line number Diff line number Diff line change
Expand Up @@ -113,23 +113,24 @@

/**
* Sync ACL with LDAP's contactgroup
* If the LDAP is enable and the last check is greater than the update period
* If the LDAP is enabled and the last check is greater than the update period
*
* @TODO : Synchronize LDAP with contacts data in background to avoid it at login
*/
$ldapEnable = $ldapLastUpdate = 0;
$queryOptions = "SELECT `key`, `value` FROM `options` WHERE `key` IN ('ldap_auth_enable', 'ldap_last_acl_update')";
$res = $pearDB->query($queryOptions);
while ($row = $res->fetch()) {
switch ($row['key']) {
case 'ldap_auth_enable':
$ldap_enable = $row['value'];
$ldapEnable = $row['value'];
break;
case 'ldap_last_acl_update':
$ldap_last_update = $row['value'];
$ldapLastUpdate = $row['value'];
break;
}
}
if ($ldap_enable == 1 && $ldap_last_update < (time() - LDAP_UPDATE_PERIOD)) {
if ($ldapEnable == 1 && $ldapLastUpdate < (time() - LDAP_UPDATE_PERIOD)) {
$cgObj->syncWithLdap();
}

Expand Down

0 comments on commit f7d2e79

Please sign in to comment.