source: branches/2.4/expressoMail1_2/index.php @ 7228

Revision 7228, 29.3 KB checked in by douglas, 7 years ago (diff)

Ticket #0000 - Copiadas as alterações do Trunk. Versão final da 2.4.2.

  • Property svn:eol-style set to native
  • Property svn:executable set to *
Line 
1<?php
2                /***************************************************************************
3                * Expresso Livre                                                           *
4                * http://www.expressolivre.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        $GLOBALS['phpgw_info']['flags'] = array(
13                'noheader' => False,
14                'nonavbar' => false,
15                'currentapp' => 'expressoMail1_2',
16                'enable_nextmatchs_class' => True
17        );
18       
19        require_once('../header.inc.php');
20        $update_version = $GLOBALS['phpgw_info']['apps']['expressoMail1_2']['version'];
21        $_SESSION['phpgw_info']['expressomail']['user'] = $GLOBALS['phpgw_info']['user'];
22        echo "<script type='text/javascript'>var template = '".$_SESSION['phpgw_info']['expressoMail1_2']['user']['preferences']['common']['template_set']."';</script>";
23        echo "<script src='js/modal/modal.js'></script>";
24        //jquery and Editor
25        echo '
26                <link rel="stylesheet" type="text/css" href="templates/default/main.css"></link>
27               
28                <link rel="stylesheet" type="text/css" href="../phpgwapi/js/dftree/dftree.css"></link>
29               
30                <link rel="stylesheet" type="text/css" href="../prototype/plugins/jquery.spinner/jquery.spinner.css"></link>
31                <link rel="stylesheet" type="text/css" href="../prototype/plugins/fullcalendar/fullcalendar.css"></link>
32                <link rel="stylesheet" type="text/css" href="../prototype/plugins/fullcalendar/fullcalendar.print.css"></link>
33                <link rel="stylesheet" type="text/css" href="../prototype/plugins/icalendar/jquery.icalendar.css"></link>
34               
35                <script type="text/javascript" src="../prototype/plugins/jquery/jquery.min.js"></script>
36                <link href="../prototype/modules/filters/filters.css" rel="stylesheet" type="text/css">
37               
38                <script type="text/javascript" src="../prototype/plugins/jquery/jquery-ui.min.js"></script>
39                <script src="../prototype/plugins/json2/json2.js" language="javascript"></script>
40                <script src="../prototype/plugins/ejs/ejs.js" language="javascript"></script>
41                <script src="../prototype/plugins/store/jquery.store.js" language="javascript"></script>
42                <script src="../prototype/plugins/farbtastic/farbtastic.js" language="javascript"></script>
43                <script src="../prototype/api/datalayer.js" language="javascript"></script>                                     
44                <script src="../prototype/api/rest.js" language="javascript"></script>                                 
45                <script type="text/javascript" src="../prototype/plugins/scrollto/jquery.scrollTo.js"></script>
46                <script language="javascript">
47                        DataLayer.dispatchPath = "../prototype/";
48                        REST.dispatchPath = "../prototype/";
49                        REST.load("");
50                </script>                                       
51                <script src="../library/ckeditor/ckeditor.js" language="javascript" charset="utf-8"></script>
52                <script src="../library/ckeditor/adapters/jquery.js" language="javascript"></script>
53                <script src="../prototype/plugins/lazy/jquery.lazy.js" language="javascript"></script>
54               
55                <link rel="Stylesheet" type="text/css" href="../prototype/plugins/jquery/jquery-ui.css" />                                     
56               
57                <link rel="stylesheet" type="text/css" href="../prototype/plugins/contextmenu/jquery.contextMenu.css"></link>
58                <link rel="stylesheet" type="text/css" href="../prototype/plugins/zebradialog/css/zebra_dialog.css"></link>             
59               
60                <link rel="stylesheet" href="../prototype/plugins/farbtastic/farbtastic.css" type="text/css" > 
61                <link rel="stylesheet" href="../prototype/plugins/fileupload/jquery.fileupload-ui.css" type="text/css" >       
62               
63                <script type="text/javascript" src="../prototype/plugins/zebradialog/javascript/zebra_dialog.js"></script>
64                <script type="text/javascript" src="../prototype/plugins/datejs/date-pt-BR.js"></script>
65                <script type="text/javascript" src="../prototype/plugins/datejs/sugarpak.js"></script>
66                <script type="text/javascript" src="../prototype/plugins/datejs/parser.js"></script>
67                <script type="text/javascript" src="../prototype/plugins/jq-raty/js/jquery.raty.min.js"></script>
68
69                <script type="text/javascript" src="../prototype/plugins/watermark/jquery.watermarkinput.js"></script>
70                <script type="text/javascript" src="../prototype/plugins/mask/jquery.maskedinput.js"></script>
71                <script type="text/javascript" src="../prototype/plugins/alphanumeric/jquery.alphanumeric.js"></script>
72                <script type="text/javascript" src="../prototype/plugins/fileupload/jquery.fileupload.js"></script>
73                <script type="text/javascript" src="../prototype/plugins/fileupload/jquery.iframe-transport.js"></script>
74               
75                <script type="text/javascript" src="../prototype/plugins/qtip/jquery.qtip-1.0.0-rc3.min.js"></script>
76                <script type="text/javascript" src="../prototype/plugins/contextmenu/jquery.contextMenu.js"></script>
77                <!-- <script type="text/javascript" src="../prototype/plugins/contextmenu/jquery.ui.position.js"></script> -->
78
79                <script type="text/javascript" src="../prototype/modules/calendar/js/timezone.js"></script>
80                <script type="text/javascript" src="../prototype/plugins/dateFormat/dateFormat.js"></script>
81                <script type="text/javascript" src="../prototype/modules/calendar/js/calendar.date.js"></script>
82                <script type="text/javascript" src="../prototype/modules/calendar/js/desktop.notification.js"></script>
83                <script type="text/javascript" src="../prototype/modules/calendar/js/calendar.codecs.js"></script>
84                <script type="text/javascript" src="../prototype/modules/calendar/js/calendar.alarms.js"></script>
85                <script type="text/javascript" src="../prototype/modules/calendar/js/helpers.js"></script>
86                <link rel="stylesheet" type="text/css" href="../prototype/plugins/freeow/style/freeow/freeow.css" >
87                <script type="text/javascript" src="../prototype/plugins/freeow/jquery.freeow.min.js"></script>
88                <script type="text/javascript" src="../prototype/plugins/freeow/jquery.freeow.js"></script>
89
90
91                <script src="js/rich_text_editor.js" type="text/javascript"></script>
92                <script src="js/base64.js" type="text/javascript"></script>
93               
94                <script type="text/javascript">
95                    User.moduleName = "expressoMail1_2";
96                </script>
97
98
99                ';
100        //---------------------------//
101
102        echo "<script src='js/globals.js?".$update_version."' type='text/javascript'></script>";
103        echo "<script src='js/sniff_browser.js?".$update_version."' type='text/javascript'></script>";
104        echo "<script src='js/QuickCatalogSearch.js' type='text/javascript'></script>";
105        //echo "<style type='text/css'>@import url(../phpgwapi/js/jscalendar/calendar-win2k-1.css);</style>";
106        //echo "<script src='../phpgwapi/js/jscalendar/calendar.js?".$update_version."' type='text/javascript'></script>";
107        //echo "<script src='../phpgwapi/js/jscalendar/calendar-setup.js?".$update_version."' type='text/javascript'></script>";
108        //echo "<script src='../phpgwapi/js/jscalendar/lang/calendar-br.js?".$update_version."' type='text/javascript'></script>";
109        echo '<script type="text/javascript" src="../phpgwapi/js/wz_dragdrop/wz_dragdrop.js?'.$update_version.'"></script>
110                <script type="text/javascript" src="../phpgwapi/js/dJSWin/dJSWin.js?'.$update_version.'"></script>
111                <script type="text/javascript" src="../phpgwapi/js/x_tools/xtools.js?'.$update_version.'"></script>';           
112
113        echo ' 
114                <script type="text/javascript" src="../prototype/plugins/treeview/jquery.treeview.js"></script>
115                <script type="text/javascript" src="../prototype/plugins/treeview/lib/jquery.cookie.js"></script>
116                <script type="text/javascript" src="../prototype/plugins/block/jquery.blockUI.js"></script>
117                <script type="text/javascript" src="../prototype/plugins/scrollto/jquery.scrollTo.js"></script>
118
119                <link rel="stylesheet" href="../prototype/plugins/treeview/jquery.treeview.css" type="text/css" media="screen" />
120               
121                <script src="../prototype/plugins/jqgrid/js/i18n/grid.locale-pt-br.js" type="text/javascript"></script>
122                <script src="../prototype/plugins/jqgrid/js/jquery.jqGrid.min.js" type="text/javascript"></script>
123                <script src="../prototype/modules/mail/js/foldertree.js" type="text/javascript"></script>
124               
125                <link rel="stylesheet" href="../prototype/plugins/jqgrid/css/ui.jqgrid.css" type="text/css" /> 
126                <link rel="stylesheet" href="../prototype/plugins/jqgrid/themes/prognusone/jquery-ui-1.8.2.custom.css" type="text/css" />       
127
128                <script src="../prototype/plugins/countdown/jquery.countdown.min.js" type="text/javascript"></script>
129                <script src="../prototype/plugins/countdown/jquery.countdown-pt-BR.js" type="text/javascript"></script>         
130               
131                <script src="../prototype/modules/mail/js/label.js" type="text/javascript"></script>   
132                <script src="../prototype/modules/mail/js/followupflag.js" type="text/javascript"></script>
133               
134                <link rel="stylesheet" href="../prototype/modules/mail/css/followupflag.css" type="text/css" />
135                <link rel="stylesheet" href="../prototype/modules/attach_message/attach_message.css" type="text/css" />
136                <!-- <link rel="stylesheet" href="../prototype/modules/mail/css/label.css" type="text/css" /> -->';     
137       
138        /*
139         * TODO: implementar o controle como preferência do usuário
140         *
141         */
142        $jcarousel = false;
143        if ($jcarousel) {
144                //jcarousel
145                echo "\n".'<link rel="stylesheet" type="text/css" href="../library/jcarousel/skins/default/skin.css" />';
146                echo "\n".'<script src="../library/jcarousel/lib/jquery.jcarousel.min.js" type="text/javascript"></script>';
147
148                //fancybox
149                echo "\n".'<link rel="stylesheet" type="text/css" href="../library/fancybox/jquery.fancybox-1.3.4.css" />';             
150                echo "\n".'<script src="../library/fancybox/jquery.fancybox-1.3.4.pack.js" type="text/javascript"></script>';
151        }
152
153        echo "<div id='overlay' style='background-color: #AAAAAAA; opacity: .50; filter:Alpha(Opacity=50); height: 100%; width: 100%; position: absolute; top: 0; left: 0; visibility: hidden; z-index: 30000000000000000000000'></div>";
154
155       
156        //Enable/Disable VoIP Service -> Voip Server Config
157        $voip_enabled = false;
158        $voip_groups = array();
159        if($GLOBALS['phpgw_info']['server']['voip_groups']) {
160                $emailVoip = false;
161                foreach(explode(",",$GLOBALS['phpgw_info']['server']['voip_groups']) as $i => $voip_group){
162                        $a_voip = explode(";",$voip_group);                     
163                        $voip_groups[] = $a_voip[1];
164                }
165                foreach($GLOBALS['phpgw']->accounts->membership() as $idx => $group){                   
166                        if(array_search($group['account_name'],$voip_groups) !== FALSE){                 
167                                $voip_enabled = true;
168                                $emailVoip = $GLOBALS['phpgw_info']['server']['voip_email_redirect'];
169                                break;
170                        }
171                }
172        }
173
174        //Local messages
175        $_SESSION['phpgw_info']['server']['expressomail']['enable_local_messages'] = $current_config['enable_local_messages'];
176
177        // Get Data from ldap_manager and emailadmin.
178        $ldap_manager = CreateObject('contactcenter.bo_ldap_manager');
179        $boemailadmin   = CreateObject('emailadmin.bo');
180        $emailadmin_profile = $boemailadmin->getProfileList();
181    // Loading Admin Config Module
182    $c = CreateObject('phpgwapi.config','expressoMail1_2');
183    $c->read_repository();
184    $current_config = $c->config_data;
185   
186    // Loading Config Module
187    $conf = CreateObject('phpgwapi.config','phpgwapi');
188    $conf->read_repository();
189    $config = $conf->config_data;   
190
191    //Carrega Configuração global do expressoMail
192        $_SESSION['phpgw_info']['expresso']['expressoMail'] =  $current_config;
193   
194        $_SESSION['phpgw_info']['expressomail']['email_server'] = $boemailadmin->getProfile($emailadmin_profile[0]['profileID']);
195        //$_SESSION['phpgw_info']['expressomail']['user'] = $GLOBALS['phpgw_info']['user'];
196        $_SESSION['phpgw_info']['expressomail']['server'] = $GLOBALS['phpgw_info']['server'];
197        $_SESSION['phpgw_info']['expressomail']['ldap_server'] = $ldap_manager ? $ldap_manager->srcs[1] : null;
198        $_SESSION['phpgw_info']['expressomail']['user']['email'] = $GLOBALS['phpgw']->preferences->values['email'];
199        $_SESSION['phpgw_info']['server']['temp_dir'] = $GLOBALS['phpgw_info']['server']['temp_dir'];
200       
201        $preferences = $GLOBALS['phpgw']->preferences->read();
202        $_SESSION['phpgw_info']['user']['preferences']['expressoMail']['gears_firefox_windows'] = $current_config['expressoMail_gears_firefox_windows'] ? $current_config['expressoMail_gears_firefox_windows'] : "";
203        $_SESSION['phpgw_info']['user']['preferences']['expressoMail']['gears_firefox_linux'] = $current_config['expressoMail_gears_firefox_linux'] ? $current_config['expressoMail_gears_firefox_linux'] : "";
204        $_SESSION['phpgw_info']['user']['preferences']['expressoMail']['gears_ie'] = $current_config['expressoMail_gears_ie'] ? $current_config['expressoMail_gears_ie'] : "";
205        $_SESSION['phpgw_info']['user']['preferences']['expressoMail'] = $preferences['enable_local_messages'];
206        $_SESSION['phpgw_info']['user']['preferences']['expressoMail'] = $preferences['expressoMail'];
207        $_SESSION['phpgw_info']['user']['preferences']['expressoMail']['voip_enabled'] = $voip_enabled;
208        $_SESSION['phpgw_info']['user']['preferences']['expressoMail']['voip_email_redirect'] = $emailVoip;
209        $_SESSION['phpgw_info']['user']['preferences']['expressoMail']['outoffice'] = $GLOBALS['phpgw_info']['user']['preferences']['expressoMail']['outoffice'];
210        $_SESSION['phpgw_info']['user']['preferences']['expressoMail']['telephone_number'] = $GLOBALS['phpgw_info']['user']['telephonenumber'];
211        $_SESSION['phpgw_info']['user']['preferences']['expressoMail']['use_cache'] = $current_config['expressoMail_enable_cache'];
212        $_SESSION['phpgw_info']['user']['preferences']['expressoMail']['expressoMail_ldap_identifier_recipient'] = $current_config['expressoMail_ldap_identifier_recipient'];
213        $_SESSION['phpgw_info']['user']['preferences']['expressoMail']['use_x_origin'] = $current_config['expressoMail_use_x_origin'];
214        $_SESSION['phpgw_info']['user']['preferences']['expressoMail']['number_of_contacts'] = $current_config['expressoMail_Number_of_dynamic_contacts'] ? $current_config['expressoMail_Number_of_dynamic_contacts'] : "0";
215        $_SESSION['phpgw_info']['user']['preferences']['expressoMail']['notification_domains'] = $current_config['expressoMail_notification_domains'];
216        $_SESSION['phpgw_info']['user']['preferences']['expressoMail']['googlegears_url'] = $current_config['expressoMail_googlegears_url'];
217    $_SESSION['phpgw_info']['user']['preferences']['expressoMail']['use_assinar_criptografar'] = $GLOBALS['phpgw_info']['server']['use_assinar_criptografar'] ?  $GLOBALS['phpgw_info']['server']['use_assinar_criptografar'] : "0";
218    $_SESSION['phpgw_info']['user']['preferences']['expressoMail']['use_signature_digital_cripto'] = $GLOBALS['phpgw_info']['user']['preferences']['expressoMail']['use_signature_digital_cripto'] ? $GLOBALS['phpgw_info']['user']['preferences']['expressoMail']['use_signature_digital_cripto'] : "0";
219    $_SESSION['phpgw_info']['user']['preferences']['expressoMail']['use_signature_digital'] = $GLOBALS['phpgw_info']['user']['preferences']['expressoMail']['use_signature_digital'] ? $GLOBALS['phpgw_info']['user']['preferences']['expressoMail']['use_signature_digital'] : "0";
220    $_SESSION['phpgw_info']['user']['preferences']['expressoMail']['search_result_number'] = $GLOBALS['phpgw_info']['user']['preferences']['expressoMail']['search_result_number'] ? $GLOBALS['phpgw_info']['user']['preferences']['expressoMail']['search_result_number'] : "50";
221    $_SESSION['phpgw_info']['user']['preferences']['expressoMail']['search_characters_number'] = $GLOBALS['phpgw_info']['user']['preferences']['expressoMail']['search_characters_number'] ? $GLOBALS['phpgw_info']['user']['preferences']['expressoMail']['search_characters_number'] : "4";
222    $_SESSION['phpgw_info']['user']['preferences']['expressoMail']['num_max_certs_to_cipher'] = $GLOBALS['phpgw_info']['server']['num_max_certs_to_cipher'] ?  $GLOBALS['phpgw_info']['server']['num_max_certs_to_cipher'] : "10";
223    $_SESSION['phpgw_info']['user']['preferences']['expressoMail']['use_signature_cripto'] = $GLOBALS['phpgw_info']['user']['preferences']['expressoMail']['use_signature_cripto'] ? $GLOBALS['phpgw_info']['user']['preferences']['expressoMail']['use_signature_cripto'] : "0";
224        $_SESSION['phpgw_info']['user']['preferences']['expressoMail']['keep_after_auto_archiving'] = $GLOBALS['phpgw_info']['user']['preferences']['expressoMail']['keep_after_auto_archiving'] ? $GLOBALS['phpgw_info']['user']['preferences']['expressoMail']['keep_after_auto_archiving'] : "0";
225
226        $_SESSION['phpgw_info']['user']['preferences']['expressoMail']['max_attachment_size'] = $current_config['expressoMail_Max_attachment_size'] ? $current_config['expressoMail_Max_attachment_size']."M" : '';
227        $_SESSION['phpgw_info']['user']['preferences']['expressoMail']['max_msg_size'] = $GLOBALS['phpgw_info']['user']['preferences']['expressoMail']['max_msg_size'] ? $GLOBALS['phpgw_info']['user']['preferences']['expressoMail']['max_msg_size'] : "0";
228        $_SESSION['phpgw_info']['user']['preferences']['expressoMail']['imap_max_folders'] = $current_config['expressoMail_imap_max_folders'];
229        $_SESSION['phpgw_info']['user']['preferences']['expressoMail']['max_email_per_page'] = $GLOBALS['phpgw_info']['user']['preferences']['expressoMail']['max_email_per_page'] ? $GLOBALS['phpgw_info']['user']['preferences']['expressoMail']['max_email_per_page'] : "50";
230        $_SESSION['phpgw_info']['user']['preferences']['expressoMail']['extended_info'] = $GLOBALS['phpgw_info']['user']['preferences']['expressoMail']['extended_info']?$_SESSION['phpgw_info']['user']['preferences']['expressoMail']['extended_info'] = $GLOBALS['phpgw_info']['user']['preferences']['expressoMail']['extended_info']:'0';
231        $_SESSION['phpgw_info']['user']['preferences']['expressoMail']['from_to_sent'] = $GLOBALS['phpgw_info']['user']['preferences']['expressoMail']['from_to_sent'] ? $GLOBALS['phpgw_info']['user']['preferences']['expressoMail']['from_to_sent'] : "0";
232        $_SESSION['phpgw_info']['user']['preferences']['expressoMail']['auto_create_local'] = $GLOBALS['phpgw_info']['user']['preferences']['expressoMail']['auto_create_local'] ? $GLOBALS['phpgw_info']['user']['preferences']['expressoMail']['auto_create_local'] : "0";
233        $_SESSION['phpgw_info']['user']['preferences']['expressoMail']['return_recipient_deafault'] = $GLOBALS['phpgw_info']['user']['preferences']['expressoMail']['return_recipient_deafault'] ? $GLOBALS['phpgw_info']['user']['preferences']['expressoMail']['return_recipient_deafault'] : "0";
234        $_SESSION['phpgw_info']['user']['preferences']['expressoMail']['quick_search_default'] = $GLOBALS['phpgw_info']['user']['preferences']['expressoMail']['quick_search_default'] ? $GLOBALS['phpgw_info']['user']['preferences']['expressoMail']['quick_search_default'] : 1;
235        $_SESSION['phpgw_info']['user']['preferences']['expressoMail']['confirm_read_message'] = $GLOBALS['phpgw_info']['user']['preferences']['expressoMail']['confirm_read_message'] ? $GLOBALS['phpgw_info']['user']['preferences']['expressoMail']['confirm_read_message'] : 0;
236        //      ACL for block edit Personal Data.
237        $_SESSION['phpgw_info']['user']['preferences']['expressoMail']['enable_quickadd_telephonenumber'] = $current_config['expressoMail_enable_quickadd_telephonenumber'] == 'true' ? $current_config['expressoMail_enable_quickadd_telephonenumber'] : "";
238        if($_SESSION['phpgw_info']['user']['preferences']['expressoMail']['enable_quickadd_telephonenumber']){
239                $_SESSION['phpgw_info']['user']['preferences']['expressoMail']['blockpersonaldata'] = $GLOBALS['phpgw']->acl->check('blockpersonaldata',1,'preferences');               
240        }
241
242        $_SESSION['phpgw_info']['user']['preferences']['expressoMail']['auto_close_first_tab'] = $GLOBALS['phpgw_info']['user']['preferences']['expressoMail']['auto_close_first_tab'] ? $GLOBALS['phpgw_info']['user']['preferences']['expressoMail']['auto_close_first_tab'] : "0";
243       
244        $template = CreateObject('phpgwapi.Template',PHPGW_APP_TPL);
245        $template->set_var("txt_loading",lang("Loading"));
246        $template->set_var("txt_clear_trash",lang("message(s) deleted from your trash folder."));
247    $template->set_var("new_message", lang("New Message"));
248        $template->set_var("lang_inbox", lang("Inbox"));
249    $template->set_var("refresh", lang("Refresh"));
250    $template->set_var("tools", lang("Tools"));
251        $template->set_var("lang_Open_Search_Window", lang("Open search window") . '...');
252        $template->set_var("lang_search_user", lang("Search user") . '...');
253        $template->set_var("upload_max_filesize",ini_get('upload_max_filesize'));
254        $template->set_var("msg_folder",$_GET['msgball']['folder']);
255        $template->set_var("msg_number",$_GET['msgball']['msgnum'] ? $_GET['msgball']['msgnum'] : $_GET['to']);
256        $template->set_var("user_email",$_SESSION['phpgw_info']['expressomail']['user']['email']);
257        include_once dirname(__FILE__) . '/../header.inc.php';
258        require_once dirname(__FILE__) . '/../services/class.servicelocator.php';
259        $alternativeMailService = ServiceLocator::getService('ldap');
260        $AlternateEmailExpresso = Array();
261        $AlternateEmailExpresso = $alternativeMailService->getMailAlternateByUidNumber($_SESSION['phpgw_info']['expressomail']['user']['account_id']);
262        $template->set_var("user_email_alternative", implode(",", $AlternateEmailExpresso));   
263        $acc = CreateObject('phpgwapi.accounts');
264        $template->set_var("user_organization", $acc->get_organization($GLOBALS['phpgw_info']['user']['account_dn']));
265        $template->set_var("cyrus_delimiter",$_SESSION['phpgw_info']['expressomail']['email_server']['imapDelimiter']);
266        $template->set_var("lang_contact_details", lang("Contact Details"));
267        $template->set_var("lang_catalog", lang("catalog"));
268        $template->set_var("lang_search", lang("search"));
269        $template->set_var("lang_page", lang("page"));
270        $template->set_var("lang_quick_search_users_dialog_title", lang("Quick Search Contacts"));
271        $template->set_var("lang_global_catalog", lang("Global Catalog"));
272        $template->set_var("lang_personal_catalog", lang("Personal Catalog"));
273        $template->set_var("lang_all_catalogs", lang("All Catalogs"));
274        // Fix problem with cyrus delimiter changes in preferences.
275        // Dots in names: enabled/disabled.
276        $save_in_folder = @preg_replace('/INBOX\//i', "INBOX".$_SESSION['phpgw_info']['expressomail']['email_server']['imapDelimiter'], $_SESSION['phpgw_info']['user']['preferences']['expressoMail']['save_in_folder']);
277        $save_in_folder = @preg_replace('/INBOX./i', "INBOX".$_SESSION['phpgw_info']['expressomail']['email_server']['imapDelimiter'], $save_in_folder);
278        $_SESSION['phpgw_info']['user']['preferences']['expressoMail']['save_in_folder'] = $save_in_folder;
279        // End Fix.
280
281        $template->set_file(Array('expressoMail' => 'index.tpl'));
282        $template->set_block('expressoMail','list');
283        $template->pfp('out','list');
284        $GLOBALS['phpgw']->common->phpgw_footer();
285   
286    $_SESSION['phpgw_info']['server']['expressomail']['expressoMail_enable_log_messages'] = $current_config['expressoMail_enable_log_messages'];
287       
288    // Begin Set Anti-Spam options.
289    $_SESSION['phpgw_info']['server']['expressomail']['expressoMail_command_for_ham'] = $current_config['expressoMail_command_for_ham'];
290    $_SESSION['phpgw_info']['server']['expressomail']['expressoMail_command_for_spam'] = $current_config['expressoMail_command_for_spam'];
291    $_SESSION['phpgw_info']['server']['expressomail']['expressoMail_use_spam_filter'] = $current_config['expressoMail_use_spam_filter'];   
292    echo '<script> var use_spam_filter = \''.$current_config['expressoMail_use_spam_filter'].'\'
293           var sieve_forward_domains = \''.$current_config['expressoMail_sieve_forward_domains'].'\'
294                  </script>';
295        // End Set Anti-Spam options.
296
297        // Begin Set Hidden Copy options.
298        $_SESSION['phpgw_info']['server']['expressomail']['allow_hidden_copy'] = $current_config['allow_hidden_copy'];
299        echo '<script> var allow_hidden_copy = \''.$current_config['allow_hidden_copy'].'\' </script>';
300        // End Set Hidden Copy options.
301       
302    // Set Imap Folder names options
303    $_SESSION['phpgw_info']['expressomail']['email_server']['imapDefaultTrashFolder']   = $_SESSION['phpgw_info']['expressomail']['email_server']['imapDefaultTrashFolder']     ? $_SESSION['phpgw_info']['expressomail']['email_server']['imapDefaultTrashFolder']             : lang("Trash");
304    $_SESSION['phpgw_info']['expressomail']['email_server']['imapDefaultDraftsFolder']  = $_SESSION['phpgw_info']['expressomail']['email_server']['imapDefaultDraftsFolder'] ? $_SESSION['phpgw_info']['expressomail']['email_server']['imapDefaultDraftsFolder']       : lang("Drafts");
305    $_SESSION['phpgw_info']['expressomail']['email_server']['imapDefaultSpamFolder']    = $_SESSION['phpgw_info']['expressomail']['email_server']['imapDefaultSpamFolder']      ? $_SESSION['phpgw_info']['expressomail']['email_server']['imapDefaultSpamFolder']              : lang("Spam");
306    $_SESSION['phpgw_info']['expressomail']['email_server']['imapDefaultSentFolder']    = $_SESSION['phpgw_info']['expressomail']['email_server']['imapDefaultSentFolder']      ? $_SESSION['phpgw_info']['expressomail']['email_server']['imapDefaultSentFolder']              : lang("Sent");
307
308    // gera paramero com tokens suportados ....
309    $var_tokens = '';
310    for($ii = 1; $ii < 11; $ii++)
311    {
312        if($GLOBALS['phpgw_info']['server']['test_token' . $ii . '1'])
313            $var_tokens .= $GLOBALS['phpgw_info']['server']['test_token' . $ii . '1'] . ',';
314    }
315
316    if(!$var_tokens)
317    {
318        $var_tokens = 'ePass2000Lx;/usr/lib/libepsng_p11.so,ePass2000Win;c:/windows/system32/ngp11v211.dll';
319    }
320
321    echo '
322        <script> var special_folders = new Array(4);
323                special_folders[\'Trash\'] = "'.$_SESSION['phpgw_info']['expressomail']['email_server']['imapDefaultTrashFolder'].'";
324                special_folders[\'Drafts\'] = "'.$_SESSION['phpgw_info']['expressomail']['email_server']['imapDefaultDraftsFolder'].'";
325                special_folders[\'Spam\'] = "'.$_SESSION['phpgw_info']['expressomail']['email_server']['imapDefaultSpamFolder'].'";
326                special_folders[\'Sent\'] = "'.$_SESSION['phpgw_info']['expressomail']['email_server']['imapDefaultSentFolder'].'";
327                var trashfolder = "'.$_SESSION['phpgw_info']['expressomail']['email_server']['imapDefaultTrashFolder'].'";
328                var draftsfolder = "'.$_SESSION['phpgw_info']['expressomail']['email_server']['imapDefaultDraftsFolder'].'";
329                var sentfolder = "'.$_SESSION['phpgw_info']['expressomail']['email_server']['imapDefaultSentFolder'].'";
330                var spamfolder = "'.$_SESSION['phpgw_info']['expressomail']['email_server']['imapDefaultSpamFolder'].'";
331                var token_param = "'.$var_tokens.'";
332                var locale = "'.$GLOBALS['phpgw']->common->getPreferredLanguage().'";
333                var defaultCalendar = "'.  (isset($config['defaultCalendar']) ?  $config['defaultCalendar']  :  "calendar" )    .'";
334                $("#sideboxdragarea").hide();
335                $("#menu2Container").hide();
336    </script>
337        <script type="text/javascript" src="../prototype/plugins/timepicker/jquery-ui-timepicker-addon.js"></script>
338        <script type="text/javascript" src="../prototype/plugins/timepicker/localization/jquery-ui-timepicker-pt-BR.js"></script>
339        <script type="text/javascript" src="../prototype/plugins/jquery/i18n/jquery.ui.datepicker-pt-BR.js"></script>
340        <link rel="Stylesheet" type="text/css" href="../prototype/plugins/timepicker/jquery-ui-timepicker-addon.css" />
341        <link rel="stylesheet" type="text/css" href="../prototype/modules/calendar/css/layout.css" />
342        <!--<link rel="stylesheet" type="text/css" href="../prototype/modules/calendar/css/style.css" /> -->
343        <script type="text/javascript" src="../prototype/modules/filters/filters.js"></script>
344       
345        ';
346       
347
348    // End Set Imap Folder names options
349        //User info
350        echo "<script language='javascript'> var account_id = ".$GLOBALS['phpgw_info']['user']['account_id'].";var expresso_offline = false;</script>";
351
352        $obj = createobject("expressoMail1_2.functions");
353
354        // setting timezone preference
355        $zones = $obj->getTimezones();
356        $_SESSION['phpgw_info']['user']['preferences']['expressoMail']['timezone'] = $GLOBALS['phpgw_info']['user']['preferences']['expressoMail']['timezone'] ? $GLOBALS['phpgw_info']['user']['preferences']['expressoMail']['timezone'] : sprintf("%s", array_search("America/Sao_Paulo", $zones));
357
358        // este arquivo deve ser carregado antes que
359        // os demais pois nele contem a função get_lang
360        // que é utilizada em diversas partes
361        echo $obj -> getFilesJs("js/common_functions.js",$update_version);
362        include("inc/load_lang.php");
363
364    // INCLUDE these JS Files:
365        if ($_SESSION['phpgw_info']['user']['preferences']['expressoMail']['use_local_messages'])
366                echo "<script src='js/gears_init.js?".$update_version."'></script>";
367        echo '<script src="../phpgwapi/js/dftree/dftree.js?'.$update_version.'"></script>';
368   
369        $scripts = "js/abas.js," .
370                                "js/main.js," .
371                                "js/draw_api.js,";
372       
373        if ($GLOBALS['phpgw_info']['user']['preferences']['expressoMail']['use_shortcuts'])
374        {
375                //echo $obj -> getFilesJs("js/shortcut.js", $update_version);
376                $scripts .= "js/shortcut.js,";
377        }
378                               
379        if($_SESSION['phpgw_info']['user']['preferences']['expressoMail']['use_local_messages'])
380                $scripts .= "js/local_messages.js,";
381        $scripts .= "js/messages_controller.js," .
382                                "js/DropDownContacts.js," .
383                                "js/doiMenuData.js," .
384                                "js/connector.js";             
385        echo $obj -> getFilesJs($scripts, $update_version);
386        echo '
387                <script type="text/javascript">
388                        init();
389                </script>
390                <script type="text/javascript">connector.updateVersion = "'.$update_version.'";</script>';
391
392
393
394        // Get Preferences or redirect to preferences page.
395        $GLOBALS['phpgw']->preferences->read_repository();
396        //print_r($_SESSION['phpgw_info']['user']['preferences']['expressoMail']);
397        unset($_SESSION['phpgw_info']['expressomail']['user']['preferences']);
398        unset($_SESSION['phpgw_info']['expressomail']['user']['acl']);
399        unset($_SESSION['phpgw_info']['expressomail']['user']['apps']);
400        unset($_SESSION['phpgw_info']['expressomail']['server']['global_denied_users']);
401        unset($_SESSION['phpgw_info']['expressomail']['server']['global_denied_groups']);
402?>
403<!-----Expresso Mail - Version Updated:<?=$update_version?>-------->
Note: See TracBrowser for help on using the repository browser.