From fc52af24f1418d6590a2d37a0d8cc31b123e38f6 Mon Sep 17 00:00:00 2001 From: Thomas Bruederli <thomas@roundcube.net> Date: Tue, 19 Aug 2014 12:08:35 -0400 Subject: [PATCH] Fix merge error that disabled contact drag'n'drop --- plugins/password/drivers/directadmin.php | 30 +++++++++++++++--------------- 1 files changed, 15 insertions(+), 15 deletions(-) diff --git a/plugins/password/drivers/directadmin.php b/plugins/password/drivers/directadmin.php index 1be14f6..fb156ce 100644 --- a/plugins/password/drivers/directadmin.php +++ b/plugins/password/drivers/directadmin.php @@ -5,7 +5,7 @@ * * Driver to change passwords via DirectAdmin Control Panel * - * @version 2.0 + * @version 2.1 * @author Victor Benincasa <vbenincasa@gmail.com> * */ @@ -34,11 +34,11 @@ $Socket->set_method('POST'); $Socket->query('/CMD_CHANGE_EMAIL_PASSWORD', array( - 'email' => $da_user, - 'oldpassword' => $da_curpass, - 'password1' => $da_newpass, - 'password2' => $da_newpass, - 'api' => '1' + 'email' => $da_user, + 'oldpassword' => $da_curpass, + 'password1' => $da_newpass, + 'password2' => $da_newpass, + 'api' => '1' )); $response = $Socket->fetch_parsed_body(); @@ -62,15 +62,16 @@ * * Very, very basic usage: * $Socket = new HTTPSocket; - * echo $Socket->get('http://user:pass@somesite.com/somedir/some.file?query=string&this=that'); + * echo $Socket->get('http://user:pass@somehost.com:2222/CMD_API_SOMEAPI?query=string&this=that'); * * @author Phi1 'l0rdphi1' Stier <l0rdphi1@liquenox.net> + * @updates 2.7 and 2.8 by Victor Benincasa <vbenincasa @ gmail.com> * @package HTTPSocket - * @version 2.7 (Updated by Victor Benincasa <vbenincasa@gmail.com>) + * @version 2.8 */ class HTTPSocket { - var $version = '2.7'; + var $version = '2.8'; /* all vars are private except $error, $query_cache, and $doFollowLocationHeader */ @@ -107,7 +108,7 @@ { if (!is_numeric($port)) { - $port = 80; + $port = 2222; } $this->remote_host = $host; @@ -166,8 +167,8 @@ $this->error = $this->warn = array(); $this->result_status_code = NULL; - // is our request a http:// ... ? - if (preg_match('!^http://!i',$request)) + // is our request a http(s):// ... ? + if (preg_match('/^(http|https):\/\//i',$request)) { $location = parse_url($request); $this->connect($location['host'],$location['port']); @@ -185,7 +186,7 @@ $array_headers = array( 'User-Agent' => "HTTPSocket/$this->version", - 'Host' => ( $this->remote_port == 80 ? $this->remote_host : "$this->remote_host:$this->remote_port" ), + 'Host' => ( $this->remote_port == 80 ? parse_url($this->remote_host,PHP_URL_HOST) : parse_url($this->remote_host,PHP_URL_HOST).":".$this->remote_port ), 'Accept' => '*/*', 'Connection' => 'Close' ); @@ -447,8 +448,7 @@ function fetch_header( $header = '' ) { $array_headers = preg_split("/\r\n/",$this->result_header); - - $array_return = array( 0 => $array_headers[0] ); + $array_return = array( 0 => $array_headers[0] ); unset($array_headers[0]); foreach ( $array_headers as $pair ) -- Gitblit v1.9.1