diff --git a/admin/inc/class.admin_prefs_sidebox_hooks.inc.php b/admin/inc/class.admin_prefs_sidebox_hooks.inc.php index 39eb43a5fe..445d4ad0bc 100644 --- a/admin/inc/class.admin_prefs_sidebox_hooks.inc.php +++ b/admin/inc/class.admin_prefs_sidebox_hooks.inc.php @@ -142,6 +142,8 @@ class admin_prefs_sidebox_hooks } $GLOBALS['egw']->hooks->register_all_hooks(); + common::delete_image_map(); + if (method_exists($GLOBALS['egw'],'invalidate_session_cache')) // egw object in setup is limited { $GLOBALS['egw']->invalidate_session_cache(); // in case with cache the egw_info array in the session diff --git a/admin/inc/hook_config_validate.inc.php b/admin/inc/hook_config_validate.inc.php new file mode 100644 index 0000000000..b7d7639ad9 --- /dev/null +++ b/admin/inc/hook_config_validate.inc.php @@ -0,0 +1,38 @@ + + * @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License + * @version $Id$ + */ + +/* + Set a global flag to indicate this file was found by setup/config.php. + config.php will unset it after parsing the form values. +*/ +$GLOBALS['egw_info']['server']['found_validation_hook'] = True; + +/** + * Check VFS dir exists and delete image map to recreate it, if vfs-image-dir changes + * + * @param string + */ +function vfs_image_dir($vfs_image_dir) +{ + //error_log(__FUNCTION__.'() vfs_image_dir='.array2string($vfs_image_dir).' was '.array2string($GLOBALS['egw_info']['server']['vfs_image_dir'])); + if (!empty($vfs_image_dir)) + { + if (!egw_vfs::file_exists($vfs_image_dir) || !egw_vfs::is_dir($vfs_image_dir)) + { + $GLOBALS['config_error'] = lang('VFS directory "%1" NOT found!',$vfs_image_dir); + return; + } + } + if ($vfs_image_dir != (string)$GLOBALS['egw_info']['server']['vfs_image_dir']) + { + common::delete_image_map(); + } +} \ No newline at end of file diff --git a/admin/setup/setup.inc.php b/admin/setup/setup.inc.php index 50eb9cce36..b4db05359a 100755 --- a/admin/setup/setup.inc.php +++ b/admin/setup/setup.inc.php @@ -34,7 +34,7 @@ $setup_info['admin']['hooks'] = array( 'acl_manager', 'add_def_pref', 'after_navbar', - 'config', + 'config_validate', 'deleteaccount', 'view_user' => 'admin.uiaccounts.edit_view_user_hook', 'edit_user' => 'admin.uiaccounts.edit_view_user_hook', diff --git a/admin/templates/default/config.tpl b/admin/templates/default/config.tpl index e9bf71ade6..6abdf4929f 100644 --- a/admin/templates/default/config.tpl +++ b/admin/templates/default/config.tpl @@ -1,4 +1,6 @@ + +
{error}