original_string: 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;
      }
code: 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;
      }
code_tokens: 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 ; }
docstring: Should a user be authorized using two factor authentication?
  
  @param string $ipAddress
  @param boolean $hasKey
  @return boolean
docstring_tokens: Should a user be authorized using two factor authentication?