Fix root passfield not editable on install

Fix user photo when gravatar not reachable
This commit is contained in:
Laurent Destailleur 2022-04-19 22:26:27 +02:00
parent 8bc4e9082c
commit aa86b2c71f
4 changed files with 9 additions and 6 deletions

View File

@ -435,7 +435,8 @@ foreach ($configfileparameters as $key => $value) {
if (empty($valuetoshow)) { if (empty($valuetoshow)) {
print img_warning("EditConfigFileToAddEntry", 'dolibarr_main_instance_unique_id'); print img_warning("EditConfigFileToAddEntry", 'dolibarr_main_instance_unique_id');
} }
print ' &nbsp; <span class="opacitymedium">('.$langs->trans("HashForPing").'='.md5('dolibarr'.$valuetoshow).')</span>'; print '</td></tr>';
print '<tr class="oddeven"><td></td><td>&nbsp; => '.$langs->trans("HashForPing").'</td><td>'.md5('dolibarr'.$valuetoshow).'</td></tr>'."\n";
} elseif ($newkey == 'dolibarr_main_prod') { } elseif ($newkey == 'dolibarr_main_prod') {
print ${$newkey}; print ${$newkey};

View File

@ -9101,12 +9101,12 @@ class Form
if (!empty($conf->gravatar->enabled) && $email && empty($noexternsourceoverwrite)) { if (!empty($conf->gravatar->enabled) && $email && empty($noexternsourceoverwrite)) {
// see https://gravatar.com/site/implement/images/php/ // see https://gravatar.com/site/implement/images/php/
$ret .= '<!-- Put link to gravatar -->'; $ret .= '<!-- Put link to gravatar -->';
$ret .= '<img class="photo'.$modulepart.($cssclass ? ' '.$cssclass : '').'" alt="Gravatar avatar" title="'.$email.' Gravatar avatar" '.($width ? ' width="'.$width.'"' : '').($height ? ' height="'.$height.'"' : '').' src="https://www.gravatar.com/avatar/'.md5(strtolower(trim($email))).'?s='.$width.'&d='.$defaultimg.'">'; // gravatar need md5 hash $ret .= '<img class="photo'.$modulepart.($cssclass ? ' '.$cssclass : '').'" alt="" title="'.$email.' Gravatar avatar" '.($width ? ' width="'.$width.'"' : '').($height ? ' height="'.$height.'"' : '').' src="https://www.gravatar.com/avatar/'.md5(strtolower(trim($email))).'?s='.$width.'&d='.$defaultimg.'">'; // gravatar need md5 hash
} else { } else {
if ($nophoto == 'company') { if ($nophoto == 'company') {
$ret .= '<div class="photo'.$modulepart.($cssclass ? ' '.$cssclass : '').'" alt="No photo" '.($width ? ' width="'.$width.'"' : '').($height ? ' height="'.$height.'"' : '').'">'.img_picto('', 'company').'</div>'; $ret .= '<div class="photo'.$modulepart.($cssclass ? ' '.$cssclass : '').'" alt="" '.($width ? ' width="'.$width.'"' : '').($height ? ' height="'.$height.'"' : '').'">'.img_picto('', 'company').'</div>';
} else { } else {
$ret .= '<img class="photo'.$modulepart.($cssclass ? ' '.$cssclass : '').'" alt="No photo" '.($width ? ' width="'.$width.'"' : '').($height ? ' height="'.$height.'"' : '').' src="'.DOL_URL_ROOT.$nophoto.'">'; $ret .= '<img class="photo'.$modulepart.($cssclass ? ' '.$cssclass : '').'" alt="" '.($width ? ' width="'.$width.'"' : '').($height ? ' height="'.$height.'"' : '').' src="'.DOL_URL_ROOT.$nophoto.'">';
} }
} }
} }

View File

@ -613,12 +613,13 @@ jQuery(document).ready(function() {
function init_needroot() function init_needroot()
{ {
console.log("init_needroot force_install_noedit=<?php echo $force_install_noedit?>");
/*alert(jQuery("#db_create_database").prop("checked")); */ /*alert(jQuery("#db_create_database").prop("checked")); */
if (jQuery("#db_create_database").is(":checked") || jQuery("#db_create_user").is(":checked")) if (jQuery("#db_create_database").is(":checked") || jQuery("#db_create_user").is(":checked"))
{ {
jQuery(".hideroot").show(); jQuery(".hideroot").show();
<?php <?php
if ($force_install_noedit == 0) { ?> if (empty($force_install_noedit)) { ?>
jQuery(".needroot").removeAttr('disabled'); jQuery(".needroot").removeAttr('disabled');
<?php } ?> <?php } ?>
} }

View File

@ -2220,3 +2220,4 @@ FillAndSaveAccountIdAndSecret=Fill and save account ID and secret first
PreviousHash=Previous hash PreviousHash=Previous hash
LateWarningAfter="Late" warning after LateWarningAfter="Late" warning after
TemplateforBusinessCards=Template for a business card in different size TemplateforBusinessCards=Template for a business card in different size
HashForPing=Hash used for ping