src/Subfission/Cas/CasManager.php
protected function configureCas( $method = 'client' ) {
		if ( $this->config['cas_enable_saml'] ) {
			$server_type = SAML_VERSION_1_1;
		} else {
			// This allows the user to use 1.0, 2.0, etc as a string in the config
			$cas_version_str = 'CAS_VERSION_' . str_replace( '.', '_',
					$this->config['cas_version'] );

			// We pull the phpCAS constant values as this is their definition
			// PHP will generate a E_WARNING if the version string is invalid which is helpful for troubleshooting
			$server_type = constant( $cas_version_str );

			if ( is_null( $server_type ) ) {
				// This will never be null, but can be invalid values for which we need to detect and substitute.
				phpCAS::log( 'Invalid CAS version set; Reverting to defaults' );
				$server_type = CAS_VERSION_2_0;
			}
		}

		phpCAS::$method( $server_type, $this->config['cas_hostname'],
			(int) $this->config['cas_port'],
			$this->config['cas_uri'], $this->config['cas_control_session'] );

		if ( $this->config['cas_enable_saml'] ) {
			// Handle SAML logout requests that emanate from the CAS host exclusively.
			// Failure to restrict SAML logout requests to authorized hosts could
			// allow denial of service attacks where at the least the server is
			// tied up parsing bogus XML messages.
			phpCAS::handleLogoutRequests( true,
				explode( ',', $this->config['cas_real_hosts'] ) );
		}
	}
protected function configureCas( $method = 'client' ) {
		if ( $this->config['cas_enable_saml'] ) {
			$server_type = SAML_VERSION_1_1;
		} else {
			// This allows the user to use 1.0, 2.0, etc as a string in the config
			$cas_version_str = 'CAS_VERSION_' . str_replace( '.', '_',
					$this->config['cas_version'] );

			// We pull the phpCAS constant values as this is their definition
			// PHP will generate a E_WARNING if the version string is invalid which is helpful for troubleshooting
			$server_type = constant( $cas_version_str );

			if ( is_null( $server_type ) ) {
				// This will never be null, but can be invalid values for which we need to detect and substitute.
				phpCAS::log( 'Invalid CAS version set; Reverting to defaults' );
				$server_type = CAS_VERSION_2_0;
			}
		}

		phpCAS::$method( $server_type, $this->config['cas_hostname'],
			(int) $this->config['cas_port'],
			$this->config['cas_uri'], $this->config['cas_control_session'] );

		if ( $this->config['cas_enable_saml'] ) {
			// Handle SAML logout requests that emanate from the CAS host exclusively.
			// Failure to restrict SAML logout requests to authorized hosts could
			// allow denial of service attacks where at the least the server is
			// tied up parsing bogus XML messages.
			phpCAS::handleLogoutRequests( true,
				explode( ',', $this->config['cas_real_hosts'] ) );
		}
	}
Configure CAS Client|Proxy

@param $method