PHP Classes

Thank You! and bugs

Recommend this page to a friend!

      cPanel API  >  All threads  >  Thank You! and bugs  >  (Un) Subscribe thread alerts  
Subject:Thank You! and bugs
Summary:Thank you very much! I found some bugs.
Messages:2
Author:Jim A
Date:2006-12-03 04:07:31
Update:2006-12-03 05:26:01
 

  1. Thank You! and bugs   Reply   Report abuse  
Picture of Jim A Jim A - 2006-12-03 04:07:31
Thank you very much for this class! I have been looking for just such a class for quite some time.

I did find some bugs I though you'd like to know about...

-------------------------------------
class HTTP
{
function HTTP($host, $username, $password, $port = 2082, $ssl = '', $theme = 'x')
{
$ssl = $ssl ? 'ssl://' : '';
$this->username = $username;
$this->password = $password;
$this->theme = $theme;
$this->auth = base64_encode($username . ':' . $password);
$this->port = $port;
$this->host = $ssl . $host; //| Bug - ssl not handled separately in code
$this->path = '/frontend/' . $theme . '/';
$this->ssl = "";//| Changed - added because HTTP->ssl is referenced. Need for PHP5. Note: Code bombs if set to $ssl - some paths become ssl://ssl://.
}
---------------------
class emailAccount
{
/**
* @ignore
*/
function emailAccount($host, $username, $password, $port = 2082, $ssl = false, $theme = 'x', $address)
{
$this->HTTP = new HTTP($host, $username, $password, $port, $ssl, $theme);
//| Changed because master account can be listed without a domain
$pos = strpos($address, '@');
if ($pos === false) {
list($this->email, $this->domain) = array($address,"");
} else {
list($this->email, $this->domain) = explode('@', $address);
}
}
------------------------
function getDefaultAddress()
{
//| Changed
$data = $this->HTTP->getData('mail/def.html');
$default = explode('<b>' . $this->domain . '</b>', $data);
if (isset($default[1])){
// default account has no @
$default = explode('<td>', $default[1]);
$default = explode('</td>', $default[1]);
}
return trim($default[0]);
}

  2. Re: Thank You! and bugs   Reply   Report abuse  
Picture of brendan brendan - 2006-12-03 05:26:01 - In reply to message 1 from Jim A
Thanks, I'll add these changes in the next release.