Add support for Privacy Policy, Terms of Service, and CAPTCHA

This commit is contained in:
netkas 2024-12-14 00:43:19 -05:00
parent 756297671f
commit c866e2f696
22 changed files with 795 additions and 138 deletions

View file

@ -135,10 +135,10 @@ class CaptchaManager
* Retrieves the captcha record for the given peer UUID.
*
* @param string|RegisteredPeerRecord $peer_uuid The UUID of the peer to retrieve the captcha for.
* @return CaptchaRecord The captcha record.
* @return CaptchaRecord|null The captcha record.
* @throws DatabaseOperationException If the operation fails.
*/
public static function getCaptcha(string|RegisteredPeerRecord $peer_uuid): CaptchaRecord
public static function getCaptcha(string|RegisteredPeerRecord $peer_uuid): ?CaptchaRecord
{
// If the peer_uuid is a RegisteredPeerRecord, get the UUID
if($peer_uuid instanceof RegisteredPeerRecord)
@ -162,7 +162,7 @@ class CaptchaManager
if($result === false)
{
throw new DatabaseOperationException('The requested captcha does not exist');
return null;
}
return CaptchaRecord::fromArray($result);
@ -175,7 +175,7 @@ class CaptchaManager
* @return bool True if a captcha exists, false otherwise.
* @throws DatabaseOperationException If the operation fails.
*/
private static function captchaExists(string|RegisteredPeerRecord $peer_uuid): bool
public static function captchaExists(string|RegisteredPeerRecord $peer_uuid): bool
{
// If the peer_uuid is a RegisteredPeerRecord, get the UUID
if($peer_uuid instanceof RegisteredPeerRecord)