Passkey rework 🔫 (#839)

* WIP: Passkey rework 🔫

* Update tracker.php

* Update Torrent.php

* Update Torrent.php

* Update displaying_torrent.php

* Update viewforum.php

* Update Torrent.php

* Update functions.php

* Update functions.php

* Updated

* Update config.php

* Update functions.php

* Update usercp_viewprofile.tpl

* Update usercp_viewprofile.tpl

* Updated

* Updated

* Update usercp_viewprofile.tpl

* Update usercp_viewprofile.tpl

* Update displaying_torrent.php
This commit is contained in:
Roman Kelesidis 2023-07-23 23:55:57 +07:00 committed by GitHub
commit 9ba9ca2b61
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 88 additions and 52 deletions

View file

@ -16,7 +16,9 @@ global $userdata, $lang;
$req_uid = (int)$this->request['user_id'];
if ($req_uid == $userdata['user_id'] || IS_ADMIN) {
if (empty($this->request['confirmed'])) {
$first_creation = !\TorrentPier\Legacy\Torrent::getPasskey($req_uid);
if (empty($this->request['confirmed']) && !$first_creation) {
$this->prompt_for_confirm($lang['BT_GEN_PASSKEY_NEW']);
}
@ -26,6 +28,7 @@ if ($req_uid == $userdata['user_id'] || IS_ADMIN) {
\TorrentPier\Legacy\Torrent::tracker_rm_user($req_uid);
$this->response['first_creation'] = $first_creation;
$this->response['passkey'] = $passkey;
} else {
$this->ajax_die($lang['NOT_AUTHORISED']);