This repository has been archived by the owner on Sep 10, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revise mail module configuration form and add install script
- Loading branch information
Jamie Snape
committed
Dec 8, 2014
1 parent
6ccd95a
commit 72cca12
Showing
7 changed files
with
131 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
<?php | ||
/*========================================================================= | ||
MIDAS Server | ||
Copyright (c) Kitware SAS. 26 rue Louis Guérin. 69100 Villeurbanne, FRANCE | ||
All rights reserved. | ||
More information http://www.kitware.com | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0.txt | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
=========================================================================*/ | ||
|
||
define('MAIL_PROVIDER_KEY', 'provider'); | ||
define('MAIL_PROVIDER_DEFAULT_VALUE', 'smtp'); | ||
define('MAIL_PROVIDER_APP_ENGINE', 'app_engine'); | ||
define('MAIL_PROVIDER_MAIL', 'mail'); | ||
define('MAIL_PROVIDER_SEND_GRID', 'send_grid'); | ||
define('MAIL_PROVIDER_SMTP', 'smtp'); | ||
define('MAIL_FROM_ADDRESS_KEY', 'from_address'); | ||
define('MAIL_FROM_ADDRESS_DEFAULT_VALUE', ''); | ||
define('MAIL_ADDRESS_VERIFICATION_KEY', 'address_verification'); | ||
define('MAIL_ADDRESS_VERIFICATION_DEFAULT_VALUE', 0); | ||
define('MAIL_SEND_GRID_USERNAME_KEY', 'send_grid_username'); | ||
define('MAIL_SEND_GRID_USERNAME_DEFAULT_VALUE', ''); | ||
define('MAIL_SEND_GRID_PASSWORD_KEY', 'send_grid_password'); | ||
define('MAIL_SEND_GRID_PASSWORD_DEFAULT_VALUE', ''); | ||
define('MAIL_SMTP_HOST_KEY', 'smtp_host'); | ||
define('MAIL_SMTP_HOST_DEFAULT_VALUE', ''); | ||
define('MAIL_SMTP_PORT_KEY', 'smtp_port'); | ||
define('MAIL_SMTP_PORT_DEFAULT_VALUE', 587); | ||
define('MAIL_SMTP_USE_SSL_KEY', 'smtp_use_ssl'); | ||
define('MAIL_SMTP_USE_SSL_DEFAULT_VALUE', 1); | ||
define('MAIL_SMTP_USERNAME_KEY', 'smtp_username'); | ||
define('MAIL_SMTP_USERNAME_DEFAULT_VALUE', ''); | ||
define('MAIL_SMTP_PASSWORD_KEY', 'smtp_password'); | ||
define('MAIL_SMTP_PASSWORD_DEFAULT_VALUE', ''); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
<?php | ||
/*========================================================================= | ||
MIDAS Server | ||
Copyright (c) Kitware SAS. 26 rue Louis Guérin. 69100 Villeurbanne, FRANCE | ||
All rights reserved. | ||
More information http://www.kitware.com | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0.txt | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
=========================================================================*/ | ||
|
||
require_once BASE_PATH.'/modules/mail/constant/module.php'; | ||
|
||
/** Install the mail module. */ | ||
class Mail_InstallScript extends MIDASModuleInstallScript | ||
{ | ||
/** @var string */ | ||
public $moduleName = 'mail'; | ||
|
||
/** Post database install. */ | ||
public function postInstall() | ||
{ | ||
/** @var SettingModel $settingModel */ | ||
$settingModel = MidasLoader::loadModel('Setting'); | ||
$settingModel->setConfig(MAIL_PROVIDER_KEY, MAIL_PROVIDER_DEFAULT_VALUE, $this->moduleName); | ||
$settingModel->setConfig(MAIL_FROM_ADDRESS_KEY, MAIL_FROM_ADDRESS_DEFAULT_VALUE, $this->moduleName); | ||
$settingModel->setConfig(MAIL_ADDRESS_VERIFICATION_KEY, MAIL_ADDRESS_VERIFICATION_DEFAULT_VALUE, $this->moduleName); | ||
$settingModel->setConfig(MAIL_SEND_GRID_USERNAME_KEY, MAIL_SEND_GRID_USERNAME_DEFAULT_VALUE, $this->moduleName); | ||
$settingModel->setConfig(MAIL_SEND_GRID_PASSWORD_KEY, MAIL_SEND_GRID_PASSWORD_DEFAULT_VALUE, $this->moduleName); | ||
$settingModel->setConfig(MAIL_SMTP_HOST_KEY, MAIL_SMTP_HOST_DEFAULT_VALUE, $this->moduleName); | ||
$settingModel->setConfig(MAIL_SMTP_PORT_KEY, MAIL_SMTP_PORT_DEFAULT_VALUE, $this->moduleName); | ||
$settingModel->setConfig(MAIL_SMTP_USE_SSL_KEY, MAIL_SMTP_USE_SSL_DEFAULT_VALUE, $this->moduleName); | ||
$settingModel->setConfig(MAIL_SMTP_USERNAME_KEY, MAIL_SMTP_USERNAME_DEFAULT_VALUE, $this->moduleName); | ||
$settingModel->setConfig(MAIL_SMTP_PASSWORD_KEY, MAIL_SMTP_PASSWORD_DEFAULT_VALUE, $this->moduleName); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters