phpgroupware-cvs
[Top][All Lists]
Advanced

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

[Phpgroupware-cvs] CVS: phpgwapi/inc functions.inc.php,1.133,1.134 foote


From: Mark A Peters <address@hidden>
Subject: [Phpgroupware-cvs] CVS: phpgwapi/inc functions.inc.php,1.133,1.134 footer.inc.php,1.17,1.18 class.setup_translation.inc.php,1.2,1.3 class.setup_html.inc.php,1.5,1.6 class.setup_detection.inc.php,1.3,1.4 class.setup.inc.php,1.12,1.13 class.sessions_php4.inc.php,1.7,1.8 class.sessions_db.inc.php,1.4,1.5 class.nextmatchs.inc.php,1.49,1.50 class.common.inc.php,1.132,1.133
Date: Mon, 29 Apr 2002 23:35:54 -0400

Update of /cvsroot/phpgroupware/phpgwapi/inc
In directory subversions:/tmp/cvs-serv4230

Modified Files:
        functions.inc.php footer.inc.php 
        class.setup_translation.inc.php class.setup_html.inc.php 
        class.setup_detection.inc.php class.setup.inc.php 
        class.sessions_php4.inc.php class.sessions_db.inc.php 
        class.nextmatchs.inc.php class.common.inc.php 
Log Message:
More utilization of the get_var() function.  Also, added a define() of the 
menuaction.  This will cut down on repetitive calls to get_var for the same 
variable.

Index: functions.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/phpgwapi/inc/functions.inc.php,v
retrieving revision 1.133
retrieving revision 1.134
diff -C2 -r1.133 -r1.134
*** functions.inc.php   26 Mar 2002 04:37:03 -0000      1.133
--- functions.inc.php   30 Apr 2002 03:35:52 -0000      1.134
***************
*** 105,110 ****
        unset ($default_domain); // we kill this for security reasons
  
!       $GLOBALS['login'] = @$GLOBALS['HTTP_POST_VARS']['login'];
!       $GLOBALS['logindomain'] = @$GLOBALS['HTTP_POST_VARS']['logindomain'];
  
        /* This code will handle virtdomains so that is a user logins with 
address@hidden, it will switch into virtualization mode. */
--- 105,110 ----
        unset ($default_domain); // we kill this for security reasons
  
!       $GLOBALS['login'] = get_var('login',Array('POST'));
!       $GLOBALS['logindomain'] = get_var('logindomain',Array('POST'));
  
        /* This code will handle virtdomains so that is a user logins with 
address@hidden, it will switch into virtualization mode. */
***************
*** 252,256 ****
        $GLOBALS['phpgw']->preferences  = CreateObject('phpgwapi.preferences');
        $GLOBALS['phpgw']->applications = CreateObject('phpgwapi.applications');
-       //      $GLOBALS['phpgw']->datetime = CreateObject('phpgwapi.datetime');
        print_debug('main class loaded', 'messageonly','api');
        if (! 
isset($GLOBALS['phpgw_info']['flags']['included_classes']['error']) ||
--- 252,255 ----
***************
*** 307,310 ****
--- 306,311 ----
                }
  
+               $GLOBALS['phpgw']->datetime = CreateObject('phpgwapi.datetime');
+ 
                /* A few hacker resistant constants that will be used throught 
the program */
                define('PHPGW_TEMPLATE_DIR', 
ExecMethod('phpgwapi.phpgw.common.get_tpl_dir', 'phpgwapi'));
***************
*** 327,330 ****
--- 328,334 ----
                */
  
+               /******* Define the GLOBALS['MENUACTION'] *******/
+               define('MENUACTION',get_var('menuaction',Array('GET')));
+ 
                /********* This sets the user variables *********/
                $GLOBALS['phpgw_info']['user']['private_dir'] = 
$GLOBALS['phpgw_info']['server']['files_dir']
***************
*** 451,455 ****
                
\*************************************************************************/
                /* Then the include file */
!               if (! preg_match ("/phpgwapi/i", PHPGW_APP_INC) && 
file_exists(PHPGW_APP_INC . '/functions.inc.php') && 
!isset($GLOBALS['HTTP_GET_VARS']['menuaction']))
                {
                        include(PHPGW_APP_INC . '/functions.inc.php');
--- 455,459 ----
                
\*************************************************************************/
                /* Then the include file */
!               if (! preg_match ("/phpgwapi/i", PHPGW_APP_INC) && 
file_exists(PHPGW_APP_INC . '/functions.inc.php') && !MENUACTION)
                {
                        include(PHPGW_APP_INC . '/functions.inc.php');
***************
*** 457,461 ****
                if (address@hidden'phpgw_info']['flags']['noheader'] && 
                        address@hidden'phpgw_info']['flags']['noappheader'] &&
!                       file_exists(PHPGW_APP_INC . '/header.inc.php') && 
!isset($GLOBALS['HTTP_GET_VARS']['menuaction']))
                {
                        include(PHPGW_APP_INC . '/header.inc.php');
--- 461,465 ----
                if (address@hidden'phpgw_info']['flags']['noheader'] && 
                        address@hidden'phpgw_info']['flags']['noappheader'] &&
!                       file_exists(PHPGW_APP_INC . '/header.inc.php') && 
!MENUACTION)
                {
                        include(PHPGW_APP_INC . '/header.inc.php');

Index: footer.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/phpgwapi/inc/footer.inc.php,v
retrieving revision 1.17
retrieving revision 1.18
diff -C2 -r1.17 -r1.18
*** footer.inc.php      29 Sep 2001 01:31:29 -0000      1.17
--- footer.inc.php      30 Apr 2002 03:35:52 -0000      1.18
***************
*** 35,39 ****
        * Include the apps footer files if it exists                            
   *
        
\**************************************************************************/
!       if ((file_exists (PHPGW_APP_INC . '/footer.inc.php') || 
isset($GLOBALS['HTTP_GET_VARS']['menuaction'])) &&
                $GLOBALS['phpgw_info']['flags']['currentapp'] != 'home' &&
                $GLOBALS['phpgw_info']['flags']['currentapp'] != 'login' &&
--- 35,39 ----
        * Include the apps footer files if it exists                            
   *
        
\**************************************************************************/
!       if((file_exists (PHPGW_APP_INC . '/footer.inc.php') || MENUACTION)) &&
                $GLOBALS['phpgw_info']['flags']['currentapp'] != 'home' &&
                $GLOBALS['phpgw_info']['flags']['currentapp'] != 'login' &&
***************
*** 41,48 ****
                address@hidden'phpgw_info']['flags']['noappfooter'])
        {
!               if ($GLOBALS['HTTP_GET_VARS']['menuaction'])
                {
!                       list($app,$class,$method) = 
explode('.',$GLOBALS['HTTP_GET_VARS']['menuaction']);
!                       if (is_array($GLOBALS[$class]->public_functions) && 
$GLOBALS[$class]->public_functions['footer'])
                        {
  //                            eval("\$GLOBALS[$class]->footer();");
--- 41,48 ----
                address@hidden'phpgw_info']['flags']['noappfooter'])
        {
!               if(MENUACTION)
                {
!                       list($app,$class,$method) = explode('.',MENUACTION);
!                       if(is_array($GLOBALS[$class]->public_functions) && 
$GLOBALS[$class]->public_functions['footer'])
                        {
  //                            eval("\$GLOBALS[$class]->footer();");

Index: class.setup_translation.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/phpgwapi/inc/class.setup_translation.inc.php,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3
*** class.setup_translation.inc.php     8 Mar 2002 04:10:58 -0000       1.2
--- class.setup_translation.inc.php     30 Apr 2002 03:35:52 -0000      1.3
***************
*** 36,40 ****
                function setup_translation()
                {
!                       $ConfigLang = 
@$GLOBALS['HTTP_COOKIE_VARS']['ConfigLang'] ? 
@$GLOBALS['HTTP_COOKIE_VARS']['ConfigLang'] : 
@$GLOBALS['HTTP_POST_VARS']['ConfigLang'];
  
                        /* TODO */
--- 36,40 ----
                function setup_translation()
                {
!                       $ConfigLang = 
get_var('ConfigLang',Array('POST','COOKIE'));
  
                        /* TODO */

Index: class.setup_html.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/phpgwapi/inc/class.setup_html.inc.php,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -r1.5 -r1.6
*** class.setup_html.inc.php    29 Apr 2002 00:27:32 -0000      1.5
--- class.setup_html.inc.php    30 Apr 2002 03:35:52 -0000      1.6
***************
*** 27,38 ****
                        $var = Array();
  
!                       @reset($GLOBALS['HTTP_POST_VARS']['domains']);
!                       while(list($k,$v) = 
@each($GLOBALS['HTTP_POST_VARS']['domains']))
                        {
!                               
if(isset($GLOBALS['HTTP_POST_VARS']['deletedomain'][$v]))
                                {
                                        continue;
                                }
!                               $dom = $GLOBALS['HTTP_POST_VARS']["setting_$v"];
                                
$GLOBALS['header_template']->set_var('DB_DOMAIN',$v);
                                while(list($x,$y) = @each($dom))
--- 27,40 ----
                        $var = Array();
  
!                       $deletedomain = get_var('deletedomain',Array('POST'));
!                       $domains = get_var('domains',Array('POST'));
!                       @reset($domains);
!                       while($domains && list($k,$v) = @each($domains))
                        {
!                               if(isset($deletedomain[$v]))
                                {
                                        continue;
                                }
!                               $dom = get_var('setting_'.$v,Array('POST'));
                                
$GLOBALS['header_template']->set_var('DB_DOMAIN',$v);
                                while(list($x,$y) = @each($dom))
***************
*** 45,49 ****
                        $GLOBALS['header_template']->set_var('domain','');
  
!                       while(list($k,$v) = 
@each($GLOBALS['HTTP_POST_VARS']['setting']))
                        {
                                $var[strtoupper($k)] = $v;
--- 47,52 ----
                        $GLOBALS['header_template']->set_var('domain','');
  
!                       $setting = get_var('setting',Array('POST'));
!                       while($setting && list($k,$v) = @each($setting))
                        {
                                $var[strtoupper($k)] = $v;

Index: class.setup_detection.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/phpgwapi/inc/class.setup_detection.inc.php,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4
*** class.setup_detection.inc.php       13 Apr 2002 03:02:22 -0000      1.3
--- class.setup_detection.inc.php       30 Apr 2002 03:35:52 -0000      1.4
***************
*** 63,67 ****
                                        }
                                        /* This is to catch old setup installs 
that did not have phpgwapi listed as an app */
!                                       $tmp = 
$setup_info['phpgwapi']['version']; /* save the file version */
                                        
if(address@hidden'phpgwapi']['currentver'])
                                        {
--- 63,67 ----
                                        }
                                        /* This is to catch old setup installs 
that did not have phpgwapi listed as an app */
!                                       $tmp = 
@$setup_info['phpgwapi']['version']; /* save the file version */
                                        
if(address@hidden'phpgwapi']['currentver'])
                                        {

Index: class.setup.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/phpgwapi/inc/class.setup.inc.php,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -r1.12 -r1.13
*** class.setup.inc.php 17 Apr 2002 11:58:09 -0000      1.12
--- class.setup.inc.php 30 Apr 2002 03:35:52 -0000      1.13
***************
*** 50,54 ****
                        {
                                /* This is to fix the reading of this value 
immediately after the cookie was set on login */
!                               $GLOBALS['ConfigDomain'] = 
@$GLOBALS['HTTP_POST_VARS']['FormDomain'] ? 
@$GLOBALS['HTTP_POST_VARS']['FormDomain'] : 'default';
                        }
  
--- 50,54 ----
                        {
                                /* This is to fix the reading of this value 
immediately after the cookie was set on login */
!                               $GLOBALS['ConfigDomain'] = 
get_var('ConfigDomain',Array('DEFAULT','POST'),'default');
                        }
  

Index: class.sessions_php4.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/phpgwapi/inc/class.sessions_php4.inc.php,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -r1.7 -r1.8
*** class.sessions_php4.inc.php 16 Jan 2002 02:10:56 -0000      1.7
--- class.sessions_php4.inc.php 30 Apr 2002 03:35:52 -0000      1.8
***************
*** 54,59 ****
                function sessions()
                {
!                       $this->sessionid = 
(isset($GLOBALS['HTTP_GET_VARS']['sessionid'])?$GLOBALS['HTTP_GET_VARS']['sessionid']:(isset($GLOBALS['HTTP_COOKIE_VARS']['sessionid'])?$GLOBALS['HTTP_COOKIE_VARS']['sessionid']:''));
!                       $this->kp3       = 
(isset($GLOBALS['HTTP_GET_VARS']['kp3'])?$GLOBALS['HTTP_GET_VARS']['kp3']:(isset($GLOBALS['HTTP_COOKIE_VARS']['kp3'])?$GLOBALS['HTTP_COOKIE_VARS']['kp3']:''));
                        /* Create the crypto object */
                        $GLOBALS['phpgw']->crypto = 
CreateObject('phpgwapi.crypto');
--- 54,59 ----
                function sessions()
                {
!                       $this->sessionid = 
get_var('sessionid',Array('COOKIE','GET'));
!                       $this->kp3       = get_var('kp3',Array('COOKIE','GET'));
                        /* Create the crypto object */
                        $GLOBALS['phpgw']->crypto = 
CreateObject('phpgwapi.crypto');
***************
*** 114,119 ****
                        if(empty($sessionid) || !$sessionid)
                        {
!                               $sessionid = 
$GLOBALS['HTTP_GET_VARS']['sessionid'] ? $GLOBALS['HTTP_GET_VARS']['sessionid'] 
: $GLOBALS['HTTP_COOKIE_VARS']['sessionid'];
!                               $kp3       = $GLOBALS['HTTP_GET_VARS']['kp3']   
    ? $GLOBALS['HTTP_GET_VARS']['kp3']       : 
$GLOBALS['HTTP_COOKIE_VARS']['kp3'];
                        }
  
--- 114,119 ----
                        if(empty($sessionid) || !$sessionid)
                        {
!                               $sessionid = 
get_var('sessionid',Array('COOKIE','GET'));
!                               $kp3       = 
get_var('kp3',Array('COOKIE','GET'));
                        }
  
***************
*** 620,626 ****
                {
                        global $PHP_SELF;
!                       if (@isset($GLOBALS['HTTP_GET_VARS']['menuaction']))
                        {
!                               $action = 
$GLOBALS['HTTP_GET_VARS']['menuaction'];
                        }
                        else
--- 620,626 ----
                {
                        global $PHP_SELF;
!                       if(MENUACTION)
                        {
!                               $action = MENUACTION;
                        }
                        else
***************
*** 842,846 ****
                function link($url, $extravars = '')
                {
!                       $kp3 = $GLOBALS['HTTP_GET_VARS']['kp3'] ? 
$GLOBALS['HTTP_GET_VARS']['kp3'] : $GLOBALS['HTTP_COOKIE_VARS']['kp3'];
  
                        if (! $kp3)
--- 842,846 ----
                function link($url, $extravars = '')
                {
!                       $kp3 = get_var('kp3',Array('COOKIE','GET'));
  
                        if (! $kp3)

Index: class.sessions_db.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/phpgwapi/inc/class.sessions_db.inc.php,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -r1.4 -r1.5
*** class.sessions_db.inc.php   29 Apr 2002 00:29:12 -0000      1.4
--- class.sessions_db.inc.php   30 Apr 2002 03:35:52 -0000      1.5
***************
*** 626,632 ****
                {
                        global $PHP_SELF;
!                       if (@isset($GLOBALS['HTTP_GET_VARS']['menuaction']))
                        {
!                               $action = 
$GLOBALS['HTTP_GET_VARS']['menuaction'];
                        }
                        else
--- 626,632 ----
                {
                        global $PHP_SELF;
!                       if(MENUACTION)
                        {
!                               $action = MENUACTION;
                        }
                        else

Index: class.nextmatchs.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/phpgwapi/inc/class.nextmatchs.inc.php,v
retrieving revision 1.49
retrieving revision 1.50
diff -C2 -r1.49 -r1.50
*** class.nextmatchs.inc.php    27 Apr 2002 22:32:18 -0000      1.49
--- class.nextmatchs.inc.php    30 Apr 2002 03:35:52 -0000      1.50
***************
*** 62,68 ****
                        }
  
!                       if(isset($GLOBALS['HTTP_GET_VARS']['menuaction']))
                        {
!                               $this->action = 
$GLOBALS['HTTP_GET_VARS']['menuaction'];
                        }
                }
--- 62,68 ----
                        }
  
!                       if(MENUACTION)
                        {
!                               $this->action = MENUACTION;
                        }
                }
***************
*** 509,513 ****
                function searchby($search_obj)
                {
!                       $qfield = $GLOBALS['HTTP_POST_VARS']['qfield'] ? 
$GLOBALS['HTTP_POST_VARS']['qfield'] : $GLOBALS['HTTP_GET_VARS']['qfield'];
  
                        $str = '';
--- 509,513 ----
                function searchby($search_obj)
                {
!                       $qfield = get_var('qfield',Array('GET','POST'));
  
                        $str = '';
***************
*** 543,547 ****
                        else
                        {
!                               $filter = $GLOBALS['HTTP_POST_VARS']['filter'] 
? $GLOBALS['HTTP_POST_VARS']['filter'] : $GLOBALS['HTTP_GET_VARS']['filter'];
                        }
  
--- 543,547 ----
                        else
                        {
!                               $filter = get_var('filter',Array('GET','POST'));
                        }
  

Index: class.common.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/phpgwapi/inc/class.common.inc.php,v
retrieving revision 1.132
retrieving revision 1.133
diff -C2 -r1.132 -r1.133
*** class.common.inc.php        10 Apr 2002 18:29:28 -0000      1.132
--- class.common.inc.php        30 Apr 2002 03:35:52 -0000      1.133
***************
*** 688,697 ****
  
                        // Setting this for display of template choices in user 
preferences
!                       if ($GLOBALS['phpgw_info']['server']['template_set'] == 
'user_choice')
                        {
                                
$GLOBALS['phpgw_info']['server']['usrtplchoice'] = 'user_choice';
                        }
  
!                       if (($GLOBALS['phpgw_info']['server']['template_set'] 
== 'user_choice' ||
                                
!isset($GLOBALS['phpgw_info']['server']['template_set'])) &&
                                
isset($GLOBALS['phpgw_info']['user']['preferences']['common']['template_set']))
--- 688,697 ----
  
                        // Setting this for display of template choices in user 
preferences
!                       if (@$GLOBALS['phpgw_info']['server']['template_set'] 
== 'user_choice')
                        {
                                
$GLOBALS['phpgw_info']['server']['usrtplchoice'] = 'user_choice';
                        }
  
!                       if ((@$GLOBALS['phpgw_info']['server']['template_set'] 
== 'user_choice' ||
                                
!isset($GLOBALS['phpgw_info']['server']['template_set'])) &&
                                
isset($GLOBALS['phpgw_info']['user']['preferences']['common']['template_set']))
***************
*** 699,703 ****
                                
$GLOBALS['phpgw_info']['server']['template_set'] = 
$GLOBALS['phpgw_info']['user']['preferences']['common']['template_set'];
                        }
!                       elseif 
($GLOBALS['phpgw_info']['server']['template_set'] == 'user_choice' ||
                                
!isset($GLOBALS['phpgw_info']['server']['template_set']))
                        {
--- 699,703 ----
                                
$GLOBALS['phpgw_info']['server']['template_set'] = 
$GLOBALS['phpgw_info']['user']['preferences']['common']['template_set'];
                        }
!                       elseif 
(@$GLOBALS['phpgw_info']['server']['template_set'] == 'user_choice' ||
                                
!isset($GLOBALS['phpgw_info']['server']['template_set']))
                        {
***************
*** 1251,1261 ****
                function show_date($t = '', $format = '')
                {
!                       if (! $t)
                        {
!                               $t = time();
                        }
  
!                       $t = $t + ((60*60) * 
$GLOBALS['phpgw_info']['user']['preferences']['common']['tz_offset']);
! 
                        if (! $format)
                        {
--- 1251,1266 ----
                function show_date($t = '', $format = '')
                {
!                       if (!$t)
                        {
!                               if(!is_object($GLOBALS['phpgw']->datetime))
!                               {
!                                       $GLOBALS['phpgw']->datetime = 
createobject('phpgwapi.datetime');
!                               }
!                               $t = $GLOBALS['phpgw']->datetime->gmtnow;
                        }
  
!                       //  + (date('I') == 1?3600:0)
!                       $t += (3600 * 
intval($GLOBALS['phpgw_info']['user']['preferences']['common']['tz_offset']));
!                       
                        if (! $format)
                        {




reply via email to

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