@@ -26,12 +26,12 @@ discard block |
||
26 | 26 | |
27 | 27 | 'theme' => "evo", |
28 | 28 | |
29 | - 'uploadURL' => rtrim($modx->config['rb_base_url'],'/'), |
|
30 | - 'uploadDir' => rtrim($modx->config['rb_base_dir'],'/'), |
|
29 | + 'uploadURL' => rtrim($modx->config['rb_base_url'], '/'), |
|
30 | + 'uploadDir' => rtrim($modx->config['rb_base_dir'], '/'), |
|
31 | 31 | 'siteURL' => $modx->config['site_url'], |
32 | - 'assetsURL' => rtrim($modx->config['rb_base_url'],'/'), |
|
33 | - 'dirPerms' => intval($modx->config['new_folder_permissions'],8), |
|
34 | - 'filePerms' => intval($modx->config['new_file_permissions'],8), |
|
32 | + 'assetsURL' => rtrim($modx->config['rb_base_url'], '/'), |
|
33 | + 'dirPerms' => intval($modx->config['new_folder_permissions'], 8), |
|
34 | + 'filePerms' => intval($modx->config['new_file_permissions'], 8), |
|
35 | 35 | 'maxfilesize' => $settings['upload_maxsize'], |
36 | 36 | 'denyUpdateCheck' => true, |
37 | 37 | |
@@ -58,14 +58,14 @@ discard block |
||
58 | 58 | 'types' => array( |
59 | 59 | |
60 | 60 | // CKEditor & FCKEditor types |
61 | - 'files' => str_replace(',',' ',$modx->config['upload_files']), |
|
62 | - 'flash' => str_replace(',',' ',$modx->config['upload_flash']), |
|
63 | - 'images' => str_replace(',',' ',$modx->config['upload_images']), |
|
61 | + 'files' => str_replace(',', ' ', $modx->config['upload_files']), |
|
62 | + 'flash' => str_replace(',', ' ', $modx->config['upload_flash']), |
|
63 | + 'images' => str_replace(',', ' ', $modx->config['upload_images']), |
|
64 | 64 | |
65 | 65 | // TinyMCE types |
66 | - 'file' => str_replace(',',' ',$modx->config['upload_files']), |
|
67 | - 'media' => str_replace(',',' ',$modx->config['upload_media']), |
|
68 | - 'image' => str_replace(',',' ',$modx->config['upload_images']), |
|
66 | + 'file' => str_replace(',', ' ', $modx->config['upload_files']), |
|
67 | + 'media' => str_replace(',', ' ', $modx->config['upload_media']), |
|
68 | + 'image' => str_replace(',', ' ', $modx->config['upload_images']), |
|
69 | 69 | ), |
70 | 70 | 'dirnameChangeChars' => array( |
71 | 71 | ' ' => "_", |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | |
90 | 90 | // THE FOLLOWING SETTINGS CANNOT BE OVERRIDED WITH SESSION CONFIGURATION |
91 | 91 | '_check4htaccess' => false, |
92 | - '_tinyMCEPath' => MODX_BASE_URL . "assets/plugins/tinymce/tiny_mce", |
|
92 | + '_tinyMCEPath' => MODX_BASE_URL."assets/plugins/tinymce/tiny_mce", |
|
93 | 93 | |
94 | 94 | '_sessionVar' => &$_SESSION['KCFINDER'], |
95 | 95 | //'_sessionLifetime' => 30, |
@@ -14,14 +14,14 @@ |
||
14 | 14 | |
15 | 15 | require "core/autoload.php"; // Init MODX |
16 | 16 | |
17 | -function returnNoPermissionsMessage($role) { |
|
17 | +function returnNoPermissionsMessage($role){ |
|
18 | 18 | global $_lang; |
19 | 19 | echo sprintf($_lang['files_management_no_permission'], $role); |
20 | 20 | exit; |
21 | 21 | } |
22 | 22 | |
23 | -if( $_GET['type'] == 'images' && !$modx->hasPermission('file_manager') && !$modx->hasPermission('assets_images')) returnNoPermissionsMessage('assets_images'); |
|
24 | -if( $_GET['type'] == 'files' && !$modx->hasPermission('file_manager') && !$modx->hasPermission('assets_files')) returnNoPermissionsMessage('assets_files'); |
|
23 | +if ($_GET['type'] == 'images' && !$modx->hasPermission('file_manager') && !$modx->hasPermission('assets_images')) returnNoPermissionsMessage('assets_images'); |
|
24 | +if ($_GET['type'] == 'files' && !$modx->hasPermission('file_manager') && !$modx->hasPermission('assets_files')) returnNoPermissionsMessage('assets_files'); |
|
25 | 25 | |
26 | 26 | $browser = new browser($modx); |
27 | 27 | $browser->action(); |
@@ -1,15 +1,15 @@ |
||
1 | 1 | <?php |
2 | 2 | $modx->config['enable_filter'] = 1; |
3 | 3 | |
4 | -$modx->addSnippet('hasPermission','return $modx->hasPermission($key);'); |
|
4 | +$modx->addSnippet('hasPermission', 'return $modx->hasPermission($key);'); |
|
5 | 5 | |
6 | -if($modx->hasPermission('new_template') || $modx->hasPermission('edit_template') || $modx->hasPermission('new_snippet') || $modx->hasPermission('edit_snippet') || $modx->hasPermission('new_plugin') || $modx->hasPermission('edit_plugin') || $modx->hasPermission('manage_metatags')) |
|
6 | +if ($modx->hasPermission('new_template') || $modx->hasPermission('edit_template') || $modx->hasPermission('new_snippet') || $modx->hasPermission('edit_snippet') || $modx->hasPermission('new_plugin') || $modx->hasPermission('edit_plugin') || $modx->hasPermission('manage_metatags')) |
|
7 | 7 | $hasAnyPermission = 1; |
8 | 8 | else $hasAnyPermission = 0; |
9 | -$modx->addSnippet('hasAnyPermission','global $hasAnyPermission; return $hasAnyPermission;'); |
|
10 | -$modx->addSnippet('getLoginUserName','return $modx->getLoginUserName();'); |
|
9 | +$modx->addSnippet('hasAnyPermission', 'global $hasAnyPermission; return $hasAnyPermission;'); |
|
10 | +$modx->addSnippet('getLoginUserName', 'return $modx->getLoginUserName();'); |
|
11 | 11 | $code = 'global $_lang;return $_SESSION["nrtotalmessages"] ? sprintf($_lang["welcome_messages"], $_SESSION["nrtotalmessages"], \'<span style="color:red;">\' . $_SESSION["nrnewmessages"] . "</span>") : $_lang["messages_no_messages"];'; |
12 | -$modx->addSnippet('getMessageCount',$code); |
|
12 | +$modx->addSnippet('getMessageCount', $code); |
|
13 | 13 | |
14 | 14 | // Large Icons |
15 | 15 | $_style['icons_backup_large'] = 'fa fa-database fa-fw fa-2x'; |
@@ -149,7 +149,7 @@ discard block |
||
149 | 149 | // using proxy, send entire URI |
150 | 150 | $this->_httprequest($URI, $fp, $URI, $this->_httpmethod); |
151 | 151 | } else { |
152 | - $path = $URI_PARTS["path"] . ($URI_PARTS["query"] ? "?" . $URI_PARTS["query"] : ""); |
|
152 | + $path = $URI_PARTS["path"].($URI_PARTS["query"] ? "?".$URI_PARTS["query"] : ""); |
|
153 | 153 | // no proxy, send only the path |
154 | 154 | $this->_httprequest($path, $fp, $URI, $this->_httpmethod); |
155 | 155 | } |
@@ -160,7 +160,7 @@ discard block |
||
160 | 160 | /* url was redirected, check if we've hit the max depth */ |
161 | 161 | if ($this->maxredirs > $this->_redirectdepth) { |
162 | 162 | // only follow redirect if it's on this site, or offsiteok is true |
163 | - if (preg_match("|^https?://" . preg_quote($this->host) . "|i", $this->_redirectaddr) || $this->offsiteok) { |
|
163 | + if (preg_match("|^https?://".preg_quote($this->host)."|i", $this->_redirectaddr) || $this->offsiteok) { |
|
164 | 164 | /* follow the redirect */ |
165 | 165 | $this->_redirectdepth++; |
166 | 166 | $this->lastredirectaddr = $this->_redirectaddr; |
@@ -188,7 +188,7 @@ discard block |
||
188 | 188 | break; |
189 | 189 | default: |
190 | 190 | // not a valid protocol |
191 | - $this->error = 'Invalid protocol "' . $URI_PARTS["scheme"] . '"\n'; |
|
191 | + $this->error = 'Invalid protocol "'.$URI_PARTS["scheme"].'"\n'; |
|
192 | 192 | return false; |
193 | 193 | break; |
194 | 194 | } |
@@ -239,7 +239,7 @@ discard block |
||
239 | 239 | // using proxy, send entire URI |
240 | 240 | $this->_httprequest($URI, $fp, $URI, $this->_submit_method, $this->_submit_type, $postdata); |
241 | 241 | } else { |
242 | - $path = $URI_PARTS["path"] . ($URI_PARTS["query"] ? "?" . $URI_PARTS["query"] : ""); |
|
242 | + $path = $URI_PARTS["path"].($URI_PARTS["query"] ? "?".$URI_PARTS["query"] : ""); |
|
243 | 243 | // no proxy, send only the path |
244 | 244 | $this->_httprequest($path, $fp, $URI, $this->_submit_method, $this->_submit_type, $postdata); |
245 | 245 | } |
@@ -249,11 +249,11 @@ discard block |
||
249 | 249 | if ($this->_redirectaddr) { |
250 | 250 | /* url was redirected, check if we've hit the max depth */ |
251 | 251 | if ($this->maxredirs > $this->_redirectdepth) { |
252 | - if (!preg_match("|^" . $URI_PARTS["scheme"] . "://|", $this->_redirectaddr)) |
|
253 | - $this->_redirectaddr = $this->_expandlinks($this->_redirectaddr, $URI_PARTS["scheme"] . "://" . $URI_PARTS["host"]); |
|
252 | + if (!preg_match("|^".$URI_PARTS["scheme"]."://|", $this->_redirectaddr)) |
|
253 | + $this->_redirectaddr = $this->_expandlinks($this->_redirectaddr, $URI_PARTS["scheme"]."://".$URI_PARTS["host"]); |
|
254 | 254 | |
255 | 255 | // only follow redirect if it's on this site, or offsiteok is true |
256 | - if (preg_match("|^https?://" . preg_quote($this->host) . "|i", $this->_redirectaddr) || $this->offsiteok) { |
|
256 | + if (preg_match("|^https?://".preg_quote($this->host)."|i", $this->_redirectaddr) || $this->offsiteok) { |
|
257 | 257 | /* follow the redirect */ |
258 | 258 | $this->_redirectdepth++; |
259 | 259 | $this->lastredirectaddr = $this->_redirectaddr; |
@@ -285,7 +285,7 @@ discard block |
||
285 | 285 | break; |
286 | 286 | default: |
287 | 287 | // not a valid protocol |
288 | - $this->error = 'Invalid protocol "' . $URI_PARTS["scheme"] . '"\n'; |
|
288 | + $this->error = 'Invalid protocol "'.$URI_PARTS["scheme"].'"\n'; |
|
289 | 289 | return false; |
290 | 290 | break; |
291 | 291 | } |
@@ -585,9 +585,9 @@ discard block |
||
585 | 585 | $match = preg_replace("|/$|", "", $match); |
586 | 586 | $match_part = parse_url($match); |
587 | 587 | $match_root = |
588 | - $match_part["scheme"] . "://" . $match_part["host"]; |
|
588 | + $match_part["scheme"]."://".$match_part["host"]; |
|
589 | 589 | |
590 | - $search = array("|^http://" . preg_quote($this->host) . "|i", |
|
590 | + $search = array("|^http://".preg_quote($this->host)."|i", |
|
591 | 591 | "|^(\/)|i", |
592 | 592 | "|^(?!http://)(?!mailto:)|i", |
593 | 593 | "|/\./|", |
@@ -595,8 +595,8 @@ discard block |
||
595 | 595 | ); |
596 | 596 | |
597 | 597 | $replace = array("", |
598 | - $match_root . "/", |
|
599 | - $match . "/", |
|
598 | + $match_root."/", |
|
599 | + $match."/", |
|
600 | 600 | "/", |
601 | 601 | "/" |
602 | 602 | ); |
@@ -625,17 +625,17 @@ discard block |
||
625 | 625 | $URI_PARTS = parse_url($URI); |
626 | 626 | if (empty($url)) |
627 | 627 | $url = "/"; |
628 | - $headers = $http_method . " " . $url . " " . $this->_httpversion . "\r\n"; |
|
628 | + $headers = $http_method." ".$url." ".$this->_httpversion."\r\n"; |
|
629 | 629 | if (!empty($this->host) && !isset($this->rawheaders['Host'])) { |
630 | - $headers .= "Host: " . $this->host; |
|
630 | + $headers .= "Host: ".$this->host; |
|
631 | 631 | if (!empty($this->port) && $this->port != '80') |
632 | - $headers .= ":" . $this->port; |
|
632 | + $headers .= ":".$this->port; |
|
633 | 633 | $headers .= "\r\n"; |
634 | 634 | } |
635 | 635 | if (!empty($this->agent)) |
636 | - $headers .= "User-Agent: " . $this->agent . "\r\n"; |
|
636 | + $headers .= "User-Agent: ".$this->agent."\r\n"; |
|
637 | 637 | if (!empty($this->accept)) |
638 | - $headers .= "Accept: " . $this->accept . "\r\n"; |
|
638 | + $headers .= "Accept: ".$this->accept."\r\n"; |
|
639 | 639 | if ($this->use_gzip) { |
640 | 640 | // make sure PHP was built with --with-zlib |
641 | 641 | // and we can handle gzipp'ed data |
@@ -643,46 +643,46 @@ discard block |
||
643 | 643 | $headers .= "Accept-encoding: gzip\r\n"; |
644 | 644 | } else { |
645 | 645 | trigger_error( |
646 | - "use_gzip is on, but PHP was built without zlib support." . |
|
646 | + "use_gzip is on, but PHP was built without zlib support.". |
|
647 | 647 | " Requesting file(s) without gzip encoding.", |
648 | 648 | E_USER_NOTICE); |
649 | 649 | } |
650 | 650 | } |
651 | 651 | if (!empty($this->referer)) |
652 | - $headers .= "Referer: " . $this->referer . "\r\n"; |
|
652 | + $headers .= "Referer: ".$this->referer."\r\n"; |
|
653 | 653 | if (!empty($this->cookies)) { |
654 | 654 | if (!is_array($this->cookies)) |
655 | - $this->cookies = (array)$this->cookies; |
|
655 | + $this->cookies = (array) $this->cookies; |
|
656 | 656 | |
657 | 657 | reset($this->cookies); |
658 | 658 | if (count($this->cookies) > 0) { |
659 | 659 | $cookie_headers .= 'Cookie: '; |
660 | 660 | foreach ($this->cookies as $cookieKey => $cookieVal) { |
661 | - $cookie_headers .= $cookieKey . "=" . urlencode($cookieVal) . "; "; |
|
661 | + $cookie_headers .= $cookieKey."=".urlencode($cookieVal)."; "; |
|
662 | 662 | } |
663 | - $headers .= substr($cookie_headers, 0, -2) . "\r\n"; |
|
663 | + $headers .= substr($cookie_headers, 0, -2)."\r\n"; |
|
664 | 664 | } |
665 | 665 | } |
666 | 666 | if (!empty($this->rawheaders)) { |
667 | 667 | if (!is_array($this->rawheaders)) |
668 | - $this->rawheaders = (array)$this->rawheaders; |
|
668 | + $this->rawheaders = (array) $this->rawheaders; |
|
669 | 669 | while (list($headerKey, $headerVal) = each($this->rawheaders)) |
670 | - $headers .= $headerKey . ": " . $headerVal . "\r\n"; |
|
670 | + $headers .= $headerKey.": ".$headerVal."\r\n"; |
|
671 | 671 | } |
672 | 672 | if (!empty($content_type)) { |
673 | 673 | $headers .= "Content-type: $content_type"; |
674 | 674 | if ($content_type == "multipart/form-data") |
675 | - $headers .= "; boundary=" . $this->_mime_boundary; |
|
675 | + $headers .= "; boundary=".$this->_mime_boundary; |
|
676 | 676 | $headers .= "\r\n"; |
677 | 677 | } |
678 | 678 | if (!empty($body)) |
679 | - $headers .= "Content-length: " . strlen($body) . "\r\n"; |
|
679 | + $headers .= "Content-length: ".strlen($body)."\r\n"; |
|
680 | 680 | if (!empty($this->user) || !empty($this->pass)) |
681 | - $headers .= "Authorization: Basic " . base64_encode($this->user . ":" . $this->pass) . "\r\n"; |
|
681 | + $headers .= "Authorization: Basic ".base64_encode($this->user.":".$this->pass)."\r\n"; |
|
682 | 682 | |
683 | 683 | //add proxy auth headers |
684 | 684 | if (!empty($this->proxy_user)) |
685 | - $headers .= 'Proxy-Authorization: ' . 'Basic ' . base64_encode($this->proxy_user . ':' . $this->proxy_pass) . "\r\n"; |
|
685 | + $headers .= 'Proxy-Authorization: '.'Basic '.base64_encode($this->proxy_user.':'.$this->proxy_pass)."\r\n"; |
|
686 | 686 | |
687 | 687 | |
688 | 688 | $headers .= "\r\n"; |
@@ -692,7 +692,7 @@ discard block |
||
692 | 692 | socket_set_timeout($fp, $this->read_timeout); |
693 | 693 | $this->timed_out = false; |
694 | 694 | |
695 | - fwrite($fp, $headers . $body, strlen($headers . $body)); |
|
695 | + fwrite($fp, $headers.$body, strlen($headers.$body)); |
|
696 | 696 | |
697 | 697 | $this->_redirectaddr = false; |
698 | 698 | unset($this->headers); |
@@ -716,10 +716,10 @@ discard block |
||
716 | 716 | // look for :// in the Location header to see if hostname is included |
717 | 717 | if (!preg_match("|\:\/\/|", $matches[2])) { |
718 | 718 | // no host in the path, so prepend |
719 | - $this->_redirectaddr = $URI_PARTS["scheme"] . "://" . $this->host . ":" . $this->port; |
|
719 | + $this->_redirectaddr = $URI_PARTS["scheme"]."://".$this->host.":".$this->port; |
|
720 | 720 | // eliminate double slash |
721 | 721 | if (!preg_match("|^/|", $matches[2])) |
722 | - $this->_redirectaddr .= "/" . $matches[2]; |
|
722 | + $this->_redirectaddr .= "/".$matches[2]; |
|
723 | 723 | else |
724 | 724 | $this->_redirectaddr .= $matches[2]; |
725 | 725 | } else |
@@ -771,7 +771,7 @@ discard block |
||
771 | 771 | if (($this->_framedepth < $this->maxframes) && preg_match_all("'<frame\s+.*src[\s]*=[\'\"]?([^\'\"\>]+)'i", $results, $match)) { |
772 | 772 | $this->results[] = $results; |
773 | 773 | for ($x = 0; $x < count($match[1]); $x++) |
774 | - $this->_frameurls[] = $this->_expandlinks($match[1][$x], $URI_PARTS["scheme"] . "://" . $this->host); |
|
774 | + $this->_frameurls[] = $this->_expandlinks($match[1][$x], $URI_PARTS["scheme"]."://".$this->host); |
|
775 | 775 | } // have we already fetched framed content? |
776 | 776 | elseif (is_array($this->results)) |
777 | 777 | $this->results[] = $results; |
@@ -858,14 +858,14 @@ discard block |
||
858 | 858 | $context_opts['ssl']['capath'] = $this->capath; |
859 | 859 | } |
860 | 860 | |
861 | - $host = 'ssl://' . $host; |
|
861 | + $host = 'ssl://'.$host; |
|
862 | 862 | } |
863 | 863 | |
864 | 864 | $context = stream_context_create($context_opts); |
865 | 865 | |
866 | 866 | if (version_compare(PHP_VERSION, '5.0.0', '>')) { |
867 | - if($this->scheme == 'http') |
|
868 | - $host = "tcp://" . $host; |
|
867 | + if ($this->scheme == 'http') |
|
868 | + $host = "tcp://".$host; |
|
869 | 869 | $fp = stream_socket_client( |
870 | 870 | "$host:$port", |
871 | 871 | $errno, |
@@ -897,7 +897,7 @@ discard block |
||
897 | 897 | case -5: |
898 | 898 | $this->error = "connection refused or timed out (-5)"; |
899 | 899 | default: |
900 | - $this->error = "connection failed (" . $errno . ")"; |
|
900 | + $this->error = "connection failed (".$errno.")"; |
|
901 | 901 | } |
902 | 902 | return false; |
903 | 903 | } |
@@ -938,26 +938,26 @@ discard block |
||
938 | 938 | while (list($key, $val) = each($formvars)) { |
939 | 939 | if (is_array($val) || is_object($val)) { |
940 | 940 | while (list($cur_key, $cur_val) = each($val)) { |
941 | - $postdata .= urlencode($key) . "[]=" . urlencode($cur_val) . "&"; |
|
941 | + $postdata .= urlencode($key)."[]=".urlencode($cur_val)."&"; |
|
942 | 942 | } |
943 | 943 | } else |
944 | - $postdata .= urlencode($key) . "=" . urlencode($val) . "&"; |
|
944 | + $postdata .= urlencode($key)."=".urlencode($val)."&"; |
|
945 | 945 | } |
946 | 946 | break; |
947 | 947 | |
948 | 948 | case "multipart/form-data": |
949 | - $this->_mime_boundary = "Snoopy" . md5(uniqid(microtime())); |
|
949 | + $this->_mime_boundary = "Snoopy".md5(uniqid(microtime())); |
|
950 | 950 | |
951 | 951 | reset($formvars); |
952 | 952 | while (list($key, $val) = each($formvars)) { |
953 | 953 | if (is_array($val) || is_object($val)) { |
954 | 954 | while (list($cur_key, $cur_val) = each($val)) { |
955 | - $postdata .= "--" . $this->_mime_boundary . "\r\n"; |
|
955 | + $postdata .= "--".$this->_mime_boundary."\r\n"; |
|
956 | 956 | $postdata .= "Content-Disposition: form-data; name=\"$key\[\]\"\r\n\r\n"; |
957 | 957 | $postdata .= "$cur_val\r\n"; |
958 | 958 | } |
959 | 959 | } else { |
960 | - $postdata .= "--" . $this->_mime_boundary . "\r\n"; |
|
960 | + $postdata .= "--".$this->_mime_boundary."\r\n"; |
|
961 | 961 | $postdata .= "Content-Disposition: form-data; name=\"$key\"\r\n\r\n"; |
962 | 962 | $postdata .= "$val\r\n"; |
963 | 963 | } |
@@ -974,12 +974,12 @@ discard block |
||
974 | 974 | fclose($fp); |
975 | 975 | $base_name = basename($file_name); |
976 | 976 | |
977 | - $postdata .= "--" . $this->_mime_boundary . "\r\n"; |
|
977 | + $postdata .= "--".$this->_mime_boundary."\r\n"; |
|
978 | 978 | $postdata .= "Content-Disposition: form-data; name=\"$field_name\"; filename=\"$base_name\"\r\n\r\n"; |
979 | 979 | $postdata .= "$file_content\r\n"; |
980 | 980 | } |
981 | 981 | } |
982 | - $postdata .= "--" . $this->_mime_boundary . "--\r\n"; |
|
982 | + $postdata .= "--".$this->_mime_boundary."--\r\n"; |
|
983 | 983 | break; |
984 | 984 | } |
985 | 985 |
@@ -1,6 +1,6 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -$c = &$settings; |
|
3 | +$c = &$settings; |
|
4 | 4 | |
5 | 5 | $c['site_name'] = 'My MODX Site'; |
6 | 6 | $c['site_start'] = 1; |
@@ -12,7 +12,7 @@ discard block |
||
12 | 12 | |
13 | 13 | $sysMsgs = ""; |
14 | 14 | $limit = count($SystemAlertMsgQueque); |
15 | - for($i=0;$i<$limit;$i++) { |
|
15 | + for ($i = 0; $i < $limit; $i++) { |
|
16 | 16 | $sysMsgs .= $SystemAlertMsgQueque[$i]."<hr sys/>"; |
17 | 17 | } |
18 | 18 | // reset message queque |
@@ -20,7 +20,7 @@ discard block |
||
20 | 20 | $_SESSION['SystemAlertMsgQueque'] = array(); |
21 | 21 | $SystemAlertMsgQueque = &$_SESSION['SystemAlertMsgQueque']; |
22 | 22 | |
23 | - if($sysMsgs!="") { |
|
23 | + if ($sysMsgs != "") { |
|
24 | 24 | ?> |
25 | 25 | |
26 | 26 | <?php // fetch the styles |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | var sysAlert = new Element('div').setProperties({ |
33 | 33 | 'class': 'sysAlert' |
34 | 34 | }); |
35 | - sysAlert.innerHTML = '<?php echo $modx->db->escape($sysMsgs);?>'; |
|
35 | + sysAlert.innerHTML = '<?php echo $modx->db->escape($sysMsgs); ?>'; |
|
36 | 36 | var boxHtml = new MooPrompt('<?php echo $_lang['sys_alert']; ?>', sysAlert, { |
37 | 37 | buttons: 1, |
38 | 38 | button1: 'Ok', |
@@ -149,7 +149,7 @@ discard block |
||
149 | 149 | $username = '', |
150 | 150 | $password = '', |
151 | 151 | $debug_level = 0 |
152 | - ) { |
|
152 | + ){ |
|
153 | 153 | $pop = new self(); |
154 | 154 | |
155 | 155 | return $pop->authorise($host, $port, $timeout, $username, $password, $debug_level); |
@@ -288,11 +288,11 @@ discard block |
||
288 | 288 | } |
289 | 289 | |
290 | 290 | // Send the Username |
291 | - $this->sendString("USER $username" . static::LE); |
|
291 | + $this->sendString("USER $username".static::LE); |
|
292 | 292 | $pop3_response = $this->getResponse(); |
293 | 293 | if ($this->checkResponse($pop3_response)) { |
294 | 294 | // Send the Password |
295 | - $this->sendString("PASS $password" . static::LE); |
|
295 | + $this->sendString("PASS $password".static::LE); |
|
296 | 296 | $pop3_response = $this->getResponse(); |
297 | 297 | if ($this->checkResponse($pop3_response)) { |
298 | 298 | return true; |
@@ -412,7 +412,7 @@ discard block |
||
412 | 412 | protected function catchWarning($errno, $errstr, $errfile, $errline) |
413 | 413 | { |
414 | 414 | $this->setError( |
415 | - 'Connecting to the POP3 server raised a PHP warning:' . |
|
415 | + 'Connecting to the POP3 server raised a PHP warning:'. |
|
416 | 416 | "errno: $errno errstr: $errstr; errfile: $errfile; errline: $errline" |
417 | 417 | ); |
418 | 418 | } |
@@ -128,10 +128,10 @@ |
||
128 | 128 | } |
129 | 129 | |
130 | 130 | return base64_encode( |
131 | - 'user=' . |
|
132 | - $this->oauthUserEmail . |
|
133 | - "\001auth=Bearer " . |
|
134 | - $this->oauthToken . |
|
131 | + 'user='. |
|
132 | + $this->oauthUserEmail. |
|
133 | + "\001auth=Bearer ". |
|
134 | + $this->oauthToken. |
|
135 | 135 | "\001\001" |
136 | 136 | ); |
137 | 137 | } |
@@ -307,7 +307,7 @@ discard block |
||
307 | 307 | } |
308 | 308 | // Connect to the SMTP server |
309 | 309 | $this->edebug( |
310 | - "Connection: opening to $host:$port, timeout=$timeout, options=" . |
|
310 | + "Connection: opening to $host:$port, timeout=$timeout, options=". |
|
311 | 311 | (count($options) > 0 ? var_export($options, true) : 'array()'), |
312 | 312 | self::DEBUG_CONNECTION |
313 | 313 | ); |
@@ -317,7 +317,7 @@ discard block |
||
317 | 317 | $socket_context = stream_context_create($options); |
318 | 318 | set_error_handler([$this, 'errorHandler']); |
319 | 319 | $this->smtp_conn = stream_socket_client( |
320 | - $host . ':' . $port, |
|
320 | + $host.':'.$port, |
|
321 | 321 | $errno, |
322 | 322 | $errstr, |
323 | 323 | $timeout, |
@@ -350,7 +350,7 @@ discard block |
||
350 | 350 | (string) $errstr |
351 | 351 | ); |
352 | 352 | $this->edebug( |
353 | - 'SMTP ERROR: ' . $this->error['error'] |
|
353 | + 'SMTP ERROR: '.$this->error['error'] |
|
354 | 354 | . ": $errstr ($errno)", |
355 | 355 | self::DEBUG_CLIENT |
356 | 356 | ); |
@@ -370,7 +370,7 @@ discard block |
||
370 | 370 | } |
371 | 371 | // Get any announcement |
372 | 372 | $announce = $this->get_lines(); |
373 | - $this->edebug('SERVER -> CLIENT: ' . $announce, self::DEBUG_SERVER); |
|
373 | + $this->edebug('SERVER -> CLIENT: '.$announce, self::DEBUG_SERVER); |
|
374 | 374 | |
375 | 375 | return true; |
376 | 376 | } |
@@ -426,7 +426,7 @@ discard block |
||
426 | 426 | $password, |
427 | 427 | $authtype = null, |
428 | 428 | $OAuth = null |
429 | - ) { |
|
429 | + ){ |
|
430 | 430 | if (!$this->server_caps) { |
431 | 431 | $this->setError('Authentication is not allowed before HELO/EHLO'); |
432 | 432 | |
@@ -443,15 +443,15 @@ discard block |
||
443 | 443 | return false; |
444 | 444 | } |
445 | 445 | |
446 | - $this->edebug('Auth method requested: ' . ($authtype ? $authtype : 'UNKNOWN'), self::DEBUG_LOWLEVEL); |
|
446 | + $this->edebug('Auth method requested: '.($authtype ? $authtype : 'UNKNOWN'), self::DEBUG_LOWLEVEL); |
|
447 | 447 | $this->edebug( |
448 | - 'Auth methods available on the server: ' . implode(',', $this->server_caps['AUTH']), |
|
448 | + 'Auth methods available on the server: '.implode(',', $this->server_caps['AUTH']), |
|
449 | 449 | self::DEBUG_LOWLEVEL |
450 | 450 | ); |
451 | 451 | |
452 | 452 | //If we have requested a specific auth type, check the server supports it before trying others |
453 | 453 | if (!in_array($authtype, $this->server_caps['AUTH'])) { |
454 | - $this->edebug('Requested auth method not available: ' . $authtype, self::DEBUG_LOWLEVEL); |
|
454 | + $this->edebug('Requested auth method not available: '.$authtype, self::DEBUG_LOWLEVEL); |
|
455 | 455 | $authtype = null; |
456 | 456 | } |
457 | 457 | |
@@ -469,7 +469,7 @@ discard block |
||
469 | 469 | |
470 | 470 | return false; |
471 | 471 | } |
472 | - self::edebug('Auth method selected: ' . $authtype, self::DEBUG_LOWLEVEL); |
|
472 | + self::edebug('Auth method selected: '.$authtype, self::DEBUG_LOWLEVEL); |
|
473 | 473 | } |
474 | 474 | |
475 | 475 | if (!in_array($authtype, $this->server_caps['AUTH'])) { |
@@ -489,7 +489,7 @@ discard block |
||
489 | 489 | // Send encoded username and password |
490 | 490 | if (!$this->sendCommand( |
491 | 491 | 'User & Password', |
492 | - base64_encode("\0" . $username . "\0" . $password), |
|
492 | + base64_encode("\0".$username."\0".$password), |
|
493 | 493 | 235 |
494 | 494 | ) |
495 | 495 | ) { |
@@ -517,7 +517,7 @@ discard block |
||
517 | 517 | $challenge = base64_decode(substr($this->last_reply, 4)); |
518 | 518 | |
519 | 519 | // Build the response |
520 | - $response = $username . ' ' . $this->hmac($challenge, $password); |
|
520 | + $response = $username.' '.$this->hmac($challenge, $password); |
|
521 | 521 | |
522 | 522 | // send encoded credentials |
523 | 523 | return $this->sendCommand('Username', base64_encode($response), 235); |
@@ -529,7 +529,7 @@ discard block |
||
529 | 529 | $oauth = $OAuth->getOauth64(); |
530 | 530 | |
531 | 531 | // Start authentication |
532 | - if (!$this->sendCommand('AUTH', 'AUTH XOAUTH2 ' . $oauth, 235)) { |
|
532 | + if (!$this->sendCommand('AUTH', 'AUTH XOAUTH2 '.$oauth, 235)) { |
|
533 | 533 | return false; |
534 | 534 | } |
535 | 535 | break; |
@@ -576,7 +576,7 @@ discard block |
||
576 | 576 | $k_ipad = $key ^ $ipad; |
577 | 577 | $k_opad = $key ^ $opad; |
578 | 578 | |
579 | - return md5($k_opad . pack('H*', md5($k_ipad . $data))); |
|
579 | + return md5($k_opad.pack('H*', md5($k_ipad.$data))); |
|
580 | 580 | } |
581 | 581 | |
582 | 582 | /** |
@@ -691,7 +691,7 @@ discard block |
||
691 | 691 | } |
692 | 692 | //If processing headers add a LWSP-char to the front of new line RFC822 section 3.1.1 |
693 | 693 | if ($in_headers) { |
694 | - $line = "\t" . $line; |
|
694 | + $line = "\t".$line; |
|
695 | 695 | } |
696 | 696 | } |
697 | 697 | $lines_out[] = $line; |
@@ -700,9 +700,9 @@ discard block |
||
700 | 700 | foreach ($lines_out as $line_out) { |
701 | 701 | //RFC2821 section 4.5.2 |
702 | 702 | if (!empty($line_out) and $line_out[0] == '.') { |
703 | - $line_out = '.' . $line_out; |
|
703 | + $line_out = '.'.$line_out; |
|
704 | 704 | } |
705 | - $this->client_send($line_out . static::LE, 'DATA'); |
|
705 | + $this->client_send($line_out.static::LE, 'DATA'); |
|
706 | 706 | } |
707 | 707 | } |
708 | 708 | |
@@ -748,7 +748,7 @@ discard block |
||
748 | 748 | */ |
749 | 749 | protected function sendHello($hello, $host) |
750 | 750 | { |
751 | - $noerror = $this->sendCommand($hello, $hello . ' ' . $host, 250); |
|
751 | + $noerror = $this->sendCommand($hello, $hello.' '.$host, 250); |
|
752 | 752 | $this->helo_rply = $this->last_reply; |
753 | 753 | if ($noerror) { |
754 | 754 | $this->parseHelloFields($hello); |
@@ -819,7 +819,7 @@ discard block |
||
819 | 819 | |
820 | 820 | return $this->sendCommand( |
821 | 821 | 'MAIL FROM', |
822 | - 'MAIL FROM:<' . $from . '>' . $useVerp, |
|
822 | + 'MAIL FROM:<'.$from.'>'.$useVerp, |
|
823 | 823 | 250 |
824 | 824 | ); |
825 | 825 | } |
@@ -859,7 +859,7 @@ discard block |
||
859 | 859 | { |
860 | 860 | return $this->sendCommand( |
861 | 861 | 'RCPT TO', |
862 | - 'RCPT TO:<' . $address . '>', |
|
862 | + 'RCPT TO:<'.$address.'>', |
|
863 | 863 | [250, 251] |
864 | 864 | ); |
865 | 865 | } |
@@ -898,7 +898,7 @@ discard block |
||
898 | 898 | |
899 | 899 | return false; |
900 | 900 | } |
901 | - $this->client_send($commandstring . static::LE, $command); |
|
901 | + $this->client_send($commandstring.static::LE, $command); |
|
902 | 902 | |
903 | 903 | $this->last_reply = $this->get_lines(); |
904 | 904 | // Fetch SMTP code and possible error code explanation |
@@ -908,8 +908,8 @@ discard block |
||
908 | 908 | $code_ex = (count($matches) > 2 ? $matches[2] : null); |
909 | 909 | // Cut off error code from each response line |
910 | 910 | $detail = preg_replace( |
911 | - "/{$code}[ -]" . |
|
912 | - ($code_ex ? str_replace('.', '\\.', $code_ex) . ' ' : '') . '/m', |
|
911 | + "/{$code}[ -]". |
|
912 | + ($code_ex ? str_replace('.', '\\.', $code_ex).' ' : '').'/m', |
|
913 | 913 | '', |
914 | 914 | $this->last_reply |
915 | 915 | ); |
@@ -920,7 +920,7 @@ discard block |
||
920 | 920 | $detail = substr($this->last_reply, 4); |
921 | 921 | } |
922 | 922 | |
923 | - $this->edebug('SERVER -> CLIENT: ' . $this->last_reply, self::DEBUG_SERVER); |
|
923 | + $this->edebug('SERVER -> CLIENT: '.$this->last_reply, self::DEBUG_SERVER); |
|
924 | 924 | |
925 | 925 | if (!in_array($code, (array) $expect)) { |
926 | 926 | $this->setError( |
@@ -930,7 +930,7 @@ discard block |
||
930 | 930 | $code_ex |
931 | 931 | ); |
932 | 932 | $this->edebug( |
933 | - 'SMTP ERROR: ' . $this->error['error'] . ': ' . $this->last_reply, |
|
933 | + 'SMTP ERROR: '.$this->error['error'].': '.$this->last_reply, |
|
934 | 934 | self::DEBUG_CLIENT |
935 | 935 | ); |
936 | 936 | |
@@ -996,7 +996,7 @@ discard block |
||
996 | 996 | public function turn() |
997 | 997 | { |
998 | 998 | $this->setError('The SMTP TURN command is not implemented'); |
999 | - $this->edebug('SMTP NOTICE: ' . $this->error['error'], self::DEBUG_CLIENT); |
|
999 | + $this->edebug('SMTP NOTICE: '.$this->error['error'], self::DEBUG_CLIENT); |
|
1000 | 1000 | |
1001 | 1001 | return false; |
1002 | 1002 | } |
@@ -1017,7 +1017,7 @@ discard block |
||
1017 | 1017 | in_array($command, ['User & Password', 'Username', 'Password'], true)) { |
1018 | 1018 | $this->edebug('CLIENT -> SERVER: <credentials hidden>', self::DEBUG_CLIENT); |
1019 | 1019 | } else { |
1020 | - $this->edebug('CLIENT -> SERVER: ' . $data, self::DEBUG_CLIENT); |
|
1020 | + $this->edebug('CLIENT -> SERVER: '.$data, self::DEBUG_CLIENT); |
|
1021 | 1021 | } |
1022 | 1022 | set_error_handler([$this, 'errorHandler']); |
1023 | 1023 | $result = fwrite($this->smtp_conn, $data); |
@@ -1123,14 +1123,14 @@ discard block |
||
1123 | 1123 | //Must pass vars in here as params are by reference |
1124 | 1124 | if (!stream_select($selR, $selW, $selW, $this->Timelimit)) { |
1125 | 1125 | $this->edebug( |
1126 | - 'SMTP -> get_lines(): timed-out (' . $this->Timeout . ' sec)', |
|
1126 | + 'SMTP -> get_lines(): timed-out ('.$this->Timeout.' sec)', |
|
1127 | 1127 | self::DEBUG_LOWLEVEL |
1128 | 1128 | ); |
1129 | 1129 | break; |
1130 | 1130 | } |
1131 | 1131 | //Deliberate noise suppression - errors are handled afterwards |
1132 | 1132 | $str = @fgets($this->smtp_conn, 515); |
1133 | - $this->edebug('SMTP INBOUND: "' . trim($str) . '"', self::DEBUG_LOWLEVEL); |
|
1133 | + $this->edebug('SMTP INBOUND: "'.trim($str).'"', self::DEBUG_LOWLEVEL); |
|
1134 | 1134 | $data .= $str; |
1135 | 1135 | // If response is only 3 chars (not valid, but RFC5321 S4.2 says it must be handled), |
1136 | 1136 | // or 4th character is a space, we are done reading, break the loop, |
@@ -1142,7 +1142,7 @@ discard block |
||
1142 | 1142 | $info = stream_get_meta_data($this->smtp_conn); |
1143 | 1143 | if ($info['timed_out']) { |
1144 | 1144 | $this->edebug( |
1145 | - 'SMTP -> get_lines(): timed-out (' . $this->Timeout . ' sec)', |
|
1145 | + 'SMTP -> get_lines(): timed-out ('.$this->Timeout.' sec)', |
|
1146 | 1146 | self::DEBUG_LOWLEVEL |
1147 | 1147 | ); |
1148 | 1148 | break; |
@@ -1150,8 +1150,8 @@ discard block |
||
1150 | 1150 | // Now check if reads took too long |
1151 | 1151 | if ($endtime and time() > $endtime) { |
1152 | 1152 | $this->edebug( |
1153 | - 'SMTP -> get_lines(): timelimit reached (' . |
|
1154 | - $this->Timelimit . ' sec)', |
|
1153 | + 'SMTP -> get_lines(): timelimit reached ('. |
|
1154 | + $this->Timelimit.' sec)', |
|
1155 | 1155 | self::DEBUG_LOWLEVEL |
1156 | 1156 | ); |
1157 | 1157 | break; |