<?php
-
/**
- * @file src/Model/User.php
- * This file includes the User class with user related database functions
+ * @copyright Copyright (C) 2020, Friendica
+ *
+ * @license GNU AGPL version 3 or any later version
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
*/
namespace Friendica\Model;
$password
));
- return notification([
- 'type' => SYSTEM_EMAIL,
- 'uid' => $user['uid'],
- 'to_email' => $user['email'],
- 'subject' => DI::l10n()->t('Registration at %s', $sitename),
- 'body' => $body
- ]);
+ $email = DI::emailer()
+ ->newSystemMail()
+ ->withMessage(DI::l10n()->t('Registration at %s', $sitename), $body)
+ ->forUser($user)
+ ->withRecipient($user['email'])
+ ->build();
+ return DI::emailer()->send($email);
}
/**
$password
));
- return notification([
- 'uid' => $user['uid'],
- 'language' => $user['language'],
- 'type' => SYSTEM_EMAIL,
- 'to_email' => $user['email'],
- 'subject' => DI::l10n()->t('Registration details for %s', $sitename),
- 'preamble' => $preamble,
- 'body' => $body
- ]);
+ $email = DI::emailer()
+ ->newSystemMail()
+ ->withMessage(DI::l10n()->t('Registration details for %s', $sitename), $preamble, $body)
+ ->forUser($user)
+ ->withRecipient($user['email'])
+ ->build();
+ return DI::emailer()->send($email);
}
/**
$userStmt = DBA::p("SELECT `user`.`uid`, `user`.`login_date`, `contact`.`last-item`
FROM `user`
- INNER JOIN `profile` ON `profile`.`uid` = `user`.`uid`
INNER JOIN `contact` ON `contact`.`uid` = `user`.`uid` AND `contact`.`self`
- WHERE (`profile`.`publish` OR `profile`.`net-publish`) AND `user`.`verified`
- AND NOT `user`.`blocked` AND NOT `user`.`account_removed`
- AND NOT `user`.`account_expired`");
+ WHERE `user`.`verified`
+ AND `user`.`login_date` > ?
+ AND NOT `user`.`blocked`
+ AND NOT `user`.`account_removed`
+ AND NOT `user`.`account_expired`",
+ DBA::NULL_DATETIME
+ );
if (!DBA::isResult($userStmt)) {
return $statistics;