Aleksander Machniak
2012-12-17 d6938bd1ea3058b21efa25a17a4437195c484067
plugins/password/drivers/cpanel.php
@@ -54,27 +54,25 @@
   function getData($url, $data = '')
   {
      $url = $this->path . $url;
      if(is_array($data))
      {
        if (is_array($data)) {
         $url = $url . '?';
         foreach($data as $key=>$value)
         {
            foreach ($data as $key => $value) {
            $url .= urlencode($key) . '=' . urlencode($value) . '&';
         }
         $url = substr($url, 0, -1);
      }
      $response = '';
      $fp = fsockopen($this->ssl . $this->host, $this->port);
      if(!$fp)
      {
        if (!$fp) {
         return false;
      }
      $out = 'GET ' . $url . ' HTTP/1.0' . "\r\n";
      $out .= 'Authorization: Basic ' . $this->auth . "\r\n";
      $out .= 'Connection: Close' . "\r\n\r\n";
      fwrite($fp, $out);
      while (!feof($fp))
      {
        while (!feof($fp)) {
         $response .= @fgets($fp);
      }
      fclose($fp);
@@ -88,12 +86,10 @@
   function emailAccount($host, $username, $password, $port, $ssl, $theme, $address)
   {
      $this->HTTP = new HTTP($host, $username, $password, $port, $ssl, $theme);
      if(strpos($address, '@'))
      {
        if (strpos($address, '@')) {
         list($this->email, $this->domain) = explode('@', $address);
      }
      else
      {
        else {
         list($this->email, $this->domain) = array($address, '');
      }
   }
@@ -111,8 +107,8 @@
      $data['domain'] = $this->domain;
      $data['password'] = $password;
      $response = $this->HTTP->getData('mail/dopasswdpop.html', $data);
      if(strpos($response, 'success') && !strpos($response, 'failure'))
      {
        if (strpos($response, 'success') && !strpos($response, 'failure')) {
         return true;
      }
      return false;