Change all the "new class" by "new Class"

This commit is contained in:
2021-05-07 13:10:37 +02:00
parent c8d275be31
commit c09fa961cd
39 changed files with 430 additions and 432 deletions

View File

@@ -70,10 +70,10 @@ class Authjwt extends Auth
throw new \Exception (dgettext ("domframework",
"No Bearer Authentication available"), 401);
$token = substr ($_SERVER["HTTP_AUTHENTICATION"], 7);
$jwt = new jwt ();
$jwt = new Jwt ();
$uuid = $jwt->decode ($token, $this->serverKey, $this->allowedAlg,
$this->cipherKey);
$cachefile = new cachefile ();
$cachefile = new Cachefile ();
$cachefile->directory = $this->cacheDir;
$payload = $cachefile->read ((string)$uuid);
// The JWT was tested in authparams. End of process
@@ -120,10 +120,10 @@ class Authjwt extends Auth
throw new \Exception (dgettext ("domframework",
"AuthJWT : can not create token for anonymous"), 403);
$uuid = uuid::uuid4 ();
$cachefile = new cachefile ();
$cachefile = new Cachefile ();
$cachefile->directory = $this->cacheDir;
$cachefile->write ($uuid, $auth);
$jwt = new jwt ();
$jwt = new Jwt ();
return $jwt->encode ($uuid,
$this->serverKey, $this->algorithm, $this->cipherKey);
}
@@ -168,10 +168,10 @@ class Authjwt extends Auth
throw new \Exception (dgettext ("domframework",
"No Bearer Authentication available"), 401);
$token = substr ($_SERVER["HTTP_AUTHENTICATION"], 7);
$jwt = new jwt ();
$jwt = new Jwt ();
$uuid = $jwt->decode ($token, $this->serverKey, $this->allowedAlg,
$this->cipherKey);
$cachefile = new cachefile ();
$cachefile = new Cachefile ();
$cachefile->directory = $this->cacheDir;
$payload = $cachefile->read ((string)$uuid);
if (empty ($uuid) || empty ($payload) || ! key_exists ("email", $payload))