- $r = q("UPDATE user set account_expires_on = '%s' where uid = %d",
- DBA::escape(DateTimeFormat::convert('now +' . $days . ' days')),
- intval($uid)
- );
-
-};
-
-
-function testdrive_cron($a,$b) {
- $r = q("select * from user where account_expires_on < UTC_TIMESTAMP() + INTERVAL 5 DAY and
- expire_notification_sent = '0000-00-00 00:00:00' ");
-
- if(count($r)) {
- foreach($r as $rr) {
- notification([
- 'uid' => $rr['uid'],
- 'type' => Type::SYSTEM,
- 'system_type' => 'testdrive_expire',
- 'language' => $rr['language'],
- 'to_name' => $rr['username'],
- 'to_email' => $rr['email'],
- 'source_name' => DI::l10n()->t('Administrator'),
- 'source_link' => DI::baseUrl()->get(),
- 'source_photo' => DI::baseUrl()->get() . '/images/person-80.jpg',
- ]);
+ DBA::update('user', ['account_expires_on' => DateTimeFormat::convert('now +' . $days . ' days')], ['uid' => $uid]);
+}