projects
/
Pman.Core
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
0f3d152
)
DataObjects/Person.php
author
Alan Knowles
<alan@roojs.com>
Mon, 17 Dec 2012 03:07:19 +0000
(11:07 +0800)
committer
Alan Knowles
<alan@roojs.com>
Mon, 17 Dec 2012 03:07:19 +0000
(11:07 +0800)
DataObjects/Person.php
patch
|
blob
|
history
diff --git
a/DataObjects/Person.php
b/DataObjects/Person.php
index
32f0ec4
..
ac9064e
100644
(file)
--- a/
DataObjects/Person.php
+++ b/
DataObjects/Person.php
@@
-809,8
+809,10
@@
class Pman_Core_DataObjects_Person extends DB_DataObject
}
function onInsert($req, $roo)
{
-
- if ($roo->authUser->id < 0) {
+ $p = DB_DataObject::factory('Person');
+ if ($roo->authUser->id < 0 && $p->count() == 1) {
+ // this seems a bit risky...
+
$g = DB_DataObject::factory('Groups');
$g->type = 0;
$g->get('name', 'Administrators');