diff options
author | Bruno Škvorc <bruno@skvorc.me> | 2016-02-07 12:47:03 +0100 |
---|---|---|
committer | Bruno Škvorc <bruno@skvorc.me> | 2016-02-07 12:47:03 +0100 |
commit | 0f782126134f87499534d3690b893b829151cfd1 (patch) | |
tree | dda0e4add2afc3797a6205352f98028b4f28d995 | |
parent | f83ccc1bf2a30c1148e02c8ea8b766903828fa9a (diff) | |
parent | af86f3abef6781e719c9a28b0fe9b5c9f794bf94 (diff) | |
download | gatekeeper-0f782126134f87499534d3690b893b829151cfd1.zip gatekeeper-0f782126134f87499534d3690b893b829151cfd1.tar.gz gatekeeper-0f782126134f87499534d3690b893b829151cfd1.tar.bz2 |
Merge pull request #1 from psecio/master
Sync from original
-rw-r--r-- | docs/installation-and-configuration.md | 3 | ||||
-rw-r--r-- | src/Psecio/Gatekeeper/Handler/FindBy.php | 4 | ||||
-rw-r--r-- | src/Psecio/Gatekeeper/Session/RememberMe.php | 2 |
3 files changed, 5 insertions, 4 deletions
diff --git a/docs/installation-and-configuration.md b/docs/installation-and-configuration.md index d5dc9ba..89180a9 100644 --- a/docs/installation-and-configuration.md +++ b/docs/installation-and-configuration.md @@ -26,7 +26,8 @@ There's a "quick start" method for getting Gatekeeper up and running in two step ``` create database gatekeeper; -grant all on gatekeeper.* to 'gk-user'@'localhost' identified by 'some-password-here'; +CREATE USER 'gk-user'@'localhost' IDENTIFIED BY 'some-password-here'; +grant all on gatekeeper.* to 'gk-user'@'localhost'; flush privileges; ``` diff --git a/src/Psecio/Gatekeeper/Handler/FindBy.php b/src/Psecio/Gatekeeper/Handler/FindBy.php index a2504e8..f943315 100644 --- a/src/Psecio/Gatekeeper/Handler/FindBy.php +++ b/src/Psecio/Gatekeeper/Handler/FindBy.php @@ -86,7 +86,7 @@ class FindBy extends \Psecio\Gatekeeper\Handler $model = substr($name, 0, strlen($name) - 1); $collectionNs = '\\Psecio\\Gatekeeper\\'.$model.'Collection'; if (!class_exists($collectionNs)) { - throw new \Psecio\Gatekepper\Exception\ModelNotFoundException('Collection type '.$model.' could not be found'); + throw new \Psecio\Gatekeeper\Exception\ModelNotFoundException('Collection type '.$model.' could not be found'); } $model = g::modelFactory($model.'Model'); $collection = new $collectionNs($this->getDb()); @@ -94,4 +94,4 @@ class FindBy extends \Psecio\Gatekeeper\Handler return $collection; } -}
\ No newline at end of file +} diff --git a/src/Psecio/Gatekeeper/Session/RememberMe.php b/src/Psecio/Gatekeeper/Session/RememberMe.php index 1402ef0..de603e9 100644 --- a/src/Psecio/Gatekeeper/Session/RememberMe.php +++ b/src/Psecio/Gatekeeper/Session/RememberMe.php @@ -188,7 +188,7 @@ class RememberMe */ public function isExpired(\Psecio\Gatekeeper\AuthTokenModel $token, $delete = true) { - if (new \Datetime() > new \DateTime($token->expires)) { + if ($token->expires !== null && new \Datetime() > new \DateTime($token->expires)) { if ($delete === true) { $this->deleteToken($token->token); } |