diff --git a/scripts/accountancy/export-thirdpartyaccount.php b/scripts/accountancy/export-thirdpartyaccount.php index ba4fe922ab9..4dc22193262 100755 --- a/scripts/accountancy/export-thirdpartyaccount.php +++ b/scripts/accountancy/export-thirdpartyaccount.php @@ -25,6 +25,10 @@ * \brief Page to detect empty accounting account */ +if (!defined('NOSESSION')) define('NOSESSION', '1'); + +$path = __DIR__.'/'; + require_once $path."../../htdocs/master.inc.php"; require_once DOL_DOCUMENT_ROOT.'/core/lib/report.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; diff --git a/scripts/bank/export-bank-receipts.php b/scripts/bank/export-bank-receipts.php index 4f2a256275a..609791232ad 100755 --- a/scripts/bank/export-bank-receipts.php +++ b/scripts/bank/export-bank-receipts.php @@ -22,6 +22,9 @@ * \ingroup bank * \brief Script file to export bank receipts into Excel files */ + +if (!defined('NOSESSION')) define('NOSESSION', '1'); + $sapi_type = php_sapi_name(); $script_file = basename(__FILE__); $path = __DIR__.'/'; diff --git a/scripts/company/export-contacts-xls-example.php b/scripts/company/export-contacts-xls-example.php index 07262b83c0e..445a17a7d30 100755 --- a/scripts/company/export-contacts-xls-example.php +++ b/scripts/company/export-contacts-xls-example.php @@ -23,6 +23,9 @@ * \ingroup company * \brief Script file to export contacts into an Excel file */ + +if (!defined('NOSESSION')) define('NOSESSION', '1'); + $sapi_type = php_sapi_name(); $script_file = basename(__FILE__); $path = __DIR__.'/'; diff --git a/scripts/company/sync_contacts_dolibarr2ldap.php b/scripts/company/sync_contacts_dolibarr2ldap.php index caaa762dea5..8e5274fb69a 100755 --- a/scripts/company/sync_contacts_dolibarr2ldap.php +++ b/scripts/company/sync_contacts_dolibarr2ldap.php @@ -23,6 +23,9 @@ * \ingroup ldap company * \brief Script to update all contacts from Dolibarr into a LDAP database */ + +if (!defined('NOSESSION')) define('NOSESSION', '1'); + $sapi_type = php_sapi_name(); $script_file = basename(__FILE__); $path = __DIR__.'/'; diff --git a/scripts/contracts/email_expire_services_to_customers.php b/scripts/contracts/email_expire_services_to_customers.php index ae449484e7b..5c98dc2913b 100755 --- a/scripts/contracts/email_expire_services_to_customers.php +++ b/scripts/contracts/email_expire_services_to_customers.php @@ -24,6 +24,9 @@ * \ingroup facture * \brief Script to send a mail to customers with services to expire */ + +if (!defined('NOSESSION')) define('NOSESSION', '1'); + $sapi_type = php_sapi_name(); $script_file = basename(__FILE__); $path = __DIR__.'/'; diff --git a/scripts/contracts/email_expire_services_to_representatives.php b/scripts/contracts/email_expire_services_to_representatives.php index 06cb67c99e9..eec151376ee 100755 --- a/scripts/contracts/email_expire_services_to_representatives.php +++ b/scripts/contracts/email_expire_services_to_representatives.php @@ -24,6 +24,9 @@ * \ingroup contracts * \brief Script to send a mail to dolibarr users linked to companies with services to expire */ + +if (!defined('NOSESSION')) define('NOSESSION', '1'); + $sapi_type = php_sapi_name(); $script_file = basename(__FILE__); $path = __DIR__.'/'; diff --git a/scripts/cron/cron_run_jobs.php b/scripts/cron/cron_run_jobs.php index 9058577aa21..e7b830c5ae6 100755 --- a/scripts/cron/cron_run_jobs.php +++ b/scripts/cron/cron_run_jobs.php @@ -30,7 +30,7 @@ if (!defined('NOREQUIREMENU')) define('NOREQUIREMENU', '1'); if (!defined('NOREQUIREHTML')) define('NOREQUIREHTML', '1'); if (!defined('NOREQUIREAJAX')) define('NOREQUIREAJAX', '1'); if (!defined('NOLOGIN')) define('NOLOGIN', '1'); - +if (!defined('NOSESSION')) define('NOSESSION', '1'); $sapi_type = php_sapi_name(); $script_file = basename(__FILE__); diff --git a/scripts/emailings/mailing-send.php b/scripts/emailings/mailing-send.php index 7cde66db687..6719fb2164f 100755 --- a/scripts/emailings/mailing-send.php +++ b/scripts/emailings/mailing-send.php @@ -25,6 +25,9 @@ * \ingroup mailing * \brief Script d'envoi d'un mailing prepare et valide */ + +if (!defined('NOSESSION')) define('NOSESSION', '1'); + $sapi_type = php_sapi_name(); $script_file = basename(__FILE__); $path = __DIR__.'/'; diff --git a/scripts/invoices/email_unpaid_invoices_to_customers.php b/scripts/invoices/email_unpaid_invoices_to_customers.php index 5617751b58b..9b59fcab6f7 100755 --- a/scripts/invoices/email_unpaid_invoices_to_customers.php +++ b/scripts/invoices/email_unpaid_invoices_to_customers.php @@ -24,6 +24,9 @@ * \ingroup facture * \brief Script to send a mail to customers with unpaid invoices */ + +if (!defined('NOSESSION')) define('NOSESSION', '1'); + $sapi_type = php_sapi_name(); $script_file = basename(__FILE__); $path = __DIR__.'/'; diff --git a/scripts/invoices/email_unpaid_invoices_to_representatives.php b/scripts/invoices/email_unpaid_invoices_to_representatives.php index 9bdd37ca599..d401894363d 100755 --- a/scripts/invoices/email_unpaid_invoices_to_representatives.php +++ b/scripts/invoices/email_unpaid_invoices_to_representatives.php @@ -24,6 +24,9 @@ * \ingroup facture * \brief Script to send a mail to dolibarr users linked to companies with unpaid invoices */ + +if (!defined('NOSESSION')) define('NOSESSION', '1'); + $sapi_type = php_sapi_name(); $script_file = basename(__FILE__); $path = __DIR__.'/'; diff --git a/scripts/invoices/rebuild_merge_pdf.php b/scripts/invoices/rebuild_merge_pdf.php index fa54bac9da8..22c55eeeb99 100755 --- a/scripts/invoices/rebuild_merge_pdf.php +++ b/scripts/invoices/rebuild_merge_pdf.php @@ -22,6 +22,9 @@ * \ingroup facture * \brief Script to rebuild PDF and merge PDF files into one */ + +if (!defined('NOSESSION')) define('NOSESSION', '1'); + $sapi_type = php_sapi_name(); $script_file = basename(__FILE__); $path = __DIR__.'/'; diff --git a/scripts/members/sync_members_dolibarr2ldap.php b/scripts/members/sync_members_dolibarr2ldap.php index 7b91a651b34..f0edb2fb8f3 100755 --- a/scripts/members/sync_members_dolibarr2ldap.php +++ b/scripts/members/sync_members_dolibarr2ldap.php @@ -23,6 +23,9 @@ * \ingroup ldap member * \brief Script de mise a jour des adherents dans LDAP depuis base Dolibarr */ + +if (!defined('NOSESSION')) define('NOSESSION', '1'); + $sapi_type = php_sapi_name(); $script_file = basename(__FILE__); $path = __DIR__.'/'; @@ -40,7 +43,7 @@ require_once DOL_DOCUMENT_ROOT."/adherents/class/adherent.class.php"; $langs->load("main"); // Global variables -$version = DOL_VERSION; +$version = constant('DOL_VERSION'); $error = 0; $confirmed = 0; diff --git a/scripts/members/sync_members_ldap2dolibarr.php b/scripts/members/sync_members_ldap2dolibarr.php index 4166772cb10..21a5075326c 100755 --- a/scripts/members/sync_members_ldap2dolibarr.php +++ b/scripts/members/sync_members_ldap2dolibarr.php @@ -23,6 +23,9 @@ * \ingroup ldap member * \brief Script de mise a jour des adherents dans Dolibarr depuis LDAP */ + +if (!defined('NOSESSION')) define('NOSESSION', '1'); + $sapi_type = php_sapi_name(); $script_file = basename(__FILE__); $path = __DIR__.'/'; @@ -42,7 +45,7 @@ require_once DOL_DOCUMENT_ROOT."/adherents/class/subscription.class.php"; $langs->loadLangs(array("main", "errors")); // Global variables -$version = DOL_VERSION; +$version = constant('DOL_VERSION'); $error = 0; $forcecommit = 0; $confirmed = 0; diff --git a/scripts/members/sync_members_types_dolibarr2ldap.php b/scripts/members/sync_members_types_dolibarr2ldap.php index a07ec0a1ff3..0a22469ec80 100755 --- a/scripts/members/sync_members_types_dolibarr2ldap.php +++ b/scripts/members/sync_members_types_dolibarr2ldap.php @@ -24,6 +24,9 @@ * \ingroup ldap core * \brief Script de mise a jour des types de membres dans LDAP depuis base Dolibarr */ + +if (!defined('NOSESSION')) define('NOSESSION', '1'); + $sapi_type = php_sapi_name(); $script_file = basename(__FILE__); $path = __DIR__.'/'; @@ -38,6 +41,7 @@ if (!isset($argv[1]) || !$argv[1]) { print "Usage: ".$script_file." now\n"; exit(-1); } + $now = $argv[1]; require_once $path."../../htdocs/master.inc.php"; @@ -45,7 +49,7 @@ require_once DOL_DOCUMENT_ROOT."/core/class/ldap.class.php"; require_once DOL_DOCUMENT_ROOT."/adherents/class/adherent_type.class.php"; // Global variables -$version = DOL_VERSION; +$version = constant('DOL_VERSION'); $error = 0; /* diff --git a/scripts/members/sync_members_types_ldap2dolibarr.php b/scripts/members/sync_members_types_ldap2dolibarr.php index 547b2664070..f24faf9b76a 100755 --- a/scripts/members/sync_members_types_ldap2dolibarr.php +++ b/scripts/members/sync_members_types_ldap2dolibarr.php @@ -25,6 +25,9 @@ * \ingroup ldap member * \brief Script to update members types into Dolibarr from LDAP */ + +if (!defined('NOSESSION')) define('NOSESSION', '1'); + $sapi_type = php_sapi_name(); $script_file = basename(__FILE__); $path = __DIR__.'/'; @@ -43,7 +46,7 @@ require_once DOL_DOCUMENT_ROOT."/adherents/class/adherent_type.class.php"; $langs->loadLangs(array("main", "errors")); // Global variables -$version = DOL_VERSION; +$version = constant('DOL_VERSION'); $error = 0; $forcecommit = 0; $confirmed = 0; diff --git a/scripts/product/migrate_picture_path.php b/scripts/product/migrate_picture_path.php index 8e452ba13b2..849eca44514 100755 --- a/scripts/product/migrate_picture_path.php +++ b/scripts/product/migrate_picture_path.php @@ -23,6 +23,9 @@ * \ingroup scripts * \brief Migrate pictures from old system prior to 3.7 to new path for 3.7+ */ + +if (!defined('NOSESSION')) define('NOSESSION', '1'); + $sapi_type = php_sapi_name(); $script_file = basename(__FILE__); $path = __DIR__.'/'; diff --git a/scripts/product/regenerate_thumbs.php b/scripts/product/regenerate_thumbs.php index 8434bdd9097..0d8c6380eb3 100755 --- a/scripts/product/regenerate_thumbs.php +++ b/scripts/product/regenerate_thumbs.php @@ -23,6 +23,9 @@ * \ingroup scripts * \brief Migrate pictures from old system prior to 3.7 to new path for 3.7+ */ + +if (!defined('NOSESSION')) define('NOSESSION', '1'); + $sapi_type = php_sapi_name(); $script_file = basename(__FILE__); $path = __DIR__.'/'; diff --git a/scripts/user/migrate_picture_path.php b/scripts/user/migrate_picture_path.php index c80097bb36b..795d03b710d 100755 --- a/scripts/user/migrate_picture_path.php +++ b/scripts/user/migrate_picture_path.php @@ -23,6 +23,9 @@ * \ingroup scripts * \brief Migrate pictures from old system prior to 3.7 to new path for 3.7+ */ + +if (!defined('NOSESSION')) define('NOSESSION', '1'); + $sapi_type = php_sapi_name(); $script_file = basename(__FILE__); $path = __DIR__.'/'; diff --git a/scripts/user/sync_groups_dolibarr2ldap.php b/scripts/user/sync_groups_dolibarr2ldap.php index c52a0151887..eb229c3d4ed 100755 --- a/scripts/user/sync_groups_dolibarr2ldap.php +++ b/scripts/user/sync_groups_dolibarr2ldap.php @@ -23,6 +23,9 @@ * \ingroup ldap core * \brief Script de mise a jour des groupes dans LDAP depuis base Dolibarr */ + +if (!defined('NOSESSION')) define('NOSESSION', '1'); + $sapi_type = php_sapi_name(); $script_file = basename(__FILE__); $path = __DIR__.'/'; diff --git a/scripts/user/sync_groups_ldap2dolibarr.php b/scripts/user/sync_groups_ldap2dolibarr.php index 28c580dce63..5432ded78ee 100755 --- a/scripts/user/sync_groups_ldap2dolibarr.php +++ b/scripts/user/sync_groups_ldap2dolibarr.php @@ -24,6 +24,9 @@ * \ingroup ldap member * \brief Script to update groups into Dolibarr from LDAP */ + +if (!defined('NOSESSION')) define('NOSESSION', '1'); + $sapi_type = php_sapi_name(); $script_file = basename(__FILE__); $path = __DIR__.'/'; diff --git a/scripts/user/sync_users_dolibarr2ldap.php b/scripts/user/sync_users_dolibarr2ldap.php index 5d36bcf44be..4f6fd00d1c7 100755 --- a/scripts/user/sync_users_dolibarr2ldap.php +++ b/scripts/user/sync_users_dolibarr2ldap.php @@ -23,6 +23,9 @@ * \ingroup ldap core * \brief Script de mise a jour des users dans LDAP depuis base Dolibarr */ + +if (!defined('NOSESSION')) define('NOSESSION', '1'); + $sapi_type = php_sapi_name(); $script_file = basename(__FILE__); $path = __DIR__.'/'; diff --git a/scripts/user/sync_users_ldap2dolibarr.php b/scripts/user/sync_users_ldap2dolibarr.php index c8502cd1f14..375cb2f43ba 100755 --- a/scripts/user/sync_users_ldap2dolibarr.php +++ b/scripts/user/sync_users_ldap2dolibarr.php @@ -23,6 +23,9 @@ * \ingroup ldap member * \brief Script to update users into Dolibarr from LDAP */ + +if (!defined('NOSESSION')) define('NOSESSION', '1'); + $sapi_type = php_sapi_name(); $script_file = basename(__FILE__); $path = __DIR__.'/'; diff --git a/scripts/website/migrate-news-joomla2dolibarr.php b/scripts/website/migrate-news-joomla2dolibarr.php index b4399ba0885..dfd92a19acf 100755 --- a/scripts/website/migrate-news-joomla2dolibarr.php +++ b/scripts/website/migrate-news-joomla2dolibarr.php @@ -22,6 +22,8 @@ * \brief Migrate news from a Joomla databse into a Dolibarr website */ +if (!defined('NOSESSION')) define('NOSESSION', '1'); + $sapi_type = php_sapi_name(); $script_file = basename(__FILE__); $path = __DIR__.'/'; diff --git a/scripts/website/regenerate-pages.php b/scripts/website/regenerate-pages.php index dfd49c1fe29..a50db09708d 100755 --- a/scripts/website/regenerate-pages.php +++ b/scripts/website/regenerate-pages.php @@ -22,6 +22,8 @@ * \brief Regenerate all pages of a web site */ +if (!defined('NOSESSION')) define('NOSESSION', '1'); + $sapi_type = php_sapi_name(); $script_file = basename(__FILE__); $path = __DIR__.'/'; diff --git a/scripts/withdrawals/build_withdrawal_file.php b/scripts/withdrawals/build_withdrawal_file.php index d6ffe710a90..5ae7ba70bf4 100755 --- a/scripts/withdrawals/build_withdrawal_file.php +++ b/scripts/withdrawals/build_withdrawal_file.php @@ -23,6 +23,9 @@ * \ingroup prelevement * \brief Script de prelevement */ + +if (!defined('NOSESSION')) define('NOSESSION', '1'); + $sapi_type = php_sapi_name(); $script_file = basename(__FILE__); $path = __DIR__.'/'; @@ -40,7 +43,7 @@ require_once DOL_DOCUMENT_ROOT."/societe/class/societe.class.php"; require_once DOL_DOCUMENT_ROOT."/compta/paiement/class/paiement.class.php"; // Global variables -$version = DOL_VERSION; +$version = constant('DOL_VERSION'); $error = 0; /*