PMCORE-2597 Importing a configuration when the TLS certificate is not set- does not appears a message about it

This commit is contained in:
Roly Rudy Gutierrez Pinto
2021-01-04 10:25:32 -04:00
parent 5ee01f86de
commit a6e3cff4d7
5 changed files with 23 additions and 3 deletions

View File

@@ -504,7 +504,7 @@ class LdapAdvanced
* @param Array $aAuthSource the authsource data * @param Array $aAuthSource the authsource data
* @return Object A object with the resulting ldap bind * @return Object A object with the resulting ldap bind
*/ */
public function ldapConnection($aAuthSource) public function ldapConnection($aAuthSource, &$resultLDAPStartTLS = false)
{ {
$pass = explode("_", $aAuthSource["AUTH_SOURCE_PASSWORD"]); $pass = explode("_", $aAuthSource["AUTH_SOURCE_PASSWORD"]);
@@ -522,7 +522,7 @@ class LdapAdvanced
ldap_set_option($ldapcnn, LDAP_OPT_REFERRALS, 0); ldap_set_option($ldapcnn, LDAP_OPT_REFERRALS, 0);
if (isset($aAuthSource["AUTH_SOURCE_ENABLED_TLS"]) && $aAuthSource["AUTH_SOURCE_ENABLED_TLS"]) { if (isset($aAuthSource["AUTH_SOURCE_ENABLED_TLS"]) && $aAuthSource["AUTH_SOURCE_ENABLED_TLS"]) {
@ldap_start_tls($ldapcnn); $resultLDAPStartTLS = @ldap_start_tls($ldapcnn);
$ldapServer = "TLS " . $ldapServer; $ldapServer = "TLS " . $ldapServer;
//$this->log($ldapcnn, "start tls"); //$this->log($ldapcnn, "start tls");
} }

View File

@@ -26321,6 +26321,12 @@ msgstr "Start Case"
msgid "Unassigned" msgid "Unassigned"
msgstr "Unassigned" msgstr "Unassigned"
# TRANSLATION
# LABEL/ID_TLS_CERTIFICATE_IS_NOT_INSTALLED_IN_THE_SERVER
#: LABEL/ID_TLS_CERTIFICATE_IS_NOT_INSTALLED_IN_THE_SERVER
msgid "TLS certificate is not installed in the server."
msgstr "TLS certificate is not installed in the server."
# TRANSLATION # TRANSLATION
# LABEL/ID_TO # LABEL/ID_TO
#: LABEL/ID_TO #: LABEL/ID_TO

View File

@@ -61343,6 +61343,7 @@ INSERT INTO TRANSLATION (TRN_CATEGORY,TRN_ID,TRN_LANG,TRN_VALUE,TRN_UPDATE_DATE
( 'LABEL','ID_TITLE_REQUIRED','en','Title is required.','2014-10-22') , ( 'LABEL','ID_TITLE_REQUIRED','en','Title is required.','2014-10-22') ,
( 'LABEL','ID_TITLE_START_CASE','en','Start Case','2014-01-15') , ( 'LABEL','ID_TITLE_START_CASE','en','Start Case','2014-01-15') ,
( 'LABEL','ID_TITLE_UNASSIGNED','en','Unassigned','2014-01-15') , ( 'LABEL','ID_TITLE_UNASSIGNED','en','Unassigned','2014-01-15') ,
( 'LABEL','ID_TLS_CERTIFICATE_IS_NOT_INSTALLED_IN_THE_SERVER','en','TLS certificate is not installed in the server.','2020-12-30') ,
( 'LABEL','ID_TO','en','To','2014-01-15') , ( 'LABEL','ID_TO','en','To','2014-01-15') ,
( 'LABEL','ID_TODAY','en','Today','2014-01-15') , ( 'LABEL','ID_TODAY','en','Today','2014-01-15') ,
( 'LABEL','ID_TOOLS','en','Tools','2014-01-15') , ( 'LABEL','ID_TOOLS','en','Tools','2014-01-15') ,

View File

@@ -392,10 +392,14 @@ switch ($function) {
//Test connection //Test connection
$ldapAdvanced = new LdapAdvanced(); $ldapAdvanced = new LdapAdvanced();
$ldapcnn = $ldapAdvanced->ldapConnection($arrayAuthenticationSourceData); $resultLDAPStartTLS = true;
$ldapcnn = $ldapAdvanced->ldapConnection($arrayAuthenticationSourceData, $resultLDAPStartTLS);
//Response //Response
$response["status"] = "OK"; $response["status"] = "OK";
if ($resultLDAPStartTLS === false) {
$response["message"] = G::LoadTranslation("ID_TLS_CERTIFICATE_IS_NOT_INSTALLED_IN_THE_SERVER");
}
} catch (Exception $e) { } catch (Exception $e) {
//Response //Response
$response["status"] = "ERROR"; $response["status"] = "ERROR";

View File

@@ -283,6 +283,15 @@
if (response.data.status === "OK") { if (response.data.status === "OK") {
this.testStatus = true; this.testStatus = true;
this.buttonLabel = this.$root.translation("ID_SAVE"); this.buttonLabel = this.$root.translation("ID_SAVE");
if ("message" in response.data) {
this.$bvModal.msgBoxOk(response.data.message, {
title: " ", //is important because title disappear
hideHeaderClose: false,
okTitle: this.$root.translation('ID_OK'),
okVariant: "success",
okOnly: true
});
}
this.$bvModal.msgBoxOk(this.$root.translation('ID_SUCCESSFUL_TEST_CONNECTION'), { this.$bvModal.msgBoxOk(this.$root.translation('ID_SUCCESSFUL_TEST_CONNECTION'), {
title: " ", //is important because title disappear title: " ", //is important because title disappear
hideHeaderClose: false, hideHeaderClose: false,