projects
/
Pman.Core
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
1a70691
)
Lock.php
author
Alan Knowles
<alan@akbkhome.com>
Thu, 18 Nov 2010 09:02:32 +0000
(17:02 +0800)
committer
Alan Knowles
<alan@akbkhome.com>
Thu, 18 Nov 2010 09:02:32 +0000
(17:02 +0800)
Lock.php
patch
|
blob
|
history
diff --git
a/Lock.php
b/Lock.php
index
6fb4a4f
..
0e32640
100644
(file)
--- a/
Lock.php
+++ b/
Lock.php
@@
-102,23
+102,36
@@
class Pman_Core_Lock extends Pman
$cc = clone($curlock);
// the user who owns the lock is not logged in.. ?? - their last
$curlock->find();
$cc = clone($curlock);
// the user who owns the lock is not logged in.. ?? - their last
$curlock->find();
- $u
= false
;
+ $u
sers = array()
;
while ($curlock->fetch()) {
$u = DB_DataObject::factory('Person');
$u->get($curlock->person_id);
if (!$u->isCurrentlyLoggedIn()) {
$cc = clone($curlock);
$cc->delete();
while ($curlock->fetch()) {
$u = DB_DataObject::factory('Person');
$u->get($curlock->person_id);
if (!$u->isCurrentlyLoggedIn()) {
$cc = clone($curlock);
$cc->delete();
- $u = false;
continue;
}
continue;
}
-
break
;
+
$users[] = clone($u)
;
}
}
- if (
$u
) {
-
$this->jerr("Item is Locked by " . $u->name . ' (' . $u->email . "), Try asking them to log out")
;
+ if (
empty($users)
) {
+
return true
;
}
}
+ // situations
+
+ //- the user is logged in, and we can clear it..
+
+ //- the user is logged in multiple times, on different browser..
+
+ //- the user is logged in multiple times on the same browser..
+
+
+
+ // one of two error messages..
+
+ $this->jerr("Item is Locked by " . $u->name . ' (' . $u->email . "), Try asking them to log out");
+
return true;
return true;