Skip to content
Snippets Groups Projects
Verified Commit 571bce2b authored by Damien's avatar Damien
Browse files

FEAT #7955 Copy login method if not exists

parent 2d71523b
No related branches found
No related tags found
No related merge requests found
......@@ -6,28 +6,28 @@
<SCRIPT>standard_connect.php</SCRIPT>
<ENABLED>true</ENABLED>
</METHOD>
<!--<METHOD>-->
<!--<ID>ldap</ID>-->
<!--<NAME>_STANDARD_LOGIN</NAME>-->
<!--<SCRIPT>standard_connect.php</SCRIPT>-->
<!--<ENABLED>true</ENABLED>-->
<!--</METHOD>-->
<!--<METHOD>-->
<!--<ID>sso</ID>-->
<!--<NAME>_SSO_LOGIN</NAME>-->
<!--<SCRIPT>sso_connect.php</SCRIPT>-->
<!--<ENABLED>true</ENABLED>-->
<!--</METHOD>-->
<!--<METHOD>-->
<!--<ID>cas</ID>-->
<!--<NAME>_CAS_LOGIN</NAME>-->
<!--<SCRIPT>cas_connect.php</SCRIPT>-->
<!--<ENABLED>true</ENABLED>-->
<!--</METHOD>-->
<!--<METHOD>-->
<!--<ID>ozwillo</ID>-->
<!--<NAME>Ozwillo</NAME>-->
<!--<SCRIPT>ozwilloConnect.php</SCRIPT>-->
<!--<ENABLED>true</ENABLED>-->
<!--</METHOD>-->
<METHOD>
<ID>ldap</ID>
<NAME>_STANDARD_LOGIN</NAME>
<SCRIPT>standard_connect.php</SCRIPT>
<ENABLED>false</ENABLED>
</METHOD>
<METHOD>
<ID>sso</ID>
<NAME>_SSO_LOGIN</NAME>
<SCRIPT>sso_connect.php</SCRIPT>
<ENABLED>false</ENABLED>
</METHOD>
<METHOD>
<ID>cas</ID>
<NAME>_CAS_LOGIN</NAME>
<SCRIPT>cas_connect.php</SCRIPT>
<ENABLED>false</ENABLED>
</METHOD>
<METHOD>
<ID>ozwillo</ID>
<NAME>Ozwillo</NAME>
<SCRIPT>ozwilloConnect.php</SCRIPT>
<ENABLED>false</ENABLED>
</METHOD>
</ROOT>
......@@ -21,18 +21,16 @@ foreach ($customs as $custom) {
$loginMethodPath = "custom/{$custom}/apps/maarch_entreprise/xml/login_method.xml";
if (!file_exists($loginMethodPath)) {
$newXml = new DomDocument("1.0", "UTF-8");
$rRootNode = $newXml->createElement('ROOT');
$newXml->appendChild($rRootNode);
$newXml->save($loginMethodPath);
copy('apps/maarch_entreprise/xml/login_method.xml', "custom/{$custom}/apps/maarch_entreprise/xml/login_method.xml");
}
$loginXmlfile = simplexml_load_file($loginMethodPath);
$newloginMethod = $loginXmlfile->addChild('METHOD');
$newloginMethod->addChild('ID', 'ldap');
$newloginMethod->addChild('NAME', '_STANDARD_LOGIN');
$newloginMethod->addChild('SCRIPT', 'standard_connect.php');
$newloginMethod->addChild('ENABLED', 'true');
foreach ($loginXmlfile->METHOD as $method) {
$method->ENABLED = 'false';
if ($method->ID == 'ldap') {
$method->ENABLED = 'true';
}
}
$res = $loginXmlfile->asXML();
$fp = @fopen($loginMethodPath, "w+");
......
......@@ -144,7 +144,7 @@ define('_ADMIN_GROUPS_DESC', "Ajouter, suspendre, ou modifier des groupes d'util
define('_ENTITIES', 'Entities');
define('_MANAGE_ENTITIES_DESC', 'Manage your organization (poles,services, etc.). Also diffusion models and visa circuit linked to services.');
define('_LISTMODELS_WORKFLOW', 'Workflow models');
define('_MANAGE_LISTMODELS_DESC', 'Manage avis and visa circuit models, which can be used in document.');
define('_MANAGE_LISTMODELS_WORKFLOW_DESC', "Manage avis and visa circuit models, which can be used in document.");
define('_DOCTYPES', 'File plan');
define('_ADMIN_DOCTYPES_DESC', 'Define the intern layout of a file (file/ sub-file/ document type). For each, define the index list to enter, and their mandatory character for the file completeness.');
define('_FILEPLANS', 'organizational file plan');
......@@ -348,7 +348,6 @@ define("_JOIN_RES_CASE_IN_PROCESS", "Link mails to cases (handling basket)");
define("_CLOSE_CASE", "Enclose cases");
define("_ADD_CASES", "Create cases");
define('_CHOOSE_ENTITY', 'Choose a department');
define('_MANAGE_LISTMODELS_WORKFLOW_DESC', "Manage avis and visa circuit models, which can be used in document.");
define('_ADD_COPY_IN_PROCESS', 'Add persons on copy in the handling');
define('_ADD_COPY_IN_INDEXING_VALIDATION', 'Forbid recipient modification on the diffusion list');
define('_UPDATE_LIST_DIFF_IN_DETAILS', 'Update diffusion list from the detailed page');
......
......@@ -104,7 +104,7 @@ class CoreConfigModel
$loggingMethod = [];
if ($loadedXml) {
foreach ($loadedXml->METHOD as $value) {
if (!empty((string)$value->ENABLED)) {
if ((string)$value->ENABLED == 'true') {
$loggingMethod['id'] = (string)$value->ID;
$loggingMethod['name'] = (string)$value->NAME;
$loggingMethod['script'] = (string)$value->SCRIPT;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment