preserved.php 9.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271
  1. <?php return array (
  2. 'ad45f84fa1252c157a77f3470c9a304e' =>
  3. array (
  4. 'criteria' =>
  5. array (
  6. 'name' => 'controlerrorlog',
  7. ),
  8. 'object' =>
  9. array (
  10. 'name' => 'controlerrorlog',
  11. 'path' => '{core_path}components/controlerrorlog/',
  12. 'assets_path' => '',
  13. ),
  14. ),
  15. 'c6b0d7dc69515ccfbc56f53ff5b92979' =>
  16. array (
  17. 'criteria' =>
  18. array (
  19. 'key' => 'controlerrorlog.last_lines',
  20. ),
  21. 'object' =>
  22. array (
  23. 'key' => 'controlerrorlog.last_lines',
  24. 'value' => '15',
  25. 'xtype' => 'numberfield',
  26. 'namespace' => 'controlerrorlog',
  27. 'area' => 'controlerrorlog.main',
  28. 'editedon' => NULL,
  29. ),
  30. ),
  31. 'fac5269bbaa2413065f4e3f500db4d84' =>
  32. array (
  33. 'criteria' =>
  34. array (
  35. 'key' => 'controlerrorlog.refresh_freq',
  36. ),
  37. 'object' =>
  38. array (
  39. 'key' => 'controlerrorlog.refresh_freq',
  40. 'value' => '60',
  41. 'xtype' => 'numberfield',
  42. 'namespace' => 'controlerrorlog',
  43. 'area' => 'controlerrorlog.main',
  44. 'editedon' => NULL,
  45. ),
  46. ),
  47. '5cc62a8e4d945052128c717ddb994514' =>
  48. array (
  49. 'criteria' =>
  50. array (
  51. 'key' => 'controlerrorlog.auto_refresh',
  52. ),
  53. 'object' =>
  54. array (
  55. 'key' => 'controlerrorlog.auto_refresh',
  56. 'value' => '1',
  57. 'xtype' => 'combo-boolean',
  58. 'namespace' => 'controlerrorlog',
  59. 'area' => 'controlerrorlog.main',
  60. 'editedon' => NULL,
  61. ),
  62. ),
  63. 'db1651ccf8d78878f7fad86a0818ec4f' =>
  64. array (
  65. 'criteria' =>
  66. array (
  67. 'key' => 'controlerrorlog.control_frontend',
  68. ),
  69. 'object' =>
  70. array (
  71. 'key' => 'controlerrorlog.control_frontend',
  72. 'value' => '',
  73. 'xtype' => 'combo-boolean',
  74. 'namespace' => 'controlerrorlog',
  75. 'area' => 'controlerrorlog.main',
  76. 'editedon' => NULL,
  77. ),
  78. ),
  79. 'f7ec2e1038e0a965ecab04223491cd3b' =>
  80. array (
  81. 'criteria' =>
  82. array (
  83. 'key' => 'controlerrorlog.admin_email',
  84. ),
  85. 'object' =>
  86. array (
  87. 'key' => 'controlerrorlog.admin_email',
  88. 'value' => '',
  89. 'xtype' => 'textfield',
  90. 'namespace' => 'controlerrorlog',
  91. 'area' => 'controlerrorlog.main',
  92. 'editedon' => NULL,
  93. ),
  94. ),
  95. 'fc52b35d4dd2b1ca9360e0658b3c1d0b' =>
  96. array (
  97. 'criteria' =>
  98. array (
  99. 'key' => 'controlerrorlog.allow_copy_deletion',
  100. ),
  101. 'object' =>
  102. array (
  103. 'key' => 'controlerrorlog.allow_copy_deletion',
  104. 'value' => '1',
  105. 'xtype' => 'combo-boolean',
  106. 'namespace' => 'controlerrorlog',
  107. 'area' => 'controlerrorlog.main',
  108. 'editedon' => NULL,
  109. ),
  110. ),
  111. '8d45f03f2b643a262a3c40630c679a36' =>
  112. array (
  113. 'criteria' =>
  114. array (
  115. 'category' => 'controlErrorLog',
  116. ),
  117. 'object' =>
  118. array (
  119. 'id' => 14,
  120. 'parent' => 0,
  121. 'category' => 'controlErrorLog',
  122. 'rank' => 0,
  123. ),
  124. ),
  125. 'c4ed937aabe20bd41baf4743e2ac2432' =>
  126. array (
  127. 'criteria' =>
  128. array (
  129. 'name' => 'controlErrorLog',
  130. ),
  131. 'object' =>
  132. array (
  133. 'id' => 7,
  134. 'source' => 1,
  135. 'property_preprocess' => 0,
  136. 'name' => 'controlErrorLog',
  137. 'description' => '',
  138. 'editor_type' => 0,
  139. 'category' => 14,
  140. 'cache_type' => 0,
  141. 'plugincode' => 'switch ($modx->event->name) {
  142. case \'OnManagerPageBeforeRender\':
  143. if ($modx->hasPermission(\'error_log_view\')) {
  144. $modx->controller->addLexiconTopic(\'controlerrorlog:default\');
  145. $modx->controller->addCss($modx->getOption(\'assets_url\').\'components/controlerrorlog/css/mgr/main.css\');
  146. $modx->controller->addJavascript($modx->getOption(\'assets_url\').\'components/controlerrorlog/js/mgr/cel.default.js\');
  147. $response = $modx->runProcessor(\'mgr/errorlog/get\', array(\'includeContent\'=>false), array(\'processors_path\' => $modx->getOption(\'core_path\') . \'components/controlerrorlog/processors/\'));
  148. $resObj = $response->getObject();
  149. $_html = "<script> controlErrorLog.config = " . $modx->toJSON($resObj) . ";</script>";
  150. $modx->controller->addHtml($_html);
  151. }
  152. break;
  153. case \'OnHandleRequest\':
  154. if ($modx->context->get(\'key\') == \'mgr\') return \'\';
  155. $f = $modx->getOption(xPDO::OPT_CACHE_PATH) . \'logs/error.log\';
  156. if (file_exists($f)) {
  157. $casheHash = $modx->cacheManager->get(\'error_log\');
  158. $hash = md5_file($f);
  159. $email = $modx->getOption(\'controlerrorlog.admin_email\');
  160. if (filesize($f) > 0 && !empty($casheHash) && $casheHash != $hash && $modx->getOption(\'controlerrorlog.control_frontend\') && !empty($email)) {
  161. $modx->lexicon->load(\'controlerrorlog:default\');
  162. /** @var modPHPMailer $mail */
  163. $mail = $modx->getService(\'mail\', \'mail.modPHPMailer\');
  164. $mail->setHTML(true);
  165. $mail->set(modMail::MAIL_SUBJECT, $modx->lexicon(\'errorlog_email_subject\'));
  166. $mail->set(modMail::MAIL_BODY, $modx->lexicon(\'errorlog_email_body\'));
  167. $mail->set(modMail::MAIL_SENDER, $modx->getOption(\'emailsender\'));
  168. $mail->set(modMail::MAIL_FROM, $modx->getOption(\'emailsender\'));
  169. $mail->set(modMail::MAIL_FROM_NAME, $modx->getOption(\'site_name\'));
  170. $mail->address(\'to\', $email);
  171. $mail->address(\'reply-to\', $modx->getOption(\'emailsender\'));
  172. if (!$mail->send()) {
  173. print (\'An error occurred while trying to send the email: \'.$modx->mail->mailer->ErrorInfo);
  174. }
  175. $mail->reset();
  176. }
  177. if ($casheHash != $hash) {
  178. $modx->cacheManager->set(\'error_log\', $hash, 0);
  179. }
  180. }
  181. break;
  182. }',
  183. 'locked' => 0,
  184. 'properties' => NULL,
  185. 'disabled' => 0,
  186. 'moduleguid' => '',
  187. 'static' => 0,
  188. 'static_file' => 'core/components/controlerrorlog/elements/plugins/plugin.controlerrorlog.php',
  189. 'content' => 'switch ($modx->event->name) {
  190. case \'OnManagerPageBeforeRender\':
  191. if ($modx->hasPermission(\'error_log_view\')) {
  192. $modx->controller->addLexiconTopic(\'controlerrorlog:default\');
  193. $modx->controller->addCss($modx->getOption(\'assets_url\').\'components/controlerrorlog/css/mgr/main.css\');
  194. $modx->controller->addJavascript($modx->getOption(\'assets_url\').\'components/controlerrorlog/js/mgr/cel.default.js\');
  195. $response = $modx->runProcessor(\'mgr/errorlog/get\', array(\'includeContent\'=>false), array(\'processors_path\' => $modx->getOption(\'core_path\') . \'components/controlerrorlog/processors/\'));
  196. $resObj = $response->getObject();
  197. $_html = "<script> controlErrorLog.config = " . $modx->toJSON($resObj) . ";</script>";
  198. $modx->controller->addHtml($_html);
  199. }
  200. break;
  201. case \'OnHandleRequest\':
  202. if ($modx->context->get(\'key\') == \'mgr\') return \'\';
  203. $f = $modx->getOption(xPDO::OPT_CACHE_PATH) . \'logs/error.log\';
  204. if (file_exists($f)) {
  205. $casheHash = $modx->cacheManager->get(\'error_log\');
  206. $hash = md5_file($f);
  207. $email = $modx->getOption(\'controlerrorlog.admin_email\');
  208. if (filesize($f) > 0 && !empty($casheHash) && $casheHash != $hash && $modx->getOption(\'controlerrorlog.control_frontend\') && !empty($email)) {
  209. $modx->lexicon->load(\'controlerrorlog:default\');
  210. /** @var modPHPMailer $mail */
  211. $mail = $modx->getService(\'mail\', \'mail.modPHPMailer\');
  212. $mail->setHTML(true);
  213. $mail->set(modMail::MAIL_SUBJECT, $modx->lexicon(\'errorlog_email_subject\'));
  214. $mail->set(modMail::MAIL_BODY, $modx->lexicon(\'errorlog_email_body\'));
  215. $mail->set(modMail::MAIL_SENDER, $modx->getOption(\'emailsender\'));
  216. $mail->set(modMail::MAIL_FROM, $modx->getOption(\'emailsender\'));
  217. $mail->set(modMail::MAIL_FROM_NAME, $modx->getOption(\'site_name\'));
  218. $mail->address(\'to\', $email);
  219. $mail->address(\'reply-to\', $modx->getOption(\'emailsender\'));
  220. if (!$mail->send()) {
  221. print (\'An error occurred while trying to send the email: \'.$modx->mail->mailer->ErrorInfo);
  222. }
  223. $mail->reset();
  224. }
  225. if ($casheHash != $hash) {
  226. $modx->cacheManager->set(\'error_log\', $hash, 0);
  227. }
  228. }
  229. break;
  230. }',
  231. ),
  232. ),
  233. 'beef8e7a85c708ddde40020258b2ecee' =>
  234. array (
  235. 'criteria' =>
  236. array (
  237. 'pluginid' => 7,
  238. 'event' => 'OnManagerPageBeforeRender',
  239. ),
  240. 'object' =>
  241. array (
  242. 'pluginid' => 7,
  243. 'event' => 'OnManagerPageBeforeRender',
  244. 'priority' => 0,
  245. 'propertyset' => 0,
  246. ),
  247. ),
  248. 'cad8effc6200116dce84759e6e09092f' =>
  249. array (
  250. 'criteria' =>
  251. array (
  252. 'pluginid' => 7,
  253. 'event' => 'OnWebPageComplete',
  254. ),
  255. 'object' =>
  256. array (
  257. 'pluginid' => 7,
  258. 'event' => 'OnWebPageComplete',
  259. 'priority' => 0,
  260. 'propertyset' => 0,
  261. ),
  262. ),
  263. );