mirror of
https://github.com/nextcloud/passman.git
synced 2025-01-04 06:23:43 +08:00
More loggin for the cron, less strict checking
This commit is contained in:
parent
c907bb540d
commit
9e8b23679c
1 changed files with 8 additions and 2 deletions
|
@ -42,14 +42,20 @@ class CronService {
|
||||||
|
|
||||||
$sql = 'SELECT count(*) as rows from `*PREFIX*notifications` WHERE `subject`= \'credential_expired\' AND object_id=?';
|
$sql = 'SELECT count(*) as rows from `*PREFIX*notifications` WHERE `subject`= \'credential_expired\' AND object_id=?';
|
||||||
$query = $this->db->prepareQuery($sql);
|
$query = $this->db->prepareQuery($sql);
|
||||||
$query->bindParam(1, $credential->getId(), \PDO::PARAM_INT);
|
$id = $credential->getId();
|
||||||
|
$query->bindParam(1, $id, \PDO::PARAM_INT);
|
||||||
$result = $query->execute();
|
$result = $query->execute();
|
||||||
if($result->fetchRow()['rows'] === 0) {
|
$this->logger->debug($credential->getLabel() .' is expired, checking notifications!', array('app' => 'passman'));
|
||||||
|
if($result->fetchRow()['rows'] == 0) {
|
||||||
|
$this->logger->debug($credential->getLabel() .' is expired, adding notification!', array('app' => 'passman'));
|
||||||
|
|
||||||
$this->activityService->add(
|
$this->activityService->add(
|
||||||
Activity::SUBJECT_ITEM_EXPIRED, array($credential->getLabel(), $credential->getUserId()),
|
Activity::SUBJECT_ITEM_EXPIRED, array($credential->getLabel(), $credential->getUserId()),
|
||||||
'', array(),
|
'', array(),
|
||||||
$link, $credential->getUserId(), Activity::TYPE_ITEM_EXPIRED);
|
$link, $credential->getUserId(), Activity::TYPE_ITEM_EXPIRED);
|
||||||
$this->notificationService->credentialExpiredNotification($credential);
|
$this->notificationService->credentialExpiredNotification($credential);
|
||||||
|
} else {
|
||||||
|
$this->logger->debug($credential->getLabel() .' is expired, already notified!', array('app' => 'passman'));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue