• Main Page
  • Related Pages
  • Namespaces
  • Data Structures
  • Files
  • Examples
  • File List
  • Globals

INSTALL/config.inc-dist.php

Go to the documentation of this file.
00001 <?php
00002 if(!defined('__PRAGYAN_CMS'))
00003 { 
00004         header($_SERVER['SERVER_PROTOCOL'].' 403 Forbidden');
00005         echo "<h1>403 Forbidden<h1><h4>You are not authorized to access the page.</h4>";
00006         echo '<hr/>'.$_SERVER['SERVER_SIGNATURE'];
00007         exit(1);
00008 }
00009 /*
00010  * Created on Sep 28, 2008
00011  * Updated on May 23, 2010 by Abhishek
00012  *
00013  * To change the template for this generated file go to
00014  * Window - Preferences - PHPeclipse - PHP - Code Templates
00015  */
00016 
00017 
00018 $configFileText = <<<CONFIGFILETEXT
00019 <?php
00027 /*******MYSQL SETTINGS************************/
00028 // defining the ip address of the mysql server.
00029 define("MYSQL_SERVER","$MYSQL_SERVER");
00030 
00031 // defining the username to connect to the database.
00032 define("MYSQL_USERNAME","$MYSQL_USERNAME");
00033 
00034 // defining the password used to connect to the database.
00035 define("MYSQL_PASSWORD","$MYSQL_PASSWORD");
00036 
00037 // defining the name of the database to connect to.
00038 define("MYSQL_DATABASE","$MYSQL_DATABASE");
00039 
00040 // defining the prefix which is appended to every table of Pragyan CMS.
00041 // this feature allows you to have multiple websites using the same database.
00042 define("MYSQL_DATABASE_PREFIX","$MYSQL_DATABASE_PREFIX");
00043 
00044 // defining the user id of the administrator. WARNING: Only experts should alter this.
00045 define("ADMIN_USERID",1);
00046 
00047 /*******CONFIGURATION SETTINGS************************/
00057 \$error_level = $error_level;
00058 switch(\$error_level) {
00059         case 0 : \$error_text = 0; break;
00060         case 1 : \$error_text = E_ERROR | E_WARNING | E_PARSE; break;
00061         case 2 : \$error_text = E_ERROR | E_WARNING | E_PARSE | E_NOTICE; break;
00062         case 3 : \$error_text = E_ALL ^ E_NOTICE;break;
00063         case 4 : \$error_text = E_ALL; break;
00064         case 5 : \$error_text = E_ALL; \$debugSet='on'; break;
00065 }
00066 ini_set('error_reporting', \$error_text);
00067 ini_set('display_errors', 0);
00068 
00069 //The language folder to be imported
00070 define("LANGUAGE","en");
00071 
00072 /*****MAIL MESSAGES SETTINGS************************************/
00073 
00074 define("MAILPATH","./cms/languages");
00075 
00076 // By default .cms/languages/en must exist
00077 
00078 /*****AUTHENTICATION SETTINGS**************************/
00079 
00080 //IMAP settings
00081 \$authmethods['imap']['status']=$AUTH_IMAP_STATUS;
00082 \$authmethods['imap']['server_address']="$AUTH_IMAP_SERVER";
00083 \$authmethods['imap']['port']="$AUTH_IMAP_PORT";
00084 \$authmethods['imap']['user_domain']="$AUTH_IMAP_DOMAIN"; // i.e. user must login with username@nitt.edu
00085 //LDAP settings
00086 \$authmethods['ldap']['status']=$AUTH_LDAP_STATUS;
00087 \$authmethods['ldap']['server_address']="$AUTH_LDAP_SERVER";
00088 \$authmethods['ldap']['search_group']="$AUTH_LDAP_SEARCHGROUP";
00089 \$authmethods['ldap']['user_domain']="$AUTH_LDAP_DOMAIN";
00090 //ADS settings
00091 \$authmethods['ads']['status']=$AUTH_ADS_STATUS;
00092 \$authmethods['ads']['server_address']="$AUTH_ADS_SERVER";
00093 \$authmethods['ads']['network_name']="$AUTH_ADS_NETWORK";
00094 \$authmethods['ads']['user_domain']="$AUTH_ADS_DOMAIN";
00095 
00096 /*****SESSION SETTINGS*********************************/
00097 if(!defined('CMS_SETUP')) {
00098  // we deal with cookies here because the session id variable is stored in a client cookie
00099  ini_set("use_cookies",1);
00100  ini_set("use_only_cookies",1);
00101 
00102 // path for session cookies
00103 \$cookie_path = "/";
00104 
00105 // timeout value for the cookie
00106 \$cookie_timeout = $cookie_timeout; // in seconds//60 * 30
00107 
00108 // timeout value for the garbage collector
00109 //   we add 300 seconds, just in case the user's computer clock
00110 //   was synchronized meanwhile; 300 secs (5 minutes) should be
00111 //   enough - just to ensure there is session data until the
00112 //   cookie expires
00113 \$garbage_timeout = \$cookie_timeout + 300; // in seconds //300
00114 
00115 // set the PHP session id (PHPSESSID) cookie to a custom value
00116 ini_set('session.name',"PHPSESSID");
00117 session_set_cookie_params(\$cookie_timeout, \$cookie_path);
00118 
00119 // set the garbage collector - who will clean the session files -
00120 //   to our custom timeout
00121 ini_set('session.gc_maxlifetime', \$garbage_timeout);
00122 /*ini_set('session.gc_probability',1); //defaults to 1
00123  *ini_set('session.gc_divisor',2); //defaults to 100
00124  * gc_probability / gc_divisor gives probability of the garbage collector
00125  * being started
00126  */
00127 // we need a distinct directory for the session files,
00128 //   otherwise another garbage collector with a lower gc_maxlifetime
00129 //   will clean our files aswell - but in our own directory, we only
00130 //   clean sessions with our "own" garbage collector (which has a
00131 //   custom timeout/maxlifetime set each time one of our scripts is
00132 //   executed)
00133 \$sessdir = \$sourceFolder."/".\$uploadFolder."/sessions";
00134 if (!is_dir(\$sessdir)) { mkdir(\$sessdir, 0777); }
00135 ini_set('session.save_path', \$sessdir);
00136 
00137 }
00138 ?>
00139 CONFIGFILETEXT;
00140 
00141 $searchConfigFileText =<<<SEARCHCONFIGFILETEXT
00142 <?php
00143         \$database="$MYSQL_DATABASE";
00144         \$mysql_user = "$MYSQL_USERNAME";
00145         \$mysql_password = "$MYSQL_PASSWORD"; 
00146         \$mysql_host = "$MYSQL_SERVER";
00147         \$mysql_table_prefix = ""; // This doesn't work in sphider
00148 
00149 
00150 
00151         \$success = mysql_pconnect (\$mysql_host, \$mysql_user, \$mysql_password);
00152         if (!\$success)
00153                 die ("<b>Cannot connect to database, check if username, password and host are correct.</b>");
00154     \$success = mysql_select_db (\$database);
00155         if (!\$success) {
00156                 print "<b>Cannot choose database, check if database name is correct.";
00157                 die();
00158         }
00159 ?>
00160 SEARCHCONFIGFILETEXT;
00161 
00162 ?>

Generated on Sun Jan 2 2011 04:55:32 for Pragyan CMS by  doxygen 1.7.1