Files
ignacionelson 6e47d76ba6 ProjectSend 2.0.0
Client file sharing, rebuilt from the ground up: a private area per
client, resumable uploads, folders, groups and categories, sharing with
expiry dates and download limits, comments, file versions, an activity
log, a REST API, and sixteen languages.

This repository begins here. ProjectSend 2 was developed privately, and
that development history is not published — the previous generation
remains available, with its own history, at projectsend/legacy.

Free software under the GNU General Public License v2, or (at your
option) any later version.
2026-08-14 01:38:12 -03:00

54 lines
1.4 KiB
PHP
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?php
declare(strict_types=1);
namespace App\Modules\Platform\Captcha\Console;
use App\Modules\Platform\Captcha\Captcha;
use App\Modules\Platform\Captcha\CaptchaVerifier;
use Illuminate\Console\Command;
/**
* Check the configured secret key against the provider.
*
* The same probe the settings screen's Test keys button runs, for anyone
* diagnosing an installation over SSH — and, more usefully, for a
* deployment script that wants to know its keys survived the move before
* the first visitor finds out they did not.
*/
class TestCaptchaCommand extends Command
{
protected $signature = 'projectsend:captcha-test';
protected $description = 'Check the configured CAPTCHA keys against the provider';
public function handle(Captcha $captcha, CaptchaVerifier $verifier): int
{
$active = $captcha->active();
if ($active === null) {
$this->warn('No CAPTCHA is configured, so there is nothing to test.');
return self::SUCCESS;
}
$this->line(sprintf(
'Testing %s with %s keys…',
$active->provider->label(),
$active->managed ? 'the platforms' : 'this installations',
));
$result = $verifier->test($active->provider, $active->secretKey);
if ($result['ok']) {
$this->info($result['message']);
return self::SUCCESS;
}
$this->error($result['message']);
return self::FAILURE;
}
}