<?php
/* daCode http://www.dacode.org/
 * src/phplib/config.sample
 * $Id: config.sample,v 1.33 2001/07/22 21:55:33 barbier Exp $
 *
 *   Rename this file to config.php3 and edit values
*/

Class Config {

	Function Config() {
		global $topdir, $libdir, $php_ext;
		$this->obj = array ();
		$this->php = $php_ext;

		//echo '<br>Config';

		///////////////////////////////////////////////////////////
		//  PART 1 : Site definitions
		//     These variables must be edited
		///////////////////////////////////////////////////////////

		//   Current available options are `mysql' or `pgsql'
		$this->sql_backend  = "mysql";

		$this->sql_host     = "localhost";
		$this->sql_user     = "my_name";
		$this->sql_passwd   = "my_pass";
		$this->sql_db       = "dacode";

		// Don't forget the "/" !
		$this->basehref     = "http://linuxfr.org/";

		$this->name         = "LinuxFR";
		$this->titledefault = "Da Linux French Page";
		
		// description is used in the rss backend generated, so don't 
		// do it too long.
		$this->description  = "Brèves Linux";
		$this->mailadmin    = "webmaster@linuxfr.org";
		//   When empty, cookies are only available for the current
		//   webserver, define it to a subdomain if you need it.
		//$this->cookiedomain = ".linuxfr.org";
		$this->cookiedomain = "";

		$this->edito = "<b>daCode</b> est un projet Open Source (GPL) ".
			"de moteur de news sur le modèle de ".
			"<a href=\"http://linuxfr.org/\">LinuxFR</a>.";

		//// If your host doesn't support the mail() command like
		//// http://www.free.fr/ then send a mail to penso@dacode.org
		//// asking for a login/password, and put them here.
		//// Be carefull, this is a privilege, if you abuse it you'll be kicked out. 
		//// It has to be used only for daCode, nothing else (you have been warned)
		$this->mail_login = "";
		$this->mail_password="";
		
		///////////////////////////////////////////////////////////
		//  Ldap : Ldap configuration if you want use LDAP
		//  If you want use ldap, set a value to ldap_hostame and
		//  complete  values :
		///////////////////////////////////////////////////////////
		
		// The hostname of the LDAP server.  It may also be a space
		// separated list of LDAP servers
		//$this->ldap_hostname = "localhost";
		$this->ldap_hostname = "";
		
		// The BASE DN of your ldap server. (if you don't know what it
		// is, you should check your slapd.conf file)
		//$this->ldap_basedn = "ou=People,dc=dacode,dc=org";
		$this->ldap_basedn = "";

		// The BIND DN for your ldap server. (if you don't know what it
		// is, you should check your slapd.conf file)
		//$this->ldap_binddn = "login=admin,ou=People,dc=dacode,dc=org";
		$this->ldap_binddn = "";
		
		// The BIND PW for your ldap server. (if you don't know what it
		// is, you should check your slapd.conf file)
		//$this->ldap_bindpw =  "admin";
		$this->ldap_bindpw =  "";
		
		// The FULL path to the configuration file with your
		// objectClass definitions.  This file must be readable by the
		// process using this class (probably your web server).  Do
		// _NOT_ make your slapd.conf file world readable.  If you have
		// objectClass definitions in your slapd.conf file, you should
		// separate them into a slapd.oc.conf file.
		//$this->ldap_sldapd_oc_conf_path = "/etc/openldap/dacode.oc.conf";
		$this->ldap_sldapd_oc_conf_path = "";

		///////////////////////////////////////////////////////////
		//  PART 2 : Site configuration
		//     These are reasonable default values, you may not
		//     need to change them to experiment daCode
		///////////////////////////////////////////////////////////

		//   Default language ID
		$this->defaultlang = "fr";

		//   Whether script name must appear in URLs
		$this->visiblenewsfile = 1;

		//   Allow anonymous comments
		$this->anonymous_comments = 1;

		//   List of valid HTML tags in comments
		$this->valid_tags = array (
			'b','i','s','u',
			'em','tt','strong','blockquote',
			'ol','ul','li',
			'p'
		);

		//   List of valid HTML tags in board
		$this->valid_tags_board = array (
			'b','i','s','u',
			'em','tt','strong','blockquote'
		);


		//   List of supplementary fields you want for users
		//   informations except the basic ones.
		//   For each field, following values must be assigned:
		//     length:      width and height (optional) in lines
		//     max_length:  maximal width
		//     type:        input type ('text' or 'textarea')
		//     public:      1: datas are visible to anyone
		//                  0: only authenticated users can view them
		$this->supp_fields = array (
	  		'téléphone'     => array(
				'length'        => '10',
				'max_length'    => '10',
				'type'          => 'text',
				'public'        => '0'
			),
	  		'adresse'       => array(
				'length'        => '50,5',
				'max_length'    => '255',
				'type'          => 'textarea',
				'public'        => '0'
			),
	  		'clé GnuPG'     => array(
				'length'        => '50,7',
				'max_length'    => '500',
				'type'          => 'textarea',
				'public'        => '1'
			)
		);

		//   Time in seconds between two votes by the same person
		$this->pollvote = 3600*12;

		//   Directory where HTML fragments (i.e. boxes) are cached.
		//   Don't forget the trailing slash !!
		//$this->cachedir = "/tmp/";
		$this->cachedir = "";

		//   htdocs/ subdirectory where generated HTML files are stored.
		//   An empty string means no caching.
		//$this->htmldir = "cache/";
		$this->htmldir = "";

		//   Mark outdated cached files instead of deleting them
		$this->mark_outdated = 1;

		//   Allow SQL persistant connexions
		$this->sql_persistant = 1;

		//   Log SQL queries to this file ; log disabled when empty
		//$this->sql_logfile = "/tmp/dacode-sqllog";
		$this->sql_logfile = "";

		//   Fortune file, if any
		//$this->fortunefile = "/tmp/fortunes.txt";
		$this->fortunefile = "";

		//   Directory where generated tarfiles are put
		//$this->create_tar_dir = "/tmp/";
		$this->create_tar_dir = "";

		//   Directory where uploaded tarfiles are put to be
		//   extracted
		//$this->upload_tar_dir = "/tmp/";
		$this->upload_tar_dir = "";

		//   When uploaded themes can be installed, it may be
		//   advisable to put them under a specific subdirectory
		//   which is writable by PHP.
		$this->theme_subdir = "contrib/";

		///////////////////////////////////////////////////////////
		//  PART 3 : Expert site configuration
		//     These values may be edited
		///////////////////////////////////////////////////////////

		$this->newstitledefault = "News doesn't have any title";
		$this->newsbodydefault  = "News doesn't have any text";
		$this->newsdepartementdefault = "";

		//   Default number of possible file attachement
		$this->numberoffiles    = 2;

		//   Default number of possible links in the news
		$this->numberoflinks    = 5;

		//   Set to 1 if you want to activate the nospider function
		$this->nospider         = 0;

		//   Max number of hits / min we accept from the same
		//   host before denying him
		$this->numberofhits     = 100;

		//   Name of main index file in htdocs in case you moved it.
		//   If your server forbid use of PATH_INFO, i.e. urls
		//   like /gen.php3/foo/bar, then append a trailing
		//   question mark.
		//$this->newsfile         = "gen.".$this->php."?";
		$this->newsfile         = "gen.".$this->php;

		//   Preferences when user is not authenticated
		$this->dft_prefs = array (
			"hide_sig" => 0,
			"score" => 1,
			"theme" => 0
		);

		$this->listofthemes = array('linuxfr', 'slashdot', 'printable', 'wm', 'lynx');

		//   Settings for search
		$this->default_results_step = 25;

		//   Number of months for archives search
		$this->default_search_interval = 3;

		//   What is considered a high load ?
		$this->highload = "5";

		$this->usersdefaultlevel = 0;

		///////////////////////////////////////////////////////////
		//  PART 4 : File and table names
		//     Change these values only when you rename some files
		//     or SQL tables
		///////////////////////////////////////////////////////////

		$this->tables = array(
			"news"            =>    "news",
			"news_author"     =>    "news_author",
			"news_moderated"  =>    "news_moderated",
			"news_body"       =>    "news_body",
			"news_urls"       =>    "news_urls",
			"attach"          =>    "news_attachements",
			"topics"          =>    "topics",
			"sections"        =>    "sections",
			"users"           =>    "users",
			"users_tempo"     =>    "users_tempo",
			"users_supp"      =>    "users_supp",
			"sessions"        =>    "sessions",
			"lang"            =>    "lang",
			"author"          =>    "news_author",
			"news_body"       =>    "news_body",
			"nospider"        =>    "nospider",
			"urls_hits"       =>    "urls_hits",
			"redirect"        =>    "redirect",
			"urls"            =>    "urls",
			"board"           =>    "board",
			"comments"        =>    "comments",
			"poll_questions"  =>    "poll_questions",
			"sig"             =>    "sig",
			"poll_ip"         =>    "poll_ip",
			"poll_answers"    =>    "poll_answers",
			"comments_scored" =>    "comments_scored",
			"messages"        =>    "messages",
			"ip_sessions"     =>    "ip_sessions",
			"webcam"          =>    "webcam",
			"tips"            =>    "tips",
			"tips_sections"   =>    "tips_sections"
		);

		/* Name of the file for info / board */
		$this->boardinfofile    = "board/info.".$this->php;

		/* Name of the file for add / board */
		$this->boardaddfile     = "board/add.".$this->php;

		/* Name of the file for index/ board */
		$this->boardindexfile   = "board/index.".$this->php;

		/* Name of the file for submit / poll */
		$this->pollsubmitfile   = "poll/new.".$this->php;

		/* Name of the file for index/ poll */
		$this->pollindexfile    = "poll/index.".$this->php;

		/* Name of the file for showing polls to moderate */
		$this->polladminfile    = "modpoll.".$this->php;

		/* Name of the file for admin */
		$this->webcamadminfile  = "webcam_admin.".$this->php;
		$this->webcamchangefile = "webcam_change.".$this->php;
		$this->tipsadminfile  = "tips_admin.".$this->php;
		$this->tipschangefile = "tips_change.".$this->php;

		/* url of the redirect script to count hits on links */
		$this->redirecthref     = "redirect.".$this->php;

		$this->commaddfile      = "comments/add.".$this->php;
		$this->adminfile        = "admin/";

		///////////////////////////////////////////////////////////
		//  PART 5 : Internal values
		//     These values must not be edited
		///////////////////////////////////////////////////////////

		//   This is the var to handle if SQL is up or not
		$this->nodb = 0;

		// This is the timestamp of the last news. Initialized to prevent
		// error in debug mode.
		$this->last_news_timestamp = 0;

		$this->countredirect = 0;

		//   Relative path to document root
		if (empty($topdir)) {
			$this->topdir = './';
		} else {
			$this->topdir = $topdir;
			if (substr($topdir, -1) != '/') {
				$this->topdir .= '/';
			}
		}
		$this->libdir = $libdir;

		if (!empty($this->cachedir) && $this->cachedir[0] != '/' && $this->cachedir[0] != '.') {
			$this->cachedir = $this->topdir . $this->cachedir;
		}

		if (substr($this->basehref, -1) != '/') {
			$this->basehref .= '/';
		}

	}

}

//  WARNING:  Make sure that there is no space or blank lines after the
//            line below, otherwise some features may not work.
?>
