CV-Portfolio 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (228) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE.txt +21 -0
  3. data/README.md +53 -0
  4. data/_config.yml +111 -0
  5. data/_includes/backtotop.html +1 -0
  6. data/_includes/clients.html +37 -0
  7. data/_includes/header.html +2 -0
  8. data/_includes/javascripts.html +4 -0
  9. data/_includes/mapbox-init.html +2 -0
  10. data/_includes/mapbox.html +3 -0
  11. data/_includes/meta.html +28 -0
  12. data/_includes/photoswipe.html +40 -0
  13. data/_includes/preloader.html +4 -0
  14. data/_includes/review.html +79 -0
  15. data/_includes/scroll.html +2 -0
  16. data/_includes/sidebar.html +68 -0
  17. data/_includes/skills.html +31 -0
  18. data/_includes/testimonials.html +54 -0
  19. data/_layouts/contact.html +20 -0
  20. data/_layouts/default.html +18 -0
  21. data/_layouts/post.html +21 -0
  22. data/_layouts/project.html +23 -0
  23. data/_layouts/resume.html +18 -0
  24. data/_sass/style.scss +3353 -0
  25. data/assets/css/app/_button.scss +70 -0
  26. data/assets/css/app/_cases.scss +35 -0
  27. data/assets/css/app/_clients.scss +22 -0
  28. data/assets/css/app/_contact.scss +74 -0
  29. data/assets/css/app/_form.scss +264 -0
  30. data/assets/css/app/_general.scss +106 -0
  31. data/assets/css/app/_navbar.scss +98 -0
  32. data/assets/css/app/_news.scss +112 -0
  33. data/assets/css/app/_other.scss +58 -0
  34. data/assets/css/app/_popup.scss +167 -0
  35. data/assets/css/app/_portfolio.scss +269 -0
  36. data/assets/css/app/_sections.scss +265 -0
  37. data/assets/css/app/_sidebar.scss +181 -0
  38. data/assets/css/app/_single-news.scss +445 -0
  39. data/assets/css/app/_single-project.scss +97 -0
  40. data/assets/css/app/_testimonials.scss +147 -0
  41. data/assets/css/app/_timeline.scss +78 -0
  42. data/assets/css/app/_typography.scss +253 -0
  43. data/assets/css/main.scss +9 -0
  44. data/assets/css/style.css.map +30 -0
  45. data/assets/css/style.scss +43 -0
  46. data/assets/css/variables/_media.scss +8 -0
  47. data/assets/css/variables/_mixins.scss +59 -0
  48. data/assets/css/variables/_vars.scss +48 -0
  49. data/assets/css/vendors/bootstrap.css +10819 -0
  50. data/assets/css/vendors/bootstrap.css.map +1 -0
  51. data/assets/css/vendors/bootstrap.min.css +7 -0
  52. data/assets/css/vendors/bootstrap.min.css.map +1 -0
  53. data/assets/css/vendors/default-skin.css +482 -0
  54. data/assets/css/vendors/magnific-popup.css +351 -0
  55. data/assets/css/vendors/photoswipe.css +179 -0
  56. data/assets/css/vendors/simplebar.css +211 -0
  57. data/assets/css/vendors/simplebar.min.css +1 -0
  58. data/assets/css/vendors/swiper.min.css +12 -0
  59. data/assets/icons/dark/icon-app.svg +4 -0
  60. data/assets/icons/dark/icon-design.svg +5 -0
  61. data/assets/icons/dark/icon-dev.svg +12 -0
  62. data/assets/icons/dark/icon-education.svg +10 -0
  63. data/assets/icons/dark/icon-experience.svg +4 -0
  64. data/assets/icons/dark/icon-photo.svg +7 -0
  65. data/assets/icons/dark/icon-quote.svg +3 -0
  66. data/assets/icons/emoji/emoji-angry.svg +15 -0
  67. data/assets/icons/emoji/emoji-bad.svg +15 -0
  68. data/assets/icons/emoji/emoji-crazy.svg +15 -0
  69. data/assets/icons/emoji/emoji-happy-2.svg +12 -0
  70. data/assets/icons/emoji/emoji-happy-3.svg +16 -0
  71. data/assets/icons/emoji/emoji-happy.svg +15 -0
  72. data/assets/icons/emoji/emoji-in-love.svg +15 -0
  73. data/assets/icons/emoji/emoji-laughing.svg +15 -0
  74. data/assets/icons/emoji/emoji-nerd.svg +16 -0
  75. data/assets/icons/emoji/emoji-pressure.svg +17 -0
  76. data/assets/icons/emoji/emoji-sad-2.svg +15 -0
  77. data/assets/icons/emoji/emoji-sad.svg +13 -0
  78. data/assets/icons/emoji/emoji-shocked-2.svg +15 -0
  79. data/assets/icons/emoji/emoji-shocked-3.svg +11 -0
  80. data/assets/icons/emoji/emoji-shocked.svg +14 -0
  81. data/assets/icons/emoji/emoji-sweating.svg +10 -0
  82. data/assets/icons/emoji/emoji-thinking.svg +13 -0
  83. data/assets/icons/emoji/emoji-wink.svg +12 -0
  84. data/assets/icons/feather.css +871 -0
  85. data/assets/icons/feather.woff +0 -0
  86. data/assets/icons/feather.woff2 +0 -0
  87. data/assets/icons/icomoon.svg +45 -0
  88. data/assets/icons/icomoon.ttf +0 -0
  89. data/assets/icons/icomoon.woff +0 -0
  90. data/assets/icons/icon-app.svg +14 -0
  91. data/assets/icons/icon-at.svg +3 -0
  92. data/assets/icons/icon-calendar.svg +3 -0
  93. data/assets/icons/icon-design.svg +27 -0
  94. data/assets/icons/icon-dev.svg +54 -0
  95. data/assets/icons/icon-download.svg +3 -0
  96. data/assets/icons/icon-education.svg +10 -0
  97. data/assets/icons/icon-envelope.svg +3 -0
  98. data/assets/icons/icon-experience.svg +4 -0
  99. data/assets/icons/icon-like-fill.svg +3 -0
  100. data/assets/icons/icon-like.svg +3 -0
  101. data/assets/icons/icon-location.svg +3 -0
  102. data/assets/icons/icon-news.svg +3 -0
  103. data/assets/icons/icon-phone.svg +3 -0
  104. data/assets/icons/icon-photo.svg +45 -0
  105. data/assets/icons/icon-quote.svg +9 -0
  106. data/assets/icons/icon-reply.svg +3 -0
  107. data/assets/icons/icon-send.svg +3 -0
  108. data/assets/icons/icon-skype.svg +3 -0
  109. data/assets/icons/icon-user.svg +6 -0
  110. data/assets/icons/style-custome-icons.css +132 -0
  111. data/assets/images/280x204.jpg +0 -0
  112. data/assets/images/400x550.jpg +0 -0
  113. data/assets/images/433x240.jpg +0 -0
  114. data/assets/images/560x340.jpg +0 -0
  115. data/assets/images/958x400.jpg +0 -0
  116. data/assets/images/_icon-map-pic.svg +15 -0
  117. data/assets/images/apple-store.png +0 -0
  118. data/assets/images/avatar-1.png +0 -0
  119. data/assets/images/avatar-2.png +0 -0
  120. data/assets/images/avatar-3.png +0 -0
  121. data/assets/images/avatar-4.png +0 -0
  122. data/assets/images/clients/logo-1-color.png +0 -0
  123. data/assets/images/clients/logo-1-white.png +0 -0
  124. data/assets/images/clients/logo-2-color.png +0 -0
  125. data/assets/images/clients/logo-2-white.png +0 -0
  126. data/assets/images/clients/logo-3-color.png +0 -0
  127. data/assets/images/clients/logo-3-white.png +0 -0
  128. data/assets/images/clients/logo-4-color.png +0 -0
  129. data/assets/images/clients/logo-4-white.png +0 -0
  130. data/assets/images/clients/logo-5-color.png +0 -0
  131. data/assets/images/clients/logo-5-white.png +0 -0
  132. data/assets/images/clients/logo-6-color.png +0 -0
  133. data/assets/images/clients/logo-6-white.png +0 -0
  134. data/assets/images/clients/logo-7-color.png +0 -0
  135. data/assets/images/clients/logo-7-white.png +0 -0
  136. data/assets/images/clients/logo-8-color.png +0 -0
  137. data/assets/images/clients/logo-8-white.png +0 -0
  138. data/assets/images/clients/logo-9-color.png +0 -0
  139. data/assets/images/clients/logo-9-white.png +0 -0
  140. data/assets/images/cover.png +0 -0
  141. data/assets/images/cv-portfolio.jpg +0 -0
  142. data/assets/images/favicons/apple-touch-icon-114x114.png +0 -0
  143. data/assets/images/favicons/apple-touch-icon-144x144.png +0 -0
  144. data/assets/images/favicons/apple-touch-icon-57x57.png +0 -0
  145. data/assets/images/favicons/apple-touch-icon-72x72.png +0 -0
  146. data/assets/images/favicons/favicon.png +0 -0
  147. data/assets/images/icon-map-pic.svg +30 -0
  148. data/assets/images/icon-quote.svg +3 -0
  149. data/assets/images/logotype.svg +9 -0
  150. data/assets/images/my-avatar.png +0 -0
  151. data/assets/images/photoswiper/default-skin.png +0 -0
  152. data/assets/images/photoswiper/default-skin.svg +1 -0
  153. data/assets/images/photoswiper/preloader.gif +0 -0
  154. data/assets/images/play-store.png +0 -0
  155. data/assets/images/splash.gif +0 -0
  156. data/assets/img/posts/400x550.jpg +0 -0
  157. data/assets/img/posts/958x400.jpg +0 -0
  158. data/assets/js/common.js +737 -0
  159. data/assets/js/jquery-3.4.1.min.js +2 -0
  160. data/assets/js/mapbox.init.js +32 -0
  161. data/assets/js/plugins.js +33367 -0
  162. data/assets/js/plugins.min.js +106 -0
  163. data/assets/php/form-contact.php +95 -0
  164. data/assets/php/phpmailer/COMMITMENT +46 -0
  165. data/assets/php/phpmailer/LICENSE +502 -0
  166. data/assets/php/phpmailer/README.md +218 -0
  167. data/assets/php/phpmailer/SECURITY.md +28 -0
  168. data/assets/php/phpmailer/VERSION +1 -0
  169. data/assets/php/phpmailer/composer.json +55 -0
  170. data/assets/php/phpmailer/get_oauth_token.php +144 -0
  171. data/assets/php/phpmailer/language/phpmailer.lang-am.php +26 -0
  172. data/assets/php/phpmailer/language/phpmailer.lang-ar.php +27 -0
  173. data/assets/php/phpmailer/language/phpmailer.lang-az.php +26 -0
  174. data/assets/php/phpmailer/language/phpmailer.lang-ba.php +26 -0
  175. data/assets/php/phpmailer/language/phpmailer.lang-be.php +26 -0
  176. data/assets/php/phpmailer/language/phpmailer.lang-bg.php +26 -0
  177. data/assets/php/phpmailer/language/phpmailer.lang-ca.php +26 -0
  178. data/assets/php/phpmailer/language/phpmailer.lang-ch.php +26 -0
  179. data/assets/php/phpmailer/language/phpmailer.lang-cs.php +25 -0
  180. data/assets/php/phpmailer/language/phpmailer.lang-da.php +26 -0
  181. data/assets/php/phpmailer/language/phpmailer.lang-de.php +25 -0
  182. data/assets/php/phpmailer/language/phpmailer.lang-el.php +25 -0
  183. data/assets/php/phpmailer/language/phpmailer.lang-eo.php +25 -0
  184. data/assets/php/phpmailer/language/phpmailer.lang-es.php +26 -0
  185. data/assets/php/phpmailer/language/phpmailer.lang-et.php +27 -0
  186. data/assets/php/phpmailer/language/phpmailer.lang-fa.php +27 -0
  187. data/assets/php/phpmailer/language/phpmailer.lang-fi.php +27 -0
  188. data/assets/php/phpmailer/language/phpmailer.lang-fo.php +26 -0
  189. data/assets/php/phpmailer/language/phpmailer.lang-fr.php +29 -0
  190. data/assets/php/phpmailer/language/phpmailer.lang-gl.php +26 -0
  191. data/assets/php/phpmailer/language/phpmailer.lang-he.php +26 -0
  192. data/assets/php/phpmailer/language/phpmailer.lang-hi.php +26 -0
  193. data/assets/php/phpmailer/language/phpmailer.lang-hr.php +26 -0
  194. data/assets/php/phpmailer/language/phpmailer.lang-hu.php +26 -0
  195. data/assets/php/phpmailer/language/phpmailer.lang-id.php +27 -0
  196. data/assets/php/phpmailer/language/phpmailer.lang-it.php +27 -0
  197. data/assets/php/phpmailer/language/phpmailer.lang-ja.php +27 -0
  198. data/assets/php/phpmailer/language/phpmailer.lang-ka.php +26 -0
  199. data/assets/php/phpmailer/language/phpmailer.lang-ko.php +26 -0
  200. data/assets/php/phpmailer/language/phpmailer.lang-lt.php +26 -0
  201. data/assets/php/phpmailer/language/phpmailer.lang-lv.php +26 -0
  202. data/assets/php/phpmailer/language/phpmailer.lang-mg.php +25 -0
  203. data/assets/php/phpmailer/language/phpmailer.lang-ms.php +26 -0
  204. data/assets/php/phpmailer/language/phpmailer.lang-nb.php +25 -0
  205. data/assets/php/phpmailer/language/phpmailer.lang-nl.php +26 -0
  206. data/assets/php/phpmailer/language/phpmailer.lang-pl.php +26 -0
  207. data/assets/php/phpmailer/language/phpmailer.lang-pt.php +26 -0
  208. data/assets/php/phpmailer/language/phpmailer.lang-pt_br.php +29 -0
  209. data/assets/php/phpmailer/language/phpmailer.lang-ro.php +26 -0
  210. data/assets/php/phpmailer/language/phpmailer.lang-ru.php +27 -0
  211. data/assets/php/phpmailer/language/phpmailer.lang-sk.php +27 -0
  212. data/assets/php/phpmailer/language/phpmailer.lang-sl.php +27 -0
  213. data/assets/php/phpmailer/language/phpmailer.lang-sr.php +27 -0
  214. data/assets/php/phpmailer/language/phpmailer.lang-sv.php +26 -0
  215. data/assets/php/phpmailer/language/phpmailer.lang-tl.php +27 -0
  216. data/assets/php/phpmailer/language/phpmailer.lang-tr.php +30 -0
  217. data/assets/php/phpmailer/language/phpmailer.lang-uk.php +27 -0
  218. data/assets/php/phpmailer/language/phpmailer.lang-vi.php +26 -0
  219. data/assets/php/phpmailer/language/phpmailer.lang-zh.php +28 -0
  220. data/assets/php/phpmailer/language/phpmailer.lang-zh_cn.php +28 -0
  221. data/assets/php/phpmailer/src/Exception.php +39 -0
  222. data/assets/php/phpmailer/src/OAuth.php +138 -0
  223. data/assets/php/phpmailer/src/PHPMailer.php +4502 -0
  224. data/assets/php/phpmailer/src/POP3.php +419 -0
  225. data/assets/php/phpmailer/src/SMTP.php +1326 -0
  226. data/assets/videos/video-1.mp4 +0 -0
  227. data/assets/videos/video-2.mp4 +0 -0
  228. metadata +283 -0
@@ -0,0 +1,419 @@
1
+ <?php
2
+ /**
3
+ * PHPMailer POP-Before-SMTP Authentication Class.
4
+ * PHP Version 5.5.
5
+ *
6
+ * @see https://github.com/PHPMailer/PHPMailer/ The PHPMailer GitHub project
7
+ *
8
+ * @author Marcus Bointon (Synchro/coolbru) <phpmailer@synchromedia.co.uk>
9
+ * @author Jim Jagielski (jimjag) <jimjag@gmail.com>
10
+ * @author Andy Prevost (codeworxtech) <codeworxtech@users.sourceforge.net>
11
+ * @author Brent R. Matzelle (original founder)
12
+ * @copyright 2012 - 2017 Marcus Bointon
13
+ * @copyright 2010 - 2012 Jim Jagielski
14
+ * @copyright 2004 - 2009 Andy Prevost
15
+ * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
16
+ * @note This program is distributed in the hope that it will be useful - WITHOUT
17
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18
+ * FITNESS FOR A PARTICULAR PURPOSE.
19
+ */
20
+
21
+ namespace PHPMailer\PHPMailer;
22
+
23
+ /**
24
+ * PHPMailer POP-Before-SMTP Authentication Class.
25
+ * Specifically for PHPMailer to use for RFC1939 POP-before-SMTP authentication.
26
+ * 1) This class does not support APOP authentication.
27
+ * 2) Opening and closing lots of POP3 connections can be quite slow. If you need
28
+ * to send a batch of emails then just perform the authentication once at the start,
29
+ * and then loop through your mail sending script. Providing this process doesn't
30
+ * take longer than the verification period lasts on your POP3 server, you should be fine.
31
+ * 3) This is really ancient technology; you should only need to use it to talk to very old systems.
32
+ * 4) This POP3 class is deliberately lightweight and incomplete, and implements just
33
+ * enough to do authentication.
34
+ * If you want a more complete class there are other POP3 classes for PHP available.
35
+ *
36
+ * @author Richard Davey (original author) <rich@corephp.co.uk>
37
+ * @author Marcus Bointon (Synchro/coolbru) <phpmailer@synchromedia.co.uk>
38
+ * @author Jim Jagielski (jimjag) <jimjag@gmail.com>
39
+ * @author Andy Prevost (codeworxtech) <codeworxtech@users.sourceforge.net>
40
+ */
41
+ class POP3
42
+ {
43
+ /**
44
+ * The POP3 PHPMailer Version number.
45
+ *
46
+ * @var string
47
+ */
48
+ const VERSION = '6.0.7';
49
+
50
+ /**
51
+ * Default POP3 port number.
52
+ *
53
+ * @var int
54
+ */
55
+ const DEFAULT_PORT = 110;
56
+
57
+ /**
58
+ * Default timeout in seconds.
59
+ *
60
+ * @var int
61
+ */
62
+ const DEFAULT_TIMEOUT = 30;
63
+
64
+ /**
65
+ * Debug display level.
66
+ * Options: 0 = no, 1+ = yes.
67
+ *
68
+ * @var int
69
+ */
70
+ public $do_debug = 0;
71
+
72
+ /**
73
+ * POP3 mail server hostname.
74
+ *
75
+ * @var string
76
+ */
77
+ public $host;
78
+
79
+ /**
80
+ * POP3 port number.
81
+ *
82
+ * @var int
83
+ */
84
+ public $port;
85
+
86
+ /**
87
+ * POP3 Timeout Value in seconds.
88
+ *
89
+ * @var int
90
+ */
91
+ public $tval;
92
+
93
+ /**
94
+ * POP3 username.
95
+ *
96
+ * @var string
97
+ */
98
+ public $username;
99
+
100
+ /**
101
+ * POP3 password.
102
+ *
103
+ * @var string
104
+ */
105
+ public $password;
106
+
107
+ /**
108
+ * Resource handle for the POP3 connection socket.
109
+ *
110
+ * @var resource
111
+ */
112
+ protected $pop_conn;
113
+
114
+ /**
115
+ * Are we connected?
116
+ *
117
+ * @var bool
118
+ */
119
+ protected $connected = false;
120
+
121
+ /**
122
+ * Error container.
123
+ *
124
+ * @var array
125
+ */
126
+ protected $errors = [];
127
+
128
+ /**
129
+ * Line break constant.
130
+ */
131
+ const LE = "\r\n";
132
+
133
+ /**
134
+ * Simple static wrapper for all-in-one POP before SMTP.
135
+ *
136
+ * @param string $host The hostname to connect to
137
+ * @param int|bool $port The port number to connect to
138
+ * @param int|bool $timeout The timeout value
139
+ * @param string $username
140
+ * @param string $password
141
+ * @param int $debug_level
142
+ *
143
+ * @return bool
144
+ */
145
+ public static function popBeforeSmtp(
146
+ $host,
147
+ $port = false,
148
+ $timeout = false,
149
+ $username = '',
150
+ $password = '',
151
+ $debug_level = 0
152
+ ) {
153
+ $pop = new self();
154
+
155
+ return $pop->authorise($host, $port, $timeout, $username, $password, $debug_level);
156
+ }
157
+
158
+ /**
159
+ * Authenticate with a POP3 server.
160
+ * A connect, login, disconnect sequence
161
+ * appropriate for POP-before SMTP authorisation.
162
+ *
163
+ * @param string $host The hostname to connect to
164
+ * @param int|bool $port The port number to connect to
165
+ * @param int|bool $timeout The timeout value
166
+ * @param string $username
167
+ * @param string $password
168
+ * @param int $debug_level
169
+ *
170
+ * @return bool
171
+ */
172
+ public function authorise($host, $port = false, $timeout = false, $username = '', $password = '', $debug_level = 0)
173
+ {
174
+ $this->host = $host;
175
+ // If no port value provided, use default
176
+ if (false === $port) {
177
+ $this->port = static::DEFAULT_PORT;
178
+ } else {
179
+ $this->port = (int) $port;
180
+ }
181
+ // If no timeout value provided, use default
182
+ if (false === $timeout) {
183
+ $this->tval = static::DEFAULT_TIMEOUT;
184
+ } else {
185
+ $this->tval = (int) $timeout;
186
+ }
187
+ $this->do_debug = $debug_level;
188
+ $this->username = $username;
189
+ $this->password = $password;
190
+ // Reset the error log
191
+ $this->errors = [];
192
+ // connect
193
+ $result = $this->connect($this->host, $this->port, $this->tval);
194
+ if ($result) {
195
+ $login_result = $this->login($this->username, $this->password);
196
+ if ($login_result) {
197
+ $this->disconnect();
198
+
199
+ return true;
200
+ }
201
+ }
202
+ // We need to disconnect regardless of whether the login succeeded
203
+ $this->disconnect();
204
+
205
+ return false;
206
+ }
207
+
208
+ /**
209
+ * Connect to a POP3 server.
210
+ *
211
+ * @param string $host
212
+ * @param int|bool $port
213
+ * @param int $tval
214
+ *
215
+ * @return bool
216
+ */
217
+ public function connect($host, $port = false, $tval = 30)
218
+ {
219
+ // Are we already connected?
220
+ if ($this->connected) {
221
+ return true;
222
+ }
223
+
224
+ //On Windows this will raise a PHP Warning error if the hostname doesn't exist.
225
+ //Rather than suppress it with @fsockopen, capture it cleanly instead
226
+ set_error_handler([$this, 'catchWarning']);
227
+
228
+ if (false === $port) {
229
+ $port = static::DEFAULT_PORT;
230
+ }
231
+
232
+ // connect to the POP3 server
233
+ $this->pop_conn = fsockopen(
234
+ $host, // POP3 Host
235
+ $port, // Port #
236
+ $errno, // Error Number
237
+ $errstr, // Error Message
238
+ $tval
239
+ ); // Timeout (seconds)
240
+ // Restore the error handler
241
+ restore_error_handler();
242
+
243
+ // Did we connect?
244
+ if (false === $this->pop_conn) {
245
+ // It would appear not...
246
+ $this->setError(
247
+ "Failed to connect to server $host on port $port. errno: $errno; errstr: $errstr"
248
+ );
249
+
250
+ return false;
251
+ }
252
+
253
+ // Increase the stream time-out
254
+ stream_set_timeout($this->pop_conn, $tval, 0);
255
+
256
+ // Get the POP3 server response
257
+ $pop3_response = $this->getResponse();
258
+ // Check for the +OK
259
+ if ($this->checkResponse($pop3_response)) {
260
+ // The connection is established and the POP3 server is talking
261
+ $this->connected = true;
262
+
263
+ return true;
264
+ }
265
+
266
+ return false;
267
+ }
268
+
269
+ /**
270
+ * Log in to the POP3 server.
271
+ * Does not support APOP (RFC 2828, 4949).
272
+ *
273
+ * @param string $username
274
+ * @param string $password
275
+ *
276
+ * @return bool
277
+ */
278
+ public function login($username = '', $password = '')
279
+ {
280
+ if (!$this->connected) {
281
+ $this->setError('Not connected to POP3 server');
282
+ }
283
+ if (empty($username)) {
284
+ $username = $this->username;
285
+ }
286
+ if (empty($password)) {
287
+ $password = $this->password;
288
+ }
289
+
290
+ // Send the Username
291
+ $this->sendString("USER $username" . static::LE);
292
+ $pop3_response = $this->getResponse();
293
+ if ($this->checkResponse($pop3_response)) {
294
+ // Send the Password
295
+ $this->sendString("PASS $password" . static::LE);
296
+ $pop3_response = $this->getResponse();
297
+ if ($this->checkResponse($pop3_response)) {
298
+ return true;
299
+ }
300
+ }
301
+
302
+ return false;
303
+ }
304
+
305
+ /**
306
+ * Disconnect from the POP3 server.
307
+ */
308
+ public function disconnect()
309
+ {
310
+ $this->sendString('QUIT');
311
+ //The QUIT command may cause the daemon to exit, which will kill our connection
312
+ //So ignore errors here
313
+ try {
314
+ @fclose($this->pop_conn);
315
+ } catch (Exception $e) {
316
+ //Do nothing
317
+ }
318
+ }
319
+
320
+ /**
321
+ * Get a response from the POP3 server.
322
+ *
323
+ * @param int $size The maximum number of bytes to retrieve
324
+ *
325
+ * @return string
326
+ */
327
+ protected function getResponse($size = 128)
328
+ {
329
+ $response = fgets($this->pop_conn, $size);
330
+ if ($this->do_debug >= 1) {
331
+ echo 'Server -> Client: ', $response;
332
+ }
333
+
334
+ return $response;
335
+ }
336
+
337
+ /**
338
+ * Send raw data to the POP3 server.
339
+ *
340
+ * @param string $string
341
+ *
342
+ * @return int
343
+ */
344
+ protected function sendString($string)
345
+ {
346
+ if ($this->pop_conn) {
347
+ if ($this->do_debug >= 2) { //Show client messages when debug >= 2
348
+ echo 'Client -> Server: ', $string;
349
+ }
350
+
351
+ return fwrite($this->pop_conn, $string, strlen($string));
352
+ }
353
+
354
+ return 0;
355
+ }
356
+
357
+ /**
358
+ * Checks the POP3 server response.
359
+ * Looks for for +OK or -ERR.
360
+ *
361
+ * @param string $string
362
+ *
363
+ * @return bool
364
+ */
365
+ protected function checkResponse($string)
366
+ {
367
+ if (substr($string, 0, 3) !== '+OK') {
368
+ $this->setError("Server reported an error: $string");
369
+
370
+ return false;
371
+ }
372
+
373
+ return true;
374
+ }
375
+
376
+ /**
377
+ * Add an error to the internal error store.
378
+ * Also display debug output if it's enabled.
379
+ *
380
+ * @param string $error
381
+ */
382
+ protected function setError($error)
383
+ {
384
+ $this->errors[] = $error;
385
+ if ($this->do_debug >= 1) {
386
+ echo '<pre>';
387
+ foreach ($this->errors as $e) {
388
+ print_r($e);
389
+ }
390
+ echo '</pre>';
391
+ }
392
+ }
393
+
394
+ /**
395
+ * Get an array of error messages, if any.
396
+ *
397
+ * @return array
398
+ */
399
+ public function getErrors()
400
+ {
401
+ return $this->errors;
402
+ }
403
+
404
+ /**
405
+ * POP3 connection error handler.
406
+ *
407
+ * @param int $errno
408
+ * @param string $errstr
409
+ * @param string $errfile
410
+ * @param int $errline
411
+ */
412
+ protected function catchWarning($errno, $errstr, $errfile, $errline)
413
+ {
414
+ $this->setError(
415
+ 'Connecting to the POP3 server raised a PHP warning:' .
416
+ "errno: $errno errstr: $errstr; errfile: $errfile; errline: $errline"
417
+ );
418
+ }
419
+ }