X-Git-Url: http://git.roojs.org/?p=Pman.Core;a=blobdiff_plain;f=DataObjects%2FCore_person.php;h=0bca6db781ab1e9313891ef27deb555d9c446220;hp=db086ddf5bdb293561363cfef8e150d1438dc8fd;hb=aef2fedc2f293b10cca06d5579fe62c0c5b1186f;hpb=e44ecdfc0138e3faaba30d90579175092eef0c92 diff --git a/DataObjects/Core_person.php b/DataObjects/Core_person.php index db086ddf..0bca6db7 100644 --- a/DataObjects/Core_person.php +++ b/DataObjects/Core_person.php @@ -536,7 +536,7 @@ class Pman_Core_DataObjects_Core_person extends DB_DataObject return false; } - $cmd = "{$oathtool} --totp --base32 {$this->oath_key}"; + $cmd = "{$oathtool} --totp --base32 " . escapeshellarg($this->oath_key); $password = exec($cmd); @@ -675,12 +675,7 @@ class Pman_Core_DataObjects_Core_person extends DB_DataObject $s = DB_DataObject::Factory('core_setting'); $oath_require = $s->lookup('core', 'two_factor_authentication_requirement'); - - if(!empty($oath_require)) { - if($oath_require->val == 0) { - $aur['require_oath'] = 0; - } - } + $aur['require_oath'] = $oath_require ? $oath_require->val : 0; return $aur; }