* baseURL + /Core/Lock/lock?on_id=...&on_table=...
* - returns id or an array of who has the locks.
*
+ * Force an unlock after a warning..
* baseURL + /Core/Lock/lock?on_id=...&on_table=...&force=1
* - returns id..
*
{
// default action is to attempt to lock..
- $action = empty($action) ? 'lock' : 'unlock';
- $this->$action($curlock);
-
-
-
+ $action = empty($action) || $action == 'lock' ? 'lock' : 'unlock';
+ $this->$action();
}
- function unlock($curlock)
+ function unlock()
{
if (empty($_REQUEST['id'])) {
));
- $nlocks = $curlock->count()
+ $nlocks = $curlock->count() ;
if ($nlocks && empty($_REQUEST['force'])) {
$curlock->selectAdd();
$curlock->selectAdd('distinct(person_id), created');
$ret[$p->id] = $p->toRooArray();
$ret[$p->id]->lock_created = $ar[$p->id];
}
- $this->jok($ret);
+ $this->jok(array_values($ret));
}
if ($nlocks) {