aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorNicolas LÅ“uillet <nicolas@loeuillet.org>2015-02-10 13:35:34 +0100
committerNicolas LÅ“uillet <nicolas@loeuillet.org>2015-02-10 13:35:34 +0100
commit92504e0dd489c0d11abc87bee42ffca717db0480 (patch)
tree98a6c122af6d81250ade7845178d9d851c4084d4
parentd4c029f46ee3a3ea9715c388f6f9c9a1e65edf50 (diff)
downloadwallabag-92504e0dd489c0d11abc87bee42ffca717db0480.tar.gz
wallabag-92504e0dd489c0d11abc87bee42ffca717db0480.tar.zst
wallabag-92504e0dd489c0d11abc87bee42ffca717db0480.zip
move dir check into constructor
-rw-r--r--src/Wallabag/CoreBundle/Security/Authentication/Provider/WsseProvider.php10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/Wallabag/CoreBundle/Security/Authentication/Provider/WsseProvider.php b/src/Wallabag/CoreBundle/Security/Authentication/Provider/WsseProvider.php
index c9b9b692..7e6a5dfb 100644
--- a/src/Wallabag/CoreBundle/Security/Authentication/Provider/WsseProvider.php
+++ b/src/Wallabag/CoreBundle/Security/Authentication/Provider/WsseProvider.php
@@ -17,6 +17,11 @@ class WsseProvider implements AuthenticationProviderInterface
17 { 17 {
18 $this->userProvider = $userProvider; 18 $this->userProvider = $userProvider;
19 $this->cacheDir = $cacheDir; 19 $this->cacheDir = $cacheDir;
20
21 // If cache directory does not exist we create it
22 if (!is_dir($this->cacheDir)) {
23 mkdir($this->cacheDir, 0777, true);
24 }
20 } 25 }
21 26
22 public function authenticate(TokenInterface $token) 27 public function authenticate(TokenInterface $token)
@@ -54,11 +59,6 @@ class WsseProvider implements AuthenticationProviderInterface
54 throw new NonceExpiredException('Previously used nonce detected'); 59 throw new NonceExpiredException('Previously used nonce detected');
55 } 60 }
56 61
57 // If cache directory does not exist we create it
58 if (!is_dir($this->cacheDir)) {
59 mkdir($this->cacheDir, 0777, true);
60 }
61
62 file_put_contents($this->cacheDir.'/'.$nonce, time()); 62 file_put_contents($this->cacheDir.'/'.$nonce, time());
63 63
64 // Validate Secret 64 // Validate Secret