* Copyright 1999-2001 (c) VA Linux Systems
* http://sourceforge.net
*
- * @version $Id$
*/
-/*
- redirect to proper hostname to get around certificate problem on IE 5
-*/
-if (is_file('/etc/sourceforge/custom/pre.php')){
- require_once('/etc/sourceforge/custom/pre.php');
-} else {
+// escaping lib
+require_once $gfcommon.'include/escapingUtils.php';
-// Defines all of the Source Forge hosts, databases, etc.
-// This needs to be loaded first becuase the lines below depend upon it.
-require ('/etc/sourceforge/local.inc');
+if (isset($_SERVER) && array_key_exists('PHP_SELF', $_SERVER) && $_SERVER['PHP_SELF']) {
+ $_SERVER['PHP_SELF'] = htmlspecialchars($_SERVER['PHP_SELF']);
+}
-/*
+if (isset($GLOBALS) && array_key_exists('PHP_SELF', $GLOBALS) && $GLOBALS['PHP_SELF']) {
+ $GLOBALS['PHP_SELF'] = htmlspecialchars($GLOBALS['PHP_SELF']);
+}
- Override vars are useful during development cycle
+// Just say no to link prefetching (Moz prefetching, Google Web Accelerator, others)
+// http://www.google.com/webmasters/faq.html#prefetchblock
+if (getStringFromServer('HTTP_X_moz') === 'prefetch'){
+ header(getStringFromServer('SERVER_PROTOCOL') . ' 404 Prefetch Forbidden');
+ trigger_error('Prefetch request forbidden.');
+ exit;
+}
- Each developer can set up a file that overrides
- vars in /etc/local.inc, if needed.
+if (!isset($no_gz_buffer) || !$no_gz_buffer) {
+ ob_start("ob_gzhandler");
+}
- Each developer has a different hostname, so $sys_default_domain
- at a minimum must be overridden.
+require $gfcgfile;
+require $gfcommon.'include/config.php';
+fusionforge_define_config_item ('core', 'forge_name', $GLOBALS['sys_name']) ;
+fusionforge_define_config_item ('core', 'user_registration_restricted', $GLOBALS['sys_user_reg_restricted']) ;
+fusionforge_read_config_file ($gfconfig.'/fusionforge.ini') ;
-*/
+// get constants used for flags or status
+require $gfcommon.'include/constants.php';
-if ($OVERRIDES_PATH) {
- require_once($OVERRIDES_PATH."overrides.inc");
-}
-if (($HTTP_HOST != $GLOBALS['sys_default_domain']) && ($HTTP_HOST != $GLOBALS['sys_fallback_domain']) && ($HTTP_HOST != 'localhost') && ($HTTP_HOST != $GLOBALS['sys_default_domain'].':80')) {
- if ($SERVER_PORT == '443') {
- header ("Location: https://".$GLOBALS['sys_default_domain']."$REQUEST_URI");
- } else {
- header ("Location: http://".$GLOBALS['sys_default_domain']."$REQUEST_URI");
- }
- exit;
+//
+if ($sys_use_jabber) {
+ require_once $gfcommon.'include/Jabber.class.php';
}
//library to determine browser settings
-require_once('www/include/browser.php');
+require_once $gfwww.'include/browser.php';
//base error library for new objects
-require_once('common/include/Error.class');
+require_once $gfcommon.'include/Error.class.php';
// HTML layout class, may be overriden by the Theme class
-require_once('www/include/Layout.class');
+require_once $gfwww.'include/Layout.class.php';
-$HTML = new Layout();
//various html utilities
-require_once('common/include/utils.php');
+require_once $gfcommon.'include/utils.php';
//database abstraction
-require_once('common/include/database.php');
+require_once $gfcommon.'include/database-'.$sys_database_type.'.php';
//security library
-require_once('common/include/session.php');
+require_once $gfcommon.'include/session.php';
-// LDAP library
-require_once('common/include/ldap.php');
+//system library
+require_once $gfcommon.'include/System.class.php';
+if (!$sys_account_manager_type) {
+ $sys_account_manager_type='UNIX';
+}
+require_once $gfcommon.'include/system/'.$sys_account_manager_type.'.class.php';
+$SYS=new $sys_account_manager_type();
//user functions like get_name, logged_in, etc
-require_once('common/include/User.class');
+require_once $gfcommon.'include/User.class.php';
//group functions like get_name, etc
-require_once('common/include/Group.class');
+require_once $gfcommon.'include/Group.class.php';
//permission functions
-require_once('common/include/Permission.class');
-
-//Project extends Group and includes preference accessors
-require_once('common/include/Project.class');
-
-//Foundry extends Group and includes preference/data accessors
-require_once('common/include/Foundry.class');
+require_once $gfcommon.'include/Permission.class.php';
//library to set up context help
-require_once('www/include/help.php');
+require_once $gfwww.'include/help.php';
//exit_error library
-require_once('www/include/exit.php');
+require_once $gfwww.'include/exit.php';
//various html libs like button bar, themable
-require_once('www/include/html.php');
-
-//left-hand nav library, themable
-require_once('www/include/menu.php');
+require_once $gfwww.'include/html.php';
-//theme functions like get_themename, etc
-require_once('www/include/theme.php');
-
-//$sys_datefmt = "Y-m-d H:i";
+//forms key generation
+require_once $gfcommon.'include/forms.php';
// #### Connect to db
db_connect();
-if (!$conn) {
- print "$sys_name Could Not Connect to Database: ".db_error();
+if (!$GLOBALS['gfconn']) {
+ print fusionforge_get_config ('core', 'forge_name')." Could Not Connect to Database: ".db_error();
exit;
}
// Plugins subsystem
-require_once('common/include/Plugin.class') ;
-require_once('common/include/PluginManager.class') ;
+require_once $gfcommon.'include/Plugin.class.php' ;
+require_once $gfcommon.'include/PluginManager.class.php' ;
+
+// SCM-specific plugins subsystem
+require_once $gfcommon.'include/SCMPlugin.class.php' ;
+
+setup_plugin_manager () ;
+
//determine if they're logged in
session_set();
-//set up the themes vars
-theme_sysinit($sys_themeid);
+plugin_hook('after_session_set');
-// OSDN functions and defs
-require_once('www/include/osdn.php');
+//mandatory login
+if (!session_loggedin() && $sys_force_login == 1 ) {
+ $expl_pathinfo = explode('/',getStringFromServer('REQUEST_URI'));
+ if (getStringFromServer('REQUEST_URI')!='/' && $expl_pathinfo[1]!='account' && $expl_pathinfo[1]!='export' ) exit_not_logged_in();
+ // Show proj* export even if not logged in when force login
+ // If not default web project page would be broken
+ if ($expl_pathinfo[1]=='export' && !ereg("^proj", $expl_pathinfo[2])) exit_not_logged_in();
+}
//insert this page view into the database
-require_once('www/include/logger.php');
+require_once $gfwww.'include/logger.php';
//
// If logged in, set up a $LUSER var referencing
// the logged in user's object
//
-if (user_isloggedin()) {
+if (session_loggedin()) {
//set up the user's timezone if they are logged in
$LUSER =& session_get_user();
+ $LUSER->setUpTheme();
+ header('Cache-Control: private');
}
+//
+// Include user Theme
+//
+require_once $sys_themeroot.$sys_theme.'/Theme.class.php';
+
+$HTML=new Theme();
+
/*
Timezone must come after logger to prevent messups
*/
-if (user_isloggedin()) {
+if (session_loggedin()) {
//set up the user's timezone if they are logged in
putenv('TZ='. $LUSER->getTimeZone());
} else {
- //just user pacific time as always
+ //just use pacific time as always
}
/*
*/
-require_once('www/include/BaseLanguage.class');
-
-if (!$sys_lang) {
- $sys_lang="English";
-}
-if (user_isloggedin()) {
- $res=$LUSER->getData();
- $classname=db_result($res,0,'classname');
- if ($classname) {
- $Language=new BaseLanguage();
- $Language->loadLanguage($classname);
- } else {
- $Language=new BaseLanguage();
- $Language->loadLanguage($sys_lang);
- }
-} else {
- //if you aren't logged in, check your browser settings
- //and see if we support that language
- //if we don't support it, just use English as default
- if ($HTTP_ACCEPT_LANGUAGE) {
- $res = language_code_to_result ($HTTP_ACCEPT_LANGUAGE);
- $classfile=db_result($res,0,'filename');
- }
- if (!$classname) {
- $classname=$sys_lang;
- }
- $Language=new BaseLanguage();
- $Language->loadLanguage($classname);
-}
-
-setlocale (LC_TIME, $Language->getText('system','locale'));
-$sys_strftimefmt = $Language->getText('system','strftimefmt');
-$sys_datefmt = $Language->getText('system','datefmt');
+require_once $gfcommon.'include/gettext.php';
+require_once $gfcommon.'include/group_section_texts.php';
-//ob_start(ob_gzhandler);
+setup_gettext_from_context();
-//
-// For now, only cache English, non-logged-in pages, with no POST going on
-//
-if (!user_isloggedin() && ($Language->getLanguageId() == 1) && (count($HTTP_POST_VARS) < 1) && !session_issecure()) {
- include_once('common/include/jpcache.php');
-}
-}
/*
RESERVED VARIABLES
-$conn
+$gfconn
$session_hash
-$Language
$LUSER - Logged in user object
$HTML
-$sys_datefmt
*/
+
+// Local Variables:
+// mode: php
+// c-file-style: "bsd"
+// End:
+
?>