DataObjects/Core_person.php
authorjohn <john@roojs.com>
Thu, 11 Oct 2018 03:50:50 +0000 (11:50 +0800)
committerjohn <john@roojs.com>
Thu, 11 Oct 2018 03:50:50 +0000 (11:50 +0800)
DataObjects/Core_person.php

index f0c839b..88e6ab8 100644 (file)
@@ -777,8 +777,11 @@ class Pman_Core_DataObjects_Core_person extends DB_DataObject
             
             $hash = $this->generateOathKey();
             
-            $_SESSION[__CLASS__] = isset($_SESSION[__CLASS__]) ? $_SESSION[__CLASS__] : array();
-            $_SESSION[__CLASS__]['oath'] = isset($_SESSION[__CLASS__]['oath']) ? $_SESSION[__CLASS__]['oath'] : array();
+            $_SESSION[__CLASS__] = 
+                isset($_SESSION[__CLASS__]) ? $_SESSION[__CLASS__] : array();
+            $_SESSION[__CLASS__]['oath'] = 
+                isset($_SESSION[__CLASS__]['oath']) ? $_SESSION[__CLASS__]['oath'] : array();
+                
             $_SESSION[__CLASS__]['oath'][$person->id] = $hash;
 
             $qrcode = $person->generateQRCode($hash);
@@ -798,12 +801,8 @@ class Pman_Core_DataObjects_Core_person extends DB_DataObject
             $person->oath_key = $_SESSION[__CLASS__]['oath'][$person->id];
             
             if($person->checkTwoFactorAuthentication($q['two_factor_auth_code'])) {
-                
-                
                 $person->update($o);
-                
                 unset($_SESSION[__CLASS__]['oath'][$person->id]);
-                
                 $roo->jok('DONE');
             }