<?php
/**
- * @copyright Copyright (C) 2020, Friendica
+ * @copyright Copyright (C) 2010-2022, the Friendica project
*
* @license GNU AGPL version 3 or any later version
*
function removeme_post(App $a)
{
- if (!local_user()) {
+ if (!DI::userSession()->getLocalUserId()) {
return;
}
- if (!empty($_SESSION['submanage'])) {
+ if (DI::userSession()->getSubManagedUserId()) {
return;
}
continue;
}
+ $l10n = DI::l10n()->withLang($admin['language']);
+
$email = DI::emailer()
->newSystemMail()
->withMessage(
- DI::l10n()->t('[Friendica System Notify]') . ' ' . DI::l10n()->t('User deleted their account'),
- DI::l10n()->t('On your Friendica node an user deleted their account. Please ensure that their data is removed from the backups.'),
- DI::l10n()->t('The user id is %d', local_user()))
+ $l10n->t('[Friendica System Notify]') . ' ' . $l10n->t('User deleted their account'),
+ $l10n->t('On your Friendica node an user deleted their account. Please ensure that their data is removed from the backups.'),
+ $l10n->t('The user id is %d', DI::userSession()->getLocalUserId()))
->forUser($admin)
->withRecipient($admin['email'])
->build();
DI::emailer()->send($email);
}
- if (User::getIdFromPasswordAuthentication($a->user, trim($_POST['qxz_password']))) {
- User::remove($a->user['uid']);
+ if (User::getIdFromPasswordAuthentication($a->getLoggedInUserId(), trim($_POST['qxz_password']))) {
+ User::remove($a->getLoggedInUserId());
unset($_SESSION['authenticated']);
unset($_SESSION['uid']);
function removeme_content(App $a)
{
- if (!local_user()) {
+ if (!DI::userSession()->getLocalUserId()) {
DI::baseUrl()->redirect();
}