DataObjects/Events.php
[Pman.Core] / DataObjects / Events.php
index 9874213..08f5393 100644 (file)
@@ -334,6 +334,18 @@ class Pman_Core_DataObjects_Events extends DB_DataObject
             $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->who = $au->name;
+            
+            if($au->tableName() == "modx_users"){
+               $e = PDO_DataObject::factory('ext_data');
+               $e->setFrom(array(            
+                  'userdata_id' => $au->pid(),            
+               ));                  
+               if($e->find(true)){                     
+                   $this->who = $e->getUserName();                   
+               }               
+            }
         }
         $this->person_table = $au ? $au->tableName() : '';
         $this->ipaddr = isset($_SERVER["REMOTE_ADDR"]) ? $_SERVER["REMOTE_ADDR"] : 'cli';
@@ -431,6 +443,8 @@ class Pman_Core_DataObjects_Events extends DB_DataObject
                 $this->ipaddr = $_SERVER['HTTP_X_FORWARDED_FOR'];
             }
         }
+        print_r($this);
+        exit;
     }
     
     function beforeUpdate($old, $request,$roo)