home *** CD-ROM | disk | FTP | other *** search
/ Cricao de Sites - 650 Layouts Prontos / WebMasters.iso / CMS / xoops-2.0.18.1.exe / xoops-2.0.18.1 / htdocs / mainfile.dist.php < prev    next >
Encoding:
PHP Script  |  2006-05-27  |  5.1 KB  |  105 lines

  1. <?php
  2. // $Id: mainfile.dist.php 506 2006-05-26 23:10:37Z skalpa $
  3. //  ------------------------------------------------------------------------ //
  4. //                XOOPS - PHP Content Management System                      //
  5. //                    Copyright (c) 2000 XOOPS.org                           //
  6. //                       <http://www.xoops.org/>                             //
  7. //  ------------------------------------------------------------------------ //
  8. //  This program is free software; you can redistribute it and/or modify     //
  9. //  it under the terms of the GNU General Public License as published by     //
  10. //  the Free Software Foundation; either version 2 of the License, or        //
  11. //  (at your option) any later version.                                      //
  12. //                                                                           //
  13. //  You may not change or alter any portion of this comment or credits       //
  14. //  of supporting developers from this source code or any supporting         //
  15. //  source code which is considered copyrighted (c) material of the          //
  16. //  original comment or credit authors.                                      //
  17. //                                                                           //
  18. //  This program is distributed in the hope that it will be useful,          //
  19. //  but WITHOUT ANY WARRANTY; without even the implied warranty of           //
  20. //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the            //
  21. //  GNU General Public License for more details.                             //
  22. //                                                                           //
  23. //  You should have received a copy of the GNU General Public License        //
  24. //  along with this program; if not, write to the Free Software              //
  25. //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA //
  26. //  ------------------------------------------------------------------------ //
  27.  
  28. if ( !defined("XOOPS_MAINFILE_INCLUDED") ) {
  29.     define("XOOPS_MAINFILE_INCLUDED",1);
  30.  
  31.     // XOOPS Physical Path
  32.     // Physical path to your main XOOPS directory WITHOUT trailing slash
  33.     // Example: define('XOOPS_ROOT_PATH', '/path/to/xoops/directory');
  34.     define('XOOPS_ROOT_PATH', '');
  35.  
  36.     // XOOPS Virtual Path (URL)
  37.     // Virtual path to your main XOOPS directory WITHOUT trailing slash
  38.     // Example: define('XOOPS_URL', 'http://url_to_xoops_directory');
  39.     define('XOOPS_URL', 'http://');
  40.  
  41.     define('XOOPS_CHECK_PATH', 0);
  42.     // Protect against external scripts execution if safe mode is not enabled
  43.     if ( XOOPS_CHECK_PATH && !@ini_get('safe_mode') ) {
  44.         if ( function_exists('debug_backtrace') ) {
  45.             $xoopsScriptPath = debug_backtrace();
  46.             if ( !count($xoopsScriptPath) ) {
  47.                  die("XOOPS path check: this file cannot be requested directly");
  48.             }
  49.             $xoopsScriptPath = $xoopsScriptPath[0]['file'];
  50.         } else {
  51.             $xoopsScriptPath = isset($_SERVER['PATH_TRANSLATED']) ? $_SERVER['PATH_TRANSLATED'] :  $_SERVER['SCRIPT_FILENAME'];
  52.         }
  53.         if ( DIRECTORY_SEPARATOR != '/' ) {
  54.             // IIS6 may double the \ chars
  55.             $xoopsScriptPath = str_replace( strpos( $xoopsScriptPath, '\\\\', 2 ) ? '\\\\' : DIRECTORY_SEPARATOR, '/', $xoopsScriptPath);
  56.         }
  57.         if ( strcasecmp( substr($xoopsScriptPath, 0, strlen(XOOPS_ROOT_PATH)), str_replace( DIRECTORY_SEPARATOR, '/', XOOPS_ROOT_PATH)) ) {
  58.              exit("XOOPS path check: Script is not inside XOOPS_ROOT_PATH and cannot run.");
  59.         }
  60.     }
  61.  
  62.     // Database
  63.     // Choose the database to be used
  64.     define('XOOPS_DB_TYPE', 'mysql');
  65.  
  66.     // Table Prefix
  67.     // This prefix will be added to all new tables created to avoid name conflict in the database. If you are unsure, just use the default 'xoops'.
  68.     define('XOOPS_DB_PREFIX', 'xoops');
  69.  
  70.     // Database Hostname
  71.     // Hostname of the database server. If you are unsure, 'localhost' works in most cases.
  72.     define('XOOPS_DB_HOST', 'localhost');
  73.  
  74.     // Database Username
  75.     // Your database user account on the host
  76.     define('XOOPS_DB_USER', '');
  77.  
  78.     // Database Password
  79.     // Password for your database user account
  80.     define('XOOPS_DB_PASS', '');
  81.  
  82.     // Database Name
  83.     // The name of database on the host. The installer will attempt to create the database if not exist
  84.     define('XOOPS_DB_NAME', '');
  85.  
  86.     // Use persistent connection? (Yes=1 No=0)
  87.     // Default is 'Yes'. Choose 'Yes' if you are unsure.
  88.     define('XOOPS_DB_PCONNECT', 0);
  89.  
  90.     define("XOOPS_GROUP_ADMIN", "1");
  91.     define("XOOPS_GROUP_USERS", "2");
  92.     define("XOOPS_GROUP_ANONYMOUS", "3");
  93.  
  94.     foreach ( array('GLOBALS', '_SESSION', 'HTTP_SESSION_VARS', '_GET', 'HTTP_GET_VARS', '_POST', 'HTTP_POST_VARS', '_COOKIE', 'HTTP_COOKIE_VARS', '_REQUEST', '_SERVER', 'HTTP_SERVER_VARS', '_ENV', 'HTTP_ENV_VARS', '_FILES', 'HTTP_POST_FILES', 'xoopsDB', 'xoopsUser', 'xoopsUserId', 'xoopsUserGroups', 'xoopsUserIsAdmin', 'xoopsConfig', 'xoopsOption', 'xoopsModule', 'xoopsModuleConfig', 'xoopsRequestUri') as $bad_global ) {
  95.         if ( isset( $_REQUEST[$bad_global] ) ) {
  96.             header( 'Location: '.XOOPS_URL.'/' );
  97.             exit();
  98.         }
  99.     }
  100.  
  101.     if (!isset($xoopsOption['nocommon']) && XOOPS_ROOT_PATH != '') {
  102.         include XOOPS_ROOT_PATH."/include/common.php";
  103.     }
  104. }
  105. ?>