[Fusionforge-commits] FusionForge branch master updated. aab62325ecc4075c6a291316e9005c8e0c291a89

Franck VILLAUME nerville at fusionforge.org
Sat Nov 9 18:16:07 CET 2013


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "FusionForge".

The branch, master has been updated
       via  aab62325ecc4075c6a291316e9005c8e0c291a89 (commit)
      from  5d0f56aa750411a2ab29e329b733ff261c24c9e3 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit aab62325ecc4075c6a291316e9005c8e0c291a89
Author: Franck Villaume <franck.villaume at trivialdev.com>
Date:   Sat Nov 9 18:14:07 2013 +0100

    feature request [#602]: drop old configuration files
    - local.inc file is definitly obsolete, not read and not used
    - config-vars.php is deleted
    - config.php per plugin is not used anymore
    - the ServerName mecanism is extend to /etc/fusionforge directory
    - some old README are updated

diff --git a/src/common/include/config-vars.php b/src/common/include/config-vars.php
deleted file mode 100644
index 1a6eb92..0000000
--- a/src/common/include/config-vars.php
+++ /dev/null
@@ -1,285 +0,0 @@
-<?php
-/**
- * FusionForge configuration variables
- *
- * Copyright 2010, Roland Mas
- * Copyright (C) 2011 Alain Peyrat - Alcatel-Lucent
- * Copyright 2012, Franck Villaume - TrivialDev
- *
- * This file is part of FusionForge. FusionForge 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 Licence, or (at your option)
- * any later version.
- *
- * FusionForge 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 FusionForge; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-
-if (file_exists($gfcgfile)) {
-	forge_define_config_item ('forge_name', 'core', $GLOBALS['sys_name']) ;
-	forge_define_config_item ('force_login', 'core', $GLOBALS['sys_force_login']) ;
-	forge_set_config_item_bool ('force_login', 'core') ;
-	forge_define_config_item ('user_registration_restricted', 'core', $GLOBALS['sys_user_reg_restricted']) ;
-	forge_set_config_item_bool ('user_registration_restricted', 'core') ;
-	forge_define_config_item ('project_registration_restricted', 'core', $GLOBALS['sys_project_reg_restricted']) ;
-	forge_set_config_item_bool ('project_registration_restricted', 'core') ;
-	forge_define_config_item ('project_auto_approval', 'core', false) ;
-	forge_set_config_item_bool ('project_auto_approval', 'core') ;
-	forge_define_config_item ('project_auto_approval_user', 'core', 'admin') ;
-	forge_define_config_item ('allow_project_without_template', 'core', true) ;
-	forge_set_config_item_bool ('allow_project_without_template', 'core') ;
-	forge_define_config_item ('web_host', 'core', $GLOBALS['sys_default_domain']) ;
-	forge_define_config_item ('http_port', 'core', 80) ;
-	forge_define_config_item ('https_port', 'core', 443) ;
-	forge_define_config_item ('apache_user', 'core', $GLOBALS['sys_apache_user']) ;
-	forge_define_config_item ('apache_group', 'core', $GLOBALS['sys_apache_group']) ;
-	forge_define_config_item ('scm_tarballs_path', 'core', '$core/data_path/scmtarballs') ;
-	forge_define_config_item ('scm_snapshots_path', 'core', '$core/data_path/scmsnapshots') ;
-	forge_define_config_item ('plugins_path', 'core', '$core/source_path/plugins') ;
-	forge_define_config_item ('themes_root', 'core', '$core/source_path/www/themes') ;
-	forge_define_config_item ('default_theme', 'core', $GLOBALS['sys_theme']) ;
-	forge_define_config_item ('default_language', 'core', $GLOBALS['sys_lang']) ;
-	forge_define_config_item ('default_timezone', 'core', $GLOBALS['sys_default_timezone']) ;
-	forge_define_config_item ('default_country_code', 'core', $GLOBALS['sys_default_country_code']) ;
-	forge_define_config_item ('use_scm', 'core', $GLOBALS['sys_use_scm']) ;
-	forge_set_config_item_bool ('use_scm', 'core') ;
-	forge_define_config_item ('use_dav', 'core', @$GLOBALS['sys_use_dav']) ;
-	forge_set_config_item_bool ('use_dav', 'core') ;
-	forge_define_config_item ('use_tracker', 'core', $GLOBALS['sys_use_tracker']) ;
-	forge_set_config_item_bool ('use_tracker', 'core') ;
-	forge_define_config_item ('use_forum', 'core', $GLOBALS['sys_use_forum']) ;
-	forge_set_config_item_bool ('use_forum', 'core') ;
-	forge_define_config_item ('use_pm', 'core', $GLOBALS['sys_use_pm']) ;
-	forge_set_config_item_bool ('use_pm', 'core') ;
-	forge_define_config_item ('use_docman', 'core', $GLOBALS['sys_use_docman']) ;
-	forge_set_config_item_bool ('use_docman', 'core') ;
-	forge_define_config_item ('use_diary', 'core', $GLOBALS['sys_use_diary']) ;
-	forge_set_config_item_bool ('use_diary', 'core') ;
-	// whether to generate the templates allowing to respond to forum notifications by mail
-	forge_define_config_item ('use_forum_mail_replies', 'core', $GLOBALS['sys_use_mail']) ;
-	forge_set_config_item_bool ('use_forum_mail_replies', 'core') ;
-	forge_define_config_item ('use_news', 'core', $GLOBALS['sys_use_news']) ;
-	forge_set_config_item_bool ('use_news', 'core') ;
-	forge_define_config_item ('use_mail', 'core', $GLOBALS['sys_use_mail']) ;
-	forge_set_config_item_bool ('use_mail', 'core') ;
-	forge_define_config_item ('use_survey', 'core', $GLOBALS['sys_use_survey']) ;
-	forge_set_config_item_bool ('use_survey', 'core') ;
-	forge_define_config_item ('use_frs', 'core', $GLOBALS['sys_use_frs']) ;
-	forge_set_config_item_bool ('use_frs', 'core') ;
-	forge_define_config_item ('use_project_tags', 'core', $GLOBALS['sys_use_project_tags']) ;
-	forge_set_config_item_bool ('use_project_tags', 'core') ;
-	forge_define_config_item ('use_project_full_list', 'core', $GLOBALS['sys_use_project_full_list']) ;
-	forge_set_config_item_bool ('use_project_full_list', 'core') ;
-	forge_define_config_item ('use_fti', 'core', $GLOBALS['sys_use_fti']) ;
-	forge_set_config_item_bool ('use_fti', 'core') ;
-	forge_define_config_item ('use_ftp', 'core', $GLOBALS['sys_use_ftp']) ;
-	forge_set_config_item_bool ('use_ftp', 'core') ;
-	forge_define_config_item ('use_trove', 'core', $GLOBALS['sys_use_trove']) ;
-	forge_set_config_item_bool ('use_trove', 'core') ;
-	forge_define_config_item ('use_snippet', 'core', $GLOBALS['sys_use_snippet']) ;
-	forge_set_config_item_bool ('use_snippet', 'core') ;
-	forge_define_config_item ('use_ssl', 'core', $GLOBALS['sys_use_ssl']) ;
-	forge_set_config_item_bool ('use_ssl', 'core') ;
-	forge_define_config_item ('use_people', 'core', $GLOBALS['sys_use_people']) ;
-	forge_set_config_item_bool ('use_people', 'core') ;
-	forge_define_config_item ('use_shell', 'core', $GLOBALS['sys_use_shell']) ;
-	forge_set_config_item_bool ('use_shell', 'core') ;
-	forge_define_config_item ('use_ratings', 'core', $GLOBALS['sys_use_ratings']) ;
-	forge_set_config_item_bool ('use_ratings', 'core') ;
-	forge_define_config_item ('use_ftp_uploads', 'core', $GLOBALS['sys_use_ftpuploads']) ;
-	forge_set_config_item_bool ('use_ftp_uploads', 'core') ;
-	forge_define_config_item ('ftp_upload_dir', 'core', $GLOBALS['sys_ftp_upload_dir']) ;
-	forge_define_config_item ('upload_dir', 'core', $GLOBALS['sys_upload_dir']) ;
-	forge_define_config_item ('use_manual_uploads', 'core', isset ($GLOBALS['sys_use_manual_uploads']) ? $GLOBALS['sys_use_manual_uploads'] : false) ;
-	forge_set_config_item_bool ('use_manual_uploads', 'core') ;
-	forge_define_config_item ('use_gateways', 'core', $GLOBALS['sys_use_gateways']) ;
-	forge_set_config_item_bool ('use_gateways', 'core') ;
-	forge_define_config_item ('use_project_vhost', 'core', $GLOBALS['sys_use_project_vhost']) ;
-	forge_set_config_item_bool ('use_project_vhost', 'core') ;
-	forge_define_config_item ('use_project_database', 'core', $GLOBALS['sys_use_project_database']) ;
-	forge_set_config_item_bool ('use_project_database', 'core') ;
-	forge_define_config_item ('use_project_multimedia', 'core', $GLOBALS['sys_use_project_multimedia']) ;
-	forge_set_config_item_bool ('use_project_multimedia', 'core') ;
-	forge_define_config_item ('shell_host', 'core', $GLOBALS['sys_shell_host']) ;
-	forge_define_config_item ('users_host', 'core', $GLOBALS['sys_users_host']) ;
-	forge_define_config_item ('lists_host', 'core', $GLOBALS['sys_lists_host']) ;
-	forge_define_config_item ('scm_host', 'core', $GLOBALS['sys_scm_host']) ;
-	forge_define_config_item ('forum_return_domain', 'core', $GLOBALS['sys_forum_return_domain']) ;
-	forge_define_config_item ('ldap_host', 'core', $GLOBALS['sys_ldap_host']) ;
-	forge_define_config_item ('ldap_port', 'core', $GLOBALS['sys_ldap_port']) ;
-	forge_define_config_item ('ldap_version', 'core', $GLOBALS['sys_ldap_version']) ;
-	forge_define_config_item ('ldap_base_dn', 'core', $GLOBALS['sys_ldap_base_dn']) ;
-	forge_define_config_item ('ldap_bind_dn', 'core', $GLOBALS['sys_ldap_bind_dn']) ;
-	forge_define_config_item ('ldap_admin_dn', 'core', $GLOBALS['sys_ldap_admin_dn']) ;
-	forge_define_config_item ('ldap_password', 'core', isset($GLOBALS['sys_ldap_passwd']) ? $GLOBALS['sys_ldap_passwd'] : '') ;
-	forge_define_config_item ('news_group', 'core', $GLOBALS['sys_news_group']) ;
-	forge_define_config_item ('stats_group', 'core', $GLOBALS['sys_stats_group']) ;
-	forge_define_config_item ('peer_rating_group', 'core', $GLOBALS['sys_peer_rating_group']) ;
-	forge_define_config_item ('template_group', 'core', $GLOBALS['sys_template_group']) ;
-	forge_define_config_item ('sendmail_path', 'core', $GLOBALS['sys_sendmail_path']) ;
-	forge_define_config_item ('mailman_path', 'core', $GLOBALS['sys_path_to_mailman']) ;
-	forge_define_config_item ('account_manager_type', 'core', $GLOBALS['sys_account_manager_type']) ;
-	forge_define_config_item ('unix_cipher', 'core', $GLOBALS['unix_cipher']) ;
-	forge_define_config_item ('homedir_prefix', 'core', $GLOBALS['homedir_prefix']) ;
-	forge_define_config_item ('groupdir_prefix', 'core', $GLOBALS['groupdir_prefix']) ;
-	forge_define_config_item ('url_root', 'core', $GLOBALS['sys_urlroot']) ;
-	forge_define_config_item ('url_prefix', 'core', $GLOBALS['sys_urlprefix']) ;
-	forge_define_config_item ('images_url', 'core', $GLOBALS['sys_images_url']) ;
-	forge_define_config_item ('images_secure_url', 'core', $GLOBALS['sys_images_secure_url']) ;
-	forge_define_config_item ('admin_email', 'core', $GLOBALS['sys_admin_email']) ;
-	forge_define_config_item ('session_key', 'core', $GLOBALS['sys_session_key']) ;
-	forge_define_config_item ('session_expire', 'core', $GLOBALS['sys_session_expire']) ;
-	forge_define_config_item ('show_source', 'core', $GLOBALS['sys_show_source']) ;
-	forge_set_config_item_bool ('show_source', 'core') ;
-	forge_define_config_item ('default_trove_cat', 'core', $GLOBALS['default_trove_cat']) ;
-	forge_define_config_item ('user_registration_accept_conditions', 'core', $GLOBALS['sys_require_accept_conditions']);
-	forge_set_config_item_bool ('user_registration_accept_conditions', 'core') ;
-	forge_define_config_item ('use_private_project', 'core', $GLOBALS['sys_use_private_project']);
-	forge_set_config_item_bool ('use_private_project', 'core') ;
-	forge_define_config_item ('require_unique_email', 'core', $GLOBALS['sys_require_unique_email']) ;
-	forge_define_config_item ('compression_method', 'core', 'gzip') ;
-	forge_define_config_item ('use_rdf', 'core', $GLOBALS['sys_use_rdf']) ;
-	forge_set_config_item_bool ('use_rdf', 'core') ;
-	forge_define_config_item ('installation_environment', 'core', $GLOBALS['sys_install_type']) ;
-	forge_define_config_item ('user_default_shell', 'core', '/bin/bash') ;
-	forge_define_config_item('gettext_path', 'core', $GLOBALS['sys_gettext_path']);
-}
-
-// Arch plugin
-if (file_exists ($gfconfig.'plugins/scmarch/config.php')) {
-	require_once $gfconfig.'plugins/scmarch/config.php' ;
-
-	forge_define_config_item ('default_server', 'scmarch', $default_arch_server) ;
-	if (isset ($arch_root)) {
-		forge_define_config_item ('repos_path', 'scmarch', $arch_root) ;
-	} else {
-		forge_define_config_item ('repos_path', 'scmarch',
-					  forge_get_config('chroot').'/scmrepos/arch') ;
-	}
-}
-
-// Bazaar plugin
-if (file_exists ($gfconfig.'plugins/scmbzr/config.php')) {
-	require_once $gfconfig.'plugins/scmbzr/config.php' ;
-
-	forge_define_config_item ('default_server', 'scmbzr', $default_bzr_server) ;
-	if (isset ($bzr_root)) {
-		forge_define_config_item ('repos_path', 'scmbzr', $bzr_root) ;
-	} else {
-		forge_define_config_item ('repos_path', 'scmbzr',
-					  forge_get_config('chroot').'/scmrepos/bzr') ;
-	}
-}
-
-// ClearCase plugin
-if (file_exists ($gfconfig.'plugins/scmccase/config.php')) {
-	require_once $gfconfig.'plugins/scmccase/config.php' ;
-	forge_define_config_item ('default_server', 'scmccase', $default_ccase_server) ;
-	forge_define_config_item ('this_server', 'scmccase', $this_server) ;
-	forge_define_config_item ('tag_pattern', 'scmccase', $tag_pattern) ;
-}
-
-// CVS plugin
-if (file_exists ($gfconfig.'plugins/scmcvs/config.php')) {
-	require_once $gfconfig.'plugins/scmcvs/config.php' ;
-
-	forge_define_config_item ('default_server', 'scmcvs', $default_cvs_server) ;
-	if (isset ($cvs_root)) {
-		forge_define_config_item ('repos_path', 'scmcvs', $cvs_root) ;
-	} elseif (isset ($cvsdir_prefix)) {
-		forge_define_config_item ('repos_path', 'scmcvs', $cvsdir_prefix) ;
-	} else {
-		forge_define_config_item ('repos_path', 'scmcvs',
-					  forge_get_config('chroot').'/scmrepos/cvs') ;
-	}
-}
-
-// Darcs plugin
-if (file_exists ($gfconfig.'plugins/scmdarcs/config.php')) {
-	require_once $gfconfig.'plugins/scmdarcs/config.php' ;
-
-	forge_define_config_item ('default_server', 'scmdarcs', $default_darcs_server) ;
-	if (isset ($darcs_root)) {
-		forge_define_config_item ('repos_path', 'scmdarcs', $darcs_root) ;
-	} else {
-		forge_define_config_item ('repos_path', 'scmdarcs',
-					  forge_get_config('chroot').'/scmrepos/darcs') ;
-	}
-}
-
-// Git plugin
-if (file_exists ($gfconfig.'plugins/scmgit/config.php')) {
-	require_once $gfconfig.'plugins/scmgit/config.php' ;
-
-	forge_define_config_item ('default_server', 'scmgit', $default_git_server) ;
-	if (isset ($git_root)) {
-		forge_define_config_item ('repos_path', 'scmgit', $git_root) ;
-	} else {
-		forge_define_config_item ('repos_path', 'scmgit',
-					  forge_get_config('chroot').'/scmrepos/git') ;
-	}
-}
-
-// Mercurial plugin
-if (file_exists ($gfconfig.'plugins/scmhg/config.php')) {
-	require_once $gfconfig.'plugins/scmhg/config.php' ;
-
-	forge_define_config_item ('default_server', 'scmhg', $default_hg_server) ;
-	if (isset ($hg_root)) {
-		forge_define_config_item ('repos_path', 'scmhg', $hg_root) ;
-	} else {
-		forge_define_config_item ('repos_path', 'scmhg',
-					  forge_get_config('chroot').'/scmrepos/hg') ;
-	}
-}
-
-// Subversion plugin
-if (file_exists ($gfconfig.'plugins/scmsvn/config.php')) {
-	require_once $gfconfig.'plugins/scmsvn/config.php' ;
-
-	forge_define_config_item ('default_server', 'scmsvn', $default_svn_server) ;
-	if (isset ($svn_root)) {
-		forge_define_config_item ('repos_path', 'scmsvn', $svn_root) ;
-	} else {
-		forge_define_config_item ('repos_path', 'scmsvn',
-			forge_get_config('chroot').'/scmrepos/svn') ;
-	}
-
-	forge_define_config_item ('use_ssh', 'scmsvn', $use_ssh ? 1 : 0) ;
-	forge_set_config_item_bool ('use_ssh', 'scmsvn') ;
-	forge_define_config_item ('use_dav', 'scmsvn', $use_dav ? 1 : 0) ;
-	forge_set_config_item_bool ('use_dav', 'scmsvn') ;
-	forge_define_config_item ('use_ssl', 'scmsvn', $use_ssl ? 1 : 0) ;
-	forge_set_config_item_bool ('use_ssl', 'scmsvn') ;
-}
-
-// Mantis plugin
-if (file_exists ($gfconfig.'plugins/mantis/config.php')) {
-	require_once $gfconfig.'plugins/mantis/config.php' ;
-
-	forge_define_config_item ('server', 'mantis', $serveur_mantis) ;
-	forge_define_config_item ('db_host', 'mantis', $mantis_db_host) ;
-	forge_define_config_item ('db_user', 'mantis', $mantis_db_user) ;
-	forge_define_config_item ('db_passwd', 'mantis', $mantis_db_passwd) ;
-}
-
-// forge_define_config_item ('', 'core', $GLOBALS['sys_']) ;
-
-/* Long-term:
- require_once $gfcommon.'include/FusionForge.class.php';
- $forge = new FusionForge() ;
- forge_define_config_item ('forge_name', 'core', $forge->software_name) ;
- forge_define_config_item ('user_registration_restricted', 'core', false) ;
-*/
-
-// Local Variables:
-// mode: php
-// c-file-style: "bsd"
-// End:
diff --git a/src/common/include/config.php b/src/common/include/config.php
index c01f12f..4cb919a 100644
--- a/src/common/include/config.php
+++ b/src/common/include/config.php
@@ -106,23 +106,13 @@ class FusionForgeConfig {
 	}
 
 	function read_config_file($filename) {
-		if (getenv('FUSIONFORGE_USE_PRE_51_CONFIG') == 'true') {
-			$fallback_only = true;
-		} else {
-			$fallback_only = false;
-		}
-
 		if (file_exists($filename) && is_readable($filename)) {
 			$sections = parse_ini_file($filename, true);
 			if (is_array($sections)) {
 				foreach ($sections as $section => $options) {
 					if (is_array($options)) {
 						foreach ($options as $var => $value) {
-							if ($fallback_only) {
-								$this->set_value($section, $var, $value);
-							} else {
-								$this->reset_value($section, $var, $value);
-							}
+							$this->reset_value($section, $var, $value);
 						}
 					}
 				}
diff --git a/src/common/include/env.inc.php b/src/common/include/env.inc.php
index b91de49..cbd7d94 100644
--- a/src/common/include/env.inc.php
+++ b/src/common/include/env.inc.php
@@ -1,6 +1,6 @@
 <?php
 /**
- * Sets the default required environement for FusionForge
+ * Sets the default required environment for FusionForge
  *
  * Some of the settings made here can be overwrite in the
  * configuration file if needed.
@@ -8,6 +8,9 @@
  */
 
 /**
+ *
+ * Copyright 2013, Franck Villaume - TrivialDev
+ *
  * This file is part of FusionForge. FusionForge 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
@@ -48,33 +51,31 @@ $fusionforge_basedir = dirname(dirname(dirname( __FILE__ )));
 //	$gfplugins: Directory for plugins.
 //
 
-// Easyforge config, allow several instances of gforge based on server name.
+// Easyforge config, allow several instances of fusionforge based on server name.
+// Require multiples VirtualHosts in your httpd configuration.
+// FORGE_CONFIG_PATH var is set in httpd.conf file and is default method shipped with the Fusionforge code source.
 if (getenv('FORGE_CONFIG_PATH') && file_exists(getenv('FORGE_CONFIG_PATH').'/config.ini')) {
 	$gfconfig = getenv('FORGE_CONFIG_PATH').'/';
+	$gfcgfile = 'config.ini';
 } elseif (getenv('sys_localinc')) {
 	$gfcgfile = getenv('sys_localinc');
 	$gfconfig = dirname($gfcgfile).'/';
+	$gfcgfile = basename($gfcgfile);
+} elseif (isset($_SERVER['SERVER_NAME']) &&
+	file_exists('/etc/fusionforge/'.$_SERVER['SERVER_NAME'].'/config.ini')) {
+	$gfcgfile = 'config.ini';
+	$gfconfig = '/etc/fusionforge/'.$_SERVER['SERVER_NAME'].'/';
 } elseif (isset($_SERVER['SERVER_NAME']) &&
-	file_exists($fusionforge_basedir.'/config/'.$_SERVER['SERVER_NAME'].'/local.inc.php')) {
-	$gfcgfile = $fusionforge_basedir.'/config/'.$_SERVER['SERVER_NAME'].'/local.inc.php';
+	file_exists($fusionforge_basedir.'/config/'.$_SERVER['SERVER_NAME'].'/config.ini')) {
+	$gfcgfile = '/config.ini';
 	$gfconfig = $fusionforge_basedir.'/config/'.$_SERVER['SERVER_NAME'].'/';
-} elseif (file_exists($fusionforge_basedir.'/config/local.inc.php')) {
-	$gfcgfile = $fusionforge_basedir.'/config/local.inc.php';
+} elseif (file_exists($fusionforge_basedir.'/config/config.ini')) {
+	$gfcgfile = 'config.ini';
 	$gfconfig = $fusionforge_basedir.'/config/';
-} elseif (file_exists('/etc/gforge/local.inc.php')) {
-	$gfcgfile = '/etc/gforge/local.inc.php';
-	$gfconfig = '/etc/gforge/';
-} elseif (file_exists('/etc/gforge/local.inc')) {
-	$gfcgfile = '/etc/gforge/local.inc';
-	$gfconfig = '/etc/gforge/';
-} elseif (file_exists('/etc/gforge/config.ini')) {
-	$gfconfig = '/etc/gforge/';
-} elseif (file_exists('/etc/fusionforge/config.ini')) {
-	$gfconfig = '/etc/fusionforge/';
 } else {
-	$gfcgfile = 'local.inc';
-	if (is_dir('/etc/gforge')){
-		$gfconfig = '/etc/gforge/';
+	$gfcgfile = 'config.ini';
+	if (is_dir('/etc/fusionforge')){
+		$gfconfig = '/etc/fusionforge/';
 	} else {
 		$gfconfig = '';
 	}
diff --git a/src/common/include/pre.php b/src/common/include/pre.php
index c9174dc..59fbb58 100644
--- a/src/common/include/pre.php
+++ b/src/common/include/pre.php
@@ -5,6 +5,7 @@
  * Copyright 1999-2001, VA Linux Systems
  * Copyright 2010, Roland Mas <lolando at debian.org>
  * Copyright (C) 2012 Alain Peyrat - Alcatel-Lucent
+ * Copyright 2013, Franck Villaume - TrivialDev
  *
  * This file is part of FusionForge. FusionForge is free software;
  * you can redistribute it and/or modify it under the terms of the
@@ -73,60 +74,15 @@ function setconfigfromenv ($sec, $var, $serv, $env) {
 	return false;
 }
 
-function setconfigfromoldsources ($sec, $var, $serv, $env, $glob) {
-	if (setconfigfromenv($sec, $var, $serv, $env)) {
-		return true;
-	}
-	if (isset ($GLOBALS[$glob])) {
-		forge_define_config_item ($var, $sec,
-					  $GLOBALS[$glob]) ;
-		return true;
-	}
-	return false;
-}
-
-if (isset($gfcgfile) && file_exists ($gfcgfile)) {
-	require_once $gfcgfile ;
-
-	setconfigfromoldsources ('core', 'database_host',
-				 'GForgeDbhost', 'sys_gfdbhost', 'sys_dbhost') ;
-	setconfigfromoldsources ('core', 'database_port',
-				 'GForgeDbport', 'sys_gfdbport', 'sys_dbport') ;
-	setconfigfromoldsources ('core', 'database_name',
-				 'GForgeDbname', 'sys_gfdbname', 'sys_dbname') ;
-	setconfigfromoldsources ('core', 'database_user',
-				 'GForgeDbuser', 'sys_gfdbuser', 'sys_dbuser') ;
-	setconfigfromoldsources ('core', 'database_password',
-				 'GForgeDbpasswd', 'sys_gfdbpasswd', 'sys_dbpasswd') ;
-	setconfigfromoldsources ('core', 'ldap_password',
-				 'GForgeLdapPasswd', 'sys_gfldap_passwd', NULL) ;
-	setconfigfromoldsources ('core', 'session_key',
-				 'GForgeSessionKey', 'sys_session_key', NULL) ;
-
-	forge_define_config_item ('source_path', 'core', $fusionforge_basedir) ;
-	forge_define_config_item ('data_path', 'core', '/var/lib/gforge') ;
-	forge_define_config_item ('chroot', 'core', '$core/data_path/chroot') ;
-	forge_define_config_item ('config_path', 'core', '/etc/gforge') ;
-
-	require_once $gfcommon.'include/config-vars.php';
-} else {
-	setconfigfromenv ('core', 'database_host',
-				 'GForgeDbhost', 'sys_gfdbhost') ;
-	setconfigfromenv ('core', 'database_port',
-				 'GForgeDbport', 'sys_gfdbport') ;
-	setconfigfromenv ('core', 'database_name',
-				 'GForgeDbname', 'sys_gfdbname') ;
-	setconfigfromenv ('core', 'database_user',
-				 'GForgeDbuser', 'sys_gfdbuser') ;
-	setconfigfromenv ('core', 'database_password',
-				 'GForgeDbpasswd', 'sys_gfdbpasswd') ;
-	setconfigfromenv ('core', 'ldap_password',
-				 'GForgeLdapPasswd', 'sys_gfldap_passwd') ;
-	setconfigfromenv ('core', 'session_key',
-				 'GForgeSessionKey', 'sys_session_key') ;
-}
+setconfigfromenv('core', 'database_host', 'GForgeDbhost', 'sys_gfdbhost');
+setconfigfromenv('core', 'database_port', 'GForgeDbport', 'sys_gfdbport');
+setconfigfromenv('core', 'database_name', 'GForgeDbname', 'sys_gfdbname');
+setconfigfromenv('core', 'database_user', 'GForgeDbuser', 'sys_gfdbuser');
+setconfigfromenv('core', 'database_password', 'GForgeDbpasswd', 'sys_gfdbpasswd');
+setconfigfromenv('core', 'ldap_password', 'GForgeLdapPasswd', 'sys_gfldap_passwd');
+setconfigfromenv('core', 'session_key', 'GForgeSessionKey', 'sys_session_key');
 
-forge_read_config_file ($gfconfig.'/config.ini') ;
+forge_read_config_file($gfconfig.'/'.$gfcgfile);
 
 if (($ecf = forge_get_config ('extra_config_files')) != NULL) {
 	$ecfa = explode (',', $ecf) ;
diff --git a/src/cronjobs/README.root b/src/cronjobs/README.root
index 8382fed..a19e839 100644
--- a/src/cronjobs/README.root
+++ b/src/cronjobs/README.root
@@ -3,23 +3,19 @@ process of adding users, groups, cvs trees etc. to your machine. These
 scripts build the /etc/passwd /etc/shadow and /etc/group files based
 on the contents of your gforge database.
 
-WARNING: There are potential security risks. Any gforge project admin could 
+WARNING: There are potential security risks. Any fusionforge project admin could 
 add a user to a project, who would then have unix-level access to your 
-machine. For best security, you should separate the CVS hosting machine from 
-the web/database machine. To do this, simply copy the gforge tarball 
-and configure a new /etc/gforge/local.inc on the cvs machine. You can create 
+machine. For best security, you should separate the SCM hosting machine from 
+the web/database machine. To do this, simply copy the fusionforge tarball 
+and configure a new /etc/fusionforge/config.ini on the SCM machine. You can create 
 a second, read-only database user, and place that user's name/password in 
-the local.inc file. This user only needs read access to the users,groups, and
-user_group tables. See the postgres manual for information on managing 
-database users and permissions.
+the config.ini file. This user only needs read access to the users, groups tables.
+See the postgres manual for information on managing database users and permissions.
 
 To use these files, you should first create any default users/groups you 
 want on your machine. YOU MUST CREATE A USER CALLED "anonymous" with /bin/false 
 as its shell. Then copy /etc/group to /etc/group.org, and do the 
 same for /etc/shadow -> /etc/shadow.org /etc/passwd -> /etc/passwd.org
 
-The usergroup.php script will build on the .org file and place them in .new
-files.
-
-WHEN YOU ARE SURE IT WORKS AS EXPECTED, you can change usergroup.php 
-FILE_EXTENSION to '' instead of '.new'
+The auth_unix.php script will build on the .org file and replace them as standard
+files (/etc/shadow & /etc/passwd).
diff --git a/src/plugins/scmsvn/README b/src/plugins/scmsvn/README
index 3112fba..18305a3 100644
--- a/src/plugins/scmsvn/README
+++ b/src/plugins/scmsvn/README
@@ -1,20 +1,20 @@
-gforge-plugin-scmsvn
+fusionforge-plugin-scmsvn
 --------------------
 
-This is the Subversion plugin for GForge. It creates Subversion
+This is the Subversion plugin for FusionForge. It creates Subversion
 repositories and provides some functionality to manage them.
 
 Decompress the plugin tarball and place it into your plugins directory.
-Usually, this would be in a location like /opt/gforge/gforge/plugins/scmsvn
-Whereever you place it, be sure your /etc/gforge/local.inc file has
-$sys_plugins_path pointing to the plugins directory.
+Usually, this would be in a location like /opt/fusionforge/src/plugins/scmsvn
+Whereever you place it, be sure your /etc/fusionforge/config.ini file has
+plugins_path pointing to the plugins directory.
 
-The scmsvn/etc/plugins/scmsvn/config.php should be copied and edited
+The scmsvn/etc/scmsvn.ini should be copied and edited
 to
 
-        /etc/gforge/plugins/scmsvn/config.php
+        /etc/fusionforge/config.ini.d/scmsvn.ini
 
-The 'Site Admin' tab on the GForge web interface now has a 'Plugin Manager'
+The 'Site Admin' tab on the FusionForge web interface now has a 'Plugin Manager'
 page where you can activate plugins on a sitewide basis. Be sure to do that
 if you want this plugin to be available to projects.
 

-----------------------------------------------------------------------

Summary of changes:
 src/common/include/config-vars.php |  285 ------------------------------------
 src/common/include/config.php      |   12 +-
 src/common/include/env.inc.php     |   39 ++---
 src/common/include/pre.php         |   62 ++------
 src/cronjobs/README.root           |   20 +--
 src/plugins/scmsvn/README          |   16 +-
 6 files changed, 46 insertions(+), 388 deletions(-)
 delete mode 100644 src/common/include/config-vars.php


hooks/post-receive
-- 
FusionForge



More information about the Fusionforge-commits mailing list