PageRenderTime 26ms CodeModel.GetById 15ms RepoModel.GetById 0ms app.codeStats 0ms

/lib/prefs/zend.php

https://gitlab.com/ElvisAns/tiki
PHP | 234 lines | 224 code | 5 blank | 5 comment | 1 complexity | 8e2fb59cab2031bd09390e64501fc704 MD5 | raw file
  1. <?php
  2. // (c) Copyright by authors of the Tiki Wiki CMS Groupware Project
  3. //
  4. // All Rights Reserved. See copyright.txt for details and a complete list of authors.
  5. // Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details.
  6. // $Id$
  7. use Tiki\Package\VendorHelper;
  8. function prefs_zend_list()
  9. {
  10. $emailOptions = [
  11. 'sendmail' => tra('Sendmail'),
  12. 'smtp' => tra('SMTP'),
  13. 'file' => tra('File (debug)'),
  14. ];
  15. $isAwsSdkInstalled = VendorHelper::getAvailableVendorPath('AwsSDK', 'aws/aws-sdk-php/src/Credentials/Credentials.php') !== false;
  16. if ($isAwsSdkInstalled) {
  17. $emailOptions = array_merge($emailOptions, ['amazonSes' => tra('Amazon SES')]);
  18. }
  19. $slmMailOptions = [
  20. 'elasticEmail' => tra('Elastic Email'),
  21. 'mailgun' => tra('Mailgun'),
  22. 'mandrill' => tra('Mandrill'),
  23. 'postage' => tra('Postage'),
  24. 'postmark' => tra('Postmark'),
  25. 'sendGrid' => tra('SendGrid'),
  26. 'sparkPost' => tra('SparkPost')
  27. ];
  28. $emailOptions = array_merge($emailOptions, $slmMailOptions);
  29. return [
  30. 'zend_mail_amazon_ses_key' => [
  31. 'name' => tra('Amazon SES Key'),
  32. 'type' => 'text',
  33. 'perspective' => false,
  34. 'default' => '',
  35. ],
  36. 'zend_mail_amazon_ses_secret' => [
  37. 'name' => tra('Amazon SES Secret'),
  38. 'type' => 'text',
  39. 'perspective' => false,
  40. 'default' => '',
  41. ],
  42. 'zend_mail_amazon_ses_region' => [
  43. 'name' => tra('Amazon SES Region'),
  44. 'type' => 'text',
  45. 'perspective' => false,
  46. 'default' => '',
  47. ],
  48. 'zend_mail_amazon_ses_version' => [
  49. 'name' => tra('Amazon SES version'),
  50. 'type' => 'text',
  51. 'perspective' => false,
  52. 'default' => '',
  53. ],
  54. 'zend_mail_elastic_email_username' => [
  55. 'name' => tra('Elastic Email Username'),
  56. 'type' => 'text',
  57. 'perspective' => false,
  58. 'default' => '',
  59. ],
  60. 'zend_mail_elastic_email_key' => [
  61. 'name' => tra('Elastic Email Key'),
  62. 'type' => 'text',
  63. 'perspective' => false,
  64. 'default' => '',
  65. ],
  66. 'zend_mail_mailgun_domain' => [
  67. 'name' => tra('Mailgun Domain'),
  68. 'type' => 'text',
  69. 'perspective' => false,
  70. 'default' => '',
  71. ],
  72. 'zend_mail_mailgun_key' => [
  73. 'name' => tra('Mailgun Key'),
  74. 'type' => 'text',
  75. 'perspective' => false,
  76. 'default' => '',
  77. ],
  78. 'zend_mail_mailgun_api_endpoint' => [
  79. 'name' => tra('Mailgun API Endpoint'),
  80. 'type' => 'text',
  81. 'perspective' => false,
  82. 'default' => '',
  83. ],
  84. 'zend_mail_mandrill_key' => [
  85. 'name' => tra('Mandrill Key'),
  86. 'type' => 'text',
  87. 'perspective' => false,
  88. 'default' => '',
  89. ],
  90. 'zend_mail_postage_key' => [
  91. 'name' => tra('Postage Key'),
  92. 'type' => 'text',
  93. 'perspective' => false,
  94. 'default' => '',
  95. ],
  96. 'zend_mail_postmark_key' => [
  97. 'name' => tra('Postmark Key'),
  98. 'type' => 'text',
  99. 'perspective' => false,
  100. 'default' => '',
  101. ],
  102. 'zend_mail_send_grid_username' => [
  103. 'name' => tra('SendGrid Username'),
  104. 'type' => 'text',
  105. 'perspective' => false,
  106. 'default' => '',
  107. ],
  108. 'zend_mail_send_grid_key' => [
  109. 'name' => tra('SendGrid Key'),
  110. 'type' => 'text',
  111. 'perspective' => false,
  112. 'default' => '',
  113. ],
  114. 'zend_mail_spark_post_key' => [
  115. 'name' => tra('SparkPost Key'),
  116. 'type' => 'text',
  117. 'perspective' => false,
  118. 'default' => '',
  119. ],
  120. 'zend_mail_smtp_server' => [
  121. 'name' => tra('SMTP server'),
  122. 'type' => 'text',
  123. 'size' => '20',
  124. 'perspective' => false,
  125. 'default' => '',
  126. ],
  127. 'zend_mail_smtp_user' => [
  128. 'name' => tra('Username'),
  129. 'type' => 'text',
  130. 'size' => '20',
  131. 'perspective' => false,
  132. 'autocomplete' => 'off',
  133. 'default' => '',
  134. ],
  135. 'zend_mail_smtp_pass' => [
  136. 'name' => tra('Password'),
  137. 'type' => 'password',
  138. 'size' => '20',
  139. 'perspective' => false,
  140. 'autocomplete' => 'off',
  141. 'default' => '',
  142. ],
  143. 'zend_mail_smtp_port' => [
  144. 'name' => tra('Port'),
  145. 'type' => 'text',
  146. 'size' => '5',
  147. 'perspective' => false,
  148. 'default' => 25,
  149. ],
  150. 'zend_mail_smtp_security' => [
  151. 'name' => tra('Security'),
  152. 'type' => 'list',
  153. 'perspective' => false,
  154. 'options' => [
  155. '' => tra('None'),
  156. 'ssl' => tra('SSL'),
  157. 'tls' => tra('TLS'),
  158. ],
  159. 'default' => '',
  160. ],
  161. 'zend_mail_handler' => [
  162. 'name' => tra('Mail sender'),
  163. 'description' => tra('Specify if Tiki should use Sendmail(the PHP mail() function), SMTP or File (Debug) (to debug email sending by means of storing emails as files on disk at ./temp/Mail_yyyymmddhhmmss_randomstring.tmp ) to send mail notifications.'),
  164. 'type' => 'list',
  165. 'options' => $emailOptions,
  166. 'default' => 'sendmail',
  167. ],
  168. 'zend_mail_smtp_auth' => [
  169. 'name' => tra('Authentication'),
  170. 'description' => tra('Mail server authentication'),
  171. 'type' => 'list',
  172. 'options' => [
  173. '' => tra('None'),
  174. 'login' => tra('LOGIN'),
  175. 'plain' => tra('PLAIN'),
  176. 'crammd5' => tra('CRAM-MD5'),
  177. ],
  178. 'default' => '',
  179. ],
  180. 'zend_mail_smtp_helo' => [
  181. 'name' => tra('Local server name'),
  182. 'description' => tra('Name of the local server. Will be reported to SMTP relay on the HELO/EHLO line.'),
  183. 'type' => 'text',
  184. 'size' => '20',
  185. 'perspective' => false,
  186. 'default' => 'localhost',
  187. ],
  188. 'zend_mail_queue' => [
  189. 'name' => tra('Mail delivery'),
  190. 'description' => tr(
  191. 'When set to Queue, messages will be stored in the database. Requires using the shell script %0 to be run for actual delivery. Only works with SMTP mail.',
  192. '<code>php console.php mail-queue:send</code>'
  193. ),
  194. 'type' => 'list',
  195. 'options' => [
  196. '' => tra('Send immediately'),
  197. 'y' => tra('Queue')
  198. ],
  199. 'default' => '',
  200. ],
  201. 'zend_http_sslverifypeer' => [
  202. 'name' => tra('Verify HTTPS certificates of remote servers'),
  203. 'description' => tra('When set to enforce, the server will fail to connect over HTTPS to a remote server that do not have a SSL certificate that is valid and can be verified against the local list of Certificate Authority (CA)'),
  204. 'type' => 'list',
  205. 'options' => [
  206. '' => tra('Do not enforce verification'),
  207. 'y' => tra('Enforce verification'),
  208. ],
  209. 'default' => '',
  210. ],
  211. 'zend_http_use_curl' => [
  212. 'name' => tra('Use CURL for HTTP connections'),
  213. 'description' => tra(
  214. 'Use CURL instead of sockets for server to server HTTP connections, when sockets are not available.'
  215. ),
  216. 'type' => 'flag',
  217. 'default' => 'n',
  218. 'extensions' => ['curl'],
  219. ],
  220. 'zend_mail_redirect' => [
  221. 'name' => tra('Catch-all email address'),
  222. 'description' => tra('Tiki will send all emails to this email address instead of the target recipients. This will actually rewrite the recipient TO, CC and BCC email headers.'),
  223. 'type' => 'text',
  224. 'size' => '20',
  225. 'perspective' => false,
  226. 'default' => '',
  227. ],
  228. ];
  229. }