source: trunk/expressoAdmin1_2/index.php @ 593

Revision 593, 3.4 KB checked in by niltonneto, 12 years ago (diff)

Código para ajudar na depuração e otimização do tempo de carregamento
dos módulos no Expresso.

  • Property svn:eol-style set to native
  • Property svn:executable set to *
Line 
1<?php
2        /*************************************************************************************\
3        * Expresso Administração                                                                                                     *
4        * by Joao Alfredo Knopik Junior (joao.alfredo@gmail.com, jakjr@celepar.pr.gov.br)        *
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        $debug = false;
12        $time_start = microtime(true);
13
14        $GLOBALS['phpgw_info'] = array();
15        $GLOBALS['phpgw_info']['flags']['currentapp'] = 'expressoAdmin1_2';
16        include('../header.inc.php');
17
18        $c = CreateObject('phpgwapi.config','expressoAdmin1_2');
19        $c->read_repository();
20       
21        $current_config = $c->config_data;
22        $ldap_manager = CreateObject('contactcenter.bo_ldap_manager');
23        $boemailadmin   = CreateObject('emailadmin.bo');
24        $emailadmin_profile = $boemailadmin->getProfileList();
25        $_SESSION['phpgw_info']['expresso']['email_server'] = $boemailadmin->getProfile($emailadmin_profile[0]['profileID']);
26        $_SESSION['phpgw_info']['expresso']['user'] = $GLOBALS['phpgw_info']['user'];
27        $_SESSION['phpgw_info']['expresso']['server'] = $GLOBALS['phpgw_info']['server'];
28        $_SESSION['phpgw_info']['expresso']['cc_ldap_server'] = $ldap_manager ? $ldap_manager->srcs[1] : null;
29        $_SESSION['phpgw_info']['expresso']['expressoAdmin'] = $current_config;
30        $_SESSION['phpgw_info']['expresso']['global_denied_users'] = $GLOBALS['phpgw_info']['server']['global_denied_users'];
31        $_SESSION['phpgw_info']['expresso']['global_denied_groups'] = $GLOBALS['phpgw_info']['server']['global_denied_groups'];
32       
33        $template = CreateObject('phpgwapi.Template',PHPGW_APP_TPL);
34        $template->set_file(Array('expressoAdmin' => 'index.tpl'));
35        $template->set_block('expressoAdmin','body');
36       
37        $var = Array(
38                'lang_user_accounts'    => lang('User Accounts'),
39                'lang_institutional_accounts'=> lang('Institutional Accounts'),
40                'lang_user_groups'              => lang('User Groups'),
41                'lang_email_lists'              => lang('Email Lists'),
42                'lang_computers'                => lang('Computers'),
43                'lang_organizations'    => lang('Organizations'),
44                'lang_sambadomains'             => lang('Samba Domains'),
45                'lang_sectors'                  => lang('Sectors'),
46                'lang_show_sessions'    => lang('Show Sessions'),
47                'display_samba_suport'  => $current_config['expressoAdmin_samba_support'] == 'true' ? '' : 'display:none',
48                'lang_logs'                             => lang('Logs')
49        );
50        $template->set_var($var);
51        $template->pfp('out','body');
52       
53        /* save lang and session */
54        if (empty($_SESSION['phpgw_info']['expressoAdmin']['lang']))
55        {
56                $_SESSION['phpgw_info']['expressoAdmin']['user']['preferences']['common']['lang'] = $GLOBALS['phpgw_info']['user']['preferences']['common']['lang'];
57                $fn = './setup/phpgw_'.$_SESSION['phpgw_info']['expressoAdmin']['user']['preferences']['common']['lang'].'.lang';
58                if (file_exists($fn))
59                {
60                        $fp = fopen($fn,'r');
61                        while ($data = fgets($fp,16000))
62                        {
63                                list($message_id,$app_name,$null,$content) = explode("\t",substr($data,0,-1));
64                                $_SESSION['phpgw_info']['expressoAdmin']['lang'][$message_id] = $content;
65                        }
66                        fclose($fp);
67                }
68        }
69
70        $GLOBALS['phpgw']->common->phpgw_footer();
71       
72        if($debug)
73                echo lang('Page was generated in %1 seconds',microtime(true) - $time_start);   
74?>
Note: See TracBrowser for help on using the repository browser.