1 | <?php |
---|
2 | |
---|
3 | $GLOBALS['phpgw_info']['flags'] = array( |
---|
4 | 'noheader' => False, |
---|
5 | 'nonavbar' => False, |
---|
6 | 'currentapp' => 'expressoMail1_2', |
---|
7 | 'enable_nextmatchs_class' => True |
---|
8 | ); |
---|
9 | |
---|
10 | require_once('../header.inc.php'); |
---|
11 | $update_version = $GLOBALS['phpgw_info']['apps']['expressoMail1_2']['version']; |
---|
12 | $_SESSION['phpgw_info']['expressomail']['user'] = $GLOBALS['phpgw_info']['user']; |
---|
13 | $GLOBALS['phpgw']->css->validate_file('expressoMail1_2/templates/' . $GLOBALS['phpgw_info']['server']['template_set'] . '/main.css'); |
---|
14 | $GLOBALS['phpgw']->css->validate_file('phpgwapi/js/dftree/dftree.css'); |
---|
15 | echo $GLOBALS['phpgw']->css->get_css(); |
---|
16 | echo "<script type='text/javascript'>var template = '".$_SESSION['phpgw_info']['expressoMail1_2']['user']['preferences']['common']['template_set']."';</script>"; |
---|
17 | echo "<script src='js/modal/modal.js'></script>"; |
---|
18 | echo "<script src='js/globals.js?".$update_version."' type='text/javascript'></script>"; |
---|
19 | echo "<script src='js/sniff_browser.js?".$update_version."' type='text/javascript'></script>"; |
---|
20 | echo "<style type='text/css'>@import url(../phpgwapi/js/jscalendar/calendar-win2k-1.css);</style>"; |
---|
21 | echo "<script src='../phpgwapi/js/jscalendar/calendar.js?".$update_version."' type='text/javascript'></script>"; |
---|
22 | echo "<script src='../phpgwapi/js/jscalendar/calendar-setup.js?".$update_version."' type='text/javascript'></script>"; |
---|
23 | echo "<script src='../phpgwapi/js/jscalendar/lang/calendar-br.js?".$update_version."' type='text/javascript'></script>"; |
---|
24 | echo '<script type="text/javascript" src="../phpgwapi/js/wz_dragdrop/wz_dragdrop.js?'.$update_version.'"></script> |
---|
25 | <script type="text/javascript" src="../phpgwapi/js/dJSWin/dJSWin.js?'.$update_version.'"></script>'; |
---|
26 | |
---|
27 | |
---|
28 | |
---|
29 | |
---|
30 | //Enable/Disable VoIP Service -> Voip Server Config |
---|
31 | $voip_enabled = false; |
---|
32 | $voip_groups = array(); |
---|
33 | if($GLOBALS['phpgw_info']['server']['voip_groups']) { |
---|
34 | $emailVoip = false; |
---|
35 | foreach(explode(",",$GLOBALS['phpgw_info']['server']['voip_groups']) as $i => $voip_group){ |
---|
36 | $a_voip = explode(";",$voip_group); |
---|
37 | $voip_groups[] = $a_voip[1]; |
---|
38 | } |
---|
39 | foreach($GLOBALS['phpgw']->accounts->membership() as $idx => $group){ |
---|
40 | if(array_search($group['account_name'],$voip_groups) !== FALSE){ |
---|
41 | $voip_enabled = true; |
---|
42 | $emailVoip = $GLOBALS['phpgw_info']['server']['voip_email_redirect']; |
---|
43 | break; |
---|
44 | } |
---|
45 | } |
---|
46 | } |
---|
47 | |
---|
48 | //Local messages |
---|
49 | $_SESSION['phpgw_info']['server']['expressomail']['enable_local_messages'] = $current_config['enable_local_messages']; |
---|
50 | |
---|
51 | // Get Data from ldap_manager and emailadmin. |
---|
52 | $ldap_manager = CreateObject('contactcenter.bo_ldap_manager'); |
---|
53 | $boemailadmin = CreateObject('emailadmin.bo'); |
---|
54 | $emailadmin_profile = $boemailadmin->getProfileList(); |
---|
55 | // Loading Admin Config Module |
---|
56 | $c = CreateObject('phpgwapi.config','expressoMail1_2'); |
---|
57 | $c->read_repository(); |
---|
58 | $current_config = $c->config_data; |
---|
59 | |
---|
60 | $_SESSION['phpgw_info']['expressomail']['email_server'] = $boemailadmin->getProfile($emailadmin_profile[0]['profileID']); |
---|
61 | // $_SESSION['phpgw_info']['expressomail']['user'] = $GLOBALS['phpgw_info']['user']; |
---|
62 | $_SESSION['phpgw_info']['expressomail']['server'] = $GLOBALS['phpgw_info']['server']; |
---|
63 | $_SESSION['phpgw_info']['expressomail']['ldap_server'] = $ldap_manager ? $ldap_manager->srcs[1] : null; |
---|
64 | $_SESSION['phpgw_info']['expressomail']['user']['email'] = $GLOBALS['phpgw']->preferences->values['email']; |
---|
65 | $_SESSION['phpgw_info']['server']['temp_dir'] = $GLOBALS['phpgw_info']['server']['temp_dir']; |
---|
66 | |
---|
67 | $preferences = $GLOBALS['phpgw']->preferences->read(); |
---|
68 | $_SESSION['phpgw_info']['user']['preferences']['expressoMail'] = $preferences['enable_local_messages']; |
---|
69 | $_SESSION['phpgw_info']['user']['preferences']['expressoMail'] = $preferences['expressoMail']; |
---|
70 | $_SESSION['phpgw_info']['user']['preferences']['expressoMail']['voip_enabled'] = $voip_enabled; |
---|
71 | $_SESSION['phpgw_info']['user']['preferences']['expressoMail']['voip_email_redirect'] = $emailVoip; |
---|
72 | $_SESSION['phpgw_info']['user']['preferences']['expressoMail']['outoffice'] = $GLOBALS['phpgw_info']['user']['preferences']['expressoMail']['outoffice']; |
---|
73 | $_SESSION['phpgw_info']['user']['preferences']['expressoMail']['telephone_number'] = $GLOBALS['phpgw_info']['user']['telephonenumber']; |
---|
74 | $_SESSION['phpgw_info']['user']['preferences']['expressoMail']['use_cache'] = $current_config['expressoMail_enable_cache']; |
---|
75 | $_SESSION['phpgw_info']['user']['preferences']['expressoMail']['number_of_contacts'] = $current_config['expressoMail_Number_of_dynamic_contacts'] ? $current_config['expressoMail_Number_of_dynamic_contacts'] : "0"; |
---|
76 | $_SESSION['phpgw_info']['user']['preferences']['expressoMail']['notification_domains'] = $current_config['expressoMail_notification_domains']; |
---|
77 | $_SESSION['phpgw_info']['user']['preferences']['expressoMail']['googlegears_url'] = $current_config['expressoMail_googlegears_url']; |
---|
78 | $_SESSION['phpgw_info']['user']['preferences']['expressoMail']['use_assinar_criptografar'] = $GLOBALS['phpgw_info']['server']['use_assinar_criptografar'] ? $GLOBALS['phpgw_info']['server']['use_assinar_criptografar'] : "0"; |
---|
79 | $_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"; |
---|
80 | $_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"; |
---|
81 | $_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"; |
---|
82 | $_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"; |
---|
83 | $_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"; |
---|
84 | $_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"; |
---|
85 | $_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"; |
---|
86 | |
---|
87 | $_SESSION['phpgw_info']['user']['preferences']['expressoMail']['max_attachment_size'] = $current_config['expressoMail_Max_attachment_size'] ? $current_config['expressoMail_Max_attachment_size']."M" : ini_get('upload_max_filesize'); |
---|
88 | $_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"; |
---|
89 | $_SESSION['phpgw_info']['user']['preferences']['expressoMail']['imap_max_folders'] = $current_config['expressoMail_imap_max_folders']; |
---|
90 | $_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"; |
---|
91 | $_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'; |
---|
92 | $_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"; |
---|
93 | $_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"; |
---|
94 | $_SESSION['phpgw_info']['user']['preferences']['expressoMail']['use_SpellChecker'] = $GLOBALS['phpgw_info']['user']['preferences']['expressoMail']['use_SpellChecker'] ? $GLOBALS['phpgw_info']['user']['preferences']['expressoMail']['use_SpellChecker'] : "0"; |
---|
95 | |
---|
96 | $_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; |
---|
97 | |
---|
98 | //SpellChecker |
---|
99 | if($_SESSION['phpgw_info']['user']['preferences']['expressoMail']['use_SpellChecker'] !='0'){ |
---|
100 | echo '<link rel="stylesheet" type="text/css" href="spell_checker/css/spell_checker.css">'; |
---|
101 | echo '<script src="spell_checker/cpaint/cpaint2.inc.js" type="text/javascript"></script>'; |
---|
102 | echo ' <script src="spell_checker/js/spell_checker.js" type="text/javascript"></script>'; |
---|
103 | } |
---|
104 | |
---|
105 | $template = CreateObject('phpgwapi.Template',PHPGW_APP_TPL); |
---|
106 | $template->set_var("txt_loading",lang("Loading")); |
---|
107 | $template->set_var("txt_clear_trash",lang("message(s) deleted from your trash folder.")); |
---|
108 | $template->set_var("new_message", lang("New Message")); |
---|
109 | $template->set_var("lang_inbox", lang("Inbox")); |
---|
110 | $template->set_var("refresh", lang("Refresh")); |
---|
111 | $template->set_var("tools", lang("Tools")); |
---|
112 | $template->set_var("lang_Open_Search_Window", lang("Open search window") . '...'); |
---|
113 | $template->set_var("lang_search_user", lang("Search user") . '...'); |
---|
114 | $template->set_var("upload_max_filesize",ini_get('upload_max_filesize')); |
---|
115 | $template->set_var("msg_folder",$_GET['msgball']['folder']); |
---|
116 | $template->set_var("msg_number",$_GET['msgball']['msgnum'] ? $_GET['msgball']['msgnum'] : $_GET['to']); |
---|
117 | $template->set_var("user_email",$_SESSION['phpgw_info']['expressomail']['user']['email']); |
---|
118 | $acc = CreateObject('phpgwapi.accounts'); |
---|
119 | $template->set_var("user_organization", $acc->get_organization($GLOBALS['phpgw_info']['user']['account_dn'])); |
---|
120 | $template->set_var("cyrus_delimiter",$_SESSION['phpgw_info']['expressomail']['email_server']['imapDelimiter']); |
---|
121 | // Fix problem with cyrus delimiter changes in preferences. |
---|
122 | // Dots in names: enabled/disabled. |
---|
123 | $save_in_folder = @eregi_replace("INBOX/", "INBOX".$_SESSION['phpgw_info']['expressomail']['email_server']['imapDelimiter'], $_SESSION['phpgw_info']['user']['preferences']['expressoMail']['save_in_folder']); |
---|
124 | $save_in_folder = @eregi_replace("INBOX.", "INBOX".$_SESSION['phpgw_info']['expressomail']['email_server']['imapDelimiter'], $save_in_folder); |
---|
125 | $_SESSION['phpgw_info']['user']['preferences']['expressoMail']['save_in_folder'] = $save_in_folder; |
---|
126 | // End Fix. |
---|
127 | |
---|
128 | $template->set_file(Array('expressoMail' => 'index.tpl')); |
---|
129 | $template->set_block('expressoMail','list'); |
---|
130 | $template->pfp('out','list'); |
---|
131 | $GLOBALS['phpgw']->common->phpgw_footer(); |
---|
132 | |
---|
133 | $_SESSION['phpgw_info']['server']['expressomail']['expressoMail_enable_log_messages'] = $current_config['expressoMail_enable_log_messages']; |
---|
134 | |
---|
135 | // Begin Set Anti-Spam options. |
---|
136 | $_SESSION['phpgw_info']['server']['expressomail']['expressoMail_command_for_ham'] = $current_config['expressoMail_command_for_ham']; |
---|
137 | $_SESSION['phpgw_info']['server']['expressomail']['expressoMail_command_for_spam'] = $current_config['expressoMail_command_for_spam']; |
---|
138 | $_SESSION['phpgw_info']['server']['expressomail']['expressoMail_use_spam_filter'] = $current_config['expressoMail_use_spam_filter']; |
---|
139 | echo '<script> var use_spam_filter = \''.$current_config['expressoMail_use_spam_filter'].'\' |
---|
140 | var sieve_forward_domains = \''.$current_config['expressoMail_sieve_forward_domains'].'\' </script>'; |
---|
141 | // End Set Anti-Spam options. |
---|
142 | |
---|
143 | // Set Imap Folder names options |
---|
144 | |
---|
145 | $_SESSION['phpgw_info']['expressomail']['email_server']['imapDefaultTrashFolder'] = $_SESSION['phpgw_info']['expressomail']['email_server']['imapDefaultTrashFolder'] ? $_SESSION['phpgw_info']['expressomail']['email_server']['imapDefaultTrashFolder'] : lang("Trash"); |
---|
146 | $_SESSION['phpgw_info']['expressomail']['email_server']['imapDefaultDraftsFolder'] = $_SESSION['phpgw_info']['expressomail']['email_server']['imapDefaultDraftsFolder'] ? $_SESSION['phpgw_info']['expressomail']['email_server']['imapDefaultDraftsFolder'] : lang("Drafts"); |
---|
147 | $_SESSION['phpgw_info']['expressomail']['email_server']['imapDefaultSpamFolder'] = $_SESSION['phpgw_info']['expressomail']['email_server']['imapDefaultSpamFolder'] ? $_SESSION['phpgw_info']['expressomail']['email_server']['imapDefaultSpamFolder'] : lang("Spam"); |
---|
148 | $_SESSION['phpgw_info']['expressomail']['email_server']['imapDefaultSentFolder'] = $_SESSION['phpgw_info']['expressomail']['email_server']['imapDefaultSentFolder'] ? $_SESSION['phpgw_info']['expressomail']['email_server']['imapDefaultSentFolder'] : lang("Sent"); |
---|
149 | |
---|
150 | // gera paramero com tokens suportados .... |
---|
151 | $var_tokens = ''; |
---|
152 | for($ii = 1; $ii < 11; $ii++) |
---|
153 | { |
---|
154 | if($GLOBALS['phpgw_info']['server']['test_token' . $ii . '1']) |
---|
155 | $var_tokens .= $GLOBALS['phpgw_info']['server']['test_token' . $ii . '1'] . ','; |
---|
156 | } |
---|
157 | |
---|
158 | if(!$var_tokens) |
---|
159 | { |
---|
160 | $var_tokens = 'ePass2000Lx;/usr/lib/libepsng_p11.so,ePass2000Win;c:/windows/system32/ngp11v211.dll'; |
---|
161 | } |
---|
162 | |
---|
163 | echo '<script> var special_folders = new Array(4); |
---|
164 | special_folders["'.$_SESSION['phpgw_info']['expressomail']['email_server']['imapDefaultTrashFolder'].'"] = \'Trash\'; |
---|
165 | special_folders["'.$_SESSION['phpgw_info']['expressomail']['email_server']['imapDefaultDraftsFolder'].'"] = \'Drafts\'; |
---|
166 | special_folders["'.$_SESSION['phpgw_info']['expressomail']['email_server']['imapDefaultSpamFolder'].'"] = \'Spam\'; |
---|
167 | special_folders["'.$_SESSION['phpgw_info']['expressomail']['email_server']['imapDefaultSentFolder'].'"] = \'Sent\'; |
---|
168 | var trashfolder = "'.$_SESSION['phpgw_info']['expressomail']['email_server']['imapDefaultTrashFolder'].'"; |
---|
169 | var draftsfolder = "'.$_SESSION['phpgw_info']['expressomail']['email_server']['imapDefaultDraftsFolder'].'"; |
---|
170 | var sentfolder = "'.$_SESSION['phpgw_info']['expressomail']['email_server']['imapDefaultSentFolder'].'"; |
---|
171 | var spamfolder = "'.$_SESSION['phpgw_info']['expressomail']['email_server']['imapDefaultSpamFolder'].'"; |
---|
172 | var token_param = "'.$var_tokens.'"; |
---|
173 | var locale = "'.$GLOBALS['phpgw']->common->getPreferredLanguage().'"; |
---|
174 | </script>'; |
---|
175 | |
---|
176 | // End Set Imap Folder names options |
---|
177 | //User info |
---|
178 | echo "<script language='javascript'> var account_id = ".$GLOBALS['phpgw_info']['user']['account_id'].";var expresso_offline = false;</script>"; |
---|
179 | |
---|
180 | $obj = createobject("expressoMail1_2.functions"); |
---|
181 | |
---|
182 | // setting timezone preference |
---|
183 | $zones = $obj->getTimezones(); |
---|
184 | $_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)); |
---|
185 | |
---|
186 | // este arquivo deve ser carregado antes que |
---|
187 | // os demais pois nele contem a função get_lang |
---|
188 | // que é utilizada em diversas partes |
---|
189 | echo $obj -> getFilesJs("js/common_functions.js"); |
---|
190 | include("inc/load_lang.php"); |
---|
191 | |
---|
192 | // INCLUDE these JS Files: |
---|
193 | if ($_SESSION['phpgw_info']['user']['preferences']['expressoMail']['use_local_messages']) |
---|
194 | echo "<script src='js/gears_init.js'></script>"; |
---|
195 | echo '<script src="../phpgwapi/js/dftree/dftree.js"></script>'; |
---|
196 | $scripts = "js/abas.js," . |
---|
197 | "js/main.js," . |
---|
198 | "js/drag_area.js," . |
---|
199 | "js/draw_api.js,"; |
---|
200 | if($_SESSION['phpgw_info']['user']['preferences']['expressoMail']['use_local_messages']) |
---|
201 | $scripts .= "js/local_messages.js,"; |
---|
202 | $scripts .= "js/messages_controller.js," . |
---|
203 | "js/DropDownContacts.js," . |
---|
204 | "js/doiMenuData.js," . |
---|
205 | "js/connector.js," . |
---|
206 | $GLOBALS['phpgw_info']['flags']['update_version']; |
---|
207 | |
---|
208 | echo $obj -> getFilesJs($scripts); |
---|
209 | echo '<script type="text/javascript">init();</script>'; |
---|
210 | |
---|
211 | if ($GLOBALS['phpgw_info']['user']['preferences']['expressoMail']['use_shortcuts']) |
---|
212 | { |
---|
213 | echo $obj -> getFilesJs("js/shortcut.js", $GLOBALS['phpgw_info']['flags']['update_version']); |
---|
214 | } |
---|
215 | |
---|
216 | // Get Preferences or redirect to preferences page. |
---|
217 | $GLOBALS['phpgw']->preferences->read_repository(); |
---|
218 | //print_r($_SESSION['phpgw_info']['user']['preferences']['expressoMail']); |
---|
219 | unset($_SESSION['phpgw_info']['expressomail']['user']['preferences']); |
---|
220 | unset($_SESSION['phpgw_info']['expressomail']['user']['acl']); |
---|
221 | unset($_SESSION['phpgw_info']['expressomail']['user']['apps']); |
---|
222 | unset($_SESSION['phpgw_info']['expressomail']['server']['global_denied_users']); |
---|
223 | unset($_SESSION['phpgw_info']['expressomail']['server']['global_denied_groups']); |
---|
224 | ?> |
---|
225 | |
---|
226 | <html> |
---|
227 | <head> |
---|
228 | <title>ExpressoMail</title> |
---|
229 | </head> |
---|
230 | <body scroll="no" style="overflow:hidden"> |
---|
231 | </body> |
---|
232 | </html> |
---|
233 | <script type="text/javascript">connector.updateVersion = "<?=$update_version?>";</script> |
---|
234 | <!-----Expresso Mail - Version Updated:<?=$update_version?>--------> |
---|