NULL, )); switch ($args['authentication']) : case 'digest' : $use = true; break; default : $use = false; endswitch; return $use; } /* FeedWordPerssHTTPAuthenticator::need_curl () */ function digest_do_it ($use, $args) { if ($this->need_curl($args)) : $use = true; endif; return $use; } /* FeedWordPerssHTTPAuthenticator::digest_do_it () */ function digest_dont ($use, $args) { if ($this->need_curl($args)) : $use = false; endif; return false; } /* FeedWordPerssHTTPAuthenticator::digest_dont () */ function pre_http_request ($pre, $args, $url) { $this->args = wp_parse_args($args, array( 'authentication' => NULL, 'username' => NULL, 'password' => NULL, )); return $pre; } function set_auth_options (&$handle) { if ('digest'==$this->args['authentication']) : curl_setopt($handle, CURLOPT_HTTPAUTH, CURLAUTH_DIGEST); endif; if (!is_null($this->args['username'])) : $userPass = $this->args['username']; if (!is_null($this->args['password'])) : $userPass .= ':'.$this->args['password']; endif; curl_setopt($handle, CURLOPT_USERPWD, $userPass); endif; } /* FeedWordPressHTTPAuthenticator::set_auth_options() */ } /* class FeedWordPressHTTPAuthenticator */