allow force unlock / index on holidays
authorAlan Knowles <alan@roojs.com>
Tue, 4 May 2021 02:59:41 +0000 (10:59 +0800)
committerAlan Knowles <alan@roojs.com>
Tue, 4 May 2021 02:59:41 +0000 (10:59 +0800)
Lock.php
sql/core_holiday.sql

index b0e7ea9..3f1494b 100644 (file)
--- a/Lock.php
+++ b/Lock.php
@@ -77,7 +77,7 @@ class Pman_Core_Lock extends Pman
             $this->jok("No lock exists"); // been deleted before.. probably ok..
         }
         
-        if ($curlock->person_id != $this->authUser->id) {
+        if ($curlock->person_id != $this->authUser->id && empty($_REQUEST['force'])) {
             // this is an error conditon..
             $this->jerr("Lock id is invalid");
         }
index f0449bb..4880851 100644 (file)
@@ -7,3 +7,4 @@ ALTER TABLE core_holiday ADD COLUMN holiday_date DATE NOT NULL DEFAULT '0000-00-
 ALTER TABLE core_holiday ADD COLUMN country VARCHAR(4) NOT NULL DEFAULT '';
 
 
+alter table core_holiday add index lookup (holiday_date, country);