plugin.php 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540
  1. <?php
  2. // PLUGIN INFORMATION
  3. $GLOBALS['plugins'][]['PHP Mailer'] = array( // Plugin Name
  4. 'name' => 'PHP Mailer', // Plugin Name
  5. 'author' => 'PHP Mailer', // Who wrote the plugin
  6. 'category' => 'Mail', // One to Two Word Description
  7. 'link' => 'https://github.com/PHPMailer/PHPMailer', // Link to plugin info
  8. 'license' => 'personal,business', // License Type use , for multiple
  9. 'idPrefix' => 'PHPMAILER', // html element id prefix
  10. 'configPrefix' => 'PHPMAILER', // config file prefix for array items without the hyphen
  11. 'version' => '1.0.0', // SemVer of plugin
  12. 'image' => 'api/plugins/php-mailer/logo.png', // 1:1 non transparent image for plugin
  13. 'settings' => true, // does plugin need a settings modal?
  14. 'bind' => true, // use default bind to make settings page - true or false
  15. 'api' => 'api/v2/plugins/php-mailer/settings', // api route for settings page
  16. 'homepage' => false // Is plugin for use on homepage? true or false
  17. );
  18. class PhpMailer extends Organizr
  19. {
  20. public function _phpMailerPluginGetEmails()
  21. {
  22. $type = null;
  23. if ($this->config['authBackend']) {
  24. if ($this->config['authBackend'] == 'plex') {
  25. $type = 'plex';
  26. }
  27. }
  28. if ($type == 'plex') {
  29. $emails = array_merge($this->userList('plex')['both'], $this->_phpMailerPluginGetOrgUsers());
  30. } elseif ($type == 'emby') {
  31. $emails = $this->_phpMailerPluginGetOrgUsers();
  32. } else {
  33. $emails = $this->_phpMailerPluginGetOrgUsers();
  34. }
  35. return $emails;
  36. }
  37. public function _phpMailerPluginGetOrgUsers()
  38. {
  39. $return = null;
  40. $result = $this->getAllUsers(true);
  41. if (is_array($result) || is_object($result)) {
  42. foreach ($result['users'] as $k => $v) {
  43. $return[$v['username']] = $v['email'];
  44. }
  45. return ($return) ?? false;
  46. }
  47. }
  48. public function _phpMailerPluginGetTemplates()
  49. {
  50. foreach (glob(dirname(__DIR__, 2) . DIRECTORY_SEPARATOR . 'plugins' . DIRECTORY_SEPARATOR . 'php-mailer' . DIRECTORY_SEPARATOR . 'misc' . DIRECTORY_SEPARATOR . 'emailTemplates' . DIRECTORY_SEPARATOR . "*.php") as $filename) {
  51. $templates[] = array(
  52. 'name' => preg_replace('/\\.[^.\\s]{3,4}$/', '', basename($filename)),
  53. 'value' => preg_replace('/\\.[^.\\s]{3,4}$/', '', basename($filename))
  54. );
  55. }
  56. return $templates;
  57. }
  58. public function _phpMailerPluginEmailTemplate($emailTemplate)
  59. {
  60. $variables = [
  61. '{user}' => $emailTemplate['user'],
  62. '{domain}' => $this->getServerPath(true),
  63. '{password}' => $emailTemplate['password'],
  64. '{inviteCode}' => $emailTemplate['inviteCode'],
  65. '{fullDomain}' => $this->getServerPath(true),
  66. '{title}' => $this->config['title'],
  67. ];
  68. $emailTemplate['body'] = strtr($emailTemplate['body'], $variables);
  69. $emailTemplate['subject'] = strtr($emailTemplate['subject'], $variables);
  70. return $emailTemplate;
  71. }
  72. public function _phpMailerPluginBuildEmail($email)
  73. {
  74. /** @noinspection PhpUnusedLocalVariableInspection */
  75. $subject = (isset($email['subject'])) ? $email['subject'] : 'Message from Server';
  76. $body = (isset($email['body'])) ? $email['body'] : 'Message Error Occurred';
  77. $type = (isset($email['type'])) ? $email['type'] : 'No Type';
  78. switch ($type) {
  79. case 'invite':
  80. $extra = 'invite';
  81. break;
  82. case 'reset':
  83. $extra = 'reset';
  84. break;
  85. default:
  86. $extra = null;
  87. break;
  88. }
  89. include('misc/emailTemplates/' . $this->config['PHPMAILER-template'] . '.php');
  90. return $email;
  91. }
  92. public function _phpMailerPluginAdminSendEmail($array)
  93. {
  94. if ($this->config['PHPMAILER-enabled']) {
  95. $emailTemplate = array(
  96. 'type' => 'admin',
  97. 'body' => $array['body'],
  98. 'subject' => $array['subject'],
  99. 'user' => null,
  100. 'password' => null,
  101. 'inviteCode' => null,
  102. );
  103. $emailTemplate = $this->_phpMailerPluginEmailTemplate($emailTemplate);
  104. $sendEmail = array(
  105. 'bcc' => $array['bcc'],
  106. 'subject' => $emailTemplate['subject'],
  107. 'body' => $this->_phpMailerPluginBuildEmail($emailTemplate),
  108. );
  109. $response = $this->_phpMailerPluginSendEmail($sendEmail);
  110. if ($response == true) {
  111. $msg = ($this->config['PHPMAILER-debugTesting']) ? $this->config['phpmOriginalDebug'] : 'Email sent';
  112. $this->setAPIResponse('success', $msg, 200);
  113. } else {
  114. $this->setAPIResponse('error', $response, 409);
  115. return false;
  116. }
  117. return true;
  118. } else {
  119. $this->setAPIResponse('error', 'PHP-Mailer is not enabled', 409);
  120. return false;
  121. }
  122. return false;
  123. }
  124. public function _phpMailerPluginGetDebug($str, $level)
  125. {
  126. $this->config['phpmOriginalDebug'] = $this->config['phpmOriginalDebug'] . $str;
  127. return $this->config['phpmOriginalDebug'];
  128. }
  129. public function _phpMailerPluginSendTestEmail()
  130. {
  131. $emailTemplate = array(
  132. 'type' => 'test',
  133. 'body' => 'This is just a test email.',
  134. 'subject' => 'Test E-Mail',
  135. 'user' => null,
  136. 'password' => null,
  137. 'inviteCode' => null,
  138. );
  139. $emailTemplate = $this->_phpMailerPluginEmailTemplate($emailTemplate);
  140. $this->config['phpmOriginalDebug'] = '|||DEBUG|||';
  141. try {
  142. $mail = new PHPMailer\PHPMailer\PHPMailer(true);
  143. $mail->SMTPDebug = 2;
  144. $mail->isSMTP();
  145. $mail->Debugoutput = function ($str, $level) {
  146. $this->_phpMailerPluginGetDebug($str, $level);
  147. };
  148. $mail->Host = $this->config['PHPMAILER-smtpHost'];
  149. $mail->Port = $this->config['PHPMAILER-smtpHostPort'];
  150. if ($this->config['PHPMAILER-smtpHostType'] !== 'n/a') {
  151. $mail->SMTPSecure = $this->config['PHPMAILER-smtpHostType'];
  152. }
  153. $mail->SMTPAuth = $this->config['PHPMAILER-smtpHostAuth'];
  154. $mail->Username = $this->config['PHPMAILER-smtpHostUsername'];
  155. $mail->Password = $this->decrypt($this->config['PHPMAILER-smtpHostPassword']);
  156. $mail->SMTPOptions = array(
  157. 'ssl' => [
  158. 'verify_peer' => $this->config['PHPMAILER-verifyCert'],
  159. 'verify_depth' => 3,
  160. 'allow_self_signed' => true,
  161. 'peer_name' => $this->config['PHPMAILER-smtpHost'],
  162. 'cafile' => $this->getCert(),
  163. ],
  164. );
  165. $mail->setFrom($this->config['PHPMAILER-smtpHostSenderEmail'], $this->config['PHPMAILER-smtpHostSenderName']);
  166. $mail->addReplyTo($this->config['PHPMAILER-smtpHostSenderEmail'], $this->config['PHPMAILER-smtpHostSenderName']);
  167. $mail->isHTML(true);
  168. $mail->addAddress($this->user['email'], $this->user['username']);
  169. $mail->Subject = $emailTemplate['subject'];
  170. $mail->Body = $this->_phpMailerPluginBuildEmail($emailTemplate);
  171. $mail->send();
  172. $this->writeLog('success', 'Mail Function - E-Mail Test Sent', $this->user['username']);
  173. $msg = ($this->config['PHPMAILER-debugTesting']) ? $this->config['phpmOriginalDebug'] : 'Email sent';
  174. $this->setAPIResponse('success', $msg, 200);
  175. return true;
  176. } catch (PHPMailer\PHPMailer\Exception $e) {
  177. $this->writeLog('error', 'Mail Function - E-Mail Test Failed[' . $mail->ErrorInfo . ']', $this->user['username']);
  178. $this->setAPIResponse('error', $e->getMessage(), 500);
  179. return false;
  180. }
  181. return false;
  182. }
  183. public function _phpMailerPluginSendEmail($emailInfo)
  184. {
  185. $to = isset($emailInfo['to']) ? $emailInfo['to'] : null;
  186. $cc = isset($emailInfo['cc']) ? $emailInfo['cc'] : null;
  187. $bcc = isset($emailInfo['bcc']) ? $emailInfo['bcc'] : null;
  188. $subject = isset($emailInfo['subject']) ? $emailInfo['subject'] : null;
  189. $body = isset($emailInfo['body']) ? $emailInfo['body'] : null;
  190. $username = isset($emailInfo['user']) ? $emailInfo['user'] : 'Organizr User';
  191. try {
  192. $mail = new PHPMailer\PHPMailer\PHPMailer(true);
  193. $mail->isSMTP();
  194. //$mail->SMTPDebug = 3;
  195. $mail->Host = $this->config['PHPMAILER-smtpHost'];
  196. $mail->Port = $this->config['PHPMAILER-smtpHostPort'];
  197. if ($this->config['PHPMAILER-smtpHostType'] !== 'n/a') {
  198. $mail->SMTPSecure = $this->config['PHPMAILER-smtpHostType'];
  199. }
  200. $mail->SMTPAuth = $this->config['PHPMAILER-smtpHostAuth'];
  201. $mail->Username = $this->config['PHPMAILER-smtpHostUsername'];
  202. $mail->Password = $this->decrypt($this->config['PHPMAILER-smtpHostPassword']);
  203. $mail->SMTPOptions = array(
  204. 'ssl' => [
  205. 'verify_peer' => $this->config['PHPMAILER-verifyCert'],
  206. 'verify_depth' => 3,
  207. 'allow_self_signed' => true,
  208. 'peer_name' => $this->config['PHPMAILER-smtpHost'],
  209. 'cafile' => $this->getCert(),
  210. ],
  211. );
  212. $mail->setFrom($this->config['PHPMAILER-smtpHostSenderEmail'], $this->config['PHPMAILER-smtpHostSenderName']);
  213. $mail->addReplyTo($this->config['PHPMAILER-smtpHostSenderEmail'], $this->config['PHPMAILER-smtpHostSenderName']);
  214. $mail->isHTML(true);
  215. if ($to) {
  216. $mail->addAddress($to, $username);
  217. }
  218. if ($cc) {
  219. $mail->addCC($cc);
  220. }
  221. if ($bcc) {
  222. if (strpos($bcc, ',') === false) {
  223. $mail->addBCC($bcc);
  224. } else {
  225. $allEmails = explode(",", $bcc);
  226. foreach ($allEmails as $gotEmail) {
  227. $mail->addBCC($gotEmail);
  228. }
  229. }
  230. }
  231. $mail->Subject = $subject;
  232. $mail->Body = $body;
  233. $mail->send();
  234. return true;
  235. } catch (PHPMailer\PHPMailer\Exception $e) {
  236. $this->writeLog('error', 'Mail Function - E-Mail Test Failed[' . $mail->ErrorInfo . ']', $this->user['username']);
  237. return $e->errorMessage();
  238. }
  239. }
  240. /* GET PHPMAILER SETTINGS */
  241. public function _phpMailerPluginGetSettings()
  242. {
  243. return array(
  244. 'Host' => array(
  245. array(
  246. 'type' => 'input',
  247. 'name' => 'PHPMAILER-smtpHost',
  248. 'label' => 'SMTP Host',
  249. 'value' => $this->config['PHPMAILER-smtpHost']
  250. ),
  251. array(
  252. 'type' => 'input',
  253. 'name' => 'PHPMAILER-smtpHostPort',
  254. 'label' => 'SMTP Port',
  255. 'value' => $this->config['PHPMAILER-smtpHostPort']
  256. )
  257. ),
  258. 'Authentication' => array(
  259. array(
  260. 'type' => 'input',
  261. 'name' => 'PHPMAILER-smtpHostUsername',
  262. 'label' => 'Username',
  263. 'value' => $this->config['PHPMAILER-smtpHostUsername']
  264. ),
  265. array(
  266. 'type' => 'password',
  267. 'name' => 'PHPMAILER-smtpHostPassword',
  268. 'label' => 'Password',
  269. 'value' => $this->config['PHPMAILER-smtpHostPassword']
  270. ),
  271. array(
  272. 'type' => 'switch',
  273. 'name' => 'PHPMAILER-smtpHostAuth',
  274. 'label' => 'Authentication',
  275. 'value' => $this->config['PHPMAILER-smtpHostAuth']
  276. ),
  277. array(
  278. 'type' => 'select',
  279. 'name' => 'PHPMAILER-smtpHostType',
  280. 'label' => 'Authentication Type',
  281. 'value' => $this->config['PHPMAILER-smtpHostType'],
  282. 'options' => array(
  283. array(
  284. 'name' => 'tls',
  285. 'value' => 'tls'
  286. ),
  287. array(
  288. 'name' => 'ssl',
  289. 'value' => 'ssl'
  290. ),
  291. array(
  292. 'name' => 'off',
  293. 'value' => 'n/a'
  294. )
  295. )
  296. ),
  297. array(
  298. 'type' => 'switch',
  299. 'name' => 'PHPMAILER-verifyCert',
  300. 'label' => 'Verify Certificate',
  301. 'value' => $this->config['PHPMAILER-verifyCert']
  302. ),
  303. ),
  304. 'Sender Information' => array(
  305. array(
  306. 'type' => 'input',
  307. 'name' => 'PHPMAILER-smtpHostSenderName',
  308. 'label' => 'Sender Name',
  309. 'value' => $this->config['PHPMAILER-smtpHostSenderName']
  310. ),
  311. array(
  312. 'type' => 'input',
  313. 'name' => 'PHPMAILER-smtpHostSenderEmail',
  314. 'label' => 'Sender Email',
  315. 'value' => $this->config['PHPMAILER-smtpHostSenderEmail'],
  316. 'placeholder' => 'i.e. same as username'
  317. )
  318. ),
  319. 'Test & Options' => array(
  320. array(
  321. 'type' => 'button',
  322. 'label' => 'Send Test',
  323. 'class' => 'phpmSendTestEmail',
  324. 'icon' => 'fa fa-paper-plane',
  325. 'text' => 'Send'
  326. ),
  327. array(
  328. 'type' => 'switch',
  329. 'name' => 'PHPMAILER-debugTesting',
  330. 'label' => 'Enable Debug Output on Email Test',
  331. 'value' => $this->config['PHPMAILER-debugTesting'],
  332. ),
  333. array(
  334. 'type' => 'input',
  335. 'name' => 'PHPMAILER-domain',
  336. 'label' => 'Domain Link Override',
  337. 'value' => $this->config['PHPMAILER-domain'],
  338. 'placeholder' => 'https://domain.com/',
  339. ),
  340. array(
  341. 'type' => 'select',
  342. 'name' => 'PHPMAILER-template',
  343. 'label' => 'Theme',
  344. 'value' => $this->config['PHPMAILER-template'],
  345. 'options' => $this->_phpMailerPluginGetTemplates()
  346. ),
  347. array(
  348. 'type' => 'input',
  349. 'name' => 'PHPMAILER-logo',
  350. 'label' => 'WAN Logo URL',
  351. 'value' => $this->config['PHPMAILER-logo'],
  352. 'placeholder' => 'Full URL',
  353. ),
  354. array(
  355. 'type' => 'switch',
  356. 'name' => 'PHPMAILER-emailTemplateRegisterUserEnabled',
  357. 'label' => 'Send Welcome E-Mail',
  358. 'value' => $this->config['PHPMAILER-emailTemplateRegisterUserEnabled'],
  359. ),
  360. ),
  361. 'Templates' => array(
  362. array(
  363. 'type' => 'accordion',
  364. 'label' => 'Edit Template',
  365. 'id' => 'customEmailTemplates',
  366. 'override' => 12,
  367. 'options' => array(
  368. array(
  369. 'id' => 'PHPMAILER-emailTemplateRegisterUserForm',
  370. 'header' => 'New Registration',
  371. 'body' => array(
  372. array(
  373. 'type' => 'input',
  374. 'name' => 'PHPMAILER-emailTemplateRegisterUserSubject',
  375. 'smallLabel' => 'Subject',
  376. 'value' => $this->config['PHPMAILER-emailTemplateRegisterUserSubject'],
  377. ),
  378. array(
  379. 'type' => 'textbox',
  380. 'name' => 'PHPMAILER-emailTemplateRegisterUser',
  381. 'smallLabel' => 'Body',
  382. 'value' => $this->config['PHPMAILER-emailTemplateRegisterUser'],
  383. 'attr' => 'rows="10"',
  384. )
  385. )
  386. ),
  387. array(
  388. 'id' => 'PHPMAILER-emailTemplateResetPasswordForm',
  389. 'header' => 'Reset Password',
  390. 'body' => array(
  391. array(
  392. 'type' => 'input',
  393. 'name' => 'PHPMAILER-emailTemplateResetSubject',
  394. 'smallLabel' => 'Subject',
  395. 'value' => $this->config['PHPMAILER-emailTemplateResetSubject'],
  396. ),
  397. array(
  398. 'type' => 'textbox',
  399. 'name' => 'PHPMAILER-emailTemplateReset',
  400. 'smallLabel' => 'Body',
  401. 'value' => $this->config['PHPMAILER-emailTemplateReset'],
  402. 'attr' => 'rows="10"',
  403. )
  404. )
  405. ),
  406. array(
  407. 'id' => 'PHPMAILER-emailTemplateInviteUserForm',
  408. 'header' => 'Invite User',
  409. 'body' => array(
  410. array(
  411. 'type' => 'input',
  412. 'name' => 'PHPMAILER-emailTemplateInviteUserSubject',
  413. 'smallLabel' => 'Subject',
  414. 'value' => $this->config['PHPMAILER-emailTemplateInviteUserSubject'],
  415. ),
  416. array(
  417. 'type' => 'textbox',
  418. 'name' => 'PHPMAILER-emailTemplateInviteUser',
  419. 'smallLabel' => 'Body',
  420. 'value' => $this->config['PHPMAILER-emailTemplateInviteUser'],
  421. 'attr' => 'rows="10"',
  422. )
  423. )
  424. ),
  425. array(
  426. 'id' => 'PHPMAILER-emailTemplateCustom-include-OneForm',
  427. 'header' => $this->config['PHPMAILER-emailTemplateCustom-include-OneName'],
  428. 'body' => array(
  429. array(
  430. 'type' => 'input',
  431. 'name' => 'PHPMAILER-emailTemplateCustom-include-OneName',
  432. 'smallLabel' => 'Name',
  433. 'value' => $this->config['PHPMAILER-emailTemplateCustom-include-OneName'],
  434. ),
  435. array(
  436. 'type' => 'input',
  437. 'name' => 'PHPMAILER-emailTemplateCustom-include-OneSubject',
  438. 'smallLabel' => 'Subject',
  439. 'value' => $this->config['PHPMAILER-emailTemplateCustom-include-OneSubject'],
  440. ),
  441. array(
  442. 'type' => 'textbox',
  443. 'name' => 'PHPMAILER-emailTemplateCustom-include-One',
  444. 'smallLabel' => 'Body',
  445. 'value' => $this->config['PHPMAILER-emailTemplateCustom-include-One'],
  446. 'attr' => 'rows="10"',
  447. )
  448. )
  449. ),
  450. array(
  451. 'id' => 'PHPMAILER-emailTemplateCustom-include-TwoForm',
  452. 'header' => $this->config['PHPMAILER-emailTemplateCustom-include-TwoName'],
  453. 'body' => array(
  454. array(
  455. 'type' => 'input',
  456. 'name' => 'PHPMAILER-emailTemplateCustom-include-TwoName',
  457. 'smallLabel' => 'Name',
  458. 'value' => $this->config['PHPMAILER-emailTemplateCustom-include-TwoName'],
  459. ),
  460. array(
  461. 'type' => 'input',
  462. 'name' => 'PHPMAILER-emailTemplateCustom-include-TwoSubject',
  463. 'smallLabel' => 'Subject',
  464. 'value' => $this->config['PHPMAILER-emailTemplateCustom-include-TwoSubject'],
  465. ),
  466. array(
  467. 'type' => 'textbox',
  468. 'name' => 'PHPMAILER-emailTemplateCustom-include-Two',
  469. 'smallLabel' => 'Body',
  470. 'value' => $this->config['PHPMAILER-emailTemplateCustom-include-Two'],
  471. 'attr' => 'rows="10"',
  472. )
  473. )
  474. ),
  475. array(
  476. 'id' => 'PHPMAILER-emailTemplateCustom-include-ThreeForm',
  477. 'header' => $this->config['PHPMAILER-emailTemplateCustom-include-ThreeName'],
  478. 'body' => array(
  479. array(
  480. 'type' => 'input',
  481. 'name' => 'PHPMAILER-emailTemplateCustom-include-ThreeName',
  482. 'smallLabel' => 'Name',
  483. 'value' => $this->config['PHPMAILER-emailTemplateCustom-include-ThreeName'],
  484. ),
  485. array(
  486. 'type' => 'input',
  487. 'name' => 'PHPMAILER-emailTemplateCustom-include-ThreeSubject',
  488. 'smallLabel' => 'Subject',
  489. 'value' => $this->config['PHPMAILER-emailTemplateCustom-include-ThreeSubject'],
  490. ),
  491. array(
  492. 'type' => 'textbox',
  493. 'name' => 'PHPMAILER-emailTemplateCustom-include-Three',
  494. 'smallLabel' => 'Body',
  495. 'value' => $this->config['PHPMAILER-emailTemplateCustom-include-Three'],
  496. 'attr' => 'rows="10"',
  497. )
  498. )
  499. ),
  500. array(
  501. 'id' => 'PHPMAILER-emailTemplateCustom-include-FourForm',
  502. 'header' => $this->config['PHPMAILER-emailTemplateCustom-include-FourName'],
  503. 'body' => array(
  504. array(
  505. 'type' => 'input',
  506. 'name' => 'PHPMAILER-emailTemplateCustom-include-FourName',
  507. 'smallLabel' => 'Name',
  508. 'value' => $this->config['PHPMAILER-emailTemplateCustom-include-FourName'],
  509. ),
  510. array(
  511. 'type' => 'input',
  512. 'name' => 'PHPMAILER-emailTemplateCustom-include-FourSubject',
  513. 'smallLabel' => 'Subject',
  514. 'value' => $this->config['PHPMAILER-emailTemplateCustom-include-FourSubject'],
  515. ),
  516. array(
  517. 'type' => 'textbox',
  518. 'name' => 'PHPMAILER-emailTemplateCustom-include-Four',
  519. 'smallLabel' => 'Body',
  520. 'value' => $this->config['PHPMAILER-emailTemplateCustom-include-Four'],
  521. 'attr' => 'rows="10"',
  522. )
  523. )
  524. ),
  525. )
  526. )
  527. )
  528. );
  529. }
  530. }