source: trunk/index.php @ 2656

Revision 2656, 3.4 KB checked in by rodsouza, 14 years ago (diff)

Ticket #1009 - Removendo redirecionamento de 'index.php' para 'home.php'.

  • Property svn:eol-style set to native
  • Property svn:executable set to *
Line 
1<?php
2        /**************************************************************************\
3        * phpGroupWare                                                             *
4        * http://www.phpgroupware.org                                              *
5        * --------------------------------------------                             *
6        *  This program is free software; you can redistribute it and/or modify it *
7        *  under the terms of the GNU General Public License as published by the   *
8        *  Free Software Foundation; either version 2 of the License, or (at your  *
9        *  option) any later version.                                              *
10        \**************************************************************************/
11
12
13        $phpgw_info = array();
14        if(!file_exists('header.inc.php'))
15        {
16                Header('Location: setup/index.php');
17                exit;
18        }
19
20        $GLOBALS['sessionid'] = isset($_GET['sessionid']) ? $_GET['sessionid'] : @$_COOKIE['sessionid'];
21        if(!$GLOBALS['sessionid'])
22        {
23                Header('Location: login.php'.
24                (isset($_SERVER['QUERY_STRING']) && !empty($_SERVER['QUERY_STRING']) ?
25                '?phpgw_forward='.urlencode('/index.php?'.$_SERVER['QUERY_STRING']):''));
26                exit;
27        }
28
29        /*
30                This is the menuaction driver for the multi-layered design
31        */
32        if(isset($_GET['menuaction']))
33        {
34                list($app,$class,$method) = explode('.',@$_GET['menuaction']);
35                if(! $app || ! $class || ! $method)
36                {
37                        $invalid_data = True;
38                }
39        }
40        else
41        {
42        //$phpgw->log->message('W-BadmenuactionVariable, menuaction missing or corrupt: %1',$menuaction);
43        //$phpgw->log->commit();
44
45                $app = 'home';
46                $invalid_data = True;
47        }
48
49        if($app == 'phpgwapi')
50        {
51                $app = 'home';
52                $api_requested = True;
53        }
54
55        $GLOBALS['phpgw_info']['flags'] = array(
56                'currentapp' => $app
57        );
58        include('./header.inc.php');
59
60        if (($GLOBALS['phpgw_info']['server']['use_https'] == 2) && ($_SERVER['HTTPS'] != 'on'))
61        {
62                Header('Location: https://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']);
63                exit;
64        }
65
66        if ( $app == 'home' && ! $api_requested )
67        {
68                echo '<script>XLink( "' . $GLOBALS[ 'phpgw' ] -> link( '/home.php' ) . '", true );</script>';
69                exit;
70        }
71
72        if($api_requested)
73        {
74                $app = 'phpgwapi';
75        }
76
77        $GLOBALS[$class] = CreateObject(sprintf('%s.%s',$app,$class));
78        if((is_array($GLOBALS[$class]->public_functions) && $GLOBALS[$class]->public_functions[$method]) && ! $invalid_data)
79        {
80                execmethod($_GET['menuaction']);
81                unset($app);
82                unset($class);
83                unset($method);
84                unset($invalid_data);
85                unset($api_requested);
86        }
87        else
88        {
89                if(!$app || !$class || !$method)
90                {
91                        if(@is_object($GLOBALS['phpgw']->log))
92                        {
93                                if($menuaction)
94                {                       
95                                        $GLOBALS['phpgw']->log->message(array(
96                                                'text' => "W-BadmenuactionVariable, menuaction missing or corrupt: $menuaction",
97                                                'p1'   => $menuaction,
98                                                'line' => __LINE__,
99                                                'file' => __FILE__
100                                        ));
101                }
102                        }
103                }
104
105                if(!is_array($GLOBALS[$class]->public_functions) || ! $$GLOBALS[$class]->public_functions[$method] && $method)
106                {
107                        if(@is_object($GLOBALS['phpgw']->log))
108                        {                               
109                                if($menuaction)
110                {                       
111                                        $GLOBALS['phpgw']->log->message(array(
112                                                'text' => "W-BadmenuactionVariable, attempted to access private method: $method",
113                                                'p1'   => $method,
114                                                'line' => __LINE__,
115                                                'file' => __FILE__
116                                        ));
117                }
118                        }
119                }
120                if(@is_object($GLOBALS['phpgw']->log))
121                {
122                        $GLOBALS['phpgw']->log->commit();
123                }
124
125                echo '<script>XLink( "' . $GLOBALS[ 'phpgw' ] -> link( '/home.php' ) . '", true );</script>';
126                exit;
127        }
128?>
Note: See TracBrowser for help on using the repository browser.