From 039039bb0078007af2495f1655956afb51a4ac05 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Mon, 28 Dec 2015 15:17:53 +0100 Subject: [PATCH 1/8] FIX #3798 #2519 Cron jobs would never be executed --- htdocs/public/cron/cron_run_jobs.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/public/cron/cron_run_jobs.php b/htdocs/public/cron/cron_run_jobs.php index 022a7641cab..8da60838468 100644 --- a/htdocs/public/cron/cron_run_jobs.php +++ b/htdocs/public/cron/cron_run_jobs.php @@ -133,7 +133,7 @@ if (is_array($object->lines) && (count($object->lines)>0)) dol_syslog("cron_run_jobs.php fetch cronjobid: ".$line->id, LOG_WARNING); //If date_next_jobs is less of current dat, execute the program, and store the execution time of the next execution in database - if ((($line->datenextrun <= $now) && $line->dateend < $now) + if ((($line->datenextrun <= $now) && $line->dateend >= $now) || ((empty($line->datenextrun)) && (empty($line->dateend)))) { From ae2295d0192009a16b36da2fea847a20ecc34f69 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Sun, 3 Jan 2016 15:10:22 +0100 Subject: [PATCH 2/8] Improvement suggested by @eldy --- htdocs/public/cron/cron_run_jobs.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/htdocs/public/cron/cron_run_jobs.php b/htdocs/public/cron/cron_run_jobs.php index 8da60838468..5fd0ff949b4 100644 --- a/htdocs/public/cron/cron_run_jobs.php +++ b/htdocs/public/cron/cron_run_jobs.php @@ -133,8 +133,7 @@ if (is_array($object->lines) && (count($object->lines)>0)) dol_syslog("cron_run_jobs.php fetch cronjobid: ".$line->id, LOG_WARNING); //If date_next_jobs is less of current dat, execute the program, and store the execution time of the next execution in database - if ((($line->datenextrun <= $now) && $line->dateend >= $now) - || ((empty($line->datenextrun)) && (empty($line->dateend)))) + if (($line->datenextrun < $now) && (empty($line->datestart) || $line->datestart <= $now) && (empty($line->dateend) || $line->dateend >= $now)) { dol_syslog("cron_run_jobs.php:: torun line->datenextrun:".dol_print_date($line->datenextrun,'dayhourtext')." line->dateend:".dol_print_date($line->dateend,'dayhourtext')." now:".dol_print_date($now,'dayhourtext')); From a0b3cdbd217051fde27d945d35fa761584cb9a9a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 5 Jan 2016 17:33:54 +0100 Subject: [PATCH 3/8] Update list.php --- htdocs/holiday/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/holiday/list.php b/htdocs/holiday/list.php index b329cffda35..751b24a9d1b 100644 --- a/htdocs/holiday/list.php +++ b/htdocs/holiday/list.php @@ -251,7 +251,7 @@ $out=''; $typeleaves=$holiday->getTypes(1,1); foreach($typeleaves as $key => $val) { - $nb_type = $holiday->getCPforUser($user->id, $val['rowid']); + $nb_type = $holiday->getCPforUser($user_id, $val['rowid']); $nb_holiday += $nb_type; $out .= ' - '.$val['label'].': '.($nb_type?price2num($nb_type):0).'
'; } From 4dacf462db00df247665ee06a6bd52cf144fbd14 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 5 Jan 2016 17:36:48 +0100 Subject: [PATCH 4/8] Update card.php --- htdocs/holiday/card.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/holiday/card.php b/htdocs/holiday/card.php index ca0b1d04d7a..87c8dc07f91 100644 --- a/htdocs/holiday/card.php +++ b/htdocs/holiday/card.php @@ -580,10 +580,10 @@ if ($action == 'confirm_cancel' && GETPOST('confirm') == 'yes') $newSolde = $soldeActuel + ($nbopenedday * $cp->getConfCP('nbHolidayDeducted')); // On ajoute la modification dans le LOG - $result1=$cp->addLogCP($user->id, $cp->fk_user, $langs->transnoentitiesnoconv("HolidaysCancelation"), $newSolde); + $result1=$cp->addLogCP($user->id, $cp->fk_user, $langs->transnoentitiesnoconv("HolidaysCancelation"), $newSolde, $cp->fk_type); // Mise à jour du solde - $result2=$cp->updateSoldeCP($cp->fk_user, $newSolde); + $result2=$cp->updateSoldeCP($cp->fk_user, $newSolde, $cp->fk_type); if ($result1 < 0 || $result2 < 0) { From 3ae5da1cd639fff8647a5cf338905cb6dcf4739d Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Wed, 6 Jan 2016 16:18:52 +0100 Subject: [PATCH 5/8] Fix: disable main.inc.php hooks --- htdocs/viewimage.php | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/htdocs/viewimage.php b/htdocs/viewimage.php index f9f2b54b292..a2713908b31 100644 --- a/htdocs/viewimage.php +++ b/htdocs/viewimage.php @@ -1,7 +1,7 @@ * Copyright (C) 2005-2012 Laurent Destailleur - * Copyright (C) 2005-2012 Regis Houssin + * Copyright (C) 2005-2016 Regis Houssin * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -24,15 +24,16 @@ * \remarks Call to wrapper is '' */ -//if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER','1'); // Not disabled cause need to load personalized language -//if (! defined('NOREQUIREDB')) define('NOREQUIREDB','1'); // Not disabled cause need to load personalized language -if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC','1'); -if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN','1'); -if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK','1'); -if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL','1'); -if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU','1'); -if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML','1'); -if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1'); +//if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER','1'); // Not disabled cause need to load personalized language +//if (! defined('NOREQUIREDB')) define('NOREQUIREDB','1'); // Not disabled cause need to load personalized language +if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC','1'); +if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN','1'); +if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK','1'); +if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL','1'); +if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU','1'); +if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML','1'); +if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1'); +if (! defined('NOREQUIREHOOK')) define('NOREQUIREHOOK','1'); // Disable "main.inc.php" hooks // Pour autre que companylogo, on charge environnement + info issus de logon comme le user if ((isset($_GET["modulepart"]) && $_GET["modulepart"] == 'companylogo') && ! defined("NOLOGIN")) define("NOLOGIN",'1'); From f2178f0369981dce326e4d67e44ae7493539d550 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Doursenaud?= Date: Fri, 8 Jan 2016 06:42:28 +0100 Subject: [PATCH 6/8] FIX #4291 Correctly filter external calendar GETPOSTs --- htdocs/admin/agenda_extsites.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/htdocs/admin/agenda_extsites.php b/htdocs/admin/agenda_extsites.php index 371854410b0..375d0af3adf 100644 --- a/htdocs/admin/agenda_extsites.php +++ b/htdocs/admin/agenda_extsites.php @@ -1,6 +1,7 @@ - * Copyright (C) 2011-2014 Juanjo Menent +/* Copyright (C) 2008-2011 Laurent Destailleur + * Copyright (C) 2011-2014 Juanjo Menent + * Copyright (C) 2016 Raphaël Doursenaud * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -88,7 +89,7 @@ if ($actionsave) // Save nb of agenda if (! $error) { - $res=dolibarr_set_const($db,'AGENDA_EXT_NB',trim(GETPOST('AGENDA_EXT_NB','alpha')),'chaine',0,'',$conf->entity); + $res=dolibarr_set_const($db,'AGENDA_EXT_NB',trim(GETPOST('AGENDA_EXT_NB','int')),'chaine',0,'',$conf->entity); if (! $res > 0) $error++; if (empty($conf->global->AGENDA_EXT_NB)) $conf->global->AGENDA_EXT_NB=5; $MAXAGENDA=empty($conf->global->AGENDA_EXT_NB)?5:$conf->global->AGENDA_EXT_NB; @@ -201,9 +202,9 @@ while ($i <= $MAXAGENDA) // Nb print ''.$langs->trans("AgendaExtNb",$key).""; // Name - print ''; + print ''; // URL - print ''; + print ''; // Color (Possible colors are limited by Google) print ''; //print $formadmin->selectColor($conf->global->$color, "google_agenda_color".$key, $colorlist); From 36dc8b1ce79c972c867b804778c5b780caea8a56 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 8 Jan 2016 13:57:53 +0100 Subject: [PATCH 7/8] FIX #4341 --- htdocs/main.inc.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index b45d672b385..b3040cbf03b 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -96,6 +96,7 @@ function test_sql_and_script_inject($val, $type) $sql_inj += preg_match('/