function ldapsync_cron in LDAP integration 6
Implements hook_cron().
Checks ldapsync_time_interval and ldapsync_last_sync_time variables to determine whether to run ldapsync.
File
- ./
ldapsync.module, line 61 - ldapsync keeps LDAP and Drupal user lists synchronized.
Code
function ldapsync_cron() {
$time_interval = variable_get('ldapsync_time_interval', -1);
// -1 means "only sync manually"
$last_sync_time = variable_get('ldapsync_last_sync_time', 0);
if (time() - $last_sync_time > $time_interval && $time_interval != -1) {
_ldapsync_sync();
}
}