Find this useful? Enter your email to receive occasional updates for securing PHP code.
Signing you up...
Thank you for signing up!
PHP Decode
<?php declare(strict_types=1); /** * Passbolt ~ Open source password manager for teams ..
Decoded Output download
<?php
declare(strict_types=1);
/**
* Passbolt ~ Open source password manager for teams
* Copyright (c) Passbolt SA (https://www.passbolt.com)
*
* Licensed under GNU Affero General Public License version 3 of the or any later version.
* For full copyright and license information, please see the LICENSE.txt
* Redistributions of files must retain the above copyright notice.
*
* @copyright Copyright (c) Passbolt SA (https://www.passbolt.com)
* @license https://opensource.org/licenses/AGPL-3.0 AGPL License
* @link https://www.passbolt.com Passbolt(tm)
* @since 2.5.0
*/
namespace Passbolt\MultiFactorAuthentication\Controller\Yubikey;
use App\Authenticator\SessionIdentificationServiceInterface;
use App\Error\Exception\CustomValidationException;
use Passbolt\MultiFactorAuthentication\Controller\MfaVerifyController;
use Passbolt\MultiFactorAuthentication\Form\MfaFormInterface;
use Passbolt\MultiFactorAuthentication\Service\MfaPolicies\RememberAMonthSettingInterface;
use Passbolt\MultiFactorAuthentication\Utility\MfaSettings;
class YubikeyVerifyPostController extends MfaVerifyController
{
/**
* Yubikey verify post
*
* @param \App\Authenticator\SessionIdentificationServiceInterface $sessionIdentificationService session ID service
* @param \Passbolt\MultiFactorAuthentication\Form\MfaFormInterface $verifyForm MFA Form
* @param \Passbolt\MultiFactorAuthentication\Service\MfaPolicies\RememberAMonthSettingInterface $rememberMeForAMonthSetting Remember a month setting.
* @throws \Cake\Http\Exception\InternalErrorException
* @throws \Cake\Http\Exception\BadRequestException
* @return void
*/
public function post(
SessionIdentificationServiceInterface $sessionIdentificationService,
MfaFormInterface $verifyForm,
RememberAMonthSettingInterface $rememberMeForAMonthSetting
) {
$this->_handleVerifiedNotRequired($sessionIdentificationService);
$this->_handleInvalidSettings(MfaSettings::PROVIDER_YUBIKEY);
// Verify hotp
try {
$verifyForm->execute($this->request->getData());
} catch (CustomValidationException $exception) {
$this->request = $this->request
->withData('hotp', '');
if ($this->request->is('json')) {
throw $exception;
}
// Display form with error msg
$this->set('providers', $this->mfaSettings->getEnabledProviders());
$this->set('verifyForm', $verifyForm);
$this->set('isRememberMeForAMonthEnabled', $rememberMeForAMonthSetting->isEnabled());
$this->viewBuilder()
->setLayout('mfa_verify')
->setTemplatePath(ucfirst(MfaSettings::PROVIDER_YUBIKEY))
->setTemplate('verifyForm');
return;
}
// Build verified proof token and associated cookie and add it to request
$this->_generateMfaToken(
MfaSettings::PROVIDER_YUBIKEY,
$sessionIdentificationService,
$rememberMeForAMonthSetting
);
$this->_handleVerifySuccess();
}
}
?>
Did this file decode correctly?
Original Code
<?php
declare(strict_types=1);
/**
* Passbolt ~ Open source password manager for teams
* Copyright (c) Passbolt SA (https://www.passbolt.com)
*
* Licensed under GNU Affero General Public License version 3 of the or any later version.
* For full copyright and license information, please see the LICENSE.txt
* Redistributions of files must retain the above copyright notice.
*
* @copyright Copyright (c) Passbolt SA (https://www.passbolt.com)
* @license https://opensource.org/licenses/AGPL-3.0 AGPL License
* @link https://www.passbolt.com Passbolt(tm)
* @since 2.5.0
*/
namespace Passbolt\MultiFactorAuthentication\Controller\Yubikey;
use App\Authenticator\SessionIdentificationServiceInterface;
use App\Error\Exception\CustomValidationException;
use Passbolt\MultiFactorAuthentication\Controller\MfaVerifyController;
use Passbolt\MultiFactorAuthentication\Form\MfaFormInterface;
use Passbolt\MultiFactorAuthentication\Service\MfaPolicies\RememberAMonthSettingInterface;
use Passbolt\MultiFactorAuthentication\Utility\MfaSettings;
class YubikeyVerifyPostController extends MfaVerifyController
{
/**
* Yubikey verify post
*
* @param \App\Authenticator\SessionIdentificationServiceInterface $sessionIdentificationService session ID service
* @param \Passbolt\MultiFactorAuthentication\Form\MfaFormInterface $verifyForm MFA Form
* @param \Passbolt\MultiFactorAuthentication\Service\MfaPolicies\RememberAMonthSettingInterface $rememberMeForAMonthSetting Remember a month setting.
* @throws \Cake\Http\Exception\InternalErrorException
* @throws \Cake\Http\Exception\BadRequestException
* @return void
*/
public function post(
SessionIdentificationServiceInterface $sessionIdentificationService,
MfaFormInterface $verifyForm,
RememberAMonthSettingInterface $rememberMeForAMonthSetting
) {
$this->_handleVerifiedNotRequired($sessionIdentificationService);
$this->_handleInvalidSettings(MfaSettings::PROVIDER_YUBIKEY);
// Verify hotp
try {
$verifyForm->execute($this->request->getData());
} catch (CustomValidationException $exception) {
$this->request = $this->request
->withData('hotp', '');
if ($this->request->is('json')) {
throw $exception;
}
// Display form with error msg
$this->set('providers', $this->mfaSettings->getEnabledProviders());
$this->set('verifyForm', $verifyForm);
$this->set('isRememberMeForAMonthEnabled', $rememberMeForAMonthSetting->isEnabled());
$this->viewBuilder()
->setLayout('mfa_verify')
->setTemplatePath(ucfirst(MfaSettings::PROVIDER_YUBIKEY))
->setTemplate('verifyForm');
return;
}
// Build verified proof token and associated cookie and add it to request
$this->_generateMfaToken(
MfaSettings::PROVIDER_YUBIKEY,
$sessionIdentificationService,
$rememberMeForAMonthSetting
);
$this->_handleVerifySuccess();
}
}
Function Calls
None |
Stats
MD5 | e36c8fd44f24e28a6a138f1df04ba2e1 |
Eval Count | 0 |
Decode Time | 77 ms |