sync
authorAlan Knowles <alan@roojs.com>
Wed, 11 Apr 2018 03:09:19 +0000 (11:09 +0800)
committerAlan Knowles <alan@roojs.com>
Wed, 11 Apr 2018 03:09:19 +0000 (11:09 +0800)
Pman.php
Pman/Login.php

index 9357184..7a1c743 100644 (file)
--- a/Pman.php
+++ b/Pman.php
@@ -1046,7 +1046,7 @@ class Pman extends HTML_FlexyFramework_Page
         $e = DB_DataObject::factory('Events');
         $e->init($act,$obj,$remarks); 
          
-        $e->event_when = date('Y-m-d H:i:s');
+        $e->event_when = $e->sqlValue('NOW()');
         
         $eid = $e->insert();
         
@@ -1071,7 +1071,7 @@ class Pman extends HTML_FlexyFramework_Page
         $e = DB_DataObject::factory('Events');
         $e->init($act,$obj,$remarks); 
          
-        $e->event_when = date('Y-m-d H:i:s');
+        $e->event_when = $e->sqlValue('NOW()');
         $wa = DB_DataObject::factory('core_watch');
         if (method_exists($wa,'notifyEvent')) {
             $wa->notifyEvent($e); // trigger any actions..
index 5901697..f1cf949 100644 (file)
@@ -172,7 +172,6 @@ class Pman_Login extends Pman
             
     }
 
-    
     function switchUser($id)
     {
         $tbl = empty($ff->Pman['authTable']) ? 'core_person' : $ff->Pman['authTable'];
@@ -183,13 +182,11 @@ class Pman_Login extends Pman
         
         $au = $u->getAuthUser();
         
-        
         // first check they have perms to do this..
         if (!$au|| ($au->company()->comptype != 'OWNER') || !$this->hasPerm('Core.Person', 'E')) {
             $this->jerr("User switching not permitted");
         }
-        
-        
+                
         $u = DB_DataObject::factory($tbl);
         $u->get($id);
         if (!$u->active()) {
@@ -197,7 +194,7 @@ class Pman_Login extends Pman
         }
         $u->login();
             // we might need this later..
-        $this->addEvent("SWITCH USER", false, $au->name . ' TO ' . $u->name);
+        $this->addEvent("SWITCH-USER", false, $au->name . ' TO ' . $u->name);
         $this->jok("SWITCH");
         
     }