phpgroupware-cvs
[Top][All Lists]
Advanced

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

[Phpgroupware-cvs] [18392] Drop realpath(__FILE__) check, it is too slow


From: Dave Hall
Subject: [Phpgroupware-cvs] [18392] Drop realpath(__FILE__) check, it is too slow, it reduces portability but improves performace
Date: Sat, 26 Jan 2008 12:45:07 +0000

Revision: 18392
          
http://svn.sv.gnu.org/viewvc/?view=rev&root=phpgroupware&revision=18392
Author:   skwashd
Date:     2008-01-26 12:45:06 +0000 (Sat, 26 Jan 2008)

Log Message:
-----------
Drop realpath(__FILE__) check, it is too slow, it reduces portability but 
improves performace
Clean up manageheader.php code a little - including better handling of default 
values - I hope
Tweak admin css
cleanup header.inc.php.template docs and formatting
bump header version to for chnages
make it easier to read table list in phpgwapi/setup.inc.php

Modified Paths:
--------------
    trunk/phpgroupware/header.inc.php.template
    trunk/phpgwapi/inc/class.setup_html.inc.php
    trunk/phpgwapi/setup/setup.inc.php
    trunk/setup/manageheader.php
    trunk/setup/templates/base/head.tpl

Modified: trunk/phpgroupware/header.inc.php.template
===================================================================
--- trunk/phpgroupware/header.inc.php.template  2007-12-12 14:40:19 UTC (rev 
18391)
+++ trunk/phpgroupware/header.inc.php.template  2008-01-26 12:45:06 UTC (rev 
18392)
@@ -5,13 +5,28 @@
        * phpgroupware header
        * @author Dan Kuykendall <address@hidden>
        * @author Joseph Engo <address@hidden>
-       * @author Dave Hall skwash at phpgroupware.org
-       * @copyright Copyright (C) 2000-2006 Free Software Foundation, Inc. 
http://www.fsf.org/
+       * @author Dave Hall <address@hidden>
+       * @copyright Copyright (C) 2000-2008 Free Software Foundation, Inc. 
http://www.fsf.org/
        * @license http://www.gnu.org/licenses/gpl.html GNU General Public 
License
        * @package phpgroupware
        * @version $Id$
        */
 
+       /*
+          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 3 of the License, or
+          (at your option) any later version.
+
+          This program is distributed in the hope that it will be useful,
+          but WITHOUT ANY WARRANTY; without even the implied warranty of
+          MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+          GNU General Public License for more details.
+
+          You should have received a copy of the GNU General Public License
+          along with this program.  If not, see <http://www.gnu.org/licenses/>.
+        */
+
        // 
**************************************************************************
        // !!!!!!! EDIT THESE LINES !!!!!!!!
        // This setting allows you to easily move the include directory and the
@@ -22,7 +37,7 @@
        /**
        * Server root directory
        */
-       define('PHPGW_SERVER_ROOT', dirname(__FILE__) );
+       define('PHPGW_SERVER_ROOT', '{SERVER_ROOT}');
        
        /**
        * Include root directory - legacy support
@@ -36,6 +51,7 @@
                $flags = $GLOBALS['phpgw_info']['flags'];
        }
        unset($GLOBALS['phpgw_info']);
+
        /**
        * @global array $phpgw_info the phpgroupware information array
        */
@@ -43,7 +59,7 @@
        unset($flags);
 
        /**
-       * @global string 
$GLOBALS['phpgw_info']['server']['header_admin_password'] Setup administrator 
password
+       * @global string $phpgw_info['server']['header_admin_password'] Setup 
administrator password
        */
        $GLOBALS['phpgw_info']['server']['header_admin_password'] = 
'{HEADER_ADMIN_PASSWORD}';
 
@@ -51,7 +67,7 @@
        {domains}
 
        /**
-       * @global boolean 
$GLOBALS['phpgw_info']['server']['show_domain_selectbox']
+       * @global boolean $phpgw_info['server']['show_domain_selectbox']
        * If you want to have your domains in a select box, change to True
        * If not, users will have to login as address@hidden
        * Note: This is only for virtual domain support, default domain users 
can login only using
@@ -60,47 +76,45 @@
        $GLOBALS['phpgw_info']['server']['show_domain_selectbox'] = 
{DOMAIN_SELECTBOX};
 
        /**
-       * @global $GLOBALS['phpgw_info']['server']['domain_from_host']
+       * @global $phpgw_info['server']['domain_from_host']
        * As an alternative to the domain select box, set this option to True
        * to use the domain name from the browser provided hostname 
($_SERVER['HTTP_HOST'])
        */
        $GLOBALS['phpgw_info']['server']['domain_from_host'] = 
{DOMAIN_FROM_HOST};
 
        /**
-       * @global boolean $GLOBALS['phpgw_info']['server']['db_persistent']
+       * @global boolean $phpgw_info['server']['db_persistent']
        * Use persistent database connection
        */
        $GLOBALS['phpgw_info']['server']['db_persistent'] = {DB_PERSISTENT};
 
        /**
-       * @global string $GLOBALS['phpgw_info']['server']['sessions_type']
-       * phpGroupWare can handle session management using the database, but if
-       * you are using PHP4+ you can usually get better performance by having 
phpGroupWare
-       * use the session support built into PHP4. PHP3 users will have to use 
the database.
-       * Your choices are 'db' or 'php'
+       * @global string $phpgw_info['server']['sessions_type']
+       * phpGroupWare offers 2 session management systems - php and db
+       * Unless you really know what you are doing use php here as it works 
better 99.5% of the time
        */
-       $GLOBALS['phpgw_info']['server']['sessions_type'] = '{SESSIONS_TYPE}';
+       $phpgw_info['server']['sessions_type'] = '{SESSIONS_TYPE}';
 
        /**
-       * @global string $GLOBALS['phpgw_info']['login_template_set']
+       * @global string $phpgw_info['login_template_set']
        * Select which login template set you want, most people will use 
'simple'
        */
        $GLOBALS['phpgw_info']['login_template_set'] = 'simple';
 
        /**
-       * @global boolean $GLOBALS['phpgw_info']['server']['mcrypt_enabled']
+       * @global boolean $phpgw_info['server']['mcrypt_enabled']
        * This is used to control mcrypt's use 
        */
        $GLOBALS['phpgw_info']['server']['mcrypt_enabled'] = {ENABLE_MCRYPT};
 
        /**
-       * @global string $GLOBALS['phpgw_info']['server']['versions']['mcrypt']
+       * @global string $phpgw_info['server']['versions']['mcrypt']
        * Set this to 'old' for versions < 2.4, otherwise the exact mcrypt 
version you use. 
        */
        $GLOBALS['phpgw_info']['server']['versions']['mcrypt'] = 
'{MCRYPT_VERSION}';
 
        /**
-       * @global string $GLOBALS['phpgw_info']['server']['mcrypt_iv']
+       * @global string $phpgw_info['server']['mcrypt_iv']
        * This is a random string used as the initialization vector for mcrypt
        * feel free to change it when setting up phpgroupware on a clean 
database,
        * but you must not change it after that point!
@@ -108,12 +122,15 @@
        */
        $GLOBALS['phpgw_info']['server']['mcrypt_iv'] = '{MCRYPT_IV}';
 
-       // This one should fix the IE-problem recognizing charset.
+       /*
+               This ensures IE gets the right character set
+       */
        header("Content-Type: text/html;charset=utf-8");
 
        // If you want phpGroupWare to be cached by proxy servers, uncomment 
the following
        // This is NOT recommended, but phpGroupWare should still work fine.
-       if(!isset($GLOBALS['phpgw_info']['flags']['nocachecontrol']) || 
!$GLOBALS['phpgw_info']['flags']['nocachecontrol'] == True)
+       if(!isset($GLOBALS['phpgw_info']['flags']['nocachecontrol']) 
+               || !$GLOBALS['phpgw_info']['flags']['nocachecontrol'] == True)
        {
                header('Cache-Control: no-cache, must-revalidate');  // HTTP/1.1
                header('Pragma: no-cache');                          // HTTP/1.0
@@ -166,7 +183,7 @@
        $GLOBALS['phpgw_info']['server']['versions']['phpgwapi'] = 
$setup_info['phpgwapi']['version'];
 
        /**
-       * @global string 
$GLOBALS['phpgw_info']['server']['versions']['current_header']
+       * @global string $phpgw_info['server']['versions']['current_header']
        * Installed header version
        */
        $GLOBALS['phpgw_info']['server']['versions']['current_header'] = 
$setup_info['phpgwapi']['versions']['current_header'];
@@ -174,13 +191,12 @@
        unset($setup_info);
        
        /**
-       * @global string $GLOBALS['phpgw_info']['server']['versions']['header']
+       * @global string $phpgw_info['server']['versions']['header']
        * Version of this header file
        */
-       $GLOBALS['phpgw_info']['server']['versions']['header'] = '1.27';
+       $GLOBALS['phpgw_info']['server']['versions']['header'] = '1.28';
        
        
-       // This is a fix for NT
        if(!isset($GLOBALS['phpgw_info']['flags']['noapi']) || 
$GLOBALS['phpgw_info']['flags']['noapi'] != True)
        {
                /**
@@ -192,7 +208,8 @@
        // Leave off the final php closing tag, some editors will add
        // a \n or space after which will mess up cookies later on
 <!-- BEGIN domain -->
-       $GLOBALS['phpgw_domain']['{DB_DOMAIN}'] = array (
+       $GLOBALS['phpgw_domain']['{DB_DOMAIN}'] = array
+       (
                'db_host' => '{DB_HOST}', 
                'db_name' => '{DB_NAME}', 
                'db_user' => '{DB_USER}', 

Modified: trunk/phpgwapi/inc/class.setup_html.inc.php
===================================================================
--- trunk/phpgwapi/inc/class.setup_html.inc.php 2007-12-12 14:40:19 UTC (rev 
18391)
+++ trunk/phpgwapi/inc/class.setup_html.inc.php 2008-01-26 12:45:06 UTC (rev 
18392)
@@ -34,14 +34,15 @@
                        {
                                $domains = array();
                        }
+
+                       $settings = phpgw::get_var("settings", 'string', 
'POST');
                        foreach($domains as $k => $v)
                        {
                                if(isset($deletedomain[$k]))
                                {
                                        continue;
                                }
-                               //$dom = phpgw::get_var("setting_{$k}", 
'string', 'POST');
-                               $dom = $_POST['settings'][$k];
+                               $dom = $settings[$k];
                                
$GLOBALS['header_template']->set_var('DB_DOMAIN',$v);
                                foreach($dom as $x => $y)
                                {

Modified: trunk/phpgwapi/setup/setup.inc.php
===================================================================
--- trunk/phpgwapi/setup/setup.inc.php  2007-12-12 14:40:19 UTC (rev 18391)
+++ trunk/phpgwapi/setup/setup.inc.php  2008-01-26 12:45:06 UTC (rev 18392)
@@ -13,12 +13,53 @@
        $setup_info['phpgwapi']['name']      = 'phpgwapi';
        $setup_info['phpgwapi']['title']     = 'phpgwapi';
        $setup_info['phpgwapi']['version']   = '0.9.17.512';
-       $setup_info['phpgwapi']['versions']['current_header'] = '1.27';
+       $setup_info['phpgwapi']['versions']['current_header'] = '1.28';
        $setup_info['phpgwapi']['enable']    = 3;
        $setup_info['phpgwapi']['app_order'] = 1;
 
        // The tables this app creates
-       $setup_info['phpgwapi']['tables'] = 
array('phpgw_config','phpgw_applications','phpgw_acl','phpgw_acl_location','phpgw_accounts','phpgw_preferences','phpgw_sessions','phpgw_app_sessions','phpgw_access_log','phpgw_hooks','phpgw_languages','phpgw_lang','phpgw_nextid','phpgw_categories','phpgw_addressbook','phpgw_addressbook_extra','phpgw_log','phpgw_interserv','phpgw_vfs','phpgw_history_log','phpgw_async','phpgw_contact','phpgw_contact_person','phpgw_contact_org','phpgw_contact_org_person','phpgw_contact_addr','phpgw_contact_note','phpgw_contact_others','phpgw_contact_comm','phpgw_contact_comm_descr','phpgw_contact_comm_type','phpgw_contact_types','phpgw_contact_addr_type','phpgw_contact_note_type','phpgw_cust_attribute','phpgw_cust_choice','phpgw_cust_function','phpgw_mapping','phpgw_mail_handler');
+       $setup_info['phpgwapi']['tables'] = array
+       (
+               'phpgw_config',
+               'phpgw_applications',
+               'phpgw_acl',
+               'phpgw_acl_location',
+               'phpgw_accounts',
+               'phpgw_preferences',
+               'phpgw_sessions',
+               'phpgw_app_sessions',
+               'phpgw_access_log',
+               'phpgw_hooks',
+               'phpgw_languages',
+               'phpgw_lang',
+               'phpgw_nextid',
+               'phpgw_categories',
+               'phpgw_addressbook',
+               'phpgw_addressbook_extra',
+               'phpgw_log',
+               'phpgw_interserv',
+               'phpgw_vfs',
+               'phpgw_history_log',
+               'phpgw_async',
+               'phpgw_contact',
+               'phpgw_contact_person',
+               'phpgw_contact_org',
+               'phpgw_contact_org_person',
+               'phpgw_contact_addr',
+               'phpgw_contact_note',
+               'phpgw_contact_others',
+               'phpgw_contact_comm',
+               'phpgw_contact_comm_descr',
+               'phpgw_contact_comm_type',
+               'phpgw_contact_types',
+               'phpgw_contact_addr_type',
+               'phpgw_contact_note_type',
+               'phpgw_cust_attribute',
+               'phpgw_cust_choice',
+               'phpgw_cust_function',
+               'phpgw_mapping',
+               'phpgw_mail_handler'
+       );
 
        // Basic information about this app
        $setup_info['notifywindow']['name']             = 'notifywindow';

Modified: trunk/setup/manageheader.php
===================================================================
--- trunk/setup/manageheader.php        2007-12-12 14:40:19 UTC (rev 18391)
+++ trunk/setup/manageheader.php        2008-01-26 12:45:06 UTC (rev 18392)
@@ -9,14 +9,27 @@
        */
 
        $phpgw_info = array();
-       $GLOBALS['phpgw_info']['flags'] = array(
-               'nocachecontrol'        => True,
-               'noheader'              => True,
-               'nonavbar'              => True,
+       $GLOBALS['phpgw_info']['flags'] = array
+       (
+               'nocachecontrol'        => true,
+               'noheader'                      => true,
+               'nonavbar'                      => true,
                'currentapp'            => 'setup',
-               'noapi'                 => True
+               'noapi'                         => true
        );
        
+       // These are the system wide defaults, which will be overwritten below 
if the user has a valid config
+       // This is the best way to prevent notices - skwashd jan08
+       $GLOBALS['phpgw_info']['server']['server_root'] = realpath('../'); 
//'/path/to/phpgroupware';
+       $GLOBALS['phpgw_info']['server']['include_root'] = realpath('../');
+       $GLOBALS['phpgw_info']['server']['header_admin_password'] = '';
+       $GLOBALS['phpgw_info']['server']['sessions_type'] = 'php';
+       $GLOBALS['phpgw_info']['server']['db_persistent'] = false;
+       $GLOBALS['phpgw_info']['server']['mcrypt_enabled'] = 
extension_loaded('mcrypt');
+       $GLOBALS['phpgw_info']['server']['versions']['mcrypt'] = '';
+       $GLOBALS['phpgw_info']['server']['domain_from_host'] = false;
+       $GLOBALS['phpgw_info']['server']['show_domain_selectbox'] = false;
+       
        /**
         * Include setup functions
         */
@@ -33,36 +46,48 @@
        function check_form_values()
        {
                $errors = '';
-               $domains = phpgw::get_var('domains', 'string', 'POST');
-               if ( !is_array($domains) )
+
+               $settings = phpgw::get_var('settings', 'string', 'POST');
+               $deletedomain = phpgw::get_var('deletedomain', 'string', 
'POST', array());
+               $domains = phpgw::get_var('domains', 'string', 'POST', array());
+
+               foreach ( array_keys($domains) as $domain )
                {
-                       $domains = array();
-               }
-               reset($domains);
-               foreach($domains as $k => $v)
-               {
-                       $deletedomain = phpgw::get_var('deletedomain', 
'string', 'POST');
-                       if ( isset($deletedomain[$k]) )
+                       if ( isset($deletedomain[$domain]) )
                        {
                                continue;
                        }
                        
-                       if(!$_POST['settings'][$k]['config_pass'])
+                       if ( !$settings[$domain]['config_pass'] )
                        {
-                               $errors .= '<br />' . lang("You didn't enter a 
config password for domain %1",$v);
+                               $errors .= '<li>' . lang('You didn\'t enter a 
config password for domain %1', $domain) . '</li>';
                        }
+                       else if ( $settings[$domain]['config_pass'] == 
'changeme' )
+                       {
+                               $errors .= '<li>' . lang('You must set a real 
password for domain %1, \'changeme\' is the insecure default', $domain) . 
'</li>';
+                       }
                }
 
                $setting = phpgw::get_var('setting', 'string', 'POST');
-               if(!$setting['HEADER_ADMIN_PASSWORD'])
+               if ( !$setting['HEADER_ADMIN_PASSWORD'] )
                {
-                       $errors .= '<br />' . lang("You didn't enter a header 
admin password");
+                       $errors .= '<li>' . lang('You didn\'t enter a header 
admin password') . '</li>';
                }
 
                if($errors)
                {
                        
$GLOBALS['phpgw_setup']->html->show_header('Error',True);
-                       echo $errors;
+                       $lang_back = lang('go back');
+                       echo <<<HTML
+                               <h1>Whoops!</h1>
+                               <div class="err">
+                                       <ul>
+                                               $errors
+                                       </ul>
+                               </div>
+                               <a href="javascript:back();">$lang_back</a>
+
+HTML;
                        exit;
                }
        }
@@ -73,7 +98,8 @@
        // added these to let the app work, need to templatize still
        $tpl_root = $GLOBALS['phpgw_setup']->html->setup_tpl_dir('setup');
        $setup_tpl = CreateObject('phpgwapi.Template',$tpl_root);
-       $setup_tpl->set_file(array(
+       $setup_tpl->set_file(array
+       (
                'T_head' => 'head.tpl',
                'T_footer' => 'footer.tpl',
                'T_alert_msg' => 'msg_alert_msg.tpl',
@@ -150,17 +176,25 @@
                        check_form_values();
                        $header_template = 
CreateObject('phpgwapi.Template','../');
                        $GLOBALS['phpgw_setup']->html->show_header('Generated 
header.inc.php', False, 'header');
-                       echo '<br />' . lang('Save this text as contents of 
your header.inc.php') . '<br /><hr />';
-                       $newheader = 
$GLOBALS['phpgw_setup']->html->generate_header();
-                       echo '<pre>';
-                       echo htmlentities($newheader);
-                       echo '</pre><hr />';
-                       echo '<form action="index.php" method="post">';
-                       echo '<br />' . lang('After retrieving the file, put it 
into place as the header.inc.php.  Then, click "continue".') . '<br />';
-                       echo '<input type="hidden" name="FormLogout" 
value="header" />';
-                       echo '<input type="submit" name="junk" value="' . 
lang('Continue') . '" />';
-                       echo '</form>';
-                       echo '</body></html>';
+
+                       $newheader = 
htmlspecialchars($GLOBALS['phpgw_setup']->html->generate_header());
+                       $lang_intro = lang('Save this text as contents of your 
header.inc.php');
+                       $lang_text = lang('After retrieving the file, put it 
into place as the header.inc.php.  Then, click "continue".');
+                       $lang_continue = lang('continue');
+                       echo  <<<HTML
+                               <h1>{$lang_intro}</h1>
+                               <pre id="header_contents">
+$newheader
+                               </pre>
+                               <form action="index.php" method="post">
+                                       $lang_text<br>
+                                       <input type="hidden" name="FormLogout" 
value="header">
+                                       <input type="submit" name="junk" 
value="{$lang_continue}">
+                               </form>
+                       </body>
+               </html>
+
+HTML;
                        break;
                case 'write':
                        check_form_values();
@@ -202,9 +236,8 @@
                                die($detected);
                        }
                        
-                       $phpver = lang('<li>You appear to be using PHP 5.2+') . 
"</li>\n";
-                       $supported_sessions_type[] = 'db';
-                       $supported_sessions_type[] = 'php';
+                       $phpver = '<li>' . lang('You appear to be using PHP 
%1+', 5.2) . "</li>\n";
+                       $supported_sessions_type = array('php', 'db');
 
                        $detected .= '<table id="manageheader">' . "\n";
 
@@ -279,13 +312,21 @@
                        */
                        if(!count($supported_db))
                        {
-                               $detected .= '<li class="err"'
-                                       . lang('Did not find any valid DB 
support!')
-                                       . "</li>\n</ul>\n"
-                                       . lang('Try to configure your php to 
support one of the above mentioned DBMS, or install phpGroupWare by hand.')
-                                       . '</b><td></tr></table></body></html>';
+                               $lang_err_nodb = lang('Did not find any valid 
DB support!');
+                               $lang_fix_nodb = lang('Try to configure your 
php to support one of the above mentioned DBMS, or install phpGroupWare by 
hand.');
+                               $detected .= <<<HTML
+                                                               <li 
class="err">$lang_err_nodb</li>
+                                                       </ul>
+                                               </b>
+                                               $lang_fix_nodb
+                                       </td>
+                               </tr>
+                       </table>
+               </body>
+       </html>
+
+HTML;
                                die($detected);
-                               exit;
                        }
 
                        /*
@@ -331,7 +372,9 @@
                                }
                                else
                                {
-                                       
if(@$GLOBALS['phpgw_info']['server']['header_version'] != 
@$GLOBALS['phpgw_info']['server']['current_header_version'])
+                                       if ( 
!isset($GLOBALS['phpgw_info']['server']['header_version'])
+                                               || 
!isset($GLOBALS['phpgw_info']['server']['current_header_version'])
+                                               || 
$GLOBALS['phpgw_info']['server']['header_version'] != 
$GLOBALS['phpgw_info']['server']['current_header_version'] )
                                        {
                                                $detected .= '<li 
class="warn">' . lang("You're using an old header.inc.php version...") . 
"</li>\n";
                                                $detected .= '<li>' . 
lang('Importing old settings into the new format....') . "</li>\n";
@@ -367,47 +410,46 @@
                                                $selected = '';
                                                $dbtype_options = '';
                                                $found_dbtype = False;
-                                               @reset($supported_db);
-                                               while(list($k,$v) = 
@each($supported_db))
+                                               foreach ( $supported_db as $db )
                                                {
-                                                       if($v == 
$GLOBALS['phpgw_domain'][$key]['db_type'])
+                                                       if ( $db == 
$GLOBALS['phpgw_domain'][$key]['db_type'] )
                                                        {
-                                                               $selected = ' 
selected="selected" ';
+                                                               $selected = ' 
selected ';
                                                                $found_dbtype = 
true;
                                                        }
                                                        else
                                                        {
                                                                $selected = '';
                                                        }
-                                                       $dbtype_options .= 
'<option ' . $selected . 'value="' . $v . '">' . $v . "\n";
+                                                       $dbtype_options .= 
<<<HTML
+                                                               
<option{$selected}value="{$db}">$db</option>
+
+HTML;
                                                }
-                                               
$setup_tpl->set_var('dbtype_options',$dbtype_options);
+                                               
$setup_tpl->set_var('dbtype_options', $dbtype_options);
 
-                                               
$setup_tpl->parse('domains','domain',True);
+                                               
$setup_tpl->parse('domains','domain', true);
                                        }
                                        $setup_tpl->set_var('domain','');
                                }
+
                                if (defined('PHPGW_SERVER_ROOT'))
                                {
                                        
$GLOBALS['phpgw_info']['server']['server_root'] = PHPGW_SERVER_ROOT;
                                        
$GLOBALS['phpgw_info']['server']['include_root'] = PHPGW_INCLUDE_ROOT; 
                                }
-                               
elseif(address@hidden($GLOBALS['phpgw_info']['server']['include_root']) && 
@$GLOBALS['phpgw_info']['server']['header_version'] <= 1.6)
+                               else if ( 
!isset($GLOBALS['phpgw_info']['server']['include_root']) && 
$GLOBALS['phpgw_info']['server']['header_version'] <= 1.6)
                                {
-                                       
$GLOBALS['phpgw_info']['server']['include_root'] = 
@$GLOBALS['phpgw_info']['server']['server_root'];
+                                       
$GLOBALS['phpgw_info']['server']['include_root'] = 
$GLOBALS['phpgw_info']['server']['server_root'];
                                }
-                               
elseif(address@hidden($GLOBALS['phpgw_info']['server']['header_version']) && 
@$GLOBALS['phpgw_info']['server']['header_version'] <= 1.6)
+                               else if ( 
!isset($GLOBALS['phpgw_info']['server']['header_version']) && 
$GLOBALS['phpgw_info']['server']['header_version'] <= 1.6)
                                {
-                                       
$GLOBALS['phpgw_info']['server']['include_root'] = 
@$GLOBALS['phpgw_info']['server']['server_root'];
+                                       
$GLOBALS['phpgw_info']['server']['include_root'] = 
$GLOBALS['phpgw_info']['server']['server_root'];
                                }
                        }
                        else
                        {
                                $detected .= '<li class="warn">' . lang('Sample 
configuration not found. using built in defaults') . "</li>\n";
-                               $GLOBALS['phpgw_info']['server']['server_root'] 
= realpath('../'); //'/path/to/phpgroupware';
-                               
$GLOBALS['phpgw_info']['server']['include_root'] = 
realpath('../');//'/path/to/phpgroupware';
-                               /* This is the basic include needed on each 
page for phpGroupWare application compliance */
-                               
$GLOBALS['phpgw_info']['flags']['htmlcompliant'] = True;
 
                                /* These are the settings for the database 
system */
                                
$setup_tpl->set_var('lang_domain',lang('Domain'));
@@ -417,15 +459,18 @@
                                $setup_tpl->set_var('db_name','phpgroupware');
                                $setup_tpl->set_var('db_user','phpgroupware');
                                $setup_tpl->set_var('db_pass','your_password');
-                               $setup_tpl->set_var('db_type','mysql');
+                               $setup_tpl->set_var('db_type', 
$supported_db[0]);
                                $setup_tpl->set_var('config_pass','changeme');
 
                                $dbtype_options = '';
-                               foreach($supported_db as $k => $v)
+                               foreach ( $supported_db as $db )
                                {
-                                       $dbtype_options .= '<option value="' . 
$v . '">' . $v . "\n";
+                                       $dbtype_options .= <<<HTML
+                                               <option 
value="{$db}">{$db}</option>
+
+HTML;
                                }
-                               
$setup_tpl->set_var('dbtype_options',$dbtype_options);
+                               $setup_tpl->set_var('dbtype_options', 
$dbtype_options);
 
                                $setup_tpl->parse('domains','domain',True);
                                $setup_tpl->set_var('domain','');
@@ -433,11 +478,6 @@
                                $setup_tpl->set_var('comment_l','<!-- ');
                                $setup_tpl->set_var('comment_r',' -->');
 
-                               /* These are a few of the advanced settings */
-                               
$GLOBALS['phpgw_info']['server']['db_persistent'] = True;
-                               
$GLOBALS['phpgw_info']['server']['mcrypt_enabled'] = extension_loaded('mcrypt');
-                               
$GLOBALS['phpgw_info']['server']['versions']['mcrypt'] = '';
-
                                srand((double)microtime()*1000000);
                                $random_char = array(
                                        
'0','1','2','3','4','5','6','7','8','9','a','b','c','d','e','f',
@@ -467,11 +507,11 @@
                        $setup_tpl->set_var('detected',$detected);
                        /* End of detected settings, now display the form with 
the detected or prior values */
 
-                       
$setup_tpl->set_var('server_root',@$GLOBALS['phpgw_info']['server']['server_root']);
-                       
$setup_tpl->set_var('include_root',@$GLOBALS['phpgw_info']['server']['include_root']);
-                       
$setup_tpl->set_var('header_admin_password',@$GLOBALS['phpgw_info']['server']['header_admin_password']);
+                       $setup_tpl->set_var('server_root', 
$GLOBALS['phpgw_info']['server']['server_root']);
+                       $setup_tpl->set_var('include_root', 
$GLOBALS['phpgw_info']['server']['include_root']);
+                       $setup_tpl->set_var('header_admin_password', 
$GLOBALS['phpgw_info']['server']['header_admin_password']);
 
-                       if(@$GLOBALS['phpgw_info']['server']['db_persistent'])
+                       if ( $GLOBALS['phpgw_info']['server']['db_persistent'] )
                        {
                                $setup_tpl->set_var('db_persistent_yes',' 
selected');
                        }
@@ -482,21 +522,24 @@
 
                        $selected = '';
                        $session_options = '';
-                       while(list($k,$v) = each($supported_sessions_type))
+                       foreach ( $supported_sessions_type as $stype )
                        {
-                               if($v == 
@$GLOBALS['phpgw_info']['server']['sessions_type'])
+                               if( $stype == 
$GLOBALS['phpgw_info']['server']['sessions_type'])
                                {
-                                       $selected = ' selected="selected" ';
+                                       $selected = ' selected ';
                                }
                                else
                                {
                                        $selected = '';
                                }
-                               $session_options .= '<option ' . $selected . 
'value="' . $v . '">' . $v . "\n";
+                               $session_options .= <<<HTML
+                                       
<option{$selected}value="{$stype}">{$stype}</option>
+
+HTML;
                        }
                        $setup_tpl->set_var('session_options',$session_options);
 
-                       if(@$GLOBALS['phpgw_info']['server']['mcrypt_enabled'])
+                       if ( $GLOBALS['phpgw_info']['server']['mcrypt_enabled'] 
)
                        {
                                $setup_tpl->set_var('mcrypt_enabled_yes',' 
selected');
                        }
@@ -515,7 +558,7 @@
                        $setup_tpl->set_var('lang_setup_acl',lang('Limit access 
to setup to the following addresses or networks (e.g. 10.1.1,127.0.0.1)'));
                        $setup_tpl->set_var('setup_acl', 
$GLOBALS['phpgw_info']['server']['setup_acl']);
 
-                       
if(@$GLOBALS['phpgw_info']['server']['show_domain_selectbox'])
+                       if ( 
$GLOBALS['phpgw_info']['server']['show_domain_selectbox'] )
                        {
                                $setup_tpl->set_var('domain_selectbox_yes',' 
selected');
                        }
@@ -524,7 +567,7 @@
                                $setup_tpl->set_var('domain_selectbox_no',' 
selected');
                        }
 
-                       
if(@$GLOBALS['phpgw_info']['server']['domain_from_host'])
+                       if ( 
$GLOBALS['phpgw_info']['server']['domain_from_host'] )
                        {
                                $setup_tpl->set_var('domain_from_host_yes',' 
selected');
                        }

Modified: trunk/setup/templates/base/head.tpl
===================================================================
--- trunk/setup/templates/base/head.tpl 2007-12-12 14:40:19 UTC (rev 18391)
+++ trunk/setup/templates/base/head.tpl 2008-01-26 12:45:06 UTC (rev 18392)
@@ -95,6 +95,15 @@
                                padding: 3px;
                        }
 
+                       #header_contents
+                       {
+                               background-color: #ddd;
+                               border: 2px solid #999;
+                               margin: 1em auto;
+                               padding: 2em;
+                               width: 100em;
+                       }
+
                        .banner
                        {
                                background-color: #4865f1;
@@ -151,12 +160,12 @@
                                background-color: #d99;
                        }
 
-                       .row_err_gen_on, #analysis li.err
+                       .row_err_gen_on
                        {
                                background-color: #fcc;
                        }
 
-                       .row_err_gen_off
+                       .row_err_gen_off, .err
                        {
                                background-color: #fdd;
                        }
@@ -197,13 +206,14 @@
                                background-color: #ddf;
                        }
 
-                       #analysis li.err
+                       /* Extra qualifiers are used here to override 
definitions above */
+                       .err, #analysis li.err
                        {
-                               background-color: #fcc;
                                border: 1px solid #f00;
+                               color: #f00;
                        }
 
-                       #analysis li.warn
+                       .warn, #analysis li.warn
                        {
                                background-color: #ff8;
                                border-color: #fc0;






reply via email to

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