From b9bbc089c9f0472f16c56578a20d1bc9785792a0 Mon Sep 17 00:00:00 2001 From: insects Date: Wed, 12 Mar 2025 14:20:15 +0100 Subject: [PATCH] fix: don't allow setting pop timer past 120 mins --- app/controllers/instance_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/instance_controller.rb b/app/controllers/instance_controller.rb index 5cfa8d9..1817f92 100644 --- a/app/controllers/instance_controller.rb +++ b/app/controllers/instance_controller.rb @@ -97,7 +97,7 @@ class InstanceController < ApplicationController def adjust_pop instance_id, nm, pwd = pop_instance_params parent_instance = Instance.find_by(public_id: instance_id) - if params[:mins] && params[:pwd] == parent_instance.password + if params[:mins] && params[:mins].to_i < 120 && params[:pwd] == parent_instance.password ts = Time.now.utc pop = Pop.find_by(instance_id: parent_instance.id, name: nm) pop.created_at = Time.at(ts - params[:mins].to_i.minutes).utc