diff --git a/lib.php b/lib.php index bbedc39e..998da8d4 100644 --- a/lib.php +++ b/lib.php @@ -197,8 +197,8 @@ public function unenrol_user(stdClass $instance, $userid) { $refundperiod = get_config('enrol_wallet', 'unenrolrefundperiod'); $now = time(); if ( - $now < $enrolend - || ($enrolstart - $now) > $refundperiod + $now > $enrolend + || ($now - $enrolstart) > $refundperiod ) { // Condition for refunding aren't met. return parent::unenrol_user($instance, $userid);