}
$this->person_name = $au && !empty($au->name) ? $au->name : '';
- if (isset($au->id) && empty($au->id)) {
+ if (empty($au) || (isset($au->id) && empty($au->id))) {
// not authenticated - and a standard id based object
$this->person_id = 0;
} else {
- $this->person_id = $au ? (!empty($au->id) ? $au->id : $au->pid()) : -1;
+ $col = $au->tableName() == "Person" ? 'person_id' : $au->tableName() . '_id';
+ // does $col exist?
+ $cols = $this->table();
+ $col = isset($cols[$col]) ? $col : 'person_id'; // for BC.... - revert to using person_id
+ $this->{$col} = $au->pid();
+ //$this->person_id = $au ? (!empty($au->id) ? $au->id : $au->pid()) : -1;
}
$this->person_table = $au ? $au->tableName() : '';
$this->ipaddr = isset($_SERVER["REMOTE_ADDR"]) ? $_SERVER["REMOTE_ADDR"] : 'cli';
}
}
- $deleted = $this->deletedRecord(false, false);
$i=0;
$files = array();
'GET' => empty($_GET) ? array() : $_GET,
'POST' =>$p,
'FILES' => $files,
- 'RELATED_DATAOBJECT' => $deleted
+
);
+ if (!empty(self::$deleted)) {
+ $out['DELETED_DATAOBJECTS'] = self::$deleted;
+ }
if (!empty($extra_data)) {
$out['EXTRA'] = $extra_data;
}