home *** CD-ROM | disk | FTP | other *** search
- <?php
- /*
- Copyright Intermesh 2003
- Author: Merijn Schering <mschering@intermesh.nl>
- Version: 1.99 Release date: 28 Februari 2003
-
- This program 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 License, or (at your
- option) any later version.
- */
-
- /////////////////////////////////////////////////////////////////////////////////
- ///////////////////// Server configuration ///////////////////
- /////////////////////////////////////////////////////////////////////////////////
-
- class GO_CONFIG
- {
- #FRAMEWORK VARIABLES
-
- #set debug to true for debugging mode
- var $debug = false;
-
- #slash to use '/' for linux and '\\' for windows
- var $slash = "%slash%";
-
- #default language
- var $language = "%language%";
-
- #time zone offset from GMT
- var $timezone_offset = %timezone_offset%;
-
- #First day of the week
- var $first_weekday = %first_weekday%;
-
- #default theme
- var $theme = "%theme%";
-
- #Allow change of theme
- var $allow_themes = %allow_themes%;
-
- #Allow users to change password
- var $allow_password_change = %allow_password_change%;
-
- #Group-Office Version
- var $version = "2.01";
-
- #relative hostname with starting and ending slash
- var $host = '%host%';
-
- #full urlto reach Group-Office
- var $full_url = '%full_url%';
-
- #title of group-office
- var $title = "%title%";
-
- #the person that gets emails at special events
- var $webmaster_email = "%webmaster_email%";
-
- #the path to the root of group-office ends with slash
- var $root_path = "%root_path%";
-
- #temporary files ends with slash
- var $tmpdir = "%tmpdir%";
-
- #The maximum number of users
- var $max_users = 0;
-
- #some pages can be edited by multiple users. Define the time interval in seconds to
- #refresh a page
- var $refresh_rate = '30';
-
- #database
- var $db_type = "%db_type%";
- var $db_host = "%db_host%";
- var $db_name = "%db_name%";
- var $db_user = "%db_user%";
- var $db_pass = "%db_pass%";
-
- #Type of authentication. Valid values are: sql, ldap and mail.
- #Group-Office will always attempt to authenticate through the medium that is set here. On failure it will try
- #the fall back on the Group-Office database.
- var $auth_db_type = "%auth_db_type%";
-
- #LDAP Authentication
- var $auth_db_host = "%auth_db_host%";
- var $auth_db_user = "%auth_db_user%";
- var $auth_db_pass = "%auth_db_pass%";
- var $auth_db_ldap_um = "%auth_db_ldap_um%";
- var $auth_db_ldap_basedn = "%auth_db_ldap_basedn%";
- var $auth_db_ldap_peopledn = "%auth_db_ldap_peopledn%";
- var $auth_db_ldap_groupsdn = "%auth_db_ldap_groupsdn%";
-
- #FILE BROWSER VARIABLES
-
- #the path to the location where the files of the file browser module are stored
- #this should NEVER be inside the document root of the webserver
- #this directory should be writable by apache. Also choose a partition that
- #has enough diskspace.
-
- var $mime_types_file = '/etc/mime.types';
- var $file_storage_path = "%file_storage_path%";
-
- var $create_mode = %create_mode%;
-
- #The maximum file size the filebrowser attempts to upload
- #note that the php.ini file must be set accordingly.(www.php.net)
-
- var $max_file_size = "%max_file_size%";
-
- #EMAIL VARIABLES
-
- #smtp server. leave empty when using local sendmail
- var $smtp_server = "%smtp_server%";
- var $smtp_port = "%smtp_port%";
- var $max_attachment_size = "%max_attachment_size%";
-
- #image to display at the login window leave blank to disable
- var $login_image = 'lib/GOCOM.gif';
-
- var $composer_width = '800';
- var $composer_height = '600';
-
- ###############################################################################
- ####################### LINUX ONLY #################################
- ###############################################################################
-
- #System account creation. This will allow users to create a system account to recieve email on
- #this machine.
-
- var $enable_system_accounts = %enable_system_accounts%;
-
- #################################only set below when system accounts are enabled###################
- #Location of sudo /etc/sudoers must be configured correctly. Apache must have access to useradd and chpasswd
- var $sudo = '/usr/bin/sudo';
- var $du = '/usr/bin/du';
-
- #location of useradd
- var $useradd = '/usr/sbin/useradd';
- var $userdel = '/usr/sbin/userdel';
- #location of chpasswd
- var $chpasswd = '/usr/sbin/chpasswd';
- #the shell for the users. set to /bin/false for no shell access
- var $shell = '/bin/false';
- #location to scripts for samba user management
- var $auto_smbadduser = '/usr/sbin/auto_smbadduser.exp';
- var $auto_smbpasswd = '/usr/sbin/auto_smbpasswd.exp';
- var $smbdeluser = '/usr/bin/smbpasswd -x';
-
- #The local E-mail addresses hostname. E-mail addresses will be username@inmail_host
- var $inmail_host = "%inmail_host%";
- var $inmail_port = "%inmail_port%";
- var $inmail_type = "%inmail_type%";
- var $inmail_root = "%inmail_root%";
- #the name of this host and optionally some connect options for IMAP of POP3
- #like '/notls' for redhat servers that need this somehow
- var $local_email_host = "%local_email_host%";
- var $email_connectstring_options = '%email_connectstring_options%';
-
- #Create Samba fileserver users
- var $enable_samba_accounts = %enable_samba_accounts%;
- #################################only set above when system accounts are enabled###################
-
- /////////////////////////////////////////////////////////////////////////////////
- ///////////////////// Do not change underneath this ///////////////////
- /////////////////////////////////////////////////////////////////////////////////
-
- #date and time formats to be used
- var $date_formats = array(
- 'd-m-Y',
- 'm-d-Y'
- );
- var $time_formats = array(
- 'G:i',
- 'g:i a'
- );
-
- #relative to root_path no slash at end
- var $module_path = 'modules';
- var $administrator_url = 'administrator';
- var $configuration_url = 'configuration';
- var $class_path = 'classes';
- var $control_path = 'controls';
- var $control_url = 'controls';
- var $theme_path = 'themes';
- var $language_path = 'language';
- var $default_filetype_icon = 'lib/icons/default.gif';
- var $window_mode = 'normal';
-
- var $db;
- var $settings = array();
-
- function GO_CONFIG()
- {
- #path to classes
- $this->class_path = $this->root_path.$this->class_path.$this->slash;
-
- #path to controls
- $this->control_path = $this->root_path.$this->control_path.$this->slash;
-
- #url to controls
- $this->control_url = $this->host.$this->control_url.$this->slash;
-
- #path to modules
- $this->module_path = $this->root_path.$this->module_path.$this->slash;
-
- #url to administrator apps
- $this->administrator_url = $this->host.$this->administrator_url.$this->slash;
-
- #url to user configuration apps
- $this->configuration_url = $this->host.$this->configuration_url.$this->slash;
-
- #filetype icon
- $this->default_filetype_icon = $this->root_path.$this->default_filetype_icon;
-
- #login image
- if ($this->login_image != '')
- {
- $this->login_image = $this->host.$this->login_image;
- }
-
- //database class library
- require_once($this->root_path.'database/'.$this->db_type.".class.inc");
- $this->db = new db();
- $this->db->Host = $this->db_host;
- $this->db->Database = $this->db_name;
- $this->db->User = $this->db_user;
- $this->db->Password = $this->db_pass;
-
- if ( $this->auth_db_type == "ldap" )
- {
- require_once($this->root_path.'database/ldap.class.inc');
- }
- }
-
- //gets a custom administrator setting from the database
- //see /configuration/preferences/index.php for an example
- function get_setting($name)
- {
- $this->db->query("SELECT * FROM settings WHERE name='$name'");
- if ($this->db->next_record())
- {
- return $this->db->f('value');
- }
- return false;
- }
-
- function save_setting($name, $value)
- {
- if ($this->get_setting($name)===false)
- {
- return $this->db->query("INSERT INTO settings (name, value) VALUES ('$name', '$value')");
- }else
- {
- return $this->db->query("UPDATE settings SET value='$value' WHERE name='$name'");
- }
- }
-
- function delete_setting($name)
- {
- return $this->db->query("DELETE FROM settings WHERE name='$name'");
- }
- }
-
- /////////////////////////////////////////////////////////////////////////////////
- ///////////////////// Group-Office initialisation //////////////////
- /////////////////////////////////////////////////////////////////////////////////
-
-
- //load configuration
- $GO_CONFIG = new GO_CONFIG();
-
- //setting session save path is required for some server configuration
- session_save_path($GO_CONFIG->tmpdir);
-
- //start session
- session_start();
-
- require($GO_CONFIG->class_path.'modules.class.inc');
- require($GO_CONFIG->class_path.'security.class.inc');
- require($GO_CONFIG->class_path.'controls.class.inc');
- require($GO_CONFIG->root_path.'functions.inc');
- require($GO_CONFIG->class_path.'crypto.class.inc');
- $GO_CRYPTO = new GO_CRYPTO();
-
- //load language management class
- require($GO_CONFIG->class_path."language.class.inc");
- $GO_LANGUAGE = new GO_LANGUAGE();
- if (isset($_REQUEST['SET_SESSION_LANGUAGE']))
- {
- $GO_LANGUAGE->set_session_language($_REQUEST['SET_SESSION_LANGUAGE']);
- }
- require($GO_LANGUAGE->get_language_file('common'));
-
- //load theme
- require($GO_CONFIG->class_path.'theme.class.inc');
- $GO_THEME = new GO_THEME();
-
- //load base classes
- $GO_MODULES = new GO_MODULES();
- $GO_SECURITY = new GO_SECURITY();
-
- define('GO_LOADED', true);
- ?>
-