mails_ingoing.php 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. <?php
  2. /* Copyright (C) 2007-2020 Laurent Destailleur <eldy@users.sourceforge.net>
  3. * Copyright (C) 2009-2012 Regis Houssin <regis.houssin@inodbox.com>
  4. * Copyright (C) 2013 Juanjo Menent <jmenent@2byte.es>
  5. * Copyright (C) 2016 Jonathan TISSEAU <jonathan.tisseau@86dev.fr>
  6. *
  7. * This program is free software; you can redistribute it and/or modify
  8. * it under the terms of the GNU General Public License as published by
  9. * the Free Software Foundation; either version 3 of the License, or
  10. * (at your option) any later version.
  11. *
  12. * This program is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. * GNU General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU General Public License
  18. * along with this program. If not, see <https://www.gnu.org/licenses/>.
  19. */
  20. /**
  21. * \file htdocs/admin/mails_ingoing.php
  22. * \brief Page to setup emails entry
  23. */
  24. // Load Dolibarr environment
  25. require '../main.inc.php';
  26. require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
  27. require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
  28. // Load translation files required by the page
  29. $langs->loadLangs(array("companies", "products", "admin", "mails", "other", "errors"));
  30. $action = GETPOST('action', 'aZ09');
  31. $cancel = GETPOST('cancel', 'aZ09');
  32. $trackid = GETPOST('trackid');
  33. if (!$user->admin) {
  34. accessforbidden();
  35. }
  36. /*
  37. * Actions
  38. */
  39. if ($action == 'update' && !$cancel) {
  40. }
  41. /*
  42. * View
  43. */
  44. $form = new Form($db);
  45. $linuxlike = 1;
  46. if (preg_match('/^win/i', PHP_OS)) {
  47. $linuxlike = 0;
  48. }
  49. if (preg_match('/^mac/i', PHP_OS)) {
  50. $linuxlike = 0;
  51. }
  52. //$wikihelp = 'EN:Setup_EMails|FR:Paramétrage_EMails|ES:Configuración_EMails';
  53. $wikihelp = '';
  54. llxHeader('', $langs->trans("Setup"), $wikihelp);
  55. print load_fiche_titre($langs->trans("EMailsSetup"), '', 'title_setup');
  56. $head = email_admin_prepare_head();
  57. // List of sending methods
  58. $listofmethods = array();
  59. $listofmethods['mail'] = 'PHP mail function';
  60. $listofmethods['smtps'] = 'SMTP/SMTPS socket library';
  61. if (version_compare(phpversion(), '7.0', '>=')) {
  62. $listofmethods['swiftmailer'] = 'Swift Mailer socket library';
  63. }
  64. // List of oauth services
  65. $oauthservices = array();
  66. foreach ($conf->global as $key => $val) {
  67. if (!empty($val) && preg_match('/^OAUTH_.*_ID$/', $key)) {
  68. $key = preg_replace('/^OAUTH_/', '', $key);
  69. $key = preg_replace('/_ID$/', '', $key);
  70. if (preg_match('/^.*-/', $key)) {
  71. $name = preg_replace('/^.*-/', '', $key);
  72. } else {
  73. $name = $langs->trans("NoName");
  74. }
  75. $provider = preg_replace('/-.*$/', '', $key);
  76. $provider = ucfirst(strtolower($provider));
  77. $oauthservices[$key] = $name." (".$provider.")";
  78. }
  79. }
  80. print dol_get_fiche_head($head, 'common_ingoing', '', -1);
  81. print '<br>';
  82. print '<span class="opacitymedium">'.$langs->trans("EMailsInGoingDesc", $langs->transnoentitiesnoconv("EmailCollector"))."</span><br>\n";
  83. print "<br><br>\n";
  84. /*
  85. print '<div class="div-table-responsive-no-min">'; // You can use div-table-responsive-no-min if you dont need reserved height for your table
  86. print '<table class="noborder centpercent">';
  87. print '<tr class="liste_titre"><td class="titlefieldmiddle">'.$langs->trans("Parameter").'</td><td>'.$langs->trans("Value").'</td></tr>';
  88. print '<br>';
  89. print '<div class="div-table-responsive-no-min">'; // You can use div-table-responsive-no-min if you dont need reserved height for your table
  90. print '<table class="noborder centpercent">';
  91. // SMTPS oauth service
  92. if (in_array(getDolGlobalString('MAIN_MAIL_SENDMODE', 'mail'), array('smtps', 'swiftmailer')) && getDolGlobalString('MAIN_MAIL_SMTPS_AUTH_TYPE') === "XOAUTH2") {
  93. $text = $oauthservices[$conf->global->MAIN_MAIL_SMTPS_OAUTH_SERVICE];
  94. if (empty($text)) {
  95. $text = $langs->trans("Undefined").img_warning();
  96. }
  97. print '<tr class="oddeven"><td>'.$langs->trans("MAIN_MAIL_SMTPS_OAUTH_SERVICE").'</td><td>'.$text.'</td></tr>';
  98. }
  99. print '</table>';
  100. print '</div>';
  101. */
  102. print dol_get_fiche_end();
  103. // End of page
  104. llxFooter();
  105. $db->close();