From 8bba4fa516e4b9adba48b1f5bb6b3af919b3ec5c Mon Sep 17 00:00:00 2001 From: coderkun Date: Thu, 24 Apr 2014 12:15:26 +0200 Subject: [PATCH] do not achieve Achievements with reached deadline or no conditions --- app/controllers/SeminaryController.inc | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/app/controllers/SeminaryController.inc b/app/controllers/SeminaryController.inc index afdea5f8..b20f4d3c 100644 --- a/app/controllers/SeminaryController.inc +++ b/app/controllers/SeminaryController.inc @@ -165,6 +165,11 @@ // Check conditions foreach($achievements as &$achievement) { + // Check deadline + if($achievement['deadline'] < date('Y-m-d H:i:s')) { + continue; + } + // Get conditions $conditions = array(); $progress = 0; @@ -237,6 +242,11 @@ break; } + // Do not achieve Achievements without conditions + if(empty($conditions)) { + continue; + } + // Check conditions $achieved = ($achievement['all_conditions'] == 1); foreach($conditions as &$condition)