Merge branch '14.0' of git@github.com:Dolibarr/dolibarr.git into develop

This commit is contained in:
Laurent Destailleur 2021-08-20 12:45:37 +02:00
commit 335e1ff405
14 changed files with 45 additions and 43 deletions

View File

@ -111,7 +111,7 @@ function checkLoginPassEntity($usertotest, $passwordtotest, $entitytotest, $auth
// Load translation files required by the page
$langs->loadLangs(array('other', 'main', 'errors'));
$_SESSION["dol_loginmesg"] = $langs->trans("ErrorFailedToLoadLoginFileForMode", $mode);
$_SESSION["dol_loginmesg"] = $langs->transnoentitiesnoconv("ErrorFailedToLoadLoginFileForMode", $mode);
}
}
}

View File

@ -76,13 +76,13 @@ function check_user_password_dolibarr($usertotest, $passwordtotest, $entitytotes
if ($obj->datestartvalidity && $db->jdate($obj->datestartvalidity) > $now) {
// Load translation files required by the page
$langs->loadLangs(array('main', 'errors'));
$_SESSION["dol_loginmesg"] = $langs->trans("ErrorLoginDateValidity");
$_SESSION["dol_loginmesg"] = $langs->transnoentitiesnoconv("ErrorLoginDateValidity");
return '--bad-login-validity--';
}
if ($obj->dateendvalidity && $db->jdate($obj->dateendvalidity) < dol_get_first_hour($now)) {
// Load translation files required by the page
$langs->loadLangs(array('main', 'errors'));
$_SESSION["dol_loginmesg"] = $langs->trans("ErrorLoginDateValidity");
$_SESSION["dol_loginmesg"] = $langs->transnoentitiesnoconv("ErrorLoginDateValidity");
return '--bad-login-validity--';
}
@ -129,7 +129,7 @@ function check_user_password_dolibarr($usertotest, $passwordtotest, $entitytotes
// Load translation files required by the page
$langs->loadLangs(array('main', 'errors'));
$_SESSION["dol_loginmesg"] = $langs->trans("ErrorBadLoginPassword");
$_SESSION["dol_loginmesg"] = $langs->transnoentitiesnoconv("ErrorBadLoginPassword");
}
// We must check entity
@ -153,7 +153,7 @@ function check_user_password_dolibarr($usertotest, $passwordtotest, $entitytotes
// Load translation files required by the page
$langs->loadLangs(array('main', 'errors'));
$_SESSION["dol_loginmesg"] = $langs->trans("ErrorBadLoginPassword");
$_SESSION["dol_loginmesg"] = $langs->transnoentitiesnoconv("ErrorBadLoginPassword");
}
} else {
dol_syslog("functions_dolibarr::check_user_password_dolibarr Authentication KO db error for '".$usertotest."' error=".$db->lasterror(), LOG_ERR);

View File

@ -38,7 +38,7 @@ function check_user_password_empty($usertotest, $passwordtotest, $entitytotest)
dol_syslog("functions_empty::check_user_password_empty usertotest=".$usertotest);
$login = '';
$_SESSION["dol_loginmesg"] = $langs->trans("FailedToLogin");
$_SESSION["dol_loginmesg"] = $langs->transnoentitiesnoconv("FailedToLogin");
return $login;
}

View File

@ -50,13 +50,13 @@ function check_user_password_http($usertotest, $passwordtotest, $entitytotest)
if ($tmpuser->datestartvalidity && $db->jdate($tmpuser->datestartvalidity) >= $now) {
// Load translation files required by the page
$langs->loadLangs(array('main', 'errors'));
$_SESSION["dol_loginmesg"] = $langs->trans("ErrorLoginDateValidity");
$_SESSION["dol_loginmesg"] = $langs->transnoentitiesnoconv("ErrorLoginDateValidity");
return '--bad-login-validity--';
}
if ($tmpuser->dateendvalidity && $db->jdate($tmpuser->dateendvalidity) <= dol_get_first_hour($now)) {
// Load translation files required by the page
$langs->loadLangs(array('main', 'errors'));
$_SESSION["dol_loginmesg"] = $langs->trans("ErrorLoginDateValidity");
$_SESSION["dol_loginmesg"] = $langs->transnoentitiesnoconv("ErrorLoginDateValidity");
return '--bad-login-validity--';
}
}

View File

@ -59,7 +59,7 @@ function check_user_password_ldap($usertotest, $passwordtotest, $entitytotest)
// Load translation files required by the page
$langs->loadLangs(array('main', 'other'));
$_SESSION["dol_loginmesg"] = $langs->trans("ErrorLDAPFunctionsAreDisabledOnThisPHP").' '.$langs->trans("TryAnotherConnectionMode");
$_SESSION["dol_loginmesg"] = $langs->transnoentitiesnoconv("ErrorLDAPFunctionsAreDisabledOnThisPHP").' '.$langs->transnoentitiesnoconv("TryAnotherConnectionMode");
return;
}
@ -123,7 +123,7 @@ function check_user_password_ldap($usertotest, $passwordtotest, $entitytotest)
$ldap->close();
sleep(1);
$langs->load('ldap');
$_SESSION["dol_loginmesg"] = $langs->trans("YouMustChangePassNextLogon", $usertotest, $ldap->domainFQDN);
$_SESSION["dol_loginmesg"] = $langs->transnoentitiesnoconv("YouMustChangePassNextLogon", $usertotest, $ldap->domainFQDN);
return '';
}
} else {
@ -169,14 +169,14 @@ function check_user_password_ldap($usertotest, $passwordtotest, $entitytotest)
$ldap->close();
// Load translation files required by the page
$langs->loadLangs(array('main', 'errors'));
$_SESSION["dol_loginmesg"] = $langs->trans("ErrorLoginDateValidity");
$_SESSION["dol_loginmesg"] = $langs->transnoentitiesnoconv("ErrorLoginDateValidity");
return '--bad-login-validity--';
}
if ($tmpuser->dateendvalidity && $db->jdate($tmpuser->dateendvalidity) <= dol_get_first_hour($now)) {
$ldap->close();
// Load translation files required by the page
$langs->loadLangs(array('main', 'errors'));
$_SESSION["dol_loginmesg"] = $langs->trans("ErrorLoginDateValidity");
$_SESSION["dol_loginmesg"] = $langs->transnoentitiesnoconv("ErrorLoginDateValidity");
return '--bad-login-validity--';
}
@ -247,7 +247,7 @@ function check_user_password_ldap($usertotest, $passwordtotest, $entitytotest)
// Load translation files required by the page
$langs->loadLangs(array('main', 'other'));
$_SESSION["dol_loginmesg"] = $langs->trans("ErrorBadLoginPassword");
$_SESSION["dol_loginmesg"] = $langs->transnoentitiesnoconv("ErrorBadLoginPassword");
}
} else {
/* Login failed. Return false, together with the error code and text from
@ -268,7 +268,7 @@ function check_user_password_ldap($usertotest, $passwordtotest, $entitytotest)
// Load translation files required by the page
$langs->loadLangs(array('main', 'other', 'errors'));
$_SESSION["dol_loginmesg"] = ($ldap->error ? $ldap->error : $langs->trans("ErrorBadLoginPassword"));
$_SESSION["dol_loginmesg"] = ($ldap->error ? $ldap->error : $langs->transnoentitiesnoconv("ErrorBadLoginPassword"));
}
$ldap->close();

View File

@ -45,11 +45,11 @@ function check_user_password_openid($usertotest, $passwordtotest, $entitytotest)
// Get identity from user and redirect browser to OpenID Server
if (GETPOSTISSET('username')) {
$openid = new SimpleOpenID();
$openid->SetIdentity($_POST['username']);
$openid->SetIdentity(GETPOST('username'));
$protocol = ($conf->file->main_force_https ? 'https://' : 'http://');
$openid->SetTrustRoot($protocol.$_SERVER["HTTP_HOST"]);
$openid->SetRequiredFields(array('email', 'fullname'));
$_SESSION['dol_entity'] = $_POST["entity"];
$_SESSION['dol_entity'] = GETPOST("entity", 'int');
//$openid->SetOptionalFields(array('dob','gender','postcode','country','language','timezone'));
if ($openid->sendDiscoveryRequestToGetXRDS()) {
$openid->SetApprovedURL($protocol.$_SERVER["HTTP_HOST"].$_SERVER["SCRIPT_NAME"]); // Send Response from OpenID server to this script
@ -62,15 +62,15 @@ function check_user_password_openid($usertotest, $passwordtotest, $entitytotest)
} elseif ($_GET['openid_mode'] == 'id_res') {
// Perform HTTP Request to OpenID server to validate key
$openid = new SimpleOpenID();
$openid->SetIdentity($_GET['openid_identity']);
$openid->SetIdentity(GETPOST('openid_identity'));
$openid_validation_result = $openid->ValidateWithServer();
if ($openid_validation_result === true) {
// OK HERE KEY IS VALID
$sql = "SELECT login, entity, datestartvalidity, dateendvalidity";
$sql .= " FROM ".MAIN_DB_PREFIX."user";
$sql .= " WHERE openid = '".$db->escape($_GET['openid_identity'])."'";
$sql .= " AND entity IN (0,".($_SESSION["dol_entity"] ? $_SESSION["dol_entity"] : 1).")";
$sql .= " WHERE openid = '".$db->escape(GETPOST('openid_identity'))."'";
$sql .= " AND entity IN (0,".($_SESSION["dol_entity"] ? ((int) $_SESSION["dol_entity"]) : 1).")";
dol_syslog("functions_openid::check_user_password_openid", LOG_DEBUG);
$resql = $db->query($sql);
@ -81,13 +81,13 @@ function check_user_password_openid($usertotest, $passwordtotest, $entitytotest)
if ($obj->datestartvalidity && $db->jdate($obj->datestartvalidity) > $now) {
// Load translation files required by the page
$langs->loadLangs(array('main', 'errors'));
$_SESSION["dol_loginmesg"] = $langs->trans("ErrorLoginDateValidity");
$_SESSION["dol_loginmesg"] = $langs->transnoentitiesnoconv("ErrorLoginDateValidity");
return '--bad-login-validity--';
}
if ($obj->dateendvalidity && $db->jdate($obj->dateendvalidity) < dol_get_first_hour($now)) {
// Load translation files required by the page
$langs->loadLangs(array('main', 'errors'));
$_SESSION["dol_loginmesg"] = $langs->trans("ErrorLoginDateValidity");
$_SESSION["dol_loginmesg"] = $langs->transnoentitiesnoconv("ErrorLoginDateValidity");
return '--bad-login-validity--';
}

View File

@ -332,7 +332,7 @@ if (isset($conf->file->main_authentication) && preg_match('/openid/', $conf->fil
if (!empty($_SESSION['dol_loginmesg'])) {
?>
<div class="center login_main_message"><div class="error">
<?php echo $_SESSION['dol_loginmesg']; ?>
<?php echo dol_escape_htmltag($_SESSION['dol_loginmesg']); ?>
</div></div>
<?php
}

View File

@ -8,21 +8,21 @@ FONTFORPDF=helvetica
FONTSIZEFORPDF=10
SeparatorDecimal=,
SeparatorThousand=Space
FormatDateShort=%m/%d/%Y
FormatDateShortInput=%m/%d/%Y
FormatDateShortJava=MM/dd/yyyy
FormatDateShortJavaInput=MM/dd/yyyy
FormatDateShortJQuery=mm/dd/yy
FormatDateShortJQueryInput=mm/dd/yy
FormatDateShort=%d-%m-%Y
FormatDateShortInput=%d-%m-%Y
FormatDateShortJava=dd-MM-yyyy
FormatDateShortJavaInput=dd-MM-yyyy
FormatDateShortJQuery=dd-mm-yy
FormatDateShortJQueryInput=dd-mm-yy
FormatHourShortJQuery=HH:MI
FormatHourShort=%I:%M %p
FormatHourShortDuration=%H:%M
FormatDateTextShort=%b %d, %Y
FormatDateText=%B %d, %Y
FormatDateHourShort=%m/%d/%Y %I:%M %p
FormatDateHourSecShort=%m/%d/%Y %I:%M:%S %p
FormatDateHourTextShort=%b %d, %Y, %I:%M %p
FormatDateHourText=%B %d, %Y, %I:%M %p
FormatDateTextShort=%d %b, %Y
FormatDateText=%d %B, %Y
FormatDateHourShort=%d-%m-%Y %I:%M %p
FormatDateHourSecShort=%d-%m-%Y %I:%M:%S %p
FormatDateHourTextShort=%d %m, %Y, %I:%M %p
FormatDateHourText=%d %B, %Y, %I:%M %p
DatabaseConnection=Databaseverbinding
NoTemplateDefined=Geen sjabloon beschikbaar voor dit e-mailtype
AvailableVariables=Beschikbare substitutievariabelen

View File

@ -651,7 +651,7 @@ if (!defined('NOLOGIN')) {
// Load translation files required by page
$langs->loadLangs(array('main', 'errors'));
$_SESSION["dol_loginmesg"] = $langs->trans("ErrorBadValueForCode");
$_SESSION["dol_loginmesg"] = $langs->transnoentitiesnoconv("ErrorBadValueForCode");
$test = false;
// Call trigger for the "security events" log
@ -745,7 +745,7 @@ if (!defined('NOLOGIN')) {
// Bad password. No authmode has found a good password.
// We set a generic message if not defined inside function checkLoginPassEntity or subfunctions
if (empty($_SESSION["dol_loginmesg"])) {
$_SESSION["dol_loginmesg"] = $langs->trans("ErrorBadLoginPassword");
$_SESSION["dol_loginmesg"] = $langs->transnoentitiesnoconv("ErrorBadLoginPassword");
}
// Call trigger for the "security events" log
@ -798,7 +798,7 @@ if (!defined('NOLOGIN')) {
// Load translation files required by page
$langs->loadLangs(array('main', 'errors'));
$_SESSION["dol_loginmesg"] = $langs->trans("ErrorCantLoadUserFromDolibarrDatabase", $login);
$_SESSION["dol_loginmesg"] = $langs->transnoentitiesnoconv("ErrorCantLoadUserFromDolibarrDatabase", $login);
$user->trigger_mesg = 'ErrorCantLoadUserFromDolibarrDatabase - login='.$login;
}
@ -862,7 +862,7 @@ if (!defined('NOLOGIN')) {
// Load translation files required by page
$langs->loadLangs(array('main', 'errors'));
$_SESSION["dol_loginmesg"] = $langs->trans("ErrorCantLoadUserFromDolibarrDatabase", $login);
$_SESSION["dol_loginmesg"] = $langs->transnoentitiesnoconv("ErrorCantLoadUserFromDolibarrDatabase", $login);
$user->trigger_mesg = 'ErrorCantLoadUserFromDolibarrDatabase - login='.$login;
}

View File

@ -231,9 +231,9 @@ $reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $obj
if (empty($reshook)) {
if ($action == '') {
if ($user->rights->produit->creer || $user->rights->service->creer) {
print '<a class="butAction" href="' . DOL_URL_ROOT . '/product/traduction.php?action=add&id=' . $object->id . '">' . $langs->trans("Add") . '</a>';
print '<a class="butAction" href="' . DOL_URL_ROOT . '/product/traduction.php?action=add&token='.newToken().'&id=' . $object->id . '">' . $langs->trans("Add") . '</a>';
if ($cnt_trans > 0) {
print '<a class="butAction" href="' . DOL_URL_ROOT . '/product/traduction.php?action=edit&id=' . $object->id . '">' . $langs->trans("Update") . '</a>';
print '<a class="butAction" href="' . DOL_URL_ROOT . '/product/traduction.php?action=edit&token='.newToken().'&id=' . $object->id . '">' . $langs->trans("Update") . '</a>';
}
}
}

View File

@ -1333,7 +1333,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0) {
print '</td>';
// Duration - Time spent
print '<td>';
print '<td class="nowraponall">';
$durationtouse = ($_POST['timespent_duration'] ? $_POST['timespent_duration'] : '');
if (GETPOSTISSET('timespent_durationhour') || GETPOSTISSET('timespent_durationmin')) {
$durationtouse = (GETPOST('timespent_durationhour') * 3600 + GETPOST('timespent_durationmin') * 60);
@ -1600,7 +1600,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0) {
// Time spent
if (!empty($arrayfields['t.task_duration']['checked'])) {
print '<td class="right">';
print '<td class="right nowraponall">';
if ($action == 'editline' && $_GET['lineid'] == $task_time->rowid) {
print '<input type="hidden" name="old_duration" value="'.$task_time->task_duration.'">';
print $form->select_duration('new_duration', $task_time->task_duration, 0, 'text');

View File

@ -1387,6 +1387,7 @@ table[summary="list_of_modules"] .fa-cog {
.width400 { width: 400px; }
.width500 { width: 500px; }
.maxwidth25 { max-width: 25px; }
.maxwidth40 { max-width: 40px; }
.maxwidth50 { max-width: 50px; }
.maxwidth75 { max-width: 75px; }
.maxwidthdate { max-width: 80px; }

View File

@ -1427,6 +1427,7 @@ table[summary="list_of_modules"] .fa-cog {
.width400 { width: 400px; }
.width500 { width: 500px; }
.maxwidth25 { max-width: 25px; }
.maxwidth40 { max-width: 40px; }
.maxwidth50 { max-width: 50px; }
.maxwidth75 { max-width: 75px; }
.maxwidth100 { max-width: 100px; }

View File

@ -97,7 +97,7 @@ if (empty($reshook)) {
if ($edituser->pass_temp && dol_verifyHash($edituser->pass_temp.'-'.$edituser->id.'-'.$dolibarr_main_instance_unique_id, $passworduidhash)) {
// Clear session
unset($_SESSION['dol_login']);
$_SESSION['dol_loginmesg'] = $langs->trans('NewPasswordValidated'); // Save message for the session page
$_SESSION['dol_loginmesg'] = $langs->transnoentitiesnoconv('NewPasswordValidated'); // Save message for the session page
$newpassword = $edituser->setPassword($user, $edituser->pass_temp, 0);
dol_syslog("passwordforgotten.php new password for user->id=".$edituser->id." validated in database");