phpgroupware-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Phpgroupware-cvs] setup config.php


From: Dave Hall
Subject: [Phpgroupware-cvs] setup config.php
Date: Mon, 20 Feb 2006 12:57:57 +0000

CVSROOT:        /cvsroot/phpgroupware
Module name:    setup
Branch:         
Changes by:     Dave Hall <address@hidden>      06/02/20 12:57:57

Modified files:
        .              : config.php 

Log message:
        add some sane acct defauls and clean up a little as I go

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/phpgroupware/setup/config.php.diff?tr1=1.84&tr2=1.85&r1=text&r2=text

Patches:
Index: setup/config.php
diff -u setup/config.php:1.84 setup/config.php:1.85
--- setup/config.php:1.84       Sun Apr 17 13:18:24 2005
+++ setup/config.php    Mon Feb 20 12:57:57 2006
@@ -5,10 +5,16 @@
        * @copyright Copyright (C) 2000-2005 Free Software Foundation, Inc. 
http://www.fsf.org/
        * @license http://www.gnu.org/licenses/gpl.html GNU General Public 
License
        * @package setup
-       * @version $Id: config.php,v 1.84 2005/04/17 13:18:24 powerstat Exp $
+       * @version $Id: config.php,v 1.85 2006/02/20 12:57:57 skwashd Exp $
        */
 
-       $phpgw_info = array();
+       if ( isset($_POST['cancel']) && $_POST['cancel'] )
+       {
+               Header('Location: index.php');
+               exit;
+       }
+
+       $GLOBALS['phpgw_info'] = array();
        $GLOBALS['phpgw_info']['flags'] = array(
                'noheader' => True,
                'nonavbar' => True,
@@ -40,7 +46,7 @@
         */
        function in_docroot($path)
        {
-               $docroots = 
array(PHPGW_SERVER_ROOT,$GLOBALS['HTTP_SERVER_VARS']['DOCUMENT_ROOT']);
+               $docroots = array(PHPGW_SERVER_ROOT, $_SERVER['DOCUMENT_ROOT']);
                
                foreach ($docroots as $docroot)
                {
@@ -77,10 +83,14 @@
        // files-dir is not longer allowed in document root, for security 
reasons !!!
        $GLOBALS['current_config']['files_dir'] = '/outside/webserver/docroot';
 
-       if(@is_dir('/tmp'))
+       if( @is_dir('/tmp') )
        {
                $GLOBALS['current_config']['temp_dir'] = '/tmp';
        }
+       elseif( @is_dir('C:\\TEMP') )
+       {
+               $GLOBALS['current_config']['temp_dir'] = 'C:\\TEMP'; //be nice 
to windoze users too
+       }
        else
        {
                $GLOBALS['current_config']['temp_dir'] = '/path/to/temp/dir';
@@ -91,11 +101,16 @@
        unset($parts[count($parts)-1]); // setup
        $GLOBALS['current_config']['webserver_url'] = implode('/',$parts);
 
-       if(@get_var('cancel',Array('POST')))
-       {
-               Header('Location: index.php');
-               exit;
-       }
+       // Add some sane defaults for accounts
+       $GLOBALS['current_config']['account_min_id'] = 1000;
+       $GLOBALS['current_config']['account_max_id'] = 65535;
+       $GLOBALS['current_config']['group_min_id'] = 500;
+       $GLOBALS['current_config']['group_max_id'] = 999;
+       $GLOBALS['current_config']['ldap_account_home'] = '/noexistant';
+       $GLOBALS['current_config']['ldap_account_shell'] = '/bin/false';
+       $GLOBALS['current_config']['ldap_host'] = 'localhost';
+       
+       $GLOBALS['current_config']['encryptkey'] = md5(time() . 
$_SERVER['HTTP_HOST']); // random enough
 
        // Check api version, use correct table
        $setup_info = $GLOBALS['phpgw_setup']->detection->get_db_versions();
@@ -110,7 +125,7 @@
        }
 
        $newsettings = get_var('newsettings',Array('POST'));
-       $files_in_docroot = 
in_docroot($GLOBALS['HTTP_POST_VARS']['newsettings']['files_dir']);
+       $files_in_docroot = in_docroot($_POST['newsettings']['files_dir']);
        if(@get_var('submit',Array('POST')) && @$newsettings && 
!$files_in_docroot)
        {
                $datetime = CreateObject('phpgwapi.datetime');
@@ -128,7 +143,7 @@
                }
                unset($datetime);
 
-               print_debug('TZ_OFFSET',$newsettings['tz_offset']);
+               print_debug('TZ_OFFSET', $newsettings['tz_offset']);
 
                $GLOBALS['phpgw_setup']->db->transaction_begin();
                // This is only temp:
@@ -189,11 +204,11 @@
        }
        
        // are we here because of an error: files-dir in docroot
-       if (is_array($GLOBALS['HTTP_POST_VARS']['newsettings']) && 
$files_in_docroot)
+       if (is_array($_POST['newsettings']) && $files_in_docroot)
        {
-               echo '<p align="center"><font color="red"><b>'.lang('Path to 
user and group files HAS TO BE OUTSIDE of the webservers 
document-root!!!')."</b></font></p>\n";
+               echo '<p align="center" style="color: 
red;"><strong>'.lang('Path to user and group files HAS TO BE OUTSIDE of the 
webservers document-root!!!')."</strong></p>\n";
 
-               foreach($GLOBALS['HTTP_POST_VARS']['newsettings'] as $key => 
$val)
+               foreach($_POST['newsettings'] as $key => $val)
                {
                        $GLOBALS['current_config'][$key] = $val;
                }




reply via email to

[Prev in Thread] Current Thread [Next in Thread]