home *** CD-ROM | disk | FTP | other *** search
/ Chip 2004 April / CMCD0404.ISO / Software / Freeware / Programare / groupoffice-com-2.01 / Group-Office.tpl < prev    next >
Text File  |  2004-03-08  |  9KB  |  305 lines

  1. <?php
  2. /*
  3. Copyright Intermesh 2003
  4. Author: Merijn Schering <mschering@intermesh.nl>
  5. Version: 1.99 Release date: 28 Februari 2003
  6.  
  7. This program is free software; you can redistribute it and/or modify it
  8. under the terms of the GNU General Public License as published by the
  9. Free Software Foundation; either version 2 of the License, or (at your
  10. option) any later version.
  11. */
  12.  
  13. /////////////////////////////////////////////////////////////////////////////////
  14. /////////////////////          Server configuration           ///////////////////
  15. /////////////////////////////////////////////////////////////////////////////////
  16.  
  17. class GO_CONFIG
  18. {
  19.     #FRAMEWORK VARIABLES
  20.  
  21.     #set debug to true for debugging mode
  22.     var $debug = false;
  23.  
  24.     #slash to use '/' for linux and '\\' for windows
  25.     var $slash = "%slash%";
  26.  
  27.     #default language
  28.     var $language = "%language%";
  29.  
  30.     #time zone offset from GMT
  31.     var $timezone_offset = %timezone_offset%;
  32.  
  33.     #First day of the week
  34.     var $first_weekday = %first_weekday%;
  35.  
  36.     #default theme
  37.        var $theme = "%theme%";
  38.  
  39.     #Allow change of theme
  40.     var $allow_themes = %allow_themes%;
  41.  
  42.     #Allow users to change password
  43.     var $allow_password_change = %allow_password_change%;
  44.  
  45.     #Group-Office Version
  46.     var $version = "2.01";
  47.  
  48.     #relative hostname with starting and ending slash
  49.     var $host = '%host%';
  50.  
  51.     #full urlto reach Group-Office
  52.     var $full_url = '%full_url%';
  53.  
  54.     #title of group-office
  55.     var $title = "%title%";
  56.  
  57.     #the person that gets emails at special events
  58.     var $webmaster_email = "%webmaster_email%";
  59.  
  60.     #the path to the root of group-office ends with slash
  61.     var $root_path = "%root_path%";
  62.  
  63.     #temporary files ends with slash
  64.     var $tmpdir = "%tmpdir%";
  65.  
  66.     #The maximum number of users
  67.     var $max_users = 0;
  68.  
  69.     #some pages can be edited by multiple users. Define the time interval in seconds to
  70.     #refresh a page
  71.     var $refresh_rate = '30';
  72.  
  73.     #database
  74.     var $db_type = "%db_type%";
  75.     var $db_host = "%db_host%";
  76.     var $db_name = "%db_name%";
  77.     var $db_user = "%db_user%";
  78.     var $db_pass = "%db_pass%";
  79.  
  80.     #Type of authentication. Valid values are: sql, ldap and mail.
  81.     #Group-Office will always attempt to authenticate through the medium that is set here. On failure it will try
  82.     #the fall back on the Group-Office database.
  83.     var $auth_db_type = "%auth_db_type%";
  84.  
  85.     #LDAP Authentication
  86.     var $auth_db_host = "%auth_db_host%";
  87.     var $auth_db_user = "%auth_db_user%";
  88.     var $auth_db_pass = "%auth_db_pass%";
  89.     var $auth_db_ldap_um = "%auth_db_ldap_um%";
  90.     var $auth_db_ldap_basedn = "%auth_db_ldap_basedn%";
  91.     var $auth_db_ldap_peopledn = "%auth_db_ldap_peopledn%";
  92.     var $auth_db_ldap_groupsdn = "%auth_db_ldap_groupsdn%";
  93.  
  94.     #FILE BROWSER VARIABLES
  95.  
  96.     #the path to the location where the files of the file browser module are stored
  97.     #this should NEVER be inside the document root of the webserver
  98.     #this directory should be writable by apache. Also choose a partition that
  99.     #has enough diskspace.
  100.  
  101.     var $mime_types_file = '/etc/mime.types';
  102.     var $file_storage_path = "%file_storage_path%";
  103.  
  104.     var $create_mode = %create_mode%;
  105.  
  106.     #The maximum file size the filebrowser attempts to upload
  107.     #note that the php.ini file must be set accordingly.(www.php.net)
  108.  
  109.     var $max_file_size = "%max_file_size%";
  110.  
  111.     #EMAIL VARIABLES
  112.  
  113.     #smtp server. leave empty when using local sendmail
  114.     var $smtp_server = "%smtp_server%";
  115.     var $smtp_port = "%smtp_port%";
  116.     var $max_attachment_size = "%max_attachment_size%";
  117.  
  118.     #image to display at the login window leave blank to disable
  119.     var $login_image = 'lib/GOCOM.gif';
  120.  
  121.     var $composer_width = '800';
  122.     var $composer_height = '600';
  123.  
  124.     ###############################################################################
  125.     #######################        LINUX ONLY     #################################
  126.     ###############################################################################
  127.  
  128.     #System account creation. This will allow users to create a system account to recieve email on
  129.     #this machine.
  130.  
  131.     var $enable_system_accounts = %enable_system_accounts%;
  132.  
  133.     #################################only set below when system accounts are enabled###################
  134.     #Location of sudo /etc/sudoers must be configured correctly. Apache must have access to useradd and chpasswd
  135.     var $sudo = '/usr/bin/sudo';
  136.     var $du = '/usr/bin/du';
  137.  
  138.     #location of useradd
  139.     var $useradd = '/usr/sbin/useradd';
  140.     var $userdel = '/usr/sbin/userdel';
  141.     #location of chpasswd
  142.     var $chpasswd = '/usr/sbin/chpasswd';
  143.     #the shell for the users. set to /bin/false for no shell access
  144.     var $shell = '/bin/false';
  145.     #location to scripts for samba user management
  146.     var $auto_smbadduser = '/usr/sbin/auto_smbadduser.exp';
  147.     var $auto_smbpasswd = '/usr/sbin/auto_smbpasswd.exp';
  148.     var $smbdeluser = '/usr/bin/smbpasswd -x';
  149.  
  150.     #The local E-mail addresses hostname. E-mail addresses will be username@inmail_host
  151.     var $inmail_host = "%inmail_host%";
  152.     var $inmail_port = "%inmail_port%";
  153.     var $inmail_type = "%inmail_type%";
  154.     var $inmail_root = "%inmail_root%";
  155.     #the name of this host and optionally some connect options for IMAP of POP3
  156.     #like '/notls' for redhat servers that need this somehow
  157.     var $local_email_host = "%local_email_host%";
  158.     var $email_connectstring_options = '%email_connectstring_options%';
  159.  
  160.     #Create Samba fileserver users
  161.     var $enable_samba_accounts = %enable_samba_accounts%;
  162.     #################################only set above when system accounts are enabled###################
  163.  
  164.     /////////////////////////////////////////////////////////////////////////////////
  165.     /////////////////////      Do not change underneath this      ///////////////////
  166.     /////////////////////////////////////////////////////////////////////////////////
  167.  
  168.     #date and time formats to be used
  169.     var $date_formats = array(
  170.                     'd-m-Y',
  171.                     'm-d-Y'
  172.                 );
  173.     var $time_formats = array(
  174.                     'G:i',
  175.                     'g:i a'
  176.                 );
  177.  
  178.     #relative to root_path no slash at end
  179.     var $module_path = 'modules';
  180.     var $administrator_url = 'administrator';
  181.     var $configuration_url = 'configuration';
  182.     var $class_path = 'classes';
  183.     var $control_path = 'controls';
  184.     var $control_url = 'controls';
  185.     var $theme_path = 'themes';
  186.     var $language_path = 'language';
  187.     var $default_filetype_icon = 'lib/icons/default.gif';
  188.     var $window_mode = 'normal';
  189.  
  190.     var $db;
  191.     var $settings = array();
  192.  
  193.     function GO_CONFIG()
  194.     {
  195.         #path to classes
  196.         $this->class_path = $this->root_path.$this->class_path.$this->slash;
  197.  
  198.         #path to controls
  199.         $this->control_path = $this->root_path.$this->control_path.$this->slash;
  200.  
  201.         #url to controls
  202.         $this->control_url = $this->host.$this->control_url.$this->slash;
  203.  
  204.         #path to modules
  205.         $this->module_path = $this->root_path.$this->module_path.$this->slash;
  206.  
  207.         #url to administrator apps
  208.         $this->administrator_url = $this->host.$this->administrator_url.$this->slash;
  209.  
  210.         #url to user configuration apps
  211.         $this->configuration_url = $this->host.$this->configuration_url.$this->slash;
  212.  
  213.         #filetype icon
  214.         $this->default_filetype_icon = $this->root_path.$this->default_filetype_icon;
  215.  
  216.         #login image
  217.         if ($this->login_image != '')
  218.         {
  219.             $this->login_image = $this->host.$this->login_image;
  220.         }
  221.  
  222.         //database class library
  223.         require_once($this->root_path.'database/'.$this->db_type.".class.inc");
  224.         $this->db = new db();
  225.         $this->db->Host = $this->db_host;
  226.         $this->db->Database = $this->db_name;
  227.         $this->db->User = $this->db_user;
  228.         $this->db->Password = $this->db_pass;
  229.  
  230.         if ( $this->auth_db_type == "ldap" )
  231.         {
  232.             require_once($this->root_path.'database/ldap.class.inc');
  233.         }
  234.     }
  235.  
  236.     //gets a custom administrator setting from the database
  237.     //see /configuration/preferences/index.php for an example
  238.     function get_setting($name)
  239.     {
  240.         $this->db->query("SELECT * FROM settings WHERE name='$name'");
  241.         if ($this->db->next_record())
  242.         {
  243.             return $this->db->f('value');
  244.         }
  245.         return false;
  246.     }
  247.  
  248.     function save_setting($name, $value)
  249.     {
  250.         if ($this->get_setting($name)===false)
  251.         {
  252.             return $this->db->query("INSERT INTO settings (name, value) VALUES ('$name', '$value')");
  253.         }else
  254.         {
  255.             return $this->db->query("UPDATE settings SET value='$value' WHERE name='$name'");
  256.         }
  257.     }
  258.  
  259.     function delete_setting($name)
  260.     {
  261.         return $this->db->query("DELETE FROM settings WHERE name='$name'");
  262.     }
  263. }
  264.  
  265. /////////////////////////////////////////////////////////////////////////////////
  266. /////////////////////       Group-Office initialisation        //////////////////
  267. /////////////////////////////////////////////////////////////////////////////////
  268.  
  269.  
  270. //load configuration
  271. $GO_CONFIG = new GO_CONFIG();
  272.  
  273. //setting session save path is required for some server configuration
  274. session_save_path($GO_CONFIG->tmpdir);
  275.  
  276. //start session
  277. session_start();
  278.  
  279. require($GO_CONFIG->class_path.'modules.class.inc');
  280. require($GO_CONFIG->class_path.'security.class.inc');
  281. require($GO_CONFIG->class_path.'controls.class.inc');
  282. require($GO_CONFIG->root_path.'functions.inc');
  283. require($GO_CONFIG->class_path.'crypto.class.inc');
  284. $GO_CRYPTO = new GO_CRYPTO();
  285.  
  286. //load language management class
  287. require($GO_CONFIG->class_path."language.class.inc");
  288. $GO_LANGUAGE = new GO_LANGUAGE();
  289. if (isset($_REQUEST['SET_SESSION_LANGUAGE']))
  290. {
  291.     $GO_LANGUAGE->set_session_language($_REQUEST['SET_SESSION_LANGUAGE']);
  292. }
  293. require($GO_LANGUAGE->get_language_file('common'));
  294.  
  295. //load theme
  296. require($GO_CONFIG->class_path.'theme.class.inc');
  297. $GO_THEME = new GO_THEME();
  298.  
  299. //load base classes
  300. $GO_MODULES = new GO_MODULES();
  301. $GO_SECURITY = new GO_SECURITY();
  302.  
  303. define('GO_LOADED', true);
  304. ?>
  305.