['filter' => FILTER_UNSAFE_RAW] ); public string $username = ''; public string $deleteFormTarget = '?account=delete'; public ?array $inputbox = null; public function __construct(string $pageParam) { if (Cfg::get('ACC_AUTH_MODE') != AUTH_MODE_SELF) $this->generateError(); parent::__construct($pageParam); } protected function generate() : void { array_unshift($this->title, Lang::account('accDelete')); parent::generate(); $this->username = User::$username; if ($this->_post['proceed']) { $error = false; if (!DB::Aowow()->selectCell('SELECT 1 FROM ?_account WHERE `status` NOT IN (?a) AND `statusTimer` > UNIX_TIMESTAMP() AND `id` = ?d', [ACC_STATUS_NEW, ACC_STATUS_NONE, ACC_STATUS_PURGING], User::$id)) { $token = Util::createHash(40); DB::Aowow()->query('UPDATE ?_account SET `status` = ?d, `statusTimer` = UNIX_TIMESTAMP() + ?d, `token` = ? WHERE `id` = ?d', ACC_STATUS_PURGING, Cfg::get('ACC_RECOVERY_DECAY'), $token, User::$id); Util::sendMail(User::$email, 'delete-account', [$token, User::$email, User::$username]); } else $error = true; $this->inputbox = ['inputbox-status', array( 'head' => Lang::account('inputbox', 'head', $error ? 'error' : 'success'), 'message' => $error ? '' : Lang::account('inputbox', 'message', 'deleteAccSent', [User::$email]), 'error' => $error ? Lang::account('inputbox', 'error', 'isRecovering') : '' )]; } } } ?>