From eef8317ab86a5e026dd2e9645b9b25f984ba2bc3 Mon Sep 17 00:00:00 2001 From: Alan Knowles Date: Thu, 18 Nov 2010 18:13:17 +0800 Subject: [PATCH] Pman/Roo.php --- Pman/Roo.php | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/Pman/Roo.php b/Pman/Roo.php index 632d3ad..f9ae3d9 100644 --- a/Pman/Roo.php +++ b/Pman/Roo.php @@ -461,6 +461,42 @@ class Pman_Roo extends Pman $this->jerr("PERMISSION DENIED"); } + // check any locks.. + // only done if we recieve a lock_id. + // we are very trusing here.. that someone has not messed around with locks.. + // the object might want to check in their checkPerm - if locking is essential.. + + $lock = DB_DataObjecT::factory('Core_locking'); + if (is_a($lock,'DB_DataObject')) { + + $lock->on_id = $x->id; + $lock->on_table= $x->tableName(); + if (!empty($_REQUEST['_lock_id'])) { + $lock->whereAdd('id != ' . ((int)$_REQUEST['_lock_id'])); + } + $lock->limit(1); + if ($lock->find(true)) { + // it's locked by someone else.. + $p = $lock->person(); + $this->jerr("Your lock is invalid, This record is locked by " . $p->name . " at " $lock->created); + } + // check the users lock.. + + } + + + if ($lock->find(true)) { + if (empty($_REQUEST['_lock_id']) || $lock->id != $_REQUEST['_lock_id']) { + + $this->jerr(" + + } + + } + + + + $_columns = !empty($req['_columns']) ? explode(',', $req['_columns']) : false; -- 2.39.2