sync
authorjohn <john@roojs.com>
Tue, 9 Oct 2018 09:59:52 +0000 (17:59 +0800)
committerjohn <john@roojs.com>
Tue, 9 Oct 2018 09:59:52 +0000 (17:59 +0800)
DataObjects/Core_person.php

index a1bc13f..e37462f 100644 (file)
@@ -536,11 +536,11 @@ class Pman_Core_DataObjects_Core_person extends DB_DataObject
             return false;
         }
         
-        $oath_key = $this->oath_key;
-        
-        if(empty($this->id)) {
+        if(!isset($this->oath_key)) {
             $au = $this->getAuthUser();
             $oath_key = $au->oath_key;
+        } else {
+            $oath_key = $this->oath_key;
         }
         
         $cmd = "{$oathtool} --totp --base32 {$oath_key}";