X-Git-Url: http://git.roojs.org/?a=blobdiff_plain;f=DataObjects%2FCore_person.php;h=b22033e144bf4e654a26a82395f8202bfba5c597;hb=f20faebe4c3fcada27e75e7f5ad84d2d801200fd;hp=e71b202b80805b35461a28166317d863b70d4f53;hpb=90f995d3743bf144536e3ad8b1172e44079bce42;p=Pman.Core diff --git a/DataObjects/Core_person.php b/DataObjects/Core_person.php index e71b202b..b22033e1 100644 --- a/DataObjects/Core_person.php +++ b/DataObjects/Core_person.php @@ -306,16 +306,20 @@ class Pman_Core_DataObjects_Core_person extends DB_DataObject if (!empty($ff->Pman['local_autoauth']) && $ff->Pman['local_autoauth'] === true) { $auto_auth_allow = true; } - if ( - (!empty($_SERVER['SERVER_ADDR'])) && + if ( !empty($ff->Pman['local_autoauth']) + && + !empty($_SERVER['SERVER_ADDR']) && + !empty($_SERVER['REMOTE_ADDR']) && ( - $_SERVER['SERVER_ADDR'] == '127.0.0.1' && - $_SERVER['REMOTE_ADDR'] == '127.0.0.1' - ) - || - ( - $_SERVER['SERVER_ADDR'] == '::1' && - $_SERVER['REMOTE_ADDR'] == '::1' + ( + $_SERVER['SERVER_ADDR'] == '127.0.0.1' && + $_SERVER['REMOTE_ADDR'] == '127.0.0.1' + ) + || + ( + $_SERVER['SERVER_ADDR'] == '::1' && + $_SERVER['REMOTE_ADDR'] == '::1' + ) ) ){ @@ -341,6 +345,7 @@ class Pman_Core_DataObjects_Core_person extends DB_DataObject "); if($member->find(true)){ $default_admin = DB_DataObject::factory($this->tableName()); + $default_admin->autoJoin(); if(!$default_admin->get($member->user_id)){ $default_admin = false; } @@ -348,11 +353,11 @@ class Pman_Core_DataObjects_Core_person extends DB_DataObject } //var_dump($ff->Pman['local_autoauth']); var_dump($_SERVER); exit; - $u = DB_DataObject::factory($this->tableName() + $u = DB_DataObject::factory($this->tableName()); $u->autoJoin(); $ff = HTML_FlexyFramework::get(); - if ($auto_auth_allow && + if ($auto_auth_allow && ($default_admin || $u->get('email', $ff->Pman['local_autoauth'])) ) { @@ -688,7 +693,7 @@ class Pman_Core_DataObjects_Core_person extends DB_DataObject $aur['require_oath'] = 1; $s = DB_DataObject::Factory('core_setting'); - $oath_require = $s->lookup('core', 'two_factor_authentication_requirement'); + $oath_require = $s->lookup('core', 'two_factor_auth_required'); $aur['require_oath'] = $oath_require ? $oath_require->val : 0; return $aur;