Added method passkeyExists() (#837)

This commit is contained in:
Roman Kelesidis 2023-07-23 13:59:42 +07:00 committed by GitHub
commit 0e8aa1177e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -740,4 +740,19 @@ class Torrent
return $success;
}
/**
* Checks if user has a passkey
*
* @param int|string $user_id
* @return bool|string
*/
public static function passkeyExists($user_id)
{
if ($passkey = DB()->fetch_row("SELECT auth_key FROM " . BB_BT_USERS . " WHERE user_id = $user_id LIMIT 1")) {
return $passkey['auth_key'];
}
return false;
}
}