public function isTwoFactorRequired($ipAddress, $hasKey)
    {
        // \MUtil_Echo::track($ipAddress, $hasKey, $this->_get('ggp_2factor_set'), $this->_get('ggp_2factor_not_set'));
        
        if ($hasKey) {
            switch ($this->_get('ggp_2factor_set')) {
                case self::TWO_FACTOR_SET_REQUIRED:
                    return true;

                case self::TWO_FACTOR_SET_OUTSIDE_ONLY:
                    // Required when not in range
                    return ! $this->util->isAllowedIP($ipAddress, $this->_get('ggp_no_2factor_ip_ranges'));
            }
        } else {
            switch ($this->_get('ggp_2factor_not_set')) {
                case self::NO_TWO_FACTOR_INSIDE_ONLY:
                    // Required even when not set when not in range
                    return ! $this->util->isAllowedIP($ipAddress, $this->_get('ggp_no_2factor_ip_ranges'));
            }
        }

        return false;
    }