function ldap_user_cron in Lightweight Directory Access Protocol (LDAP) 8.4
Same name and namespace in other branches
- 8.2 ldap_user/ldap_user.module \ldap_user_cron()
- 8.3 ldap_user/ldap_user.module \ldap_user_cron()
- 7.2 ldap_user/ldap_user.module \ldap_user_cron()
Implements hook_cron().
File
- ldap_user/
ldap_user.module, line 25
Code
function ldap_user_cron() {
$check_orphans = \Drupal::config('ldap_user.settings')
->get('orphanedDrupalAcctBehavior');
if ($check_orphans !== 'ldap_user_orphan_do_not_check') {
/** @var \Drupal\ldap_user\Processor\OrphanProcessor $processor */
$processor = \Drupal::service('ldap.orphan_processor');
$processor
->checkOrphans();
}
$ldapUpdateQuery = \Drupal::config('ldap_user.settings')
->get('userUpdateCronQuery');
if (\Drupal::moduleHandler()
->moduleExists('ldap_query') && $ldapUpdateQuery != NULL && $ldapUpdateQuery !== 'none') {
/** @var \Drupal\ldap_user\Processor\GroupUserUpdateProcessor $processor */
$processor = \Drupal::service('ldap.group_user_update_processor');
if ($processor
->updateDue()) {
$processor
->runQuery($ldapUpdateQuery);
}
}
}