Added delete account options

This commit is contained in:
2026-06-17 13:43:17 +02:00
parent 73471162bf
commit 0436a99a7c
28 changed files with 235 additions and 8 deletions

View File

@@ -0,0 +1,30 @@
<?php
namespace RomhackPlaza\Master\Service\DeleteAccount;
use XF\Entity\User;
use XF\Service\AbstractService;
class CodeService extends AbstractService
{
private string $masterKey;
protected function setup()
{
$this->masterKey = \XF::options()->rhpz_delete_account_master_key;
}
public function generateDeleteAllDataKey( User $user )
{
$dataString = "delete_data_{$user->user_id}";
return hash_hmac('md5', $dataString, $this->masterKey );
}
public function generateDeleteAccountKey( User $user )
{
$dataString = "delete_account_{$user->user_id}";
return hash_hmac('md5', $dataString, $this->masterKey );
}
}