diff --git a/htdocs/cache.manifest b/htdocs/cache.manifest index f0ea032ea16..34782a02141 100644 --- a/htdocs/cache.manifest +++ b/htdocs/cache.manifest @@ -1,30 +1,41 @@ -# version 1 - -# Files listed under CACHE will be cached after they are loaded; -# while the ones under NETWORK are said to be white-listed. -# What this means is that they require a live connection to the server. -# If the user isn't connected to the server, the browser should not use the cached version instead. - CACHE MANIFEST +# version 2013-05-21 13:30:21 +# Note: If this file is dynamic, it must return MIME text/cache-manifest +# Note: Order of CACHE, NETWORK and FALLBACK section does not change behaviour +" Note: + +# Files listed under CACHE will be ALWAYS cached after they are loaded. +# And they will be always used from Cache after (even after refresh). CACHE: -index.php -main.inc.php -master.inc.php -filefunc.inc.php -core/lib/functions.lib.php +theme/dolibarr_logo.png +support/ +support/index.php +support/online.php + +support/background.png +support/default.css +support/dolibarr_logo2.png +support/headbg.jpg +support/helpcenter.png +support/internet.png +support/mail.png +support/pagemaster.png +support/redstar.png +support/sparkangels.png +support/star.png +support/who.png + # The NETWORK section contains the path to a folder to ensure that requests -# to load resources contained under /api will bypass the cache and always fetch the resource from the server. - +# to load resources will use internet. +# CACHE has priority on NETWORK, so usage is useless NETWORK: -# search.php -# login.php -# /api +/ # The FALLBACK section contains entries that provide a backup strategy. # If the browser is unable to retrieve the original content, the fallback resource will be used. # In the example above, we display a static image in case the dynamic one is unavailable. - FALLBACK: -# images/dynamic.php static_image.png \ No newline at end of file +#/ public/offline.php +#theme/amarok/img/* theme/eldy/img/ diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 5a39f4b09ef..df7ae4d4c43 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -360,7 +360,7 @@ if (! defined('NOLOGIN')) // If in demo mode, we check we go to home page through the public/demo/index.php page if (! empty($dolibarr_main_demo) && $_SERVER['PHP_SELF'] == DOL_URL_ROOT.'/index.php') // We ask index page { - if (! preg_match('/public/',$_SERVER['HTTP_REFERER'])) + if (empty($_SERVER['HTTP_REFERER']) || ! preg_match('/public/',$_SERVER['HTTP_REFERER'])) { dol_syslog("Call index page from another url than demo page"); $url=''; @@ -925,7 +925,7 @@ function top_htmlhead($head, $title='', $disablejs=0, $disablehead=0, $arrayofjs //print ''; //print ''; print "\n"; - if (! empty($conf->global->MAIN_USE_CACHE_MANIFEST)) print ''."\n"; + if (! empty($conf->global->MAIN_USE_CACHE_MANIFEST)) print ''."\n"; else print ''."\n"; //print ''."\n"; if (empty($disablehead)) diff --git a/htdocs/public/offline.php b/htdocs/public/offline.php new file mode 100644 index 00000000000..d97c8e6e7f3 --- /dev/null +++ b/htdocs/public/offline.php @@ -0,0 +1,38 @@ + + * Copyright (C) 2004-2012 Laurent Destailleur + * Copyright (C) 2005-2012 Regis Houssin + * Copyright (C) 2011-2012 Juanjo Menent + * + * 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 + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +/** + * \file htdocs/public/offline.php + * \brief Dolibarr offline page + */ + +define('NOCSRFCHECK',1); +define('NOLOGIN',1); + +require '../main.inc.php'; + +/** + * View + */ + +print 'Sorry, it seems your internet connexion is off.
'; +print 'You need to be connected to network to use this software.
'; + +?> \ No newline at end of file diff --git a/htdocs/support/inc.php b/htdocs/support/inc.php index 42a4d65ce27..122f0626079 100644 --- a/htdocs/support/inc.php +++ b/htdocs/support/inc.php @@ -216,7 +216,7 @@ function pHeader($soutitre,$next,$action='none') header("Content-type: text/html; charset=".$conf->file->character_set_client); print ''."\n"; - print ''."\n"; + print ''."\n"; print ''."\n"; print ''."\n"; print ''."\n";