- Добавлена проверка валидности по дате

parent 3d507dc8
...@@ -686,8 +686,12 @@ class User extends \common\components\ActiveRecordModel implements IdentityInter ...@@ -686,8 +686,12 @@ class User extends \common\components\ActiveRecordModel implements IdentityInter
*/ */
public function checkToAutoAuthByHash($hash) public function checkToAutoAuthByHash($hash)
{ {
$date = new \DateTime();
/** @var AuthHashes $data */
$data = AuthHashes::find()->where(['hash' => $hash, 'email' => $this->email]); $data = AuthHashes::find()->where(['hash' => $hash, 'email' => $this->email]);
if (!is_null($data)) { if (!is_null($data)) {
$dataDate = new \DateTime($data->valid_date);
if ($date<=$dataDate)
return true; return true;
} }
return false; return false;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment