$photo_failure = false;
$filename = basename($photo);
- $curlResult = Network::curl($photo, true);
+ $curlResult = DI::httpRequest()->curl($photo, true);
if ($curlResult->isSuccess()) {
$img_str = $curlResult->getBody();
$type = $curlResult->getContentType();
// unique), so it cannot be re-registered in the future.
DBA::insert('userd', ['username' => $user['nickname']]);
- // The user and related data will be deleted in "cron_expire_and_remove_users" (cronjobs.php)
+ // The user and related data will be deleted in Friendica\Worker\CronJobs::expireAndRemoveUsers()
DBA::update('user', ['account_removed' => true, 'account_expires_on' => DateTimeFormat::utc('now + 7 day')], ['uid' => $uid]);
Worker::add(PRIORITY_HIGH, 'Notifier', Delivery::REMOVAL, $uid);
'total_users' => 0,
'active_users_halfyear' => 0,
'active_users_monthly' => 0,
+ 'active_users_weekly' => 0,
];
$userStmt = DBA::select('owner-view', ['uid', 'login_date', 'last-item'],
$halfyear = time() - (180 * 24 * 60 * 60);
$month = time() - (30 * 24 * 60 * 60);
+ $week = time() - (7 * 24 * 60 * 60);
while ($user = DBA::fetch($userStmt)) {
$statistics['total_users']++;
) {
$statistics['active_users_monthly']++;
}
+
+ if ((strtotime($user['login_date']) > $week) || (strtotime($user['last-item']) > $week)
+ ) {
+ $statistics['active_users_weekly']++;
+ }
}
DBA::close($userStmt);
$condition = [];
switch ($type) {
case 'active':
+ $condition['account_removed'] = false;
$condition['blocked'] = false;
break;
case 'blocked':