├── .gitignore ├── vendor ├── pragmarx │ └── google2fa │ │ ├── tests │ │ ├── .gitkeep │ │ └── bootstrap.php │ │ ├── upgrading.md │ │ ├── .gitignore │ │ ├── docs │ │ └── playground.jpg │ │ ├── src │ │ ├── Exceptions │ │ │ ├── InvalidCharactersException.php │ │ │ ├── SecretKeyTooShortException.php │ │ │ ├── IncompatibleWithGoogleAuthenticatorException.php │ │ │ └── InsecureCallException.php │ │ └── Support │ │ │ ├── Url.php │ │ │ ├── Constants.php │ │ │ ├── QRCode.php │ │ │ └── Base32.php │ │ ├── .travis.yml │ │ ├── LICENSE.md │ │ ├── .scrutinizer.yml │ │ ├── RELICENSED.md │ │ ├── phpunit.xml │ │ ├── composer.json │ │ └── changelog.md ├── paragonie │ ├── constant_time_encoding │ │ ├── .gitignore │ │ ├── psalm.xml │ │ ├── .travis.yml │ │ ├── phpunit.xml.dist │ │ ├── tests │ │ │ ├── Base64DotSlashTest.php │ │ │ ├── Base64DotSlashOrderedTest.php │ │ │ ├── HexTest.php │ │ │ ├── Base32Test.php │ │ │ ├── Base32HexTest.php │ │ │ └── Base64UrlSafeTest.php │ │ ├── composer.json │ │ ├── src │ │ │ ├── EncoderInterface.php │ │ │ ├── Binary.php │ │ │ ├── Base64DotSlashOrdered.php │ │ │ ├── Base64DotSlash.php │ │ │ └── Base64UrlSafe.php │ │ ├── LICENSE.txt │ │ └── README.md │ └── random_compat │ │ ├── build-phar.sh │ │ ├── dist │ │ ├── random_compat.phar.pubkey │ │ └── random_compat.phar.pubkey.asc │ │ ├── psalm-autoload.php │ │ ├── composer.json │ │ ├── LICENSE │ │ ├── psalm.xml │ │ ├── other │ │ └── build_phar.php │ │ └── lib │ │ ├── error_polyfill.php │ │ ├── random_bytes_mcrypt.php │ │ ├── cast_to_int.php │ │ ├── random_bytes_libsodium_legacy.php │ │ ├── random_bytes_libsodium.php │ │ └── random_bytes_com_dotnet.php ├── dasprid │ └── enum │ │ ├── .gitignore │ │ ├── .coveralls.yml │ │ ├── src │ │ ├── Exception │ │ │ ├── ExceptionInterface.php │ │ │ ├── MismatchException.php │ │ │ ├── ExpectationException.php │ │ │ ├── IllegalArgumentException.php │ │ │ ├── CloneNotSupportedException.php │ │ │ ├── SerializeNotSupportedException.php │ │ │ └── UnserializeNotSupportedException.php │ │ └── NullValue.php │ │ ├── phpunit.xml.dist │ │ ├── test │ │ ├── WeekDay.php │ │ ├── NullValueTest.php │ │ └── Planet.php │ │ ├── composer.json │ │ ├── phpcs.xml │ │ └── .travis.yml ├── autoload.php ├── composer │ ├── autoload_classmap.php │ ├── autoload_namespaces.php │ ├── autoload_files.php │ ├── autoload_psr4.php │ ├── LICENSE │ ├── autoload_real.php │ └── autoload_static.php ├── bacon │ └── bacon-qr-code │ │ ├── src │ │ ├── Exception │ │ │ ├── WriterException.php │ │ │ ├── ExceptionInterface.php │ │ │ ├── RuntimeException.php │ │ │ ├── OutOfBoundsException.php │ │ │ ├── InvalidArgumentException.php │ │ │ └── UnexpectedValueException.php │ │ ├── Renderer │ │ │ ├── RendererInterface.php │ │ │ ├── Path │ │ │ │ ├── OperationInterface.php │ │ │ │ ├── Close.php │ │ │ │ ├── Line.php │ │ │ │ ├── Move.php │ │ │ │ ├── Curve.php │ │ │ │ └── Path.php │ │ │ ├── Color │ │ │ │ ├── ColorInterface.php │ │ │ │ ├── Gray.php │ │ │ │ ├── Alpha.php │ │ │ │ ├── Rgb.php │ │ │ │ └── Cmyk.php │ │ │ ├── Module │ │ │ │ ├── ModuleInterface.php │ │ │ │ ├── SquareModule.php │ │ │ │ ├── DotsModule.php │ │ │ │ └── EdgeIterator │ │ │ │ │ └── Edge.php │ │ │ ├── RendererStyle │ │ │ │ ├── GradientType.php │ │ │ │ ├── Gradient.php │ │ │ │ ├── EyeFill.php │ │ │ │ └── RendererStyle.php │ │ │ ├── Eye │ │ │ │ ├── EyeInterface.php │ │ │ │ ├── CompositeEye.php │ │ │ │ ├── SquareEye.php │ │ │ │ ├── ModuleEye.php │ │ │ │ └── SimpleCircleEye.php │ │ │ ├── Image │ │ │ │ ├── TransformationMatrix.php │ │ │ │ └── ImageBackEndInterface.php │ │ │ └── PlainTextRenderer.php │ │ ├── Common │ │ │ ├── BitUtils.php │ │ │ ├── EcBlock.php │ │ │ ├── ErrorCorrectionLevel.php │ │ │ ├── EcBlocks.php │ │ │ └── Mode.php │ │ ├── Encoder │ │ │ ├── BlockPair.php │ │ │ └── QrCode.php │ │ └── Writer.php │ │ ├── CHANGELOG.md │ │ ├── composer.json │ │ ├── LICENSE │ │ └── README.md └── symfony │ ├── polyfill-util │ ├── README.md │ ├── Binary.php │ ├── composer.json │ ├── LICENSE │ ├── BinaryNoFuncOverload.php │ ├── BinaryOnFuncOverload.php │ ├── LegacyTestListener.php │ └── TestListener.php │ └── polyfill-php56 │ ├── README.md │ ├── composer.json │ ├── LICENSE │ └── bootstrap.php ├── authenticator ├── fields │ ├── qrcode │ │ ├── assets │ │ │ └── css │ │ │ │ └── qrcode.css │ │ └── qrcode.php │ └── authenticator │ │ ├── assets │ │ └── css │ │ │ └── authenticator.css │ │ └── authenticator.php ├── blueprints │ └── users │ │ └── default.yml ├── views │ ├── settings │ │ └── index.php │ └── auth │ │ └── login.php ├── forms │ ├── settings │ │ ├── backup.php │ │ ├── turn-off.php │ │ └── turn-on.php │ └── auth │ │ └── login.php └── translations │ ├── en.json │ ├── nl_BE.json │ └── pt_BR.json ├── package.json ├── .editorconfig ├── composer.json ├── authenticator.php └── src ├── Exceptions ├── InvalidBackupCode.php └── InvalidOrExpiredCode.php ├── View.php ├── Roots.php ├── Authenticator.php ├── bootstrap.php └── Controllers └── LoginController.php /.gitignore: -------------------------------------------------------------------------------- 1 | .php_cs.cache 2 | -------------------------------------------------------------------------------- /vendor/pragmarx/google2fa/tests/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /vendor/pragmarx/google2fa/upgrading.md: -------------------------------------------------------------------------------- 1 | # Google2FA 2 | 3 | -------------------------------------------------------------------------------- /vendor/paragonie/constant_time_encoding/.gitignore: -------------------------------------------------------------------------------- 1 | .idea/ 2 | vendor/ -------------------------------------------------------------------------------- /vendor/pragmarx/google2fa/.gitignore: -------------------------------------------------------------------------------- 1 | composer.phar 2 | vendor 3 | coverage 4 | -------------------------------------------------------------------------------- /vendor/dasprid/enum/.gitignore: -------------------------------------------------------------------------------- 1 | /composer.lock 2 | /phpunit.xml 3 | /vendor/ 4 | -------------------------------------------------------------------------------- /authenticator/fields/qrcode/assets/css/qrcode.css: -------------------------------------------------------------------------------- 1 | .qrcode { 2 | text-align: center; 3 | } 4 | -------------------------------------------------------------------------------- /authenticator/blueprints/users/default.yml: -------------------------------------------------------------------------------- 1 | fields: 2 | authenticator: 3 | type: authenticator 4 | -------------------------------------------------------------------------------- /vendor/dasprid/enum/.coveralls.yml: -------------------------------------------------------------------------------- 1 | coverage_clover: clover.xml 2 | json_path: coveralls-upload.json 3 | -------------------------------------------------------------------------------- /authenticator/views/settings/index.php: -------------------------------------------------------------------------------- 1 |
4 | -------------------------------------------------------------------------------- /vendor/pragmarx/google2fa/docs/playground.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pedroborges/kirby-authenticator/HEAD/vendor/pragmarx/google2fa/docs/playground.jpg -------------------------------------------------------------------------------- /vendor/paragonie/random_compat/build-phar.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | basedir=$( dirname $( readlink -f ${BASH_SOURCE[0]} ) ) 4 | 5 | php -dphar.readonly=0 "$basedir/other/build_phar.php" $* -------------------------------------------------------------------------------- /vendor/autoload.php: -------------------------------------------------------------------------------- 1 | ", 4 | "version": "1.0.0-beta", 5 | "description": "Kirby Authenticator", 6 | "type": "kirby-plugin", 7 | "license": "MIT" 8 | } 9 | -------------------------------------------------------------------------------- /vendor/bacon/bacon-qr-code/src/Exception/WriterException.php: -------------------------------------------------------------------------------- 1 | 2 |16 | * 17 | * @internal 18 | */ 19 | class BinaryNoFuncOverload 20 | { 21 | public static function strlen($s) 22 | { 23 | return \strlen($s); 24 | } 25 | 26 | public static function strpos($haystack, $needle, $offset = 0) 27 | { 28 | return strpos($haystack, $needle, $offset); 29 | } 30 | 31 | public static function strrpos($haystack, $needle, $offset = 0) 32 | { 33 | return strrpos($haystack, $needle, $offset); 34 | } 35 | 36 | public static function substr($string, $start, $length = PHP_INT_MAX) 37 | { 38 | return substr($string, $start, $length); 39 | } 40 | 41 | public static function stripos($s, $needle, $offset = 0) 42 | { 43 | return stripos($s, $needle, $offset); 44 | } 45 | 46 | public static function stristr($s, $needle, $part = false) 47 | { 48 | return stristr($s, $needle, $part); 49 | } 50 | 51 | public static function strrchr($s, $needle, $part = false) 52 | { 53 | return strrchr($s, $needle, $part); 54 | } 55 | 56 | public static function strripos($s, $needle, $offset = 0) 57 | { 58 | return strripos($s, $needle, $offset); 59 | } 60 | 61 | public static function strstr($s, $needle, $part = false) 62 | { 63 | return strstr($s, $needle, $part); 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /vendor/paragonie/constant_time_encoding/tests/Base64UrlSafeTest.php: -------------------------------------------------------------------------------- 1 | assertSame( 26 | $random, 27 | Base64UrlSafe::decode($enc) 28 | ); 29 | $this->assertSame( 30 | \strtr(\base64_encode($random), '+/', '-_'), 31 | $enc 32 | ); 33 | 34 | $unpadded = \rtrim($enc, '='); 35 | $this->assertSame( 36 | $unpadded, 37 | Base64UrlSafe::encodeUnpadded($random) 38 | ); 39 | $this->assertSame( 40 | $random, 41 | Base64UrlSafe::decode($unpadded) 42 | ); 43 | } 44 | } 45 | 46 | $random = \random_bytes(1 << 20); 47 | $enc = Base64UrlSafe::encode($random); 48 | $this->assertTrue(Binary::safeStrlen($enc) > 65536); 49 | $this->assertSame( 50 | $random, 51 | Base64UrlSafe::decode($enc) 52 | ); 53 | $this->assertSame( 54 | \strtr(\base64_encode($random), '+/', '-_'), 55 | $enc 56 | ); 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /vendor/bacon/bacon-qr-code/README.md: -------------------------------------------------------------------------------- 1 | # QR Code generator 2 | 3 | [](http://travis-ci.org/Bacon/BaconQrCode) 4 | [](https://coveralls.io/github/Bacon/BaconQrCode?branch=master) 5 | [](https://packagist.org/packages/bacon/bacon-qr-code) 6 | [](https://packagist.org/packages/bacon/bacon-qr-code) 7 | [](https://packagist.org/packages/bacon/bacon-qr-code) 8 | 9 | 10 | ## Introduction 11 | BaconQrCode is a port of QR code portion of the ZXing library. It currently 12 | only features the encoder part, but could later receive the decoder part as 13 | well. 14 | 15 | As the Reed Solomon codec implementation of the ZXing library performs quite 16 | slow in PHP, it was exchanged with the implementation by Phil Karn. 17 | 18 | 19 | ## Example usage 20 | ```php 21 | use BaconQrCode\Renderer\ImageRenderer; 22 | use BaconQrCode\Renderer\Image\ImagickImageBackEnd; 23 | use BaconQrCode\Renderer\RendererStyle\RendererStyle; 24 | use BaconQrCode\Writer; 25 | 26 | $renderer = new ImageRenderer( 27 | new RendererStyle(400), 28 | new ImagickImageBackEnd() 29 | ); 30 | $writer = new Writer($renderer); 31 | $writer->writeFile('Hello World!', 'qrcode.png'); 32 | ``` 33 | 34 | ## Available image renderer back ends 35 | BaconQrCode comes with multiple back ends for rendering images. Currently included are the following: 36 | 37 | - `ImagickImageBackEnd`: renders raster images using the Imagick library 38 | - `SvgImageBackEnd`: renders SVG files using XMLWriter 39 | - `EpsImageBackEnd`: renders EPS files 40 | -------------------------------------------------------------------------------- /vendor/paragonie/random_compat/other/build_phar.php: -------------------------------------------------------------------------------- 1 | buildFromDirectory(dirname(__DIR__).'/lib'); 19 | rename( 20 | dirname(__DIR__).'/lib/index.php', 21 | dirname(__DIR__).'/lib/random.php' 22 | ); 23 | 24 | /** 25 | * If we pass an (optional) path to a private key as a second argument, we will 26 | * sign the Phar with OpenSSL. 27 | * 28 | * If you leave this out, it will produce an unsigned .phar! 29 | */ 30 | if ($argc > 1) { 31 | if (!@is_readable($argv[1])) { 32 | echo 'Could not read the private key file:', $argv[1], "\n"; 33 | exit(255); 34 | } 35 | $pkeyFile = file_get_contents($argv[1]); 36 | 37 | $private = openssl_get_privatekey($pkeyFile); 38 | if ($private !== false) { 39 | $pkey = ''; 40 | openssl_pkey_export($private, $pkey); 41 | $phar->setSignatureAlgorithm(Phar::OPENSSL, $pkey); 42 | 43 | /** 44 | * Save the corresponding public key to the file 45 | */ 46 | if (!@is_readable($dist.'/random_compat.phar.pubkey')) { 47 | $details = openssl_pkey_get_details($private); 48 | file_put_contents( 49 | $dist.'/random_compat.phar.pubkey', 50 | $details['key'] 51 | ); 52 | } 53 | } else { 54 | echo 'An error occurred reading the private key from OpenSSL.', "\n"; 55 | exit(255); 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /vendor/bacon/bacon-qr-code/src/Renderer/Path/Curve.php: -------------------------------------------------------------------------------- 1 | x1 = $x1; 41 | $this->y1 = $y1; 42 | $this->x2 = $x2; 43 | $this->y2 = $y2; 44 | $this->x3 = $x3; 45 | $this->y3 = $y3; 46 | } 47 | 48 | public function getX1() : float 49 | { 50 | return $this->x1; 51 | } 52 | 53 | public function getY1() : float 54 | { 55 | return $this->y1; 56 | } 57 | 58 | public function getX2() : float 59 | { 60 | return $this->x2; 61 | } 62 | 63 | public function getY2() : float 64 | { 65 | return $this->y2; 66 | } 67 | 68 | public function getX3() : float 69 | { 70 | return $this->x3; 71 | } 72 | 73 | public function getY3() : float 74 | { 75 | return $this->y3; 76 | } 77 | 78 | /** 79 | * @return self 80 | */ 81 | public function translate(float $x, float $y) : OperationInterface 82 | { 83 | return new self( 84 | $this->x1 + $x, 85 | $this->y1 + $y, 86 | $this->x2 + $x, 87 | $this->y2 + $y, 88 | $this->x3 + $x, 89 | $this->y3 + $y 90 | ); 91 | } 92 | } 93 | -------------------------------------------------------------------------------- /authenticator/forms/settings/turn-on.php: -------------------------------------------------------------------------------- 1 | [ 6 | 'label' => 'authenticator.turnOn.label', 7 | 'type' => 'info', 8 | 'text' => l('authenticator.turnOn.text', [ 9 | 'ios' => 'iOS', 10 | 'android' => 'Android', 11 | 'windows' => 'Windows Mobile' 12 | ]) 13 | ], 14 | 'qrcode' => [ 15 | 'label' => 'authenticator.turnOn.qrcode.label', 16 | 'type' => 'qrcode', 17 | 'text' => 'authenticator.turnOn.qrcode.text', 18 | 'code' => $url, 19 | 'size' => 150 20 | ], 21 | // TODO: Require security code confirmation 22 | 'security_code' => [ 23 | 'label' => 'authenticator.securityCode.confirmation.label', 24 | 'type' => 'number', 25 | 'icon' => 'shield', 26 | 'placeholder' => null, 27 | 'min' => 1, 28 | 'max' => 999999, 29 | 'help' => 'authenticator.securityCode.help', 30 | 'required' => true, 31 | 'autofocus' => true 32 | ] 33 | ]); 34 | 35 | $form->attr('autocomplete', 'off'); 36 | $form->data('autosubmit', 'native'); 37 | 38 | $form->cancel('users/' . $user->username . '/edit'); 39 | 40 | $form->buttons->submit->addClass('btn-positive'); 41 | $form->buttons->submit->value = l('authenticator.toggle.on'); 42 | 43 | return $form; 44 | }; 45 | -------------------------------------------------------------------------------- /vendor/paragonie/random_compat/lib/error_polyfill.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Symfony\Polyfill\Util; 13 | 14 | /** 15 | * Binary safe version of string functions overloaded when MB_OVERLOAD_STRING is enabled. 16 | * 17 | * @author Nicolas Grekas
18 | * 19 | * @internal 20 | */ 21 | class BinaryOnFuncOverload 22 | { 23 | public static function strlen($s) 24 | { 25 | return mb_strlen($s, '8bit'); 26 | } 27 | 28 | public static function strpos($haystack, $needle, $offset = 0) 29 | { 30 | return mb_strpos($haystack, $needle, $offset, '8bit'); 31 | } 32 | 33 | public static function strrpos($haystack, $needle, $offset = 0) 34 | { 35 | return mb_strrpos($haystack, $needle, $offset, '8bit'); 36 | } 37 | 38 | public static function substr($string, $start, $length = 2147483647) 39 | { 40 | return mb_substr($string, $start, $length, '8bit'); 41 | } 42 | 43 | public static function stripos($s, $needle, $offset = 0) 44 | { 45 | return mb_stripos($s, $needle, $offset, '8bit'); 46 | } 47 | 48 | public static function stristr($s, $needle, $part = false) 49 | { 50 | return mb_stristr($s, $needle, $part, '8bit'); 51 | } 52 | 53 | public static function strrchr($s, $needle, $part = false) 54 | { 55 | return mb_strrchr($s, $needle, $part, '8bit'); 56 | } 57 | 58 | public static function strripos($s, $needle, $offset = 0) 59 | { 60 | return mb_strripos($s, $needle, $offset, '8bit'); 61 | } 62 | 63 | public static function strstr($s, $needle, $part = false) 64 | { 65 | return mb_strstr($s, $needle, $part, '8bit'); 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /vendor/dasprid/enum/test/Planet.php: -------------------------------------------------------------------------------- 1 | mass = $mass; 51 | $this->radius = $radius; 52 | } 53 | 54 | public function mass() : float 55 | { 56 | return $this->mass; 57 | } 58 | 59 | public function radius() : float 60 | { 61 | return $this->radius; 62 | } 63 | 64 | public function surfaceGravity() : float 65 | { 66 | return self::G * $this->mass / ($this->radius * $this->radius); 67 | } 68 | 69 | public function surfaceWeight(float $otherMass) : float 70 | { 71 | return $otherMass * $this->surfaceGravity(); 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /vendor/bacon/bacon-qr-code/src/Common/EcBlocks.php: -------------------------------------------------------------------------------- 1 | ecCodewordsPerBlock = $ecCodewordsPerBlock; 32 | $this->ecBlocks = $ecBlocks; 33 | } 34 | 35 | /** 36 | * Returns the number of EC codewords per block. 37 | */ 38 | public function getEcCodewordsPerBlock() : int 39 | { 40 | return $this->ecCodewordsPerBlock; 41 | } 42 | 43 | /** 44 | * Returns the total number of EC block appearances. 45 | */ 46 | public function getNumBlocks() : int 47 | { 48 | $total = 0; 49 | 50 | foreach ($this->ecBlocks as $ecBlock) { 51 | $total += $ecBlock->getCount(); 52 | } 53 | 54 | return $total; 55 | } 56 | 57 | /** 58 | * Returns the total count of EC codewords. 59 | */ 60 | public function getTotalEcCodewords() : int 61 | { 62 | return $this->ecCodewordsPerBlock * $this->getNumBlocks(); 63 | } 64 | 65 | /** 66 | * Returns the EC blocks included in this collection. 67 | * 68 | * @return EcBlock[] 69 | */ 70 | public function getEcBlocks() : array 71 | { 72 | return $this->ecBlocks; 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /vendor/bacon/bacon-qr-code/src/Writer.php: -------------------------------------------------------------------------------- 1 | renderer = $renderer; 29 | } 30 | 31 | /** 32 | * Writes QR code and returns it as string. 33 | * 34 | * Content is a string which *should* be encoded in UTF-8, in case there are 35 | * non ASCII-characters present. 36 | * 37 | * @throws InvalidArgumentException if the content is empty 38 | */ 39 | public function writeString( 40 | string $content, 41 | string $encoding = Encoder::DEFAULT_BYTE_MODE_ECODING, 42 | ?ErrorCorrectionLevel $ecLevel = null 43 | ) : string { 44 | if (strlen($content) === 0) { 45 | throw new InvalidArgumentException('Found empty contents'); 46 | } 47 | 48 | if (null === $ecLevel) { 49 | $ecLevel = ErrorCorrectionLevel::L(); 50 | } 51 | 52 | return $this->renderer->render(Encoder::encode($content, $ecLevel, $encoding)); 53 | } 54 | 55 | /** 56 | * Writes QR code to a file. 57 | * 58 | * @see Writer::writeString() 59 | */ 60 | public function writeFile( 61 | string $content, 62 | string $filename, 63 | string $encoding = Encoder::DEFAULT_BYTE_MODE_ECODING, 64 | ?ErrorCorrectionLevel $ecLevel = null 65 | ) : void { 66 | file_put_contents($filename, $this->writeString($content, $encoding, $ecLevel)); 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /vendor/bacon/bacon-qr-code/src/Renderer/RendererStyle/EyeFill.php: -------------------------------------------------------------------------------- 1 | externalColor = $externalColor; 29 | $this->internalColor = $internalColor; 30 | } 31 | 32 | public static function uniform(ColorInterface $color) : self 33 | { 34 | return new self($color, $color); 35 | } 36 | 37 | public static function inherit() : self 38 | { 39 | return self::$inherit ?: self::$inherit = new self(null, null); 40 | } 41 | 42 | public function inheritsBothColors() : bool 43 | { 44 | return null === $this->externalColor && null === $this->internalColor; 45 | } 46 | 47 | public function inheritsExternalColor() : bool 48 | { 49 | return null === $this->externalColor; 50 | } 51 | 52 | public function inheritsInternalColor() : bool 53 | { 54 | return null === $this->internalColor; 55 | } 56 | 57 | public function getExternalColor() : ColorInterface 58 | { 59 | if (null === $this->externalColor) { 60 | throw new RuntimeException('External eye color inherits foreground color'); 61 | } 62 | 63 | return $this->externalColor; 64 | } 65 | 66 | public function getInternalColor() : ColorInterface 67 | { 68 | if (null === $this->internalColor) { 69 | throw new RuntimeException('Internal eye color inherits foreground color'); 70 | } 71 | 72 | return $this->internalColor; 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /vendor/bacon/bacon-qr-code/src/Renderer/Module/DotsModule.php: -------------------------------------------------------------------------------- 1 | 1) { 27 | throw new InvalidArgumentException('Size must between 0 (exclusive) and 1 (inclusive)'); 28 | } 29 | 30 | $this->size = $size; 31 | } 32 | 33 | public function createPath(ByteMatrix $matrix) : Path 34 | { 35 | $width = $matrix->getWidth(); 36 | $height = $matrix->getHeight(); 37 | $path = new Path(); 38 | $halfSize = $this->size / 2; 39 | $margin = (1 - $this->size) / 2; 40 | 41 | for ($y = 0; $y < $height; ++$y) { 42 | for ($x = 0; $x < $width; ++$x) { 43 | if (! $matrix->get($x, $y)) { 44 | continue; 45 | } 46 | 47 | $pathX = $x + $margin; 48 | $pathY = $y + $margin; 49 | 50 | $path = $path 51 | ->move($pathX + $this->size, $pathY + $halfSize) 52 | ->ellipticArc($halfSize, $halfSize, 0, false, true, $pathX + $halfSize, $pathY + $this->size) 53 | ->ellipticArc($halfSize, $halfSize, 0, false, true, $pathX, $pathY + $halfSize) 54 | ->ellipticArc($halfSize, $halfSize, 0, false, true, $pathX + $halfSize, $pathY) 55 | ->ellipticArc($halfSize, $halfSize, 0, false, true, $pathX + $this->size, $pathY + $halfSize) 56 | ->close() 57 | ; 58 | } 59 | } 60 | 61 | return $path; 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /vendor/bacon/bacon-qr-code/src/Renderer/RendererStyle/RendererStyle.php: -------------------------------------------------------------------------------- 1 | margin = $margin; 46 | $this->size = $size; 47 | $this->module = $module ?: SquareModule::instance(); 48 | $this->eye = $eye ?: new ModuleEye($this->module); 49 | $this->fill = $fill ?: Fill::default(); 50 | } 51 | 52 | public function withSize(int $size) : self 53 | { 54 | $style = clone $this; 55 | $style->size = $size; 56 | return $style; 57 | } 58 | 59 | public function withMargin(int $margin) : self 60 | { 61 | $style = clone $this; 62 | $style->margin = $margin; 63 | return $style; 64 | } 65 | 66 | public function getSize() : int 67 | { 68 | return $this->size; 69 | } 70 | 71 | public function getMargin() : int 72 | { 73 | return $this->margin; 74 | } 75 | 76 | public function getModule() : ModuleInterface 77 | { 78 | return $this->module; 79 | } 80 | 81 | public function getEye() : EyeInterface 82 | { 83 | return $this->eye; 84 | } 85 | 86 | public function getFill() : Fill 87 | { 88 | return $this->fill; 89 | } 90 | } 91 | -------------------------------------------------------------------------------- /vendor/paragonie/constant_time_encoding/src/EncoderInterface.php: -------------------------------------------------------------------------------- 1 | values = [1, 0, 0, 1, 0, 0]; 16 | } 17 | 18 | public function multiply(self $other) : self 19 | { 20 | $matrix = new self(); 21 | $matrix->values[0] = $this->values[0] * $other->values[0] + $this->values[2] * $other->values[1]; 22 | $matrix->values[1] = $this->values[1] * $other->values[0] + $this->values[3] * $other->values[1]; 23 | $matrix->values[2] = $this->values[0] * $other->values[2] + $this->values[2] * $other->values[3]; 24 | $matrix->values[3] = $this->values[1] * $other->values[2] + $this->values[3] * $other->values[3]; 25 | $matrix->values[4] = $this->values[0] * $other->values[4] + $this->values[2] * $other->values[5] 26 | + $this->values[4]; 27 | $matrix->values[5] = $this->values[1] * $other->values[4] + $this->values[3] * $other->values[5] 28 | + $this->values[5]; 29 | 30 | return $matrix; 31 | } 32 | 33 | public static function scale(float $size) : self 34 | { 35 | $matrix = new self(); 36 | $matrix->values = [$size, 0, 0, $size, 0, 0]; 37 | return $matrix; 38 | } 39 | 40 | public static function translate(float $x, float $y) : self 41 | { 42 | $matrix = new self(); 43 | $matrix->values = [1, 0, 0, 1, $x, $y]; 44 | return $matrix; 45 | } 46 | 47 | public static function rotate(int $degrees) : self 48 | { 49 | $matrix = new self(); 50 | $matrix->values = [cos($degrees), sin($degrees), -sin($degrees), cos($degrees), 0, 0]; 51 | return $matrix; 52 | } 53 | 54 | 55 | /** 56 | * Applies this matrix onto a point and returns the resulting viewport point. 57 | * 58 | * @return float[] 59 | */ 60 | public function apply(float $x, float $y) : array 61 | { 62 | return [ 63 | $x * $this->values[0] + $y * $this->values[2] + $this->values[4], 64 | $x * $this->values[2] + $x * $this->values[3] + $this->values[5], 65 | ]; 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /vendor/bacon/bacon-qr-code/src/Renderer/Color/Rgb.php: -------------------------------------------------------------------------------- 1 | 255) { 33 | throw new Exception\InvalidArgumentException('Red must be between 0 and 255'); 34 | } 35 | 36 | if ($green < 0 || $green > 255) { 37 | throw new Exception\InvalidArgumentException('Green must be between 0 and 255'); 38 | } 39 | 40 | if ($blue < 0 || $blue > 255) { 41 | throw new Exception\InvalidArgumentException('Blue must be between 0 and 255'); 42 | } 43 | 44 | $this->red = $red; 45 | $this->green = $green; 46 | $this->blue = $blue; 47 | } 48 | 49 | public function getRed() : int 50 | { 51 | return $this->red; 52 | } 53 | 54 | public function getGreen() : int 55 | { 56 | return $this->green; 57 | } 58 | 59 | public function getBlue() : int 60 | { 61 | return $this->blue; 62 | } 63 | 64 | public function toRgb() : Rgb 65 | { 66 | return $this; 67 | } 68 | 69 | public function toCmyk() : Cmyk 70 | { 71 | $c = 1 - ($this->red / 255); 72 | $m = 1 - ($this->green / 255); 73 | $y = 1 - ($this->blue / 255); 74 | $k = min($c, $m, $y); 75 | 76 | return new Cmyk( 77 | (int) (100 * ($c - $k) / (1 - $k)), 78 | (int) (100 * ($m - $k) / (1 - $k)), 79 | (int) (100 * ($y - $k) / (1 - $k)), 80 | (int) (100 * $k) 81 | ); 82 | } 83 | 84 | public function toGray() : Gray 85 | { 86 | return new Gray((int) (($this->red * 0.21 + $this->green * 0.71 + $this->blue * 0.07) / 2.55)); 87 | } 88 | } 89 | -------------------------------------------------------------------------------- /vendor/pragmarx/google2fa/changelog.md: -------------------------------------------------------------------------------- 1 | ## Change Log 2 | 3 | ## [3.0.1] - 2018-03-15 4 | ### Changed 5 | - Relicensed to MIT 6 | 7 | ## [3.0.0] - 2018-03-07 8 | ### Changed 9 | - It's now mandatory to enable Google Api secret key access by executing `setAllowInsecureCallToGoogleApis(true);` 10 | 11 | ## [2.0.4] - 2017-06-22 12 | ### Fixed 13 | - Fix Base32 to keep supporting PHP 5.4 && 5.5. 14 | 15 | ## [2.0.3] - 2017-06-22 16 | ## [2.0.2] - 2017-06-21 17 | ## [2.0.1] - 2017-06-20 18 | ### Fixed 19 | - Minor bugs 20 | 21 | ## [2.0.0] - 2017-06-20 22 | ### Changed 23 | - Drop the Laravel support in favor of a bridge package (https://github.com/antonioribeiro/google2fa-laravel). 24 | - Using a more secure Base 32 algorithm, to prevent cache-timing attacks. 25 | - Added verifyKeyNewer() method to prevent reuse of keys. 26 | - Refactored to remove complexity, by extracting support methods. 27 | - Created a package playground page (https://pragmarx.com/google2fa) 28 | 29 | ## [2.0.0] - 2017-06-20 30 | ### Changed 31 | - Drop the Laravel support in favor of a bridge package (https://github.com/antonioribeiro/google2fa-laravel). 32 | - Using a more secure Base 32 algorithm, to prevent cache-timing attacks. 33 | - Added verifyKeyNewer() method to prevent reuse of keys. 34 | - Refactored to remove complexity, by extracting support methods. 35 | - Created a package playground page (https://pragmarx.com/google2fa) 36 | 37 | ## [1.0.1] - 2016-07-18 38 | ### Changed 39 | - Drop support for PHP 5.3.7, require PHP 5.4+. 40 | - Coding style is now PSR-2 automatically enforced by StyleCI. 41 | 42 | ## [1.0.0] - 2016-07-17 43 | ### Changed 44 | - Package bacon/bacon-qr-code was moved to "suggest". 45 | 46 | ## [0.8.1] - 2016-07-17 47 | ### Fixed 48 | - Allow paragonie/random_compat ~1.4|~2.0. 49 | 50 | ## [0.8.0] - 2016-07-17 51 | ### Changed 52 | - Bumped christian-riesen/base32 to ~1.3 53 | - Use paragonie/random_compat to generate cryptographically secure random secret keys 54 | - Readme improvements 55 | - Drop simple-qrcode in favor of bacon/bacon-qr-code 56 | - Fix tavis setup for phpspec, PHP 7, hhvm and improve cache 57 | 58 | ## [0.7.0] - 2015-11-07 59 | ### Changed 60 | - Fixed URL generation for QRCodes 61 | - Avoid time attacks 62 | 63 | ## [0.2.0] - 2015-02-19 64 | ### Changed 65 | - Laravel 5 compatibility. 66 | 67 | ## [0.1.0] - 2014-07-06 68 | ### Added 69 | - First version. 70 | -------------------------------------------------------------------------------- /vendor/bacon/bacon-qr-code/src/Common/Mode.php: -------------------------------------------------------------------------------- 1 | characterCountBitsForVersions = $characterCountBitsForVersions; 48 | $this->bits = $bits; 49 | } 50 | 51 | /** 52 | * Returns the number of bits used in a specific QR code version. 53 | */ 54 | public function getCharacterCountBits(Version $version) : int 55 | { 56 | $number = $version->getVersionNumber(); 57 | 58 | if ($number <= 9) { 59 | $offset = 0; 60 | } elseif ($number <= 26) { 61 | $offset = 1; 62 | } else { 63 | $offset = 2; 64 | } 65 | 66 | return $this->characterCountBitsForVersions[$offset]; 67 | } 68 | 69 | /** 70 | * Returns the four bits used to encode this mode. 71 | */ 72 | public function getBits() : int 73 | { 74 | return $this->bits; 75 | } 76 | } 77 | -------------------------------------------------------------------------------- /authenticator/fields/authenticator/authenticator.php: -------------------------------------------------------------------------------- 1 | [ 7 | 'authenticator.css' 8 | ] 9 | ]; 10 | 11 | public function isOn() 12 | { 13 | return 16 === strlen($this->model()->authenticatorsecret); 14 | } 15 | 16 | public function label() 17 | { 18 | $status = $this->isOn() 19 | ? '' . l('authenticator.field.status.on') . '' 20 | : '' . l('authenticator.field.status.off') . ''; 21 | 22 | $label = new Brick('label', l('authenticator.field.label', compact('status'))); 23 | $label->addClass('label'); 24 | 25 | return $label; 26 | } 27 | 28 | public function help() 29 | { 30 | $text = $this->isOn() 31 | ? l('authenticator.field.info.on') 32 | : l('authenticator.field.info.off'); 33 | 34 | $help = new Brick('div', $text); 35 | $help->addClass('field-help marginalia text'); 36 | 37 | return $help; 38 | } 39 | 40 | public function content() 41 | { 42 | if (! $this->canEdit()) { 43 | return null; 44 | } 45 | 46 | $username = $this->model()->username; 47 | 48 | $action = $this->isOn() ? 'off' : 'on'; 49 | $icon = $this->isOn() ? 'fa-toggle-off' : 'fa-toggle-on'; 50 | $text = $this->isOn() ? l('authenticator.toggle.off') : l('authenticator.toggle.on'); 51 | 52 | $button = new Brick('a'); 53 | $button->addClass('label-option'); 54 | $button->data('modal', true); 55 | $button->attr('href', purl('users/' . $username . '/two-steps/' . $action)); 56 | $button->html('' . $text); 57 | 58 | return $button; 59 | } 60 | 61 | public function element() 62 | { 63 | $status = $this->isOn() 64 | ? 'two-steps--on' 65 | : 'two-steps--off'; 66 | 67 | return parent::element()->addClass($status); 68 | } 69 | 70 | protected function canEdit() 71 | { 72 | // TODO: allow admin to enable/disable two-step login for other users 73 | // return $this->model()->username == site()->user() || site()->user()->isAdmin(); 74 | return $this->model()->username == site()->user(); 75 | } 76 | } 77 | -------------------------------------------------------------------------------- /vendor/symfony/polyfill-util/LegacyTestListener.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Symfony\Polyfill\Util; 13 | 14 | /** 15 | * @author Nicolas Grekas
16 | */
17 | class LegacyTestListener extends \PHPUnit_Framework_TestSuite implements \PHPUnit_Framework_TestListener
18 | {
19 | private $suite;
20 | private $trait;
21 |
22 | public function __construct(\PHPUnit_Framework_TestSuite $suite = null)
23 | {
24 | if ($suite) {
25 | $this->suite = $suite;
26 | $this->setName($suite->getName().' with polyfills enabled');
27 | $this->addTest($suite);
28 | }
29 | $this->trait = new TestListenerTrait();
30 | }
31 |
32 | public function startTestSuite(\PHPUnit_Framework_TestSuite $suite)
33 | {
34 | $this->trait->startTestSuite($suite);
35 | }
36 |
37 | protected function setUp()
38 | {
39 | TestListenerTrait::$enabledPolyfills = $this->suite->getName();
40 | }
41 |
42 | protected function tearDown()
43 | {
44 | TestListenerTrait::$enabledPolyfills = false;
45 | }
46 |
47 | public function addError(\PHPUnit_Framework_Test $test, \Exception $e, $time)
48 | {
49 | $this->trait->addError($test, $e, $time);
50 | }
51 |
52 | public function addWarning(\PHPUnit_Framework_Test $test, \PHPUnit_Framework_Warning $e, $time)
53 | {
54 | }
55 |
56 | public function addFailure(\PHPUnit_Framework_Test $test, \PHPUnit_Framework_AssertionFailedError $e, $time)
57 | {
58 | $this->trait->addError($test, $e, $time);
59 | }
60 |
61 | public function addIncompleteTest(\PHPUnit_Framework_Test $test, \Exception $e, $time)
62 | {
63 | }
64 |
65 | public function addRiskyTest(\PHPUnit_Framework_Test $test, \Exception $e, $time)
66 | {
67 | }
68 |
69 | public function addSkippedTest(\PHPUnit_Framework_Test $test, \Exception $e, $time)
70 | {
71 | }
72 |
73 | public function endTestSuite(\PHPUnit_Framework_TestSuite $suite)
74 | {
75 | }
76 |
77 | public function startTest(\PHPUnit_Framework_Test $test)
78 | {
79 | }
80 |
81 | public function endTest(\PHPUnit_Framework_Test $test, $time)
82 | {
83 | }
84 | }
85 |
--------------------------------------------------------------------------------
/vendor/bacon/bacon-qr-code/src/Renderer/PlainTextRenderer.php:
--------------------------------------------------------------------------------
1 | margin = $margin;
39 | }
40 |
41 | /**
42 | * @throws InvalidArgumentException if matrix width doesn't match height
43 | */
44 | public function render(QrCode $qrCode) : string
45 | {
46 | $matrix = $qrCode->getMatrix();
47 | $matrixSize = $matrix->getWidth();
48 |
49 | if ($matrixSize !== $matrix->getHeight()) {
50 | throw new InvalidArgumentException('Matrix must have the same width and height');
51 | }
52 |
53 | $rows = $matrix->getArray()->toArray();
54 |
55 | if (0 !== $matrixSize % 2) {
56 | $rows[] = array_fill(0, $matrixSize, 0);
57 | }
58 |
59 | $horizontalMargin = str_repeat(self::EMPTY_BLOCK, $this->margin);
60 | $result = str_repeat("\n", (int) ceil($this->margin / 2));
61 |
62 | for ($i = 0; $i < $matrixSize; $i += 2) {
63 | $result .= $horizontalMargin;
64 |
65 | $upperRow = $rows[$i];
66 | $lowerRow = $rows[$i + 1];
67 |
68 | for ($j = 0; $j < $matrixSize; ++$j) {
69 | $upperBit = $upperRow[$j];
70 | $lowerBit = $lowerRow[$j];
71 |
72 | if ($upperBit) {
73 | $result .= $lowerBit ? self::FULL_BLOCK : self::UPPER_HALF_BLOCK;
74 | } else {
75 | $result .= $lowerBit ? self::LOWER_HALF_BLOCK : self::EMPTY_BLOCK;
76 | }
77 | }
78 |
79 | $result .= $horizontalMargin . "\n";
80 | }
81 |
82 | $result .= str_repeat("\n", (int) ceil($this->margin / 2));
83 |
84 | return $result;
85 | }
86 | }
87 |
--------------------------------------------------------------------------------
/vendor/paragonie/constant_time_encoding/LICENSE.txt:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2016 - 2018 Paragon Initiative Enterprises
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
23 | ------------------------------------------------------------------------------
24 | This library was based on the work of Steve "Sc00bz" Thomas.
25 | ------------------------------------------------------------------------------
26 |
27 | The MIT License (MIT)
28 |
29 | Copyright (c) 2014 Steve Thomas
30 |
31 | Permission is hereby granted, free of charge, to any person obtaining a copy
32 | of this software and associated documentation files (the "Software"), to deal
33 | in the Software without restriction, including without limitation the rights
34 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
35 | copies of the Software, and to permit persons to whom the Software is
36 | furnished to do so, subject to the following conditions:
37 |
38 | The above copyright notice and this permission notice shall be included in all
39 | copies or substantial portions of the Software.
40 |
41 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
42 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
43 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
44 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
45 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
46 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
47 | SOFTWARE.
48 |
49 |
--------------------------------------------------------------------------------
/vendor/bacon/bacon-qr-code/src/Renderer/Module/EdgeIterator/Edge.php:
--------------------------------------------------------------------------------
1 |
15 | */
16 | private $points = [];
17 |
18 | /**
19 | * @var array
27 | */
28 | class TestListener extends TestSuite implements TestListenerInterface
29 | {
30 | private $suite;
31 | private $trait;
32 |
33 | public function __construct(TestSuite $suite = null)
34 | {
35 | if ($suite) {
36 | $this->suite = $suite;
37 | $this->setName($suite->getName().' with polyfills enabled');
38 | $this->addTest($suite);
39 | }
40 | $this->trait = new TestListenerTrait();
41 | }
42 |
43 | public function startTestSuite(TestSuite $suite)
44 | {
45 | $this->trait->startTestSuite($suite);
46 | }
47 |
48 | protected function setUp()
49 | {
50 | TestListenerTrait::$enabledPolyfills = $this->suite->getName();
51 | }
52 |
53 | protected function tearDown()
54 | {
55 | TestListenerTrait::$enabledPolyfills = false;
56 | }
57 |
58 | public function addError(Test $test, \Exception $e, $time)
59 | {
60 | $this->trait->addError($test, $e, $time);
61 | }
62 |
63 | public function addWarning(Test $test, Warning $e, $time)
64 | {
65 | }
66 |
67 | public function addFailure(Test $test, AssertionFailedError $e, $time)
68 | {
69 | $this->trait->addError($test, $e, $time);
70 | }
71 |
72 | public function addIncompleteTest(Test $test, \Exception $e, $time)
73 | {
74 | }
75 |
76 | public function addRiskyTest(Test $test, \Exception $e, $time)
77 | {
78 | }
79 |
80 | public function addSkippedTest(Test $test, \Exception $e, $time)
81 | {
82 | }
83 |
84 | public function endTestSuite(TestSuite $suite)
85 | {
86 | }
87 |
88 | public function startTest(Test $test)
89 | {
90 | }
91 |
92 | public function endTest(Test $test, $time)
93 | {
94 | }
95 | }
96 | }
97 |
--------------------------------------------------------------------------------
/vendor/paragonie/constant_time_encoding/src/Base64DotSlashOrdered.php:
--------------------------------------------------------------------------------
1 | 0x2d && $src < 0x3a) ret += $src - 0x2e + 1; // -45
52 | $ret += (((0x2d - $src) & ($src - 0x3a)) >> 8) & ($src - 45);
53 |
54 | // if ($src > 0x40 && $src < 0x5b) ret += $src - 0x41 + 12 + 1; // -52
55 | $ret += (((0x40 - $src) & ($src - 0x5b)) >> 8) & ($src - 52);
56 |
57 | // if ($src > 0x60 && $src < 0x7b) ret += $src - 0x61 + 38 + 1; // -58
58 | $ret += (((0x60 - $src) & ($src - 0x7b)) >> 8) & ($src - 58);
59 |
60 | return $ret;
61 | }
62 |
63 | /**
64 | * Uses bitwise operators instead of table-lookups to turn 8-bit integers
65 | * into 6-bit integers.
66 | *
67 | * @param int $src
68 | * @return string
69 | */
70 | protected static function encode6Bits(int $src): string
71 | {
72 | $src += 0x2e;
73 |
74 | // if ($src > 0x39) $src += 0x41 - 0x3a; // 7
75 | $src += ((0x39 - $src) >> 8) & 7;
76 |
77 | // if ($src > 0x5a) $src += 0x61 - 0x5b; // 6
78 | $src += ((0x5a - $src) >> 8) & 6;
79 |
80 | return \pack('C', $src);
81 | }
82 | }
83 |
--------------------------------------------------------------------------------
/vendor/paragonie/constant_time_encoding/README.md:
--------------------------------------------------------------------------------
1 | # Constant-Time Encoding
2 |
3 | [](https://travis-ci.org/paragonie/constant_time_encoding)
4 | [](https://packagist.org/packages/paragonie/constant_time_encoding)
5 | [](https://packagist.org/packages/paragonie/constant_time_encoding)
6 | [](https://packagist.org/packages/paragonie/constant_time_encoding)
7 | [](https://packagist.org/packages/paragonie/constant_time_encoding)
8 |
9 | Based on the [constant-time base64 implementation made by Steve "Sc00bz" Thomas](https://github.com/Sc00bz/ConstTimeEncoding),
10 | this library aims to offer character encoding functions that do not leak
11 | information about what you are encoding/decoding via processor cache
12 | misses. Further reading on [cache-timing attacks](http://blog.ircmaxell.com/2014/11/its-all-about-time.html).
13 |
14 | Our fork offers the following enchancements:
15 |
16 | * `mbstring.func_overload` resistance
17 | * Unit tests
18 | * Composer- and Packagist-ready
19 | * Base16 encoding
20 | * Base32 encoding
21 | * Uses `pack()` and `unpack()` instead of `chr()` and `ord()`
22 |
23 | ## PHP Version Requirements
24 |
25 | Version 2 of this library should work on **PHP 7** or newer. For PHP 5
26 | support, see [the v1.x branch](https://github.com/paragonie/constant_time_encoding/tree/v1.x).
27 |
28 | If you are adding this as a dependency to a project intended to work on both PHP 5 and PHP 7, please set the required version to `^1|^2` instead of just `^1` or `^2`.
29 |
30 | ## How to Install
31 |
32 | ```sh
33 | composer require paragonie/constant_time_encoding
34 | ```
35 |
36 | ## How to Use
37 |
38 | ```php
39 | use \ParagonIE\ConstantTime\Encoding;
40 |
41 | // possibly (if applicable):
42 | // require 'vendor/autoload.php';
43 |
44 | $data = random_bytes(32);
45 | echo Encoding::base64Encode($data), "\n";
46 | echo Encoding::base32EncodeUpper($data), "\n";
47 | echo Encoding::base32Encode($data), "\n";
48 | echo Encoding::hexEncode($data), "\n";
49 | echo Encoding::hexEncodeUpper($data), "\n";
50 | ```
51 |
52 | Example output:
53 |
54 | ```
55 | 1VilPkeVqirlPifk5scbzcTTbMT2clp+Zkyv9VFFasE=
56 | 2VMKKPSHSWVCVZJ6E7SONRY3ZXCNG3GE6ZZFU7TGJSX7KUKFNLAQ====
57 | 2vmkkpshswvcvzj6e7sonry3zxcng3ge6zzfu7tgjsx7kukfnlaq====
58 | d558a53e4795aa2ae53e27e4e6c71bcdc4d36cc4f6725a7e664caff551456ac1
59 | D558A53E4795AA2AE53E27E4E6C71BDCC4D36CC4F6725A7E664CAFF551456AC1
60 | ```
61 |
62 | If you only need a particular variant, you can just reference the
63 | required class like so:
64 |
65 | ```php
66 | use \ParagonIE\ConstantTime\Base64;
67 | use \ParagonIE\ConstantTime\Base32;
68 |
69 | $data = random_bytes(32);
70 | echo Base64::encode($data), "\n";
71 | echo Base32::encode($data), "\n";
72 | ```
73 |
74 | Example output:
75 |
76 | ```
77 | 1VilPkeVqirlPifk5scbzcTTbMT2clp+Zkyv9VFFasE=
78 | 2vmkkpshswvcvzj6e7sonry3zxcng3ge6zzfu7tgjsx7kukfnlaq====
79 | ```
80 |
--------------------------------------------------------------------------------
/vendor/paragonie/random_compat/lib/random_bytes_libsodium_legacy.php:
--------------------------------------------------------------------------------
1 | 2147483647) {
70 | for ($i = 0; $i < $bytes; $i += 1073741824) {
71 | $n = ($bytes - $i) > 1073741824
72 | ? 1073741824
73 | : $bytes - $i;
74 | $buf .= Sodium::randombytes_buf((int) $n);
75 | }
76 | } else {
77 | $buf .= Sodium::randombytes_buf((int) $bytes);
78 | }
79 |
80 | if (is_string($buf)) {
81 | if (RandomCompat_strlen($buf) === $bytes) {
82 | return $buf;
83 | }
84 | }
85 |
86 | /**
87 | * If we reach here, PHP has failed us.
88 | */
89 | throw new Exception(
90 | 'Could not gather sufficient random data'
91 | );
92 | }
93 | }
94 |
--------------------------------------------------------------------------------
/vendor/paragonie/random_compat/lib/random_bytes_libsodium.php:
--------------------------------------------------------------------------------
1 | 2147483647) {
66 | $buf = '';
67 | for ($i = 0; $i < $bytes; $i += 1073741824) {
68 | $n = ($bytes - $i) > 1073741824
69 | ? 1073741824
70 | : $bytes - $i;
71 | $buf .= \Sodium\randombytes_buf($n);
72 | }
73 | } else {
74 | /** @var string|bool $buf */
75 | $buf = \Sodium\randombytes_buf($bytes);
76 | }
77 |
78 | if (is_string($buf)) {
79 | if (RandomCompat_strlen($buf) === $bytes) {
80 | return $buf;
81 | }
82 | }
83 |
84 | /**
85 | * If we reach here, PHP has failed us.
86 | */
87 | throw new Exception(
88 | 'Could not gather sufficient random data'
89 | );
90 | }
91 | }
92 |
--------------------------------------------------------------------------------
/vendor/paragonie/random_compat/lib/random_bytes_com_dotnet.php:
--------------------------------------------------------------------------------
1 | GetRandom($bytes, 0));
75 | if (RandomCompat_strlen($buf) >= $bytes) {
76 | /**
77 | * Return our random entropy buffer here:
78 | */
79 | return (string) RandomCompat_substr($buf, 0, $bytes);
80 | }
81 | ++$execCount;
82 | } while ($execCount < $bytes);
83 |
84 | /**
85 | * If we reach here, PHP has failed us.
86 | */
87 | throw new Exception(
88 | 'Could not gather sufficient random data'
89 | );
90 | }
91 | }
--------------------------------------------------------------------------------
/vendor/paragonie/constant_time_encoding/src/Base64DotSlash.php:
--------------------------------------------------------------------------------
1 | 0x2d && $src < 0x30) ret += $src - 0x2e + 1; // -45
52 | $ret += (((0x2d - $src) & ($src - 0x30)) >> 8) & ($src - 45);
53 |
54 | // if ($src > 0x40 && $src < 0x5b) ret += $src - 0x41 + 2 + 1; // -62
55 | $ret += (((0x40 - $src) & ($src - 0x5b)) >> 8) & ($src - 62);
56 |
57 | // if ($src > 0x60 && $src < 0x7b) ret += $src - 0x61 + 28 + 1; // -68
58 | $ret += (((0x60 - $src) & ($src - 0x7b)) >> 8) & ($src - 68);
59 |
60 | // if ($src > 0x2f && $src < 0x3a) ret += $src - 0x30 + 54 + 1; // 7
61 | $ret += (((0x2f - $src) & ($src - 0x3a)) >> 8) & ($src + 7);
62 |
63 | return $ret;
64 | }
65 |
66 | /**
67 | * Uses bitwise operators instead of table-lookups to turn 8-bit integers
68 | * into 6-bit integers.
69 | *
70 | * @param int $src
71 | * @return string
72 | */
73 | protected static function encode6Bits(int $src): string
74 | {
75 | $src += 0x2e;
76 |
77 | // if ($src > 0x2f) $src += 0x41 - 0x30; // 17
78 | $src += ((0x2f - $src) >> 8) & 17;
79 |
80 | // if ($src > 0x5a) $src += 0x61 - 0x5b; // 6
81 | $src += ((0x5a - $src) >> 8) & 6;
82 |
83 | // if ($src > 0x7a) $src += 0x30 - 0x7b; // -75
84 | $src -= ((0x7a - $src) >> 8) & 75;
85 |
86 | return \pack('C', $src);
87 | }
88 | }
89 |
--------------------------------------------------------------------------------
/src/Controllers/LoginController.php:
--------------------------------------------------------------------------------
1 | layout('base', [
19 | 'content' => $this->view('auth/error', [
20 | 'error' => $e->getMessage()
21 | ])
22 | ]);
23 | }
24 |
25 | if ($login->isAuthenticated()) {
26 | $this->redirect();
27 | }
28 |
29 | if ($login->isBlocked()) {
30 | return $this->layout('base', [
31 | 'content' => $this->view('auth/block')
32 | ]);
33 | }
34 |
35 | $attempts = $this->logData('sc_attempts');
36 | $canUseBackupCode = $attempts && $attempts >= 3;
37 |
38 | $self = $this;
39 | $form = $this->form('auth/login', compact('canUseBackupCode'), function ($form) use ($self, $login, $canUseBackupCode) {
40 | $data = $form->serialize();
41 | $backupCodeWasUsed = false;
42 |
43 | try {
44 | if ($canUseBackupCode) {
45 | $backupCodeWasUsed = $self->validateBackupCode($data);
46 | } else {
47 | $self->validateUserSecret($data['security_code'], $data['username']);
48 | }
49 |
50 | $login->attempt($data['username'], $data['password']);
51 |
52 | if ($backupCodeWasUsed) {
53 | $self->alert(l('authenticator.turnOff.success'));
54 | $self->redirect('users/' . site()->user()->username . '/edit');
55 | }
56 |
57 | $self->redirect();
58 | } catch (Exception $e) {
59 | if ($e instanceof InvalidOrExpiredCode) {
60 | $form->alert($e->getMessage());
61 | $form->fields->security_code->error = true;
62 | $self->logAttempt();
63 | } elseif ($e instanceof InvalidBackupCode) {
64 | $form->alert($e->getMessage());
65 | $form->fields->backup_code->error = true;
66 | } else {
67 | $form->alert(l('login.error'));
68 | $form->fields->username->error = true;
69 | $form->fields->password->error = true;
70 | }
71 | }
72 | });
73 |
74 | return $this->layout('base', [
75 | 'bodyclass' => 'login',
76 | 'content' => $this->view('auth/login', compact('form'))
77 | ]);
78 | }
79 |
80 | public function logout()
81 | {
82 | if ($user = panel()->user()) {
83 | $user->logout();
84 | }
85 |
86 | $this->redirect('login');
87 | }
88 |
89 | public function logAttempt()
90 | {
91 | $data = $this->logData();
92 |
93 | $data['sc_attempts'] = isset($data['sc_attempts'])
94 | ? $data['sc_attempts'] + 1
95 | : 1;
96 |
97 | $this->log($data);
98 | }
99 | }
100 |
--------------------------------------------------------------------------------
/vendor/bacon/bacon-qr-code/src/Encoder/QrCode.php:
--------------------------------------------------------------------------------
1 | mode = $mode;
63 | $this->errorCorrectionLevel = $errorCorrectionLevel;
64 | $this->version = $version;
65 | $this->maskPattern = $maskPattern;
66 | $this->matrix = $matrix;
67 | }
68 |
69 | /**
70 | * Gets the mode.
71 | */
72 | public function getMode() : Mode
73 | {
74 | return $this->mode;
75 | }
76 |
77 | /**
78 | * Gets the EC level.
79 | */
80 | public function getErrorCorrectionLevel() : ErrorCorrectionLevel
81 | {
82 | return $this->errorCorrectionLevel;
83 | }
84 |
85 | /**
86 | * Gets the version.
87 | */
88 | public function getVersion() : Version
89 | {
90 | return $this->version;
91 | }
92 |
93 | /**
94 | * Gets the mask pattern.
95 | */
96 | public function getMaskPattern() : int
97 | {
98 | return $this->maskPattern;
99 | }
100 |
101 | /**
102 | * Gets the matrix.
103 | *
104 | * @return ByteMatrix
105 | */
106 | public function getMatrix()
107 | {
108 | return $this->matrix;
109 | }
110 |
111 | /**
112 | * Validates whether a mask pattern is valid.
113 | */
114 | public static function isValidMaskPattern(int $maskPattern) : bool
115 | {
116 | return $maskPattern > 0 && $maskPattern < self::NUM_MASK_PATTERNS;
117 | }
118 |
119 | /**
120 | * Returns a string representation of the QR code.
121 | */
122 | public function __toString() : string
123 | {
124 | $result = "<<\n"
125 | . ' mode: ' . $this->mode . "\n"
126 | . ' ecLevel: ' . $this->errorCorrectionLevel . "\n"
127 | . ' version: ' . $this->version . "\n"
128 | . ' maskPattern: ' . $this->maskPattern . "\n";
129 |
130 | if ($this->matrix === null) {
131 | $result .= " matrix: null\n";
132 | } else {
133 | $result .= " matrix:\n";
134 | $result .= $this->matrix;
135 | }
136 |
137 | $result .= ">>\n";
138 |
139 | return $result;
140 | }
141 | }
142 |
--------------------------------------------------------------------------------
/vendor/paragonie/constant_time_encoding/src/Base64UrlSafe.php:
--------------------------------------------------------------------------------
1 | 0x40 && $src < 0x5b) $ret += $src - 0x41 + 1; // -64
53 | $ret += (((0x40 - $src) & ($src - 0x5b)) >> 8) & ($src - 64);
54 |
55 | // if ($src > 0x60 && $src < 0x7b) $ret += $src - 0x61 + 26 + 1; // -70
56 | $ret += (((0x60 - $src) & ($src - 0x7b)) >> 8) & ($src - 70);
57 |
58 | // if ($src > 0x2f && $src < 0x3a) $ret += $src - 0x30 + 52 + 1; // 5
59 | $ret += (((0x2f - $src) & ($src - 0x3a)) >> 8) & ($src + 5);
60 |
61 | // if ($src == 0x2c) $ret += 62 + 1;
62 | $ret += (((0x2c - $src) & ($src - 0x2e)) >> 8) & 63;
63 |
64 | // if ($src == 0x5f) ret += 63 + 1;
65 | $ret += (((0x5e - $src) & ($src - 0x60)) >> 8) & 64;
66 |
67 | return $ret;
68 | }
69 |
70 | /**
71 | * Uses bitwise operators instead of table-lookups to turn 8-bit integers
72 | * into 6-bit integers.
73 | *
74 | * @param int $src
75 | * @return string
76 | */
77 | protected static function encode6Bits(int $src): string
78 | {
79 | $diff = 0x41;
80 |
81 | // if ($src > 25) $diff += 0x61 - 0x41 - 26; // 6
82 | $diff += ((25 - $src) >> 8) & 6;
83 |
84 | // if ($src > 51) $diff += 0x30 - 0x61 - 26; // -75
85 | $diff -= ((51 - $src) >> 8) & 75;
86 |
87 | // if ($src > 61) $diff += 0x2d - 0x30 - 10; // -13
88 | $diff -= ((61 - $src) >> 8) & 13;
89 |
90 | // if ($src > 62) $diff += 0x5f - 0x2b - 1; // 3
91 | $diff += ((62 - $src) >> 8) & 49;
92 |
93 | return \pack('C', $src + $diff);
94 | }
95 | }
96 |
--------------------------------------------------------------------------------
/vendor/pragmarx/google2fa/src/Support/Base32.php:
--------------------------------------------------------------------------------
1 | toBase32($prefix) : '';
26 |
27 | $secret = $this->strPadBase32($secret, $length);
28 |
29 | $this->validateSecret($secret);
30 |
31 | return $secret;
32 | }
33 |
34 | /**
35 | * Decodes a base32 string into a binary string.
36 | *
37 | * @param string $b32
38 | *
39 | * @throws InvalidCharactersException
40 | *
41 | * @return int
42 | */
43 | public function base32Decode($b32)
44 | {
45 | $b32 = strtoupper($b32);
46 |
47 | $this->validateSecret($b32);
48 |
49 | return ParagonieBase32::decodeUpper($b32);
50 | }
51 |
52 | /**
53 | * Pad string with random base 32 chars.
54 | *
55 | * @param $string
56 | * @param $length
57 | *
58 | * @return string
59 | */
60 | private function strPadBase32($string, $length)
61 | {
62 | for ($i = 0; $i < $length; $i++) {
63 | $string .= substr(Constants::VALID_FOR_B32_SCRAMBLED, $this->getRandomNumber(), 1);
64 | }
65 |
66 | return $string;
67 | }
68 |
69 | /**
70 | * Encode a string to Base32.
71 | *
72 | * @param $string
73 | *
74 | * @return mixed
75 | */
76 | public function toBase32($string)
77 | {
78 | $encoded = ParagonieBase32::encodeUpper($string);
79 |
80 | return str_replace('=', '', $encoded);
81 | }
82 |
83 | /**
84 | * Get a random number.
85 | *
86 | * @param $from
87 | * @param $to
88 | *
89 | * @return int
90 | */
91 | protected function getRandomNumber($from = 0, $to = 31)
92 | {
93 | return random_int($from, $to);
94 | }
95 |
96 | /**
97 | * Validate the secret.
98 | *
99 | * @param $b32
100 | */
101 | protected function validateSecret($b32)
102 | {
103 | $this->checkForValidCharacters($b32);
104 |
105 | $this->checkGoogleAuthenticatorCompatibility($b32);
106 | }
107 |
108 | /**
109 | * Check if the secret key is compatible with Google Authenticator.
110 | *
111 | * @param $b32
112 | *
113 | * @throws IncompatibleWithGoogleAuthenticatorException
114 | */
115 | protected function checkGoogleAuthenticatorCompatibility($b32)
116 | {
117 | if ($this->enforceGoogleAuthenticatorCompatibility && ((strlen($b32) & (strlen($b32) - 1)) !== 0)) {
118 | throw new IncompatibleWithGoogleAuthenticatorException();
119 | }
120 | }
121 |
122 | /**
123 | * Check if all secret key characters are valid.
124 | *
125 | * @param $b32
126 | *
127 | * @throws InvalidCharactersException
128 | */
129 | protected function checkForValidCharacters($b32)
130 | {
131 | if (preg_replace('/[^'.Constants::VALID_FOR_B32.']/', '', $b32) !== $b32) {
132 | throw new InvalidCharactersException();
133 | }
134 | }
135 | }
136 |
--------------------------------------------------------------------------------
Once activated, you'll use both your password and a 6-digit security code sent to your phone to log in.",
9 | "authenticator.turnOn.label": "Turn on 2-step verification",
10 | "authenticator.turnOn.text": "An authenticator app lets you generate security codes on your phone. If you don’t already have one, install it now your device: {ios}, {android}, or {windows}.",
11 | "authenticator.turnOn.qrcode.label": "To configure your authenticator app:",
12 | "authenticator.turnOn.qrcode.text": "- Add a new time-based token\n- Use your app to scan the QR code below",
13 | "authenticator.turnOn.success": "2-step verification has been turned on",
14 | "authenticator.turnOn.error": "2-step verification could not be turned on",
15 | "authenticator.turnOff.label": "Do you really want to disable 2-step verification?",
16 | "authenticator.turnOff.text": "Turning off 2-step verification will remove the extra security on your account and you’ll only need your password to sign in.",
17 | "authenticator.turnOff.success": "2-step verification has been turned off",
18 | "authenticator.turnOff.error": "2-step verification could not be turned off",
19 | "authenticator.securityCode.confirmation.label": "Confirm your security code",
20 | "authenticator.securityCode.label": "Security code",
21 | "authenticator.securityCode.error": "Invalid or expired security code",
22 | "authenticator.securityCode.help": "Enter the 6-digit security code generated by your mobile authenticator app",
23 | "authenticator.backup.label": "Save the backup code",
24 | "authenticator.backup.text": "You can save a backup code to use when you don't have access to your mobile authenticator app. To do that, copy the code below and store it safely.",
25 | "authenticator.backup.note": "If you ever get locked out of your account, contact your website administrator.",
26 | "authenticator.backup.cancel": "No, thank you",
27 | "authenticator.backup.error": "Your backup code could not be saved",
28 | "authenticator.backupCode.label": "Backup code",
29 | "authenticator.backupCode.error": "Invalid backup code",
30 | "authenticator.backupCode.help": "Enter the backup code created when you enabled 2-step verification"
31 | }
32 |
--------------------------------------------------------------------------------
/vendor/composer/autoload_static.php:
--------------------------------------------------------------------------------
1 | __DIR__ . '/..' . '/paragonie/random_compat/lib/random.php',
11 | 'bd9634f2d41831496de0d3dfe4c94881' => __DIR__ . '/..' . '/symfony/polyfill-php56/bootstrap.php',
12 | '4ae513dcd6c6781fd946d90523cfc740' => __DIR__ . '/../..' . '/src/bootstrap.php',
13 | );
14 |
15 | public static $prefixLengthsPsr4 = array (
16 | 'S' =>
17 | array (
18 | 'Symfony\\Polyfill\\Util\\' => 22,
19 | 'Symfony\\Polyfill\\Php56\\' => 23,
20 | ),
21 | 'P' =>
22 | array (
23 | 'PragmaRX\\Google2FA\\Tests\\' => 25,
24 | 'PragmaRX\\Google2FA\\' => 19,
25 | 'PedroBorges\\Authenticator\\' => 26,
26 | 'ParagonIE\\ConstantTime\\' => 23,
27 | ),
28 | 'D' =>
29 | array (
30 | 'DASPRiD\\Enum\\' => 13,
31 | ),
32 | 'B' =>
33 | array (
34 | 'BaconQrCode\\' => 12,
35 | ),
36 | );
37 |
38 | public static $prefixDirsPsr4 = array (
39 | 'Symfony\\Polyfill\\Util\\' =>
40 | array (
41 | 0 => __DIR__ . '/..' . '/symfony/polyfill-util',
42 | ),
43 | 'Symfony\\Polyfill\\Php56\\' =>
44 | array (
45 | 0 => __DIR__ . '/..' . '/symfony/polyfill-php56',
46 | ),
47 | 'PragmaRX\\Google2FA\\Tests\\' =>
48 | array (
49 | 0 => __DIR__ . '/..' . '/pragmarx/google2fa/tests',
50 | ),
51 | 'PragmaRX\\Google2FA\\' =>
52 | array (
53 | 0 => __DIR__ . '/..' . '/pragmarx/google2fa/src',
54 | ),
55 | 'PedroBorges\\Authenticator\\' =>
56 | array (
57 | 0 => __DIR__ . '/../..' . '/src',
58 | ),
59 | 'ParagonIE\\ConstantTime\\' =>
60 | array (
61 | 0 => __DIR__ . '/..' . '/paragonie/constant_time_encoding/src',
62 | ),
63 | 'DASPRiD\\Enum\\' =>
64 | array (
65 | 0 => __DIR__ . '/..' . '/dasprid/enum/src',
66 | ),
67 | 'BaconQrCode\\' =>
68 | array (
69 | 0 => __DIR__ . '/..' . '/bacon/bacon-qr-code/src',
70 | ),
71 | );
72 |
73 | public static function getInitializer(ClassLoader $loader)
74 | {
75 | return \Closure::bind(function () use ($loader) {
76 | $loader->prefixLengthsPsr4 = ComposerStaticInitc4c18db373ff26146736e56d851f765b::$prefixLengthsPsr4;
77 | $loader->prefixDirsPsr4 = ComposerStaticInitc4c18db373ff26146736e56d851f765b::$prefixDirsPsr4;
78 |
79 | }, null, ClassLoader::class);
80 | }
81 | }
82 |
--------------------------------------------------------------------------------
/authenticator/translations/nl_BE.json:
--------------------------------------------------------------------------------
1 | {
2 | "authenticator.toggle.on": "Activeren",
3 | "authenticator.toggle.off": "Uitschakelen",
4 | "authenticator.field.label": "2-factor authenticatie staat {status}",
5 | "authenticator.field.status.on": "aan",
6 | "authenticator.field.status.off": "af",
7 | "authenticator.field.info.on": "Account is beschermd met beveilingscode èn paswoord.",
8 | "authenticator.field.info.off": "Activeer 2-factor authenticatie om je account beter te beschermen.
Van zodra geactiveerd zul je een naast je paswoord een SMS ontvangen met een 6-cijferige om in te loggen.",
9 | "authenticator.turnOn.label": "2-factor authenticatie activeren",
10 | "authenticator.turnOn.text": "Een authenticator app kan beveilingscodes genereren op je smartphone. Wanneer je nog geen hebt, installeer nu één voor: {ios}, {android}, of {windows}.",
11 | "authenticator.turnOn.qrcode.label": "Om je authenticator app te configureren:",
12 | "authenticator.turnOn.qrcode.text": "- Tijdsafhankelijk token toevoegen\n- Gebruik je app om de QR code hieronder te scannen",
13 | "authenticator.turnOn.success": "2-factor authenticatie werd geactiveerd",
14 | "authenticator.turnOn.error": "2-factor authenticatie kan niet worden geactiveerd",
15 | "authenticator.turnOff.label": "Weet u zeker dat u 2-factor authenticatie wilt uitschakelen?",
16 | "authenticator.turnOff.text": "2-factor authenticatie uitschakelen zal alle extra beveiligingsmaatregelen op uw account verwijderen. Hierna heb je enkel je paswoord nodig om in te loggen.",
17 | "authenticator.turnOff.success": "2-factor authenticatie werd uitgeschakeld",
18 | "authenticator.turnOff.error": "2-factor authenticatie kan niet worden uitgeschakeld",
19 | "authenticator.securityCode.confirmation.label": "Beveilingscode bevestigen",
20 | "authenticator.securityCode.label": "Beveilingscode",
21 | "authenticator.securityCode.error": "Ongeldige of verlopen beveilingscode",
22 | "authenticator.securityCode.help": "Geef de 6-cijferige beveilingscode die werd gegenereerd door uw mobiele authenticator app",
23 | "authenticator.backup.label": "Backup code opslaan",
24 | "authenticator.backup.text": "U kan een backup code opslaan om te gebruiken wanneer u geen toegang hebt tot uw mobiele authenticator app. Om dit te doen, kopieer de onderstaande code en sla deze op een veilige locatie op.",
25 | "authenticator.backup.note": "Wanneer u ooit buitengesloten bent, contacteer de website administrator.",
26 | "authenticator.backup.cancel": "Nee, bedankt",
27 | "authenticator.backup.error": "Uw backup code kan niet worden opgeslaan",
28 | "authenticator.backupCode.label": "Backup code",
29 | "authenticator.backupCode.error": "Ongeldige backup code",
30 | "authenticator.backupCode.help": "Geef uw backup code in die werd aangemaakt wanneer u 2-factor authenticatie hebt geactiveerd"
31 | }
32 |
--------------------------------------------------------------------------------
/vendor/bacon/bacon-qr-code/src/Renderer/Color/Cmyk.php:
--------------------------------------------------------------------------------
1 | 100) {
39 | throw new Exception\InvalidArgumentException('Cyan must be between 0 and 100');
40 | }
41 |
42 | if ($magenta < 0 || $magenta > 100) {
43 | throw new Exception\InvalidArgumentException('Magenta must be between 0 and 100');
44 | }
45 |
46 | if ($yellow < 0 || $yellow > 100) {
47 | throw new Exception\InvalidArgumentException('Yellow must be between 0 and 100');
48 | }
49 |
50 | if ($black < 0 || $black > 100) {
51 | throw new Exception\InvalidArgumentException('Black must be between 0 and 100');
52 | }
53 |
54 | $this->cyan = $cyan;
55 | $this->magenta = $magenta;
56 | $this->yellow = $yellow;
57 | $this->black = $black;
58 | }
59 |
60 | public function getCyan() : int
61 | {
62 | return $this->cyan;
63 | }
64 |
65 | public function getMagenta() : int
66 | {
67 | return $this->magenta;
68 | }
69 |
70 | public function getYellow() : int
71 | {
72 | return $this->yellow;
73 | }
74 |
75 | public function getBlack() : int
76 | {
77 | return $this->black;
78 | }
79 |
80 | public function toRgb() : Rgb
81 | {
82 | $k = $this->black / 100;
83 | $c = (-$k * $this->cyan + $k * 100 + $this->cyan) / 100;
84 | $m = (-$k * $this->magenta + $k * 100 + $this->magenta) / 100;
85 | $y = (-$k * $this->yellow + $k * 100 + $this->yellow) / 100;
86 |
87 | return new Rgb(
88 | (int) (-$c * 255 + 255),
89 | (int) (-$m * 255 + 255),
90 | (int) (-$y * 255 + 255)
91 | );
92 | }
93 |
94 | public function toCmyk() : Cmyk
95 | {
96 | return $this;
97 | }
98 |
99 | public function toGray() : Gray
100 | {
101 | return $this->toRgb()->toGray();
102 | }
103 | }
104 |
--------------------------------------------------------------------------------
/authenticator/translations/pt_BR.json:
--------------------------------------------------------------------------------
1 | {
2 | "authenticator.toggle.on": "Ativar",
3 | "authenticator.toggle.off": "Desativar",
4 | "authenticator.field.label": "A verificação em duas etapas está {status}",
5 | "authenticator.field.status.on": "ativa",
6 | "authenticator.field.status.off": "desativada",
7 | "authenticator.field.info.on": "Conta protegida com código de segurança além da senha.",
8 | "authenticator.field.info.off": "A verificação em duas etapas aumenta a segurança da sua conta.
Uma vez ativada, você precisará usar sua senha e um código de 6 dígitos enviado para o seu celular para entrar.",
9 | "authenticator.turnOn.label": "Ativar verificação em duas etapas",
10 | "authenticator.turnOn.text": "Um aplicativo autenticador gera um código de segurança no seu celular. Caso você ainda não tenha um, instale-o agora no seu celular: {ios}, {android} ou {windows}.",
11 | "authenticator.turnOn.qrcode.label": "Para configurar seu aplicativo autenticador:",
12 | "authenticator.turnOn.qrcode.text": "- Vá em adicionar novo código baseado em tempo\n- Use seu aplicativo para escanear o código QR abaixo",
13 | "authenticator.turnOn.success": "A verificação em duas etapas foi ativada",
14 | "authenticator.turnOn.error": "Não foi possível ativar a verificação em duas etapas",
15 | "authenticator.turnOff.label": "Quer mesmo desativar a verificação em duas etapas?",
16 | "authenticator.turnOff.text": "Desativar a verificação em duas etapas removerá a camada extra de proteção e você precisará apenas da sua senha para entrar.",
17 | "authenticator.turnOff.success": "A verificação em duas etapas foi desativada",
18 | "authenticator.turnOff.error": "Não foi possível desativar a verificação em duas etapas",
19 | "authenticator.securityCode.confirmation.label": "Confirme seu código de segurança",
20 | "authenticator.securityCode.label": "Código de segurança",
21 | "authenticator.securityCode.error": "Código de segurança inválido ou expirado",
22 | "authenticator.securityCode.help": "Digite o código de segurança de 6 dígitos gerado pelo aplicativo autenticador no seu celular",
23 | "authenticator.backup.label": "Salve o código de backup",
24 | "authenticator.backup.text": "Você pode salvar um código de segurança para usar quando não tiver accesso ao aplicativo autenticador. Para isso, copie o código abaixo e armazene-o em local seguro.",
25 | "authenticator.backup.note": "Se por algum motivo você não conseguir acessar sua conta, contate o administrador do site.",
26 | "authenticator.backup.cancel": "Não, obrigado",
27 | "authenticator.backup.error": "Não foi possível salver seu código de backup",
28 | "authenticator.backupCode.label": "Código de backup",
29 | "authenticator.backupCode.error": "Código de backup inválido",
30 | "authenticator.backupCode.help": "Digite o código de backup criado quando você ativou a verificação em duas etapas"
31 | }
32 |
--------------------------------------------------------------------------------
/vendor/bacon/bacon-qr-code/src/Renderer/Image/ImageBackEndInterface.php:
--------------------------------------------------------------------------------
1 | allowInsecureCallToGoogleApis) {
31 | throw new InsecureCallException('It\'s not secure to send secret keys to Google Apis, you have to explicitly allow it by calling $google2fa->setAllowInsecureCallToGoogleApis(true).');
32 | }
33 |
34 | $url = $this->getQRCodeUrl($company, $holder, $secret);
35 |
36 | return Url::generateGoogleQRCodeUrl('https://chart.googleapis.com/', 'chart', 'chs='.$size.'x'.$size.'&chld=M|0&cht=qr&chl=', $url);
37 | }
38 |
39 | /**
40 | * Generates a QR code data url to display inline.
41 | *
42 | * @param string $company
43 | * @param string $holder
44 | * @param string $secret
45 | * @param int $size
46 | * @param string $encoding Default to UTF-8
47 | *
48 | * @return string
49 | */
50 | public function getQRCodeInline($company, $holder, $secret, $size = 200, $encoding = 'utf-8')
51 | {
52 | $url = $this->getQRCodeUrl($company, $holder, $secret);
53 |
54 | $renderer = new Png();
55 | $renderer->setWidth($size);
56 | $renderer->setHeight($size);
57 |
58 | $bacon = new BaconQrCodeWriter($renderer);
59 | $data = $bacon->writeString($url, $encoding);
60 |
61 | return 'data:image/png;base64,'.base64_encode($data);
62 | }
63 |
64 | /**
65 | * Creates a QR code url.
66 | *
67 | * @param $company
68 | * @param $holder
69 | * @param $secret
70 | *
71 | * @return string
72 | */
73 | public function getQRCodeUrl($company, $holder, $secret)
74 | {
75 | return 'otpauth://totp/'.rawurlencode($company).':'.rawurlencode($holder).'?secret='.$secret.'&issuer='.rawurlencode($company).'';
76 | }
77 |
78 | /**
79 | * AllowInsecureCallToGoogleApis setter.
80 | *
81 | * @param mixed $allowInsecureCallToGoogleApis
82 | *
83 | * @return QRCode
84 | */
85 | public function setAllowInsecureCallToGoogleApis($allowInsecureCallToGoogleApis)
86 | {
87 | $this->allowInsecureCallToGoogleApis = $allowInsecureCallToGoogleApis;
88 |
89 | return $this;
90 | }
91 | }
92 |
--------------------------------------------------------------------------------
/vendor/bacon/bacon-qr-code/src/Renderer/Path/Path.php:
--------------------------------------------------------------------------------
1 | operations[] = new Move($x, $y);
26 | return $path;
27 | }
28 |
29 | /**
30 | * Draws a line from the current position to another position.
31 | */
32 | public function line(float $x, float $y) : self
33 | {
34 | $path = clone $this;
35 | $path->operations[] = new Line($x, $y);
36 | return $path;
37 | }
38 |
39 | /**
40 | * Draws an elliptic arc from the current position to another position.
41 | */
42 | public function ellipticArc(
43 | float $xRadius,
44 | float $yRadius,
45 | float $xAxisRotation,
46 | bool $largeArc,
47 | bool $sweep,
48 | float $x,
49 | float $y
50 | ) : self {
51 | $path = clone $this;
52 | $path->operations[] = new EllipticArc($xRadius, $yRadius, $xAxisRotation, $largeArc, $sweep, $x, $y);
53 | return $path;
54 | }
55 |
56 | /**
57 | * Draws a curve from the current position to another position.
58 | */
59 | public function curve(float $x1, float $y1, float $x2, float $y2, float $x3, float $y3) : self
60 | {
61 | $path = clone $this;
62 | $path->operations[] = new Curve($x1, $y1, $x2, $y2, $x3, $y3);
63 | return $path;
64 | }
65 |
66 | /**
67 | * Closes a sub-path.
68 | */
69 | public function close() : self
70 | {
71 | $path = clone $this;
72 | $path->operations[] = Close::instance();
73 | return $path;
74 | }
75 |
76 | /**
77 | * Appends another path to this one.
78 | */
79 | public function append(self $other) : self
80 | {
81 | $path = clone $this;
82 | $path->operations = array_merge($this->operations, $other->operations);
83 | return $path;
84 | }
85 |
86 | public function translate(float $x, float $y) : self
87 | {
88 | $path = new self();
89 |
90 | foreach ($this->operations as $operation) {
91 | $path->operations[] = $operation->translate($x, $y);
92 | }
93 |
94 | return $path;
95 | }
96 |
97 | /**
98 | * @return OperationInterface[]|Traversable
99 | */
100 | public function getIterator() : Traversable
101 | {
102 | foreach ($this->operations as $operation) {
103 | yield $operation;
104 | }
105 | }
106 | }
107 |
--------------------------------------------------------------------------------
/vendor/paragonie/random_compat/lib/cast_to_int.php:
--------------------------------------------------------------------------------
1 | operators might accidentally let a float
38 | * through.
39 | *
40 | * @param int|float $number The number we want to convert to an int
41 | * @param bool $fail_open Set to true to not throw an exception
42 | *
43 | * @return float|int
44 | * @psalm-suppress InvalidReturnType
45 | *
46 | * @throws TypeError
47 | */
48 | function RandomCompat_intval($number, $fail_open = false)
49 | {
50 | if (is_int($number) || is_float($number)) {
51 | $number += 0;
52 | } elseif (is_numeric($number)) {
53 | /** @psalm-suppress InvalidOperand */
54 | $number += 0;
55 | }
56 | /** @var int|float $number */
57 |
58 | if (
59 | is_float($number)
60 | &&
61 | $number > ~PHP_INT_MAX
62 | &&
63 | $number < PHP_INT_MAX
64 | ) {
65 | $number = (int) $number;
66 | }
67 |
68 | if (is_int($number)) {
69 | return (int) $number;
70 | } elseif (!$fail_open) {
71 | throw new TypeError(
72 | 'Expected an integer.'
73 | );
74 | }
75 | return $number;
76 | }
77 | }
78 |
--------------------------------------------------------------------------------
/vendor/symfony/polyfill-util/TestListener.php:
--------------------------------------------------------------------------------
1 |
7 | *
8 | * For the full copyright and license information, please view the LICENSE
9 | * file that was distributed with this source code.
10 | */
11 |
12 | namespace Symfony\Polyfill\Util;
13 |
14 | use PHPUnit\Framework\AssertionFailedError;
15 | use PHPUnit\Framework\TestListener as TestListenerInterface;
16 | use PHPUnit\Framework\Test;
17 | use PHPUnit\Framework\TestSuite;
18 | use PHPUnit\Framework\Warning;
19 |
20 | if (class_exists('PHPUnit_Runner_Version') && version_compare(\PHPUnit_Runner_Version::id(), '6.0.0', '<')) {
21 | class_alias('Symfony\Polyfill\Util\LegacyTestListener', 'Symfony\Polyfill\Util\TestListener');
22 | // Using an early return instead of a else does not work when using the PHPUnit phar due to some weird PHP behavior (the class
23 | // gets defined without executing the code before it and so the definition is not properly conditional)
24 | } else {
25 | /**
26 | * @author Nicolas Grekas