-
-
Notifications
You must be signed in to change notification settings - Fork 143
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3863 from laurentj/notification-sender
[internal] support of new config parameter notificationReceiverEmail
- Loading branch information
Showing
2 changed files
with
32 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<?php | ||
|
||
class lizmapModuleUpgrader_commconfig extends jInstallerModule | ||
{ | ||
public $targetVersions = array( | ||
'3.7.0-alpha.3', | ||
'3.6.6', | ||
); | ||
|
||
public $date = '2023-08-31'; | ||
|
||
public function install() | ||
{ | ||
// copy the value of adminContactEmail into the config parameter notificationReceiverEmail | ||
// for jCommunity 1.4+ | ||
$liveIni = new \Jelix\IniFile\IniModifier(jApp::varConfigPath('liveconfig.ini.php')); | ||
$currentValue = $liveIni->getValue('notificationReceiverEmail', 'jcommunity'); | ||
if (!$currentValue) { | ||
$lizmapConfFile = jApp::varConfigPath('lizmapConfig.ini.php'); | ||
$ini = new \Jelix\IniFile\IniModifier($lizmapConfFile); | ||
$contact = $ini->getValue('adminContactEmail', 'services'); | ||
$liveIni->setValue('notificationReceiverEmail', $contact, 'jcommunity'); | ||
$liveIni->save(); | ||
} | ||
} | ||
} |