diff --git a/htdocs/admin/ldap_contacts.php b/htdocs/admin/ldap_contacts.php index 424c426f023..0f8fec1cecc 100644 --- a/htdocs/admin/ldap_contacts.php +++ b/htdocs/admin/ldap_contacts.php @@ -143,7 +143,7 @@ if (!function_exists("ldap_connect")) { print dol_get_fiche_head($head, 'contacts', $langs->trans("LDAPSetup"), -1); -print $langs->trans("LDAPDescContact").'
'; +print ''.$langs->trans("LDAPDescContact").'
'; print '
'; print '
'; diff --git a/htdocs/admin/ldap_groups.php b/htdocs/admin/ldap_groups.php index 2422282655e..23a4103bc75 100644 --- a/htdocs/admin/ldap_groups.php +++ b/htdocs/admin/ldap_groups.php @@ -117,7 +117,7 @@ if (!function_exists("ldap_connect")) { print dol_get_fiche_head($head, 'groups', $langs->trans("LDAPSetup"), -1); -print $langs->trans("LDAPDescGroups").'
'; +print ''.$langs->trans("LDAPDescGroups").'
'; print '
'; diff --git a/htdocs/admin/ldap_members.php b/htdocs/admin/ldap_members.php index 010b5c08e33..b7783c99ca0 100644 --- a/htdocs/admin/ldap_members.php +++ b/htdocs/admin/ldap_members.php @@ -191,7 +191,7 @@ print ''; print dol_get_fiche_head($head, 'members', $langs->trans("LDAPSetup"), -1); -print $langs->trans("LDAPDescMembers").'
'; +print ''.$langs->trans("LDAPDescMembers").'
'; print '
'; print ''; diff --git a/htdocs/admin/ldap_members_types.php b/htdocs/admin/ldap_members_types.php index 0a71033d465..abb017ea037 100644 --- a/htdocs/admin/ldap_members_types.php +++ b/htdocs/admin/ldap_members_types.php @@ -109,7 +109,7 @@ if (!function_exists("ldap_connect")) { print dol_get_fiche_head($head, 'memberstypes', $langs->trans("LDAPSetup"), -1); -print $langs->trans("LDAPDescMembersTypes").'
'; +print ''.$langs->trans("LDAPDescMembersTypes").'
'; print '
'; diff --git a/htdocs/admin/ldap_users.php b/htdocs/admin/ldap_users.php index a333536a440..ef0bdc9b5d2 100644 --- a/htdocs/admin/ldap_users.php +++ b/htdocs/admin/ldap_users.php @@ -180,7 +180,7 @@ print ''; print dol_get_fiche_head($head, 'users', $langs->trans("LDAPSetup"), -1); -print $langs->trans("LDAPDescUsers").'
'; +print ''.$langs->trans("LDAPDescUsers").'
'; print '
'; diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 7fb707f3402..a65c4a03108 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -4886,7 +4886,7 @@ class Form * @param string $action Action * @param array $formquestion An array with forms complementary inputs * @param string $selectedchoice "" or "no" or "yes" - * @param int $useajax 0=No, 1=Yes, 2=Yes but submit page with &confirm=no if choice is No, 'xxx'=preoutput confirm box with div id=dialog-confirm-xxx + * @param int|string $useajax 0=No, 1=Yes use Ajax to show the popup, 2=Yes and also submit page with &confirm=no if choice is No, 'xxx'=Yes and preoutput confirm box with div id=dialog-confirm-xxx * @param int $height Force height of box * @param int $width Force width of box * @return void @@ -5151,8 +5151,10 @@ class Form } $jsforcursor = ''; + if ($useajax == 1) { $jsforcursor = '// The call to urljump can be slow, so we set the wait cursor'."\n"; $jsforcursor .= 'jQuery("html,body,#id-container").addClass("cursorwait");'."\n"; + } $formconfirm .= ' resizable: false, @@ -5212,6 +5214,7 @@ class Form var urljump=pageno + (pageno.indexOf("?") < 0 ? "?" : "") + options; //alert(urljump); if (pageno.length > 0) { + '.$jsforcursor.' var post = $.post( pageno, options, diff --git a/htdocs/core/class/ldap.class.php b/htdocs/core/class/ldap.class.php index 6f54229c993..689fbe6845e 100644 --- a/htdocs/core/class/ldap.class.php +++ b/htdocs/core/class/ldap.class.php @@ -263,6 +263,7 @@ class Ldap if ($this->result) { $this->bind = $this->result; $connected = 2; + $this->connectedServer = $host; break; } else { $this->error = ldap_errno($this->connection).' '.ldap_error($this->connection); @@ -275,6 +276,7 @@ class Ldap if ($this->result) { $this->bind = $this->result; $connected = 2; + $this->connectedServer = $host; break; } else { $this->error = ldap_errno($this->connection).' '.ldap_error($this->connection); @@ -287,6 +289,7 @@ class Ldap if ($result) { $this->bind = $this->result; $connected = 1; + $this->connectedServer = $host; break; } else { $this->error = ldap_errno($this->connection).' '.ldap_error($this->connection); @@ -297,10 +300,8 @@ class Ldap if (!$connected) { $this->unbind(); - } else { - $this->connectedServer = $host; } - } + } // End loop on each server } if ($connected) { diff --git a/htdocs/core/login/functions_ldap.php b/htdocs/core/login/functions_ldap.php index 18800c3a19e..fdc44448418 100644 --- a/htdocs/core/login/functions_ldap.php +++ b/htdocs/core/login/functions_ldap.php @@ -233,12 +233,14 @@ function check_user_password_ldap($usertotest, $passwordtotest, $entitytotest) $usertmp = new User($db); $usertmp->fetch('', $login); - $ret = $mc->checkRight($usertmp->id, $entitytotest); - if ($ret < 0) { - dol_syslog("functions_ldap::check_user_password_ldap Authentication KO entity '".$entitytotest."' not allowed for user id '".$usertmp->id."'", LOG_NOTICE); - $login = ''; // force authentication failure + if (is_object($mc)) { + $ret = $mc->checkRight($usertmp->id, $entitytotest); + if ($ret < 0) { + dol_syslog("functions_ldap::check_user_password_ldap Authentication KO entity '".$entitytotest."' not allowed for user id '".$usertmp->id."'", LOG_NOTICE); + $login = ''; // force authentication failure + } + unset($usertmp); } - unset($usertmp); } } if ($result == 1) { diff --git a/htdocs/recruitment/recruitmentcandidature_card.php b/htdocs/recruitment/recruitmentcandidature_card.php index 33bf5b677af..7f1bbab2566 100644 --- a/htdocs/recruitment/recruitmentcandidature_card.php +++ b/htdocs/recruitment/recruitmentcandidature_card.php @@ -586,7 +586,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea // Cancel if ($permissiontoadd) { if ($object->status == $object::STATUS_VALIDATED) { - print ''.$langs->trans("Cancel").''."\n"; + print ''.$langs->trans("Cancel").''."\n"; } elseif ($object->status == $object::STATUS_REFUSED || $object->status == $object::STATUS_CANCELED || $object->status == $object::STATUS_CONTRACT_REFUSED) { print ''.$langs->trans("Re-Open").''."\n"; } diff --git a/htdocs/ticket/agenda.php b/htdocs/ticket/agenda.php index 5f7263f5214..6f1fa43b472 100644 --- a/htdocs/ticket/agenda.php +++ b/htdocs/ticket/agenda.php @@ -83,7 +83,7 @@ if (!$action) { // Security check $id = GETPOST("id", 'int'); if ($user->socid > 0) $socid = $user->socid; -$result = restrictedArea($user, 'ticket', $id, ''); +$result = restrictedArea($user, 'ticket', $object->id, ''); // restrict access for externals users if ($user->socid > 0 && ($object->fk_soc != $user->socid)) { @@ -164,11 +164,15 @@ if ($object->fk_user_create > 0) { $langs->load("users"); $fuser = new User($db); $fuser->fetch($object->fk_user_create); - $morehtmlref .= $fuser->getNomUrl(0); -} -if (!empty($object->origin_email)) { + $morehtmlref .= $fuser->getNomUrl(-1); +} elseif (!empty($object->email_msgid)) { $morehtmlref .= '
'.$langs->trans("CreatedBy").' : '; - $morehtmlref .= $object->origin_email.' ('.$langs->trans("TicketEmailOriginIssuer").')'; + $morehtmlref .= img_picto('', 'email', 'class="paddingrightonly"'); + $morehtmlref .= dol_escape_htmltag($object->origin_email).' ('.$form->textwithpicto($langs->trans("CreatedByEmailCollector"), $langs->trans("EmailMsgID").': '.$object->email_msgid).')'; +} elseif (!empty($object->origin_email)) { + $morehtmlref .= '
'.$langs->trans("CreatedBy").' : '; + $morehtmlref .= img_picto('', 'email', 'class="paddingrightonly"'); + $morehtmlref .= dol_escape_htmltag($object->origin_email).' ('.$langs->trans("CreatedByPublicPortal").')'; } // Thirdparty diff --git a/htdocs/ticket/messaging.php b/htdocs/ticket/messaging.php index 6e9c63462a2..8d6b555229e 100644 --- a/htdocs/ticket/messaging.php +++ b/htdocs/ticket/messaging.php @@ -51,7 +51,7 @@ if (!$sortfield) { $sortfield = "a.datep,a.id"; } if (!$sortorder) { - $sortorder = "desc"; + $sortorder = "DESC"; } $offset = $limit * $page; $pageprev = $page - 1;