PluginProbe
WP-Optimize – Cache, Compress images, Minify & Clean database to boost page speed & performance / 3.2.3
WP-Optimize – Cache, Compress images, Minify & Clean database to boost page speed & performance v3.2.3
4.7.0 4.6.1 4.6.0 4.5.5 4.5.4 4.5.3 4.5.2 3.2.20 3.2.21 3.2.22 3.2.3 3.2.5 3.2.6 3.2.7 3.2.9 3.3.0 3.3.1 3.3.2 3.4.0 3.4.1 3.4.2 3.5.0 3.6.0 3.7.0 3.7.1 All 111 releases
wp-optimize / vendor / intervention / httpauth / src / Vault / BasicVault.php

BasicVault.php in WP-Optimize – Cache, Compress images, Minify & Clean database to boost page speed & performance 3.2.3, at vendor/intervention/httpauth/src/Vault/BasicVault.php

38 lines 855 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace Intervention\HttpAuth\Vault;
4
5 use Intervention\HttpAuth\AbstractVault;
6 use Intervention\HttpAuth\Directive;
7 use Intervention\HttpAuth\Key;
8
9 class BasicVault extends AbstractVault
10 {
11 /**
12 * Determine if given key is able to unlock (access) vault.
13 *
14 * @param Key $key
15 * @return bool
16 */
17 public function unlocksWithKey(Key $key): bool
18 {
19 $username_match = $this->getUsername() == $key->getUsername();
20 $password_match = $this->getPassword() == $key->getPassword();
21
22 return $username_match && $password_match;
23 }
24
25 /**
26 * Return auth directive
27 *
28 * @return Directive
29 */
30 public function getDirective(): Directive
31 {
32 return new Directive('basic', [
33 'realm' => $this->getRealm(),
34 'charset' => 'UTF-8',
35 ]);
36 }
37 }
38