source: branches/2.2/mobile/index.php @ 3571

Revision 3571, 2.7 KB checked in by eduardoalex, 13 years ago (diff)

Ticket #1408 - Modificado o layout da tela de enviar email do expresso mini.

RevLine 
[454]1<?php
2        //TODO: Aplicar o conceito de subapp (mobileapp)
3
4        $phpgw_info = array();
5        $GLOBALS['sessionid'] = isset($_GET['sessionid']) ? $_GET['sessionid'] : @$_COOKIE['sessionid'];
[1851]6
7        $proxies=explode(',',$_SERVER['HTTP_X_FORWARDED_HOST']);
8        $fwConstruct = isset($_SERVER['HTTP_X_FORWARDED_HOST']) ? $proxies[0] : $_SERVER['HTTP_HOST'];
9
[454]10        if(!$GLOBALS['sessionid'])
[1851]11        {
12                //$location = 'Location: ' . $fwConstruct . 'login.php';
[3571]13    if ($_SERVER['HTTPS'] != 'on')
14    {
15        $aux = 'http://';
16    }
17    else
18    {
19                        $aux = 'https://';
20    }
[1851]21                Header('Location: ' . $aux . $fwConstruct . '/mobile/login.php');
[454]22                exit;
23        }
24
25        if ($GLOBALS['phpgw_info']['server']['use_https'] > 0)  {
26                if ($_SERVER['HTTPS'] != 'on') {
[1851]27                        Header('Location: https://' . $fwConstruct . '/' . $_SERVER['REQUEST_URI']);
[454]28                        exit;
29                }
30        }
31
32        /*
33                This is the menuaction driver for the multi-layered design
34        */
[623]35
[3571]36        if(isset($_REQUEST['menuaction']))
[454]37        {
[3571]38                list($mobileapp,$class,$method) = explode('.',@$_REQUEST['menuaction']);
[454]39                if(! $mobileapp || ! $class || ! $method)
40                {
41                        $invalid_data = True;
42                }
43        }
44        else
45        {
46                $mobileapp = 'home';
47                $invalid_data = True;
48        }
49
[1851]50
[454]51        $GLOBALS['phpgw_info']['flags'] = array(
52                'noheader'   => True,
53                'nonavbar'   => True,
54                'currentapp' => 'mobile',
55                'mobileapp'  => $mobileapp,
56        );
57
58        include('../header.inc.php');
59        include('./mobile_header.inc.php');
[1851]60
[454]61        if($mobileapp == 'home')
62        {
[623]63                start_prefered_app();
[454]64        }
[1851]65
[454]66        $GLOBALS[$class] = CreateObject(sprintf('%s.%s','mobile',$class));
67        $public_functions = $GLOBALS[$class]->public_functions;
68        if((is_array($GLOBALS[$class]->public_functions) && $GLOBALS[$class]->public_functions[$method]) && ! $invalid_data)
[1851]69        {
70                $GLOBALS['phpgw_info']['mobiletemplate'] = CreateObject("mobile.mobiletemplate");
71                $GLOBALS['phpgw_info']['mobiletemplate'] -> print_page($class,$method);
[454]72                unset($mobileapp);
73                unset($class);
74                unset($method);
75                unset($invalid_data);
[623]76
[454]77        }
78        else
79        {
80                if(!$mobileapp || !$class || !$method)
81                {
82                        if(@is_object($GLOBALS['phpgw']->log))
83                        {
84                                $GLOBALS['phpgw']->log->message(array(
85                                        'text' => 'W-BadmenuactionVariable, menuaction missing or corrupt: %1',
86                                        'p1'   => $menuaction,
87                                        'line' => __LINE__,
88                                        'file' => __FILE__
89                                ));
90                        }
91                }
92
93                if(!is_array($GLOBALS[$class]->public_functions) || ! $GLOBALS[$class]->public_functions[$method] && $method)
94                {
95                        if(@is_object($GLOBALS['phpgw']->log))
96                        {
97                                $GLOBALS['phpgw']->log->message(array(
98                                        'text' => 'W-BadmenuactionVariable, attempted to access private method: %1',
99                                        'p1'   => $method,
100                                        'line' => __LINE__,
101                                        'file' => __FILE__
102                                ));
103                        }
104                }
105                if(@is_object($GLOBALS['phpgw']->log))
106                {
107                        $GLOBALS['phpgw']->log->commit();
[1851]108                }
[623]109                start_prefered_app();
[454]110        }
111
112?>
Note: See TracBrowser for help on using the repository browser.