function authUserArray()
{
-
$aur = $this->toArray();
if ($this->id < 1) {
return $aur;
}
-
//DB_DataObject::debugLevel(1);
$c = DB_Dataobject::factory('core_company');
$im = DB_Dataobject::factory('Images');
$oath_require = $s->lookup('core', 'two_factor_auth_required');
$aur['require_oath'] = $oath_require ? $oath_require->val : 0;
+ $aur['core_person_settings'] = array();
+
+ $core_person_settings = DB_DataObject::factory('core_person_settings');
+ $core_person_settings->setFrom(array(
+ 'person_id' => $this->id
+ ));
+
+ foreach ($core_person_settings->fetchAll() as $k => $v) {
+ $aur['core_person_settings'][$v->scope] = $v->toArray();
+ }
+
return $aur;
}
--- /dev/null
+<?php
+/**
+ * Table Definition for Core_person_settings
+ */
+class_exists('DB_DataObject') ? '' : require_once 'DB/DataObject.php';
+
+class Pman_Core_DataObjects_Core_person_settings extends DB_DataObject
+{
+ ###START_AUTOCODE
+ /* the code below is auto generated do not remove the above tag */
+
+ public $__table = 'core_person_settings';
+ public $id;
+ public $person_id;
+ public $scope;
+ public $data;
+
+ /* the code above is auto generated do not remove the tag below */
+ ###END_AUTOCODE
+
+ function beforeInsert($q, $roo)
+ {
+ if(
+ !$roo->authUser ||
+ (!empty($this->person_id) && $this->person_id != $roo->authUser->id)
+ ) {
+ $roo->jerr('Access Dennied');
+ }
+
+ }
+
+ function beforeUpdate($old, $q, $roo)
+ {
+ if(
+ !$roo->authUser ||
+ (!empty($this->person_id) && $this->person_id != $roo->authUser->id)
+ ) {
+ $roo->jerr('Access Dennied');
+ }
+ }
+
+ }
authorized_by = core_person:id
updated_by = core_person:id
-
-
+[core_person_settings]
+person_id = core_person:id
[database__render]
core_project = name
--- /dev/null
+
+CREATE TABLE core_person_settings (
+ id int(11) NOT NULL auto_increment,
+ PRIMARY KEY (id)
+);
+
+ALTER TABLE core_person_settings ADD COLUMN person_id INT(11) NOT NULL DEFAULT 0;
+ALTER TABLE core_person_settings ADD COLUMN scope VARCHAR(254) NOT NULL DEFAULT '';
+ALTER TABLE core_person_settings ADD COLUMN data TEXT NOT NULL DEFAULT '';
\ No newline at end of file