sync
authorAlan Knowles <alan@roojs.com>
Thu, 19 Jan 2017 01:54:01 +0000 (09:54 +0800)
committerAlan Knowles <alan@roojs.com>
Thu, 19 Jan 2017 01:54:01 +0000 (09:54 +0800)
DataObjects/Core_person.php
DataObjects/Events.php

index 635ff1c..d93f84a 100644 (file)
@@ -263,8 +263,7 @@ class Pman_Core_DataObjects_Core_person extends DB_DataObject
         if (!empty($_SESSION[get_class($this)][$sesPrefix .'-auth'])) {
             // in session...
             $a = unserialize($_SESSION[get_class($this)][$sesPrefix .'-auth']);
-            
-            
+             
             $u = DB_DataObject::factory($this->tableName());
             if ($a->id && $u->get($a->id)) { //&& strlen($u->passwd)) {
               
@@ -446,7 +445,7 @@ class Pman_Core_DataObjects_Core_person extends DB_DataObject
         }
         
         // open up iptables at login..
-        $dbname = $this->database();
+        $dbname = $this->databaseNickname();
         touch( '/tmp/run_pman_admin_iptables-'.$dbname);
          
         // refresh admin group if we are logged in as one..
@@ -1208,9 +1207,9 @@ class Pman_Core_DataObjects_Core_person extends DB_DataObject
         
         $appname = empty($ff->appNameShort) ? $ff->project : $ff->project . '-' . $ff->appNameShort;
         
-        $db = $this->getDatabaseConnection();
+        $dname = method_exists($this, 'getDatabaseConnection') ? $this->getDatabaseConnection()->dsn['database'] : $this->databaseNickname();
         
-        $sesPrefix = $appname.'-' .get_class($this) .'-'.$db->dsn['database'] ;
+        $sesPrefix = $appname.'-' .get_class($this) .'-' . $dname;
 
         return $sesPrefix;
     }
index 521ead8..87c3abc 100644 (file)
@@ -312,7 +312,7 @@ class Pman_Core_DataObjects_Events extends DB_DataObject
         } else {
             $col = $au->tableName() == "Person" ? 'person_id' : $au->tableName() . '_id';
             // does $col exist?
-            $cols = $this->table();
+            $cols = $this->tableColumns();
             $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;