diff --git a/htdocs/core/website.inc.php b/htdocs/core/website.inc.php index f7908844afc..34c011c34ca 100644 --- a/htdocs/core/website.inc.php +++ b/htdocs/core/website.inc.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2017-2019 Laurent Destailleur * * 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 @@ -51,6 +51,14 @@ if (! is_object($websitepage)) if ($pageid > 0) { $websitepage->fetch($pageid); + + if (! defined('USEDOLIBARREDITOR') && in_array($websitepage->type_container, array('menu', 'other'))) + { + $weblangs->load("website"); + http_response_code(404); + print '


'.$weblangs->trans("YouTryToAccessToAFileThatIsNotAWebsitePage").'
'; + exit; + } } // A lang was forced, so we change weblangs init diff --git a/htdocs/install/mysql/data/llx_c_type_container.sql b/htdocs/install/mysql/data/llx_c_type_container.sql index 949f0bad687..703d8f2ac34 100644 --- a/htdocs/install/mysql/data/llx_c_type_container.sql +++ b/htdocs/install/mysql/data/llx_c_type_container.sql @@ -33,5 +33,6 @@ insert into llx_c_type_container (code,label,module,active) values ('page', 'Page', 'system', 1); insert into llx_c_type_container (code,label,module,active) values ('banner', 'Banner', 'system', 1); insert into llx_c_type_container (code,label,module,active) values ('blogpost', 'BlogPost', 'system', 1); +insert into llx_c_type_container (code,label,module,active) values ('menu', 'Menu', 'system', 1); insert into llx_c_type_container (code,label,module,active) values ('other', 'Other', 'system', 1); diff --git a/htdocs/install/mysql/migration/10.0.0-11.0.0.sql b/htdocs/install/mysql/migration/10.0.0-11.0.0.sql index e5712cc262f..9c52044291d 100644 --- a/htdocs/install/mysql/migration/10.0.0-11.0.0.sql +++ b/htdocs/install/mysql/migration/10.0.0-11.0.0.sql @@ -51,6 +51,8 @@ ALTER TABLE llx_adherent_type ADD UNIQUE INDEX uk_adherent_type_libelle (libelle -- For v11 +insert into llx_c_type_container (code,label,module,active) values ('menu', 'Menu', 'system', 1); + INSERT INTO llx_c_ticket_type (code, pos, label, active, use_default, description) VALUES('HELP', '15', 'Request for functionnal help', 1, 0, NULL); ALTER TABLE llx_don ADD COLUMN fk_user_modif integer; diff --git a/htdocs/langs/en_US/website.lang b/htdocs/langs/en_US/website.lang index 62ce5a23531..116b500fb7d 100644 --- a/htdocs/langs/en_US/website.lang +++ b/htdocs/langs/en_US/website.lang @@ -118,4 +118,5 @@ EditInLineOnOff=Mode 'Edit inline' is %s ShowSubContainersOnOff=Mode to execute 'dynamic content' is %s GlobalCSSorJS=Global CSS/JS/Header file of web site BackToHomePage=Back to home page... -TranslationLinks=Translation links \ No newline at end of file +TranslationLinks=Translation links +YouTryToAccessToAFileThatIsNotAWebsitePage=You try to access to a page that is not a website page \ No newline at end of file