diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index cbe356ed169..0173e03730e 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -188,7 +188,8 @@ class Form { $ret .= $this->editInPlace($object, $value, $htmlname, $perm, $typeofdata, $editvalue, $extObject, $custommsg); } else { - if (GETPOST('action', 'aZ09') == 'edit'.$htmlname) + $editmode = (GETPOST('action', 'aZ09') == 'edit'.$htmlname); + if ($editmode) { $ret .= "\n"; $ret .= '
'; diff --git a/htdocs/core/tpl/notes.tpl.php b/htdocs/core/tpl/notes.tpl.php index 8cda27679c4..283f9eeb873 100644 --- a/htdocs/core/tpl/notes.tpl.php +++ b/htdocs/core/tpl/notes.tpl.php @@ -88,20 +88,22 @@ else $typeofdata = 'textarea:12:95%'; print ''."\n"; print '
'."\n"; print '
'."\n"; -print '
'."\n"; +$editmode = (GETPOST('action', 'aZ09') == 'edit'.$note_public); +print '
'."\n"; print $form->editfieldkey("NotePublic", $note_public, $value_public, $object, $permission, $typeofdata, $moreparam, '', 0); print '
'."\n"; -print '
'."\n"; +print '
'."\n"; print $form->editfieldval("NotePublic", $note_public, $value_public, $object, $permission, $typeofdata, '', null, null, $moreparam, 1)."\n"; print '
'."\n"; print '
'."\n"; if (empty($user->socid)) { // Private notes (always hidden to external users) print '
'."\n"; - print '
'."\n"; + $editmode = (GETPOST('action', 'aZ09') == 'edit'.$note_private); + print '
'."\n"; print $form->editfieldkey("NotePrivate", $note_private, $value_private, $object, $permission, $typeofdata, $moreparam, '', 0); print '
'."\n"; - print '
'."\n"; + print '
'."\n"; print $form->editfieldval("NotePrivate", $note_private, $value_private, $object, $permission, $typeofdata, '', null, null, $moreparam, 1); print '
'."\n"; print '
'."\n"; diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index e0800d2a5f9..bcbeba44f46 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -111,6 +111,7 @@ body { trans("DIRECTION").";\n"; ?> } +/* Style used to protect html content in output to avoid attack by replacing full page with js content */ .sensiblehtmlcontent * { position: static !important; } diff --git a/htdocs/user/note.php b/htdocs/user/note.php index 60b9a3b6be2..cb38fd3c4ac 100644 --- a/htdocs/user/note.php +++ b/htdocs/user/note.php @@ -109,10 +109,12 @@ if ($id) // Login print ''.$langs->trans("Login").''.$object->login.' '; + $editenabled = (($action == 'edit') && !empty($user->rights->user->user->creer)); + // Note print ''.$langs->trans("Note").''; - print ''; - if ($action == 'edit' && $user->rights->user->user->creer) + print ''; + if ($editenabled) { print ""; print "id."\">";