| | |
| | | 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); |
| | |
| | | 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, ''); |
| | | } |
| | | } |
| | |
| | | $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; |