source: sandbox/2.4-expresso-api/home.php @ 5888

Revision 5888, 5.2 KB checked in by cristiano, 12 years ago (diff)

Ticket #2598 - implementação base REST + oauth

  • Property svn:eol-style set to native
  • Property svn:executable set to *
Line 
1<?php
2        /**************************************************************************\
3        * eGroupWare                                                               *
4        * http://www.egroupware.org                                                *
5        * The file written by Joseph Engo <jengo@phpgroupware.org>                 *
6        * This file modified by Greg Haygood <shrykedude@bellsouth.net>            *
7        * --------------------------------------------                             *
8        *  This program is free software; you can redistribute it and/or modify it *
9        *  under the terms of the GNU General Public License as published by the   *
10        *  Free Software Foundation; either version 2 of the License, or (at your  *
11        *  option) any later version.                                              *
12        \**************************************************************************/
13        $phpgw_info = array();
14        $current_url = substr($_SERVER["SCRIPT_NAME"], 0, strpos($_SERVER["SCRIPT_NAME"],'home.php'));
15
16        if (!is_file('header.inc.php'))
17        {
18                Header('Location: '.$current_url.'setup/index.php');
19                exit;
20        }
21
22        $GLOBALS['sessionid'] = @$_GET['sessionid'] ? $_GET['sessionid'] : @$_COOKIE['sessionid'];
23        if (!isset($GLOBALS['sessionid']) || !$GLOBALS['sessionid'])
24        {
25                Header('Location: '.$current_url.'login.php?cd=10');
26                exit;
27        }
28
29        $GLOBALS['phpgw_info']['flags'] = array(
30                'noheader'                => True,
31                'nonavbar'                => True,
32                'currentapp'              => 'home',
33                'enable_network_class'    => True,
34                'enable_contacts_class'   => True,
35                'enable_nextmatchs_class' => True
36        );
37        include('header.inc.php');
38       
39        //detect browser
40        require_once('phpgwapi/inc/class.browser.inc.php');
41       
42        $ifMobile       = false;
43        $browser        = new browser();
44       
45       
46        switch( $browser->get_platform() )
47        {
48                case browser::PLATFORM_IPHONE:
49                case browser::PLATFORM_IPOD:
50                case browser::PLATFORM_IPAD:
51                case browser::PLATFORM_BLACKBERRY:
52                case browser::PLATFORM_ANDROID:                                         
53                        $ifMobile = false;
54                        break;                 
55        }
56       
57        if( $ifMobile )
58        {
59                if( $_GET['dont_redirect_if_moble'] != 1 )
60                {
61                        $GLOBALS['phpgw']->redirect('/mobile/index.php');
62                        exit;                   
63                }
64        }
65       
66       
67        $GLOBALS['phpgw_info']['flags']['app_header']=lang('home');
68
69        // Commented by alpeb: The following prevented anonymous users to get a home page. Perhaps it was done with anonymous users such as the ones
70        // used by  wiki and sitemgr in mind. However, if you mark a normal user as anonymous just to avoid being shown in sessions and access log (like you would for an admin that doesn't want to be noticed), the user won't be able to login anymore. That's why I commented the code.
71        /*if ($GLOBALS['phpgw']->session->session_flags == 'A')
72        {
73                if ($_SERVER['HTTP_REFERER'] && strstr($_SERVER['HTTP_REFERER'],'home.php') === False)
74                {
75                        $GLOBALS['phpgw']->redirect($_SERVER['HTTP_REFERER']);
76                }
77                else
78                {
79                        // redirect to the login-page, better then giving an empty page
80                        $GLOBALS['phpgw']->redirect('login.php');
81                }
82                exit;
83        }*/
84
85        if ($GLOBALS['phpgw_info']['server']['force_default_app'] && $GLOBALS['phpgw_info']['server']['force_default_app'] != 'user_choice')
86        {
87                $GLOBALS['phpgw_info']['user']['preferences']['common']['default_app'] = $GLOBALS['phpgw_info']['server']['force_default_app'];
88        }
89
90        if ($_GET['cd']=='yes' && $GLOBALS['phpgw_info']['user']['preferences']['common']['default_app'] &&
91                $GLOBALS['phpgw_info']['user']['apps'][$GLOBALS['phpgw_info']['user']['preferences']['common']['default_app']])
92        {
93                $GLOBALS['phpgw']->redirect($GLOBALS['phpgw']->link('/' . $GLOBALS['phpgw_info']['user']['preferences']['common']['default_app'] . '/' . 'index.php'));
94        }
95        else
96        {
97                $GLOBALS['phpgw']->common->phpgw_header();
98                echo parse_navbar();
99        }
100
101//Inicio       
102        echo '
103            <link rel="Stylesheet" type="text/css" href="prototype/plugins/jquery/jquery-ui.css" />                                     
104   
105            <script type="text/javascript" src="prototype/plugins/jquery/jquery.min.js"></script>
106       
107            <script type="text/javascript" src="prototype/plugins/jquery/jquery-ui.min.js"></script>
108            <script type="text/javascript" src="prototype/plugins/jquery/jquery-ui.custom.min.js"></script>
109            <script src="prototype/plugins/json2/json2.js" language="javascript"></script>
110            <script src="prototype/plugins/ejs/ejs.js" language="javascript"></script>
111            <script src="prototype/plugins/store/jquery.store.js" language="javascript"></script>
112           
113            <script src="prototype/api/datalayer.js" language="javascript"></script>   
114           
115            <script type="text/javascript" src="prototype/plugins/datejs/date-pt-BR.js"></script>
116            <script type="text/javascript" src="prototype/plugins/datejs/sugarpak.js"></script>
117            <script type="text/javascript" src="prototype/plugins/datejs/parser.js"></script>
118
119            <script type="text/javascript" src="prototype/plugins/countdown/jquery.countdown.min.js"></script>
120            <script type="text/javascript" src="prototype/plugins/countdown/jquery.countdown-pt-BR.js"></script>
121           
122            <script type="text/javascript" src="prototype/modules/home/js/home.js"></script>
123            <link rel="Stylesheet" type="text/css" href="prototype/modules/home/css/home.css" />       
124        ';
125
126        echo'
127            <tr>
128                <td>
129                    <div class="portlets" style="width: 100%;"></div>
130                <td>
131            </tr>';
132
133//Fim   
134        $GLOBALS['phpgw']->common->phpgw_footer();
135?>
Note: See TracBrowser for help on using the repository browser.