source: companies/serpro/index.php @ 903

Revision 903, 3.3 KB checked in by niltonneto, 15 years ago (diff)

Importacao inicial do Expresso do Serpro

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                /*if (($GLOBALS['phpgw_info']['server']['use_https'] == 2) && ($_SERVER['HTTPS'] != 'on'))
24                {
25                       
26                        Header('Location: https://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']);
27                        exit;
28                }
29                else
30                {*/
31                        Header('Location: login.php'.
32                        (isset($_SERVER['QUERY_STRING']) && !empty($_SERVER['QUERY_STRING']) ?
33                        '?phpgw_forward='.urlencode('/index.php?'.$_SERVER['QUERY_STRING']):''));
34                        exit;
35                //}
36        }
37
38        /*
39                This is the menuaction driver for the multi-layered design
40        */
41        if(isset($_GET['menuaction']))
42        {
43                list($app,$class,$method) = explode('.',@$_GET['menuaction']);
44                if(! $app || ! $class || ! $method)
45                {
46                        $invalid_data = True;
47                }
48        }
49        else
50        {
51        //$phpgw->log->message('W-BadmenuactionVariable, menuaction missing or corrupt: %1',$menuaction);
52        //$phpgw->log->commit();
53
54                $app = 'home';
55                $invalid_data = True;
56        }
57
58        if($app == 'phpgwapi')
59        {
60                $app = 'home';
61                $api_requested = True;
62        }
63
64        $GLOBALS['phpgw_info']['flags'] = array(
65                'noheader'   => True,
66                'nonavbar'   => True,
67                'currentapp' => $app
68        );
69        include('./header.inc.php');
70
71        if($app == 'home' && !$api_requested)
72        {
73                Header('Location: ' . $GLOBALS['phpgw']->link('/home.php'));
74        }
75
76        if($api_requested)
77        {
78                $app = 'phpgwapi';
79        }
80
81        $GLOBALS[$class] = CreateObject(sprintf('%s.%s',$app,$class));
82        if((is_array($GLOBALS[$class]->public_functions) && $GLOBALS[$class]->public_functions[$method]) && ! $invalid_data)
83        {
84                execmethod($_GET['menuaction']);
85                unset($app);
86                unset($class);
87                unset($method);
88                unset($invalid_data);
89                unset($api_requested);
90        }
91        else
92        {
93                if(!$app || !$class || !$method)
94                {
95                        if(@is_object($GLOBALS['phpgw']->log))
96                        {
97                                $GLOBALS['phpgw']->log->message(array(
98                                        'text' => 'W-BadmenuactionVariable, menuaction missing or corrupt: %1',
99                                        'p1'   => $menuaction,
100                                        'line' => __LINE__,
101                                        'file' => __FILE__
102                                ));
103                        }
104                }
105
106                if(!is_array($GLOBALS[$class]->public_functions) || ! $$GLOBALS[$class]->public_functions[$method] && $method)
107                {
108                        if(@is_object($GLOBALS['phpgw']->log))
109                        {
110                                $GLOBALS['phpgw']->log->message(array(
111                                        'text' => 'W-BadmenuactionVariable, attempted to access private method: %1',
112                                        'p1'   => $method,
113                                        'line' => __LINE__,
114                                        'file' => __FILE__
115                                ));
116                        }
117                }
118                if(@is_object($GLOBALS['phpgw']->log))
119                {
120                        $GLOBALS['phpgw']->log->commit();
121                }
122
123                $GLOBALS['phpgw']->redirect_link('/home.php');
124        }
125
126        /*if(!isset($GLOBALS['phpgw_info']['nofooter']))
127        {
128                $GLOBALS['phpgw']->common->phpgw_footer();
129        }*/
130?>
Note: See TracBrowser for help on using the repository browser.