summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'plugins')
-rw-r--r--plugins/password/drivers/directadmin.php26
-rw-r--r--plugins/show_additional_headers/package.xml6
-rw-r--r--plugins/show_additional_headers/show_additional_headers.php5
3 files changed, 19 insertions, 18 deletions
diff --git a/plugins/password/drivers/directadmin.php b/plugins/password/drivers/directadmin.php
index 1be14f6e8..657c21eb4 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>
*
*/
@@ -62,16 +62,17 @@ class rcube_directadmin_password
*
* 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 */
var $method = 'GET';
@@ -107,7 +108,7 @@ class HTTPSocket {
{
if (!is_numeric($port))
{
- $port = 80;
+ $port = 2222;
}
$this->remote_host = $host;
@@ -166,13 +167,13 @@ class HTTPSocket {
$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']);
$this->set_login($location['user'],$location['pass']);
-
+
$request = $location['path'];
$content = $location['query'];
@@ -185,7 +186,7 @@ class HTTPSocket {
$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' );
@@ -325,7 +326,7 @@ class HTTPSocket {
}
}
-
+
list($this->result_header,$this->result_body) = preg_split("/\r\n\r\n/",$this->result,2);
if ($this->bind_host)
@@ -364,6 +365,7 @@ class HTTPSocket {
$this->query($headers['location']);
}
}
+
}
function getTransferSpeed()
@@ -447,7 +449,7 @@ class HTTPSocket {
function fetch_header( $header = '' )
{
$array_headers = preg_split("/\r\n/",$this->result_header);
-
+
$array_return = array( 0 => $array_headers[0] );
unset($array_headers[0]);
diff --git a/plugins/show_additional_headers/package.xml b/plugins/show_additional_headers/package.xml
index 00d65812b..7297916c3 100644
--- a/plugins/show_additional_headers/package.xml
+++ b/plugins/show_additional_headers/package.xml
@@ -15,10 +15,10 @@
<email>roundcube@gmail.com</email>
<active>yes</active>
</lead>
- <date>2011-11-21</date>
+ <date>2012-04-23</date>
<version>
- <release>1.1</release>
- <api>1.1</api>
+ <release>2.0</release>
+ <api>2.0</api>
</version>
<stability>
<release>stable</release>
diff --git a/plugins/show_additional_headers/show_additional_headers.php b/plugins/show_additional_headers/show_additional_headers.php
index cc71421ee..69ac7f2a7 100644
--- a/plugins/show_additional_headers/show_additional_headers.php
+++ b/plugins/show_additional_headers/show_additional_headers.php
@@ -42,9 +42,8 @@ class show_additional_headers extends rcube_plugin
{
$rcmail = rcmail::get_instance();
foreach ((array)$rcmail->config->get('show_additional_headers', array()) as $header) {
- $key = strtolower($header);
- if ($value = $p['headers']->others[$key])
- $p['output'][$key] = array('title' => $header, 'value' => Q($value));
+ if ($value = $p['headers']->get($header))
+ $p['output'][$header] = array('title' => $header, 'value' => Q($value));
}
return $p;