Added delete account options
This commit is contained in:
30
Service/DeleteAccount/CodeService.php
Normal file
30
Service/DeleteAccount/CodeService.php
Normal 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 );
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user