--- /tmp/dsg/dolibarr/htdocs/github_document.php
+++ /tmp/dsg/dolibarr/htdocs/client_document.php
@@ -76,7 +76,7 @@
require_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php';
$encoding = '';
-$action = GETPOST('action', 'aZ09');
+$action = GETPOST('action', 'alpha');
$original_file = GETPOST('file', 'alphanohtml'); // Do not use urldecode here ($_GET are already decoded by PHP).
$hashp = GETPOST('hashp', 'aZ09');
$modulepart = GETPOST('modulepart', 'alpha');
@@ -133,14 +133,20 @@
// We remove first level of directory
$original_file = (($tmp[1] ? $tmp[1].'/' : '').$ecmfile->filename); // this is relative to module dir
//var_dump($original_file); exit;
- } else {
+ }
+ else
+ {
accessforbidden('Bad link. File is from another module part.', 0, 0, 1);
}
- } else {
+ }
+ else
+ {
$modulepart = $moduleparttocheck;
$original_file = (($tmp[1] ? $tmp[1].'/' : '').$ecmfile->filename); // this is relative to module dir
}
- } else {
+ }
+ else
+ {
$langs->load("errors");
accessforbidden($langs->trans("ErrorFileNotFoundWithSharedLink"), 0, 0, 1);
}
@@ -153,15 +159,11 @@
if (!empty($conf->global->MAIN_DISABLE_FORCE_SAVEAS)) $attachment = false;
// Define mime type
-$type = 'application/octet-stream'; // By default
+$type = 'application/octet-stream';
if (GETPOST('type', 'alpha')) $type = GETPOST('type', 'alpha');
else $type = dol_mimetype($original_file);
-// Security: Force to octet-stream if file is a dangerous file. For example when it is a .noexe file
-// We do not force if file is a javascript to be able to get js from website module with '."\n";
if (!defined('DISABLE_JQUERY_TABLEDND')) print ''."\n";
// jQuery jnotify
- if (empty($conf->global->MAIN_DISABLE_JQUERY_JNOTIFY) && !defined('DISABLE_JQUERY_JNOTIFY')) {
+ if (empty($conf->global->MAIN_DISABLE_JQUERY_JNOTIFY) && !defined('DISABLE_JQUERY_JNOTIFY'))
+ {
print ''."\n";
}
+ // Flot
+ if (empty($conf->global->MAIN_JS_GRAPH) || $conf->global->MAIN_JS_GRAPH == 'jflot')
+ {
+ if (empty($conf->global->MAIN_DISABLE_JQUERY_FLOT) && !defined('DISABLE_JQUERY_FLOT'))
+ {
+ if (constant('JS_JQUERY_FLOT'))
+ {
+ print ''."\n";
+ print ''."\n";
+ print ''."\n";
+ }
+ else
+ {
+ print ''."\n";
+ print ''."\n";
+ print ''."\n";
+ /* Test for jflot 4.2 -> not better than current
+ print ''."\n";
+ print ''."\n";
+ print ''."\n";
+ print ''."\n";
+ print ''."\n";
+ print ''."\n";
+ print ''."\n";
+ print ''."\n";
+ print ''."\n";
+ */
+ }
+ }
+ }
// Chart
- if (empty($conf->global->MAIN_JS_GRAPH) || $conf->global->MAIN_JS_GRAPH == 'chart') {
+ if ($conf->global->MAIN_JS_GRAPH == 'chart')
+ {
print ''."\n";
}
// jQuery jeditable for Edit In Place features
- if (!empty($conf->global->MAIN_USE_JQUERY_JEDITABLE) && !defined('DISABLE_JQUERY_JEDITABLE')) {
+ if (!empty($conf->global->MAIN_USE_JQUERY_JEDITABLE) && !defined('DISABLE_JQUERY_JEDITABLE'))
+ {
print ''."\n";
print ''."\n";
print ''."\n";
@@ -1483,7 +1405,7 @@
print 'var urlLoadInPlace = \''.DOL_URL_ROOT.'/core/ajax/loadinplace.php\';'."\n";
print 'var tooltipInPlace = \''.$langs->transnoentities('ClickToEdit').'\';'."\n"; // Added in title attribute of span
print 'var placeholderInPlace = \' \';'."\n"; // If we put another string than $langs->trans("ClickToEdit") here, nothing is shown. If we put empty string, there is error, Why ?
- print 'var cancelInPlace = \''.$langs->trans("Cancel").'\';'."\n";
+ print 'var cancelInPlace = \''.$langs->trans('Cancel').'\';'."\n";
print 'var submitInPlace = \''.$langs->trans('Ok').'\';'."\n";
print 'var indicatorInPlace = \'theme."/img/working.gif".'">\';'."\n";
print 'var withInPlace = 300;'; // width in pixel for default string edit
@@ -1491,108 +1413,110 @@
print ''."\n";
print ''."\n";
}
- // jQuery Timepicker
- if (!empty($conf->global->MAIN_USE_JQUERY_TIMEPICKER) || defined('REQUIRE_JQUERY_TIMEPICKER')) {
- print ''."\n";
- print ''."\n";
- }
- if (!defined('DISABLE_SELECT2') && (!empty($conf->global->MAIN_USE_JQUERY_MULTISELECT) || defined('REQUIRE_JQUERY_MULTISELECT'))) {
- // jQuery plugin "mutiselect", "multiple-select", "select2", ...
- $tmpplugin = empty($conf->global->MAIN_USE_JQUERY_MULTISELECT) ?constant('REQUIRE_JQUERY_MULTISELECT') : $conf->global->MAIN_USE_JQUERY_MULTISELECT;
- print ''."\n"; // We include full because we need the support of containerCssClass
- }
- if (!defined('DISABLE_MULTISELECT')) // jQuery plugin "mutiselect" to select with checkboxes. Can be removed once we have an enhanced search tool
- {
- print ''."\n";
- }
- }
-
- if (!$disablejs && !empty($conf->use_javascript_ajax)) {
- // CKEditor
- if ((!empty($conf->fckeditor->enabled) && (empty($conf->global->FCKEDITOR_EDITORNAME) || $conf->global->FCKEDITOR_EDITORNAME == 'ckeditor') && !defined('DISABLE_CKEDITOR')) || defined('FORCE_CKEDITOR'))
- {
- print ''."\n";
- $pathckeditor = DOL_URL_ROOT.'/includes/ckeditor/ckeditor/';
- $jsckeditor = 'ckeditor.js';
- if (constant('JS_CKEDITOR')) {
- // To use external ckeditor 4 js lib
- $pathckeditor = constant('JS_CKEDITOR');
- }
- print ''."\n";
- print ''."\n";
- print ''."\n";
- }
-
- // Browser notifications (if NOREQUIREMENU is on, it is mostly a page for popup, so we do not enable notif too. We hide also for public pages).
- if (!defined('NOBROWSERNOTIF') && !defined('NOREQUIREMENU') && !defined('NOLOGIN'))
- {
- $enablebrowsernotif = false;
- if (!empty($conf->agenda->enabled) && !empty($conf->global->AGENDA_REMINDER_BROWSER)) $enablebrowsernotif = true;
- if ($conf->browser->layout == 'phone') $enablebrowsernotif = false;
- if ($enablebrowsernotif)
- {
- print ''."\n";
- print ''."\n";
- }
- }
-
- // Global js function
- print ''."\n";
- print ''."\n";
-
- // JS forced by modules (relative url starting with /)
- if (!empty($conf->modules_parts['js'])) // $conf->modules_parts['js'] is array('module'=>array('file1','file2'))
- {
- $arrayjs = (array) $conf->modules_parts['js'];
- foreach ($arrayjs as $modjs => $filesjs)
- {
- $filesjs = (array) $filesjs; // To be sure filejs is an array
- foreach ($filesjs as $jsfile)
- {
- // jsfile is a relative path
- print ''."\n".''."\n";
- }
- }
- }
- // JS forced by page in top_htmlhead (relative url starting with /)
- if (is_array($arrayofjs))
- {
- print ''."\n";
- foreach ($arrayofjs as $jsfile)
- {
- if (preg_match('/^(http|\/\/)/i', $jsfile))
- {
- print ''."\n";
- } else {
- print ''."\n";
- }
- }
- }
- }
-
- if (!empty($head)) print $head."\n";
- if (!empty($conf->global->MAIN_HTML_HEADER)) print $conf->global->MAIN_HTML_HEADER."\n";
-
- $parameters = array();
- $result = $hookmanager->executeHooks('addHtmlHeader', $parameters); // Note that $action and $object may have been modified by some hooks
- print $hookmanager->resPrint; // Replace Title to show
-
- print "\n\n";
- }
-
- $conf->headerdone = 1; // To tell header was output
+ // jQuery Timepicker
+ if (!empty($conf->global->MAIN_USE_JQUERY_TIMEPICKER) || defined('REQUIRE_JQUERY_TIMEPICKER'))
+ {
+ print ''."\n";
+ print ''."\n";
+ }
+ if (!defined('DISABLE_SELECT2') && (!empty($conf->global->MAIN_USE_JQUERY_MULTISELECT) || defined('REQUIRE_JQUERY_MULTISELECT'))) // jQuery plugin "mutiselect", "multiple-select", "select2", ...
+ {
+ $tmpplugin = empty($conf->global->MAIN_USE_JQUERY_MULTISELECT) ?constant('REQUIRE_JQUERY_MULTISELECT') : $conf->global->MAIN_USE_JQUERY_MULTISELECT;
+ print ''."\n"; // We include full because we need the support of containerCssClass
+ }
+ }
+
+ if (!$disablejs && !empty($conf->use_javascript_ajax))
+ {
+ // CKEditor
+ if ((!empty($conf->fckeditor->enabled) && (empty($conf->global->FCKEDITOR_EDITORNAME) || $conf->global->FCKEDITOR_EDITORNAME == 'ckeditor') && !defined('DISABLE_CKEDITOR')) || defined('FORCE_CKEDITOR'))
+ {
+ print ''."\n";
+ $pathckeditor = DOL_URL_ROOT.'/includes/ckeditor/ckeditor/';
+ $jsckeditor = 'ckeditor.js';
+ if (constant('JS_CKEDITOR')) // To use external ckeditor 4 js lib
+ {
+ $pathckeditor = constant('JS_CKEDITOR');
+ }
+ print ''."\n";
+ print ''."\n";
+ print ''."\n";
+ }
+
+ // Browser notifications
+ if (!defined('DISABLE_BROWSER_NOTIF'))
+ {
+ $enablebrowsernotif = false;
+ if (!empty($conf->agenda->enabled) && !empty($conf->global->AGENDA_REMINDER_BROWSER)) $enablebrowsernotif = true;
+ if ($conf->browser->layout == 'phone') $enablebrowsernotif = false;
+ if ($enablebrowsernotif)
+ {
+ print ''."\n";
+ print ''."\n";
+ }
+ }
+
+ // Global js function
+ print ''."\n";
+ print ''."\n";
+
+ // JS forced by modules (relative url starting with /)
+ if (!empty($conf->modules_parts['js'])) // $conf->modules_parts['js'] is array('module'=>array('file1','file2'))
+ {
+ $arrayjs = (array) $conf->modules_parts['js'];
+ foreach ($arrayjs as $modjs => $filesjs)
+ {
+ $filesjs = (array) $filesjs; // To be sure filejs is an array
+ foreach ($filesjs as $jsfile)
+ {
+ // jsfile is a relative path
+ print ''."\n".''."\n";
+ }
+ }
+ }
+ // JS forced by page in top_htmlhead (relative url starting with /)
+ if (is_array($arrayofjs))
+ {
+ print ''."\n";
+ foreach ($arrayofjs as $jsfile)
+ {
+ if (preg_match('/^(http|\/\/)/i', $jsfile))
+ {
+ print ''."\n";
+ }
+ else
+ {
+ print ''."\n";
+ }
+ }
+ }
+ }
+
+ if (!empty($head)) print $head."\n";
+ if (!empty($conf->global->MAIN_HTML_HEADER)) print $conf->global->MAIN_HTML_HEADER."\n";
+
+ $parameters = array();
+ $result = $hookmanager->executeHooks('addHtmlHeader', $parameters); // Note that $action and $object may have been modified by some hooks
+ print $hookmanager->resPrint; // Replace Title to show
+
+ print "\n\n";
+ }
+
+ $conf->headerdone = 1; // To tell header was output
}
@@ -1621,7 +1545,7 @@
$searchform = '';
$bookmarks = '';
- // Instantiate hooks for external modules
+ // Instantiate hooks of thirdparty module
$hookmanager->initHooks(array('toprightmenu'));
$toprightmenu = '';
@@ -1629,8 +1553,7 @@
// For backward compatibility with old modules
if (empty($conf->headerdone))
{
- $disablenofollow = 0;
- top_htmlhead($head, $title, $disablejs, $disablehead, $arrayofjs, $arrayofcss, 0, $disablenofollow);
+ top_htmlhead($head, $title, $disablejs, $disablehead, $arrayofjs, $arrayofcss);
print '