diff --git a/plugins/addons/mailtemplate/class_mailTemplateInvitations.inc b/plugins/addons/mailtemplate/class_mailTemplateInvitations.inc new file mode 100644 index 0000000000000000000000000000000000000000..72d75d473c5976c1211b8e001d63e113a406b143 --- /dev/null +++ b/plugins/addons/mailtemplate/class_mailTemplateInvitations.inc @@ -0,0 +1,74 @@ +<?php +/* + This code is part of FusionDirectory (http://www.fusiondirectory.org) + + Copyright (C) 2018-2022 FusionDirectory + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA +*/ + +class mailTemplateInvitations extends simplePlugin +{ + protected $displayHeader = TRUE; + + static function plInfo (): array + { + return [ + 'plShortName' => _('Mail Template Invitations'), + 'plDescription' => _('Mail Template Invitations'), + 'plIcon' => 'geticon.php?context=applications&icon=supann&size=48', + 'plSmallIcon' => 'geticon.php?context=applications&icon=supann-status&size=16', + 'plPriority' => 33, + 'plObjectClass' => ['fdMailTemplateInvitations'], + 'plFilter' => '(objectClass=fdMailTemplateInvitations)', + 'plObjectType' => ['mailTemplate'], + 'plConflicts' => ['mailTemplateUserReminder', 'mailTemplateUserRecovery'], + 'plProvidedAcls' => parent::generatePlProvidedAcls(static::getAttributesInfo()) + ]; + } + + static function getAttributesInfo (): array + { + return [ + + ]; + } + + function __construct ($dn = NULL, $object = NULL, $parent = NULL, $mainTab = FALSE) + { + global $config; + parent::__construct($dn, $object, $parent, $mainTab); + } + + protected function shouldSave (): bool + { + global $config; + + $ldap = $config->get_ldap_link(); + $ldap->cd($config->current['BASE']); + $ldap->search('(&(objectClass=fdMailTemplateInvitations))', ['cn','fdMailTemplateInvitations']); + while ($attrs = $ldap->fetch()) { + if (isset($this->attrs['fdMailTemplateInvitations'])) { + $error = new FusionDirectoryError(htmlescape(sprintf(_('Invitations Mail Template Is Already Existing!')))); + $error->display(); + + return FALSE; + } + } + + return TRUE; + } + +} diff --git a/plugins/addons/mailtemplate/class_mailTemplateUserRecovery.inc b/plugins/addons/mailtemplate/class_mailTemplateUserRecovery.inc index 0d11b850a27a09504b4f3b37f6057f1c275bec54..efa76ec0f88ea23495bbdf15afb7c288da427c59 100644 --- a/plugins/addons/mailtemplate/class_mailTemplateUserRecovery.inc +++ b/plugins/addons/mailtemplate/class_mailTemplateUserRecovery.inc @@ -2,7 +2,7 @@ /* This code is part of FusionDirectory (http://www.fusiondirectory.org) - Copyright (C) 2018-2019 FusionDirectory + Copyright (C) 2018-2022 FusionDirectory This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -34,7 +34,7 @@ class mailTemplateUserRecovery extends simplePlugin 'plObjectClass' => ['fdMailTemplateUserRecovery'], 'plFilter' => '(objectClass=fdMailTemplateUserRecovery)', 'plObjectType' => ['mailTemplate'], - 'plConflicts' => ['mailTemplateUserReminder'], + 'plConflicts' => ['mailTemplateUserReminder', 'mailTemplateInvitations'], 'plProvidedAcls' => parent::generatePlProvidedAcls(static::getAttributesInfo()) ]; } diff --git a/plugins/addons/mailtemplate/class_mailTemplateUserReminder.inc b/plugins/addons/mailtemplate/class_mailTemplateUserReminder.inc index d885606ff3a1ccad82bd350246868ba8eab8c13c..455d9bc7bf3b6f77a5e475f1d2ae1aae05f31874 100644 --- a/plugins/addons/mailtemplate/class_mailTemplateUserReminder.inc +++ b/plugins/addons/mailtemplate/class_mailTemplateUserReminder.inc @@ -1,5 +1,25 @@ <?php +/* + This code is part of FusionDirectory (http://www.fusiondirectory.org) + + Copyright (C) 2018-2022 FusionDirectory + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA +*/ + class mailTemplateUserReminder extends simplePlugin { protected $displayHeader = TRUE; @@ -15,7 +35,7 @@ class mailTemplateUserReminder extends simplePlugin 'plObjectClass' => ['fdMailTemplateUserReminder'], 'plFilter' => '(objectClass=fdMailTemplateUserReminder)', 'plObjectType' => ['mailTemplate'], - 'plConflicts' => ['mailTemplateUserRecovery'], + 'plConflicts' => ['mailTemplateUserRecovery', 'mailTemplateInvitations'], 'plProvidedAcls' => parent::generatePlProvidedAcls(static::getAttributesInfo()) ]; } diff --git a/plugins/config/mailtemplate/class_mailTemplateConfig.inc b/plugins/config/mailtemplate/class_mailTemplateConfig.inc index 6a6c26678556bef3c5b2dc961bce7602de848e7f..a1a2e8957ed6635ba889de9367e8a2fa09ef0f8f 100644 --- a/plugins/config/mailtemplate/class_mailTemplateConfig.inc +++ b/plugins/config/mailtemplate/class_mailTemplateConfig.inc @@ -1,7 +1,7 @@ <?php /* This code is part of FusionDirectory (http://www.fusiondirectory.org/) - Copyright (C) 2012-2016 FusionDirectory + Copyright (C) 2012-2022 FusionDirectory This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by