Additional.php 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. <?php
  2. /**
  3. * @copyright Copyright (c) 2016 Arthur Schiwon <blizzz@arthur-schiwon.de>
  4. *
  5. * @author Arthur Schiwon <blizzz@arthur-schiwon.de>
  6. *
  7. * @license GNU AGPL version 3 or any later version
  8. *
  9. * This program is free software: you can redistribute it and/or modify
  10. * it under the terms of the GNU Affero General Public License as
  11. * published by the Free Software Foundation, either version 3 of the
  12. * License, or (at your option) any later version.
  13. *
  14. * This program is distributed in the hope that it will be useful,
  15. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  17. * GNU Affero General Public License for more details.
  18. *
  19. * You should have received a copy of the GNU Affero General Public License
  20. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  21. *
  22. */
  23. namespace OC\Settings\Admin;
  24. use Doctrine\DBAL\Connection;
  25. use Doctrine\DBAL\DBALException;
  26. use Doctrine\DBAL\Platforms\SqlitePlatform;
  27. use OC\Lock\DBLockingProvider;
  28. use OC\Lock\NoopLockingProvider;
  29. use OCP\AppFramework\Http\TemplateResponse;
  30. use OCP\IConfig;
  31. use OCP\IDBConnection;
  32. use OCP\IL10N;
  33. use OCP\Lock\ILockingProvider;
  34. use OCP\Settings\ISettings;
  35. class Additional implements ISettings {
  36. /** @var IConfig */
  37. private $config;
  38. /**
  39. * @param IConfig $config
  40. */
  41. public function __construct(IConfig $config) {
  42. $this->config = $config;
  43. }
  44. /**
  45. * @return TemplateResponse
  46. */
  47. public function getForm() {
  48. $parameters = [
  49. // Mail
  50. 'sendmail_is_available' => (bool) \OC_Helper::findBinaryPath('sendmail'),
  51. 'mail_domain' => $this->config->getSystemValue('mail_domain', ''),
  52. 'mail_from_address' => $this->config->getSystemValue('mail_from_address', ''),
  53. 'mail_smtpmode' => $this->config->getSystemValue('mail_smtpmode', ''),
  54. 'mail_smtpsecure' => $this->config->getSystemValue('mail_smtpsecure', ''),
  55. 'mail_smtphost' => $this->config->getSystemValue('mail_smtphost', ''),
  56. 'mail_smtpport' => $this->config->getSystemValue('mail_smtpport', ''),
  57. 'mail_smtpauthtype' => $this->config->getSystemValue('mail_smtpauthtype', ''),
  58. 'mail_smtpauth' => $this->config->getSystemValue('mail_smtpauth', false),
  59. 'mail_smtpname' => $this->config->getSystemValue('mail_smtpname', ''),
  60. 'mail_smtppassword' => $this->config->getSystemValue('mail_smtppassword', ''),
  61. ];
  62. return new TemplateResponse('settings', 'admin/additional-mail', $parameters, '');
  63. }
  64. /**
  65. * @return string the section ID, e.g. 'sharing'
  66. */
  67. public function getSection() {
  68. return 'additional';
  69. }
  70. /**
  71. * @return int whether the form should be rather on the top or bottom of
  72. * the admin section. The forms are arranged in ascending order of the
  73. * priority values. It is required to return a value between 0 and 100.
  74. *
  75. * E.g.: 70
  76. */
  77. public function getPriority() {
  78. return 0;
  79. }
  80. }