[2] | 1 | <?php |
---|
[2360] | 2 | |
---|
[2529] | 3 | /**************************************************************************\ |
---|
| 4 | * Expresso Livre * |
---|
| 5 | * http://www.expressolivre.org * |
---|
| 6 | * -------------------------------------------- * |
---|
| 7 | * This program is free software; you can redistribute it and/or modify it * |
---|
| 8 | * under the terms of the GNU General Public License as published by the * |
---|
| 9 | * Free Software Foundation; either version 2 of the License, or (at your * |
---|
| 10 | * option) any later version. * |
---|
| 11 | \**************************************************************************/ |
---|
[2517] | 12 | |
---|
[2529] | 13 | $GLOBALS['phpgw_info']['flags'] = array( |
---|
| 14 | //'noheader' => False, |
---|
| 15 | //'nonavbar' => False, |
---|
| 16 | 'currentapp' => 'expressoMail1_2', |
---|
| 17 | 'update_version' => '1.235', |
---|
| 18 | 'enable_nextmatchs_class' => True |
---|
| 19 | ); |
---|
[2517] | 20 | |
---|
[2529] | 21 | require_once('../header.inc.php'); |
---|
[2517] | 22 | |
---|
[2529] | 23 | include_once("inc/load_lang.php"); |
---|
[2517] | 24 | |
---|
[2529] | 25 | $_SESSION['phpgw_info']['expressomail']['user'] = $GLOBALS['phpgw_info']['user']; |
---|
| 26 | |
---|
| 27 | //Enable/Disable VoIP Service -> Voip Server Config |
---|
| 28 | $voip_enabled = false; |
---|
| 29 | $voip_groups = array(); |
---|
| 30 | if($GLOBALS['phpgw_info']['server']['voip_groups']) { |
---|
| 31 | $emailVoip = false; |
---|
| 32 | foreach(explode(",",$GLOBALS['phpgw_info']['server']['voip_groups']) as $i => $voip_group){ |
---|
| 33 | $a_voip = explode(";",$voip_group); |
---|
| 34 | $voip_groups[] = $a_voip[1]; |
---|
| 35 | } |
---|
| 36 | foreach($GLOBALS['phpgw']->accounts->membership() as $idx => $group){ |
---|
| 37 | if(array_search($group['account_name'],$voip_groups) !== FALSE){ |
---|
| 38 | $voip_enabled = true; |
---|
| 39 | $emailVoip = $GLOBALS['phpgw_info']['server']['voip_email_redirect']; |
---|
| 40 | break; |
---|
[395] | 41 | } |
---|
[358] | 42 | } |
---|
[2529] | 43 | } |
---|
[72] | 44 | |
---|
[2529] | 45 | // Get Data from ldap_manager and emailadmin. |
---|
| 46 | $ldap_manager = CreateObject('contactcenter.bo_ldap_manager'); |
---|
| 47 | $boemailadmin = CreateObject('emailadmin.bo'); |
---|
| 48 | $emailadmin_profile = $boemailadmin->getProfileList(); |
---|
[485] | 49 | |
---|
[2529] | 50 | // Loading Admin Config Module |
---|
| 51 | $c = CreateObject('phpgwapi.config','expressoMail1_2'); |
---|
| 52 | $c->read_repository(); |
---|
| 53 | $current_config = $c->config_data; |
---|
| 54 | |
---|
| 55 | $_SESSION['phpgw_info']['expressomail']['email_server'] = $boemailadmin->getProfile($emailadmin_profile[0]['profileID']); |
---|
[790] | 56 | // $_SESSION['phpgw_info']['expressomail']['user'] = $GLOBALS['phpgw_info']['user']; |
---|
[2529] | 57 | $_SESSION['phpgw_info']['expressomail']['max_folders_to_show'] = $current_config['expressoMail_Max_folders_to_show'] ? $current_config['expressoMail_Max_folders_to_show'] : "200"; |
---|
| 58 | $_SESSION['phpgw_info']['expressomail']['server'] = $GLOBALS['phpgw_info']['server']; |
---|
| 59 | $_SESSION['phpgw_info']['expressomail']['ldap_server'] = $ldap_manager ? $ldap_manager->srcs[1] : null; |
---|
| 60 | $_SESSION['phpgw_info']['expressomail']['user']['email'] = $GLOBALS['phpgw']->preferences->values['email']; |
---|
[2517] | 61 | |
---|
[2529] | 62 | $preferences = $GLOBALS['phpgw']->preferences->read(); |
---|
| 63 | $_SESSION['phpgw_info']['user']['preferences']['expressoMail'] = $preferences['expressoMail']; |
---|
| 64 | $_SESSION['phpgw_info']['user']['preferences']['expressoMail']['voip_enabled'] = $voip_enabled; |
---|
| 65 | $_SESSION['phpgw_info']['user']['preferences']['expressoMail']['voip_email_redirect'] = $emailVoip; |
---|
| 66 | $_SESSION['phpgw_info']['user']['preferences']['expressoMail']['outoffice'] = $GLOBALS['phpgw_info']['user']['preferences']['expressoMail']['outoffice']; |
---|
| 67 | $_SESSION['phpgw_info']['user']['preferences']['expressoMail']['telephone_number'] = $GLOBALS['phpgw_info']['user']['telephonenumber']; |
---|
| 68 | $_SESSION['phpgw_info']['user']['preferences']['expressoMail']['use_cache'] = $current_config['expressoMail_enable_cache']; |
---|
| 69 | $_SESSION['phpgw_info']['user']['preferences']['expressoMail']['number_of_contacts'] = $current_config['expressoMail_Number_of_dynamic_contacts'] ? $current_config['expressoMail_Number_of_dynamic_contacts'] : "0"; |
---|
| 70 | $_SESSION['phpgw_info']['user']['preferences']['expressoMail']['notification_domains'] = $current_config['expressoMail_notification_domains']; |
---|
| 71 | $_SESSION['phpgw_info']['user']['preferences']['expressoMail']['googlegears_url'] = $current_config['expressoMail_googlegears_url']; |
---|
| 72 | $_SESSION['phpgw_info']['user']['preferences']['expressoMail']['use_assinar_criptografar'] = $GLOBALS['phpgw_info']['server']['use_assinar_criptografar'] ? $GLOBALS['phpgw_info']['server']['use_assinar_criptografar'] : "0"; |
---|
| 73 | $_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"; |
---|
| 74 | $_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"; |
---|
| 75 | $_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"; |
---|
| 76 | $_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"; |
---|
| 77 | $_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"; |
---|
| 78 | $_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"; |
---|
| 79 | $_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"; |
---|
| 80 | $_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'); |
---|
| 81 | $_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"; |
---|
[2517] | 82 | |
---|
[2529] | 83 | $template = CreateObject('phpgwapi.Template',PHPGW_APP_TPL); |
---|
| 84 | $template->set_var("txt_loading",lang("Loading")); |
---|
| 85 | $template->set_var("txt_clear_trash",lang("message(s) deleted from your trash folder.")); |
---|
| 86 | $template->set_var("new_message", lang("New Message")); |
---|
| 87 | $template->set_var("lang_inbox", lang("Inbox")); |
---|
| 88 | $template->set_var("refresh", lang("Refresh")); |
---|
| 89 | $template->set_var("tools", lang("Tools")); |
---|
| 90 | $template->set_var("lang_Open_Search_Window", lang("Open search window") . '...'); |
---|
| 91 | $template->set_var("lang_search_user", lang("Search user") . '...'); |
---|
| 92 | $template->set_var("upload_max_filesize",ini_get('upload_max_filesize')); |
---|
| 93 | $template->set_var("msg_folder",$_GET['msgball']['folder']); |
---|
| 94 | $template->set_var("msg_number",$_GET['msgball']['msgnum'] ? $_GET['msgball']['msgnum'] : $_GET['to']); |
---|
| 95 | $template->set_var("user_email",$_SESSION['phpgw_info']['expressomail']['user']['email']); |
---|
[2517] | 96 | |
---|
[2529] | 97 | $acc = CreateObject('phpgwapi.accounts'); |
---|
[2517] | 98 | |
---|
[2529] | 99 | $template->set_var("user_organization", $acc->get_organization($GLOBALS['phpgw_info']['user']['account_dn'])); |
---|
| 100 | $template->set_var("cyrus_delimiter",$_SESSION['phpgw_info']['expressomail']['email_server']['imapDelimiter']); |
---|
[2517] | 101 | |
---|
[2529] | 102 | // Fix problem with cyrus delimiter changes in preferences. |
---|
| 103 | // Dots in names: enabled/disabled. |
---|
| 104 | $save_in_folder = @eregi_replace("INBOX/", "INBOX".$_SESSION['phpgw_info']['expressomail']['email_server']['imapDelimiter'], $_SESSION['phpgw_info']['user']['preferences']['expressoMail']['save_in_folder']); |
---|
| 105 | $save_in_folder = @eregi_replace("INBOX.", "INBOX".$_SESSION['phpgw_info']['expressomail']['email_server']['imapDelimiter'], $save_in_folder); |
---|
| 106 | $_SESSION['phpgw_info']['user']['preferences']['expressoMail']['save_in_folder'] = $save_in_folder; |
---|
| 107 | // End Fix. |
---|
[2517] | 108 | |
---|
[2529] | 109 | $template->set_file(Array('expressoMail' => 'index.tpl')); |
---|
| 110 | $template->set_var( 'url', $GLOBALS[ 'phpgw' ] -> link( '/expressoMail1_2' ) ); |
---|
| 111 | $template->set_block('expressoMail','list'); |
---|
| 112 | $template->pfp('out','list'); |
---|
[2517] | 113 | |
---|
[2529] | 114 | $GLOBALS['phpgw']->common->phpgw_footer(); |
---|
[2] | 115 | |
---|
[2529] | 116 | $_SESSION['phpgw_info']['server']['expressomail']['expressoMail_enable_log_messages'] = $current_config['expressoMail_enable_log_messages']; |
---|
[98] | 117 | |
---|
[2529] | 118 | // Begin Set Anti-Spam options. |
---|
| 119 | $_SESSION['phpgw_info']['server']['expressomail']['expressoMail_command_for_ham'] = $current_config['expressoMail_command_for_ham']; |
---|
| 120 | $_SESSION['phpgw_info']['server']['expressomail']['expressoMail_command_for_spam'] = $current_config['expressoMail_command_for_spam']; |
---|
| 121 | $_SESSION['phpgw_info']['server']['expressomail']['expressoMail_use_spam_filter'] = $current_config['expressoMail_use_spam_filter']; |
---|
| 122 | echo '<script> var use_spam_filter = "' . $current_config['expressoMail_use_spam_filter'] . '"</script>'; |
---|
| 123 | // End Set Anti-Spam options. |
---|
[1035] | 124 | |
---|
[2529] | 125 | // Set Imap Folder names options |
---|
| 126 | $_SESSION['phpgw_info']['expressomail']['email_server']['imapDefaultTrashFolder'] = $_SESSION['phpgw_info']['expressomail']['email_server']['imapDefaultTrashFolder'] ? $_SESSION['phpgw_info']['expressomail']['email_server']['imapDefaultTrashFolder'] : lang("Trash"); |
---|
| 127 | $_SESSION['phpgw_info']['expressomail']['email_server']['imapDefaultDraftsFolder'] = $_SESSION['phpgw_info']['expressomail']['email_server']['imapDefaultDraftsFolder'] ? $_SESSION['phpgw_info']['expressomail']['email_server']['imapDefaultDraftsFolder'] : lang("Drafts"); |
---|
| 128 | $_SESSION['phpgw_info']['expressomail']['email_server']['imapDefaultSpamFolder'] = $_SESSION['phpgw_info']['expressomail']['email_server']['imapDefaultSpamFolder'] ? $_SESSION['phpgw_info']['expressomail']['email_server']['imapDefaultSpamFolder'] : lang("Spam"); |
---|
| 129 | $_SESSION['phpgw_info']['expressomail']['email_server']['imapDefaultSentFolder'] = $_SESSION['phpgw_info']['expressomail']['email_server']['imapDefaultSentFolder'] ? $_SESSION['phpgw_info']['expressomail']['email_server']['imapDefaultSentFolder'] : lang("Sent"); |
---|
[1035] | 130 | |
---|
[2529] | 131 | // gera paramero com tokens suportados .... |
---|
| 132 | $var_tokens = ''; |
---|
| 133 | for($ii = 1; $ii < 11; $ii++) |
---|
| 134 | { |
---|
| 135 | if($GLOBALS['phpgw_info']['server']['test_token' . $ii . '1']) |
---|
| 136 | $var_tokens .= $GLOBALS['phpgw_info']['server']['test_token' . $ii . '1'] . ','; |
---|
| 137 | } |
---|
[1035] | 138 | |
---|
[2529] | 139 | if(!$var_tokens) |
---|
| 140 | { |
---|
| 141 | $var_tokens = 'ePass2000Lx;/usr/lib/libepsng_p11.so,ePass2000Win;c:/windows/system32/ngp11v211.dll'; |
---|
| 142 | } |
---|
[2519] | 143 | |
---|
| 144 | |
---|
[2529] | 145 | if ( ! @is_object($GLOBALS['phpgw']->js ) ) |
---|
| 146 | $GLOBALS['phpgw']->js = CreateObject('phpgwapi.javascript'); |
---|
[98] | 147 | |
---|
[2529] | 148 | $GLOBALS['phpgw']->js->validate_file( 'dJSWin', 'dJSWin' ); |
---|
| 149 | $GLOBALS['phpgw']->js->validate_file( 'dftree', 'dftree' ); |
---|
[98] | 150 | |
---|
[2529] | 151 | $GLOBALS['phpgw']->js->validate_file( 'modal', 'modal', 'expressoMail1_2' ); |
---|
| 152 | $GLOBALS['phpgw']->js->validate_file( 'jscalendar', 'calendar', 'expressoMail1_2' ); |
---|
| 153 | $GLOBALS['phpgw']->js->validate_file( 'jscalendar', 'calendar-setup', 'expressoMail1_2' ); |
---|
| 154 | $GLOBALS['phpgw']->js->validate_file( 'jscalendar', 'lang/calendar-br', 'expressoMail1_2' ); |
---|
| 155 | $GLOBALS['phpgw']->js->validate_file( 'jscode', 'globals', 'expressoMail1_2' ); |
---|
| 156 | $GLOBALS['phpgw']->js->validate_file( 'jscode', 'sniff_browser', 'expressoMail1_2' ); |
---|
| 157 | $GLOBALS['phpgw']->js->validate_file( 'jscode', 'common_functions', 'expressoMail1_2' ); |
---|
| 158 | $GLOBALS['phpgw']->js->validate_file( 'jscode', 'abas', 'expressoMail1_2' ); |
---|
| 159 | $GLOBALS['phpgw']->js->validate_file( 'jscode', 'doiMenuData', 'expressoMail1_2' ); |
---|
| 160 | $GLOBALS['phpgw']->js->validate_file( 'jscode', 'drag_area', 'expressoMail1_2' ); |
---|
| 161 | $GLOBALS['phpgw']->js->validate_file( 'jscode', 'draw_api', 'expressoMail1_2' ); |
---|
| 162 | $GLOBALS['phpgw']->js->validate_file( 'jscode', 'DropDownContacts', 'expressoMail1_2' ); |
---|
| 163 | $GLOBALS['phpgw']->js->validate_file( 'jscode', 'InfoContact', 'expressoMail1_2' ); |
---|
| 164 | $GLOBALS['phpgw']->js->validate_file( 'jscode', 'main', 'expressoMail1_2' ); |
---|
| 165 | $GLOBALS['phpgw']->js->validate_file( 'jscode', 'local_messages', 'expressoMail1_2' ); |
---|
| 166 | $GLOBALS['phpgw']->js->validate_file( 'jscode', 'messages_controller', 'expressoMail1_2' ); |
---|
| 167 | $GLOBALS['phpgw']->js->validate_file( 'jscode', 'rich_text_editor', 'expressoMail1_2' ); |
---|
| 168 | $GLOBALS['phpgw']->js->validate_file( 'jscode', 'wfolders', 'expressoMail1_2' ); |
---|
[790] | 169 | |
---|
[2529] | 170 | if ($GLOBALS['phpgw_info']['user']['preferences']['expressoMail']['use_shortcuts']) |
---|
| 171 | $GLOBALS['phpgw']->js->validate_file( 'jscode', 'shortcut', 'expressoMail1_2' ); |
---|
[2] | 172 | |
---|
[2529] | 173 | if ($_SESSION['phpgw_info']['user']['preferences']['expressoMail']['use_local_messages']) |
---|
| 174 | $GLOBALS['phpgw']->js->validate_file( 'jscode', 'gears_init', 'expressoMail1_2' ); |
---|
[117] | 175 | |
---|
[2517] | 176 | |
---|
[2529] | 177 | $expressoMail_url = $GLOBALS[ 'phpgw' ] -> link( '/expressoMail1_2' ); |
---|
| 178 | $phpgwapi_url = $GLOBALS[ 'phpgw' ] -> link( '/phpgwapi' ); |
---|
[2517] | 179 | |
---|
[2529] | 180 | $script = '<link rel="stylesheet" type="text/css" href="' . $expressoMail_url . '/templates/' . $GLOBALS['phpgw_info']['server']['template_set'] . '/main.css">'; |
---|
| 181 | $script .= '<link rel="stylesheet" type="text/css" href="' . $phpgwapi_url . '/js/dftree/dftree.css">'; |
---|
| 182 | $script .= '<style type="text/css">@import url(' . $phpgwapi_url . '/js/jscalendar/calendar-win2k-1.css);</style>'; |
---|
| 183 | $script .= '<script type="text/javascript">var template = "' . $GLOBALS['phpgw_info']['server']['template_set'] . '";'; |
---|
| 184 | $script .= 'var special_folders = new Array(4);'; |
---|
| 185 | $script .= 'special_folders["'.$_SESSION['phpgw_info']['expressomail']['email_server']['imapDefaultTrashFolder'].'"] = \'Trash\';'; |
---|
| 186 | $script .= 'special_folders["'.$_SESSION['phpgw_info']['expressomail']['email_server']['imapDefaultDraftsFolder'].'"] = \'Drafts\';'; |
---|
| 187 | $script .= 'special_folders["'.$_SESSION['phpgw_info']['expressomail']['email_server']['imapDefaultSpamFolder'].'"] = \'Spam\';'; |
---|
| 188 | $script .= 'special_folders["'.$_SESSION['phpgw_info']['expressomail']['email_server']['imapDefaultSentFolder'].'"] = \'Sent\';'; |
---|
| 189 | $script .= 'var trashfolder = "'.$_SESSION['phpgw_info']['expressomail']['email_server']['imapDefaultTrashFolder'].'";'; |
---|
| 190 | $script .= 'var draftsfolder = "'.$_SESSION['phpgw_info']['expressomail']['email_server']['imapDefaultDraftsFolder'].'";'; |
---|
| 191 | $script .= 'var sentfolder = "'.$_SESSION['phpgw_info']['expressomail']['email_server']['imapDefaultSentFolder'].'";'; |
---|
| 192 | $script .= 'var spamfolder = "'.$_SESSION['phpgw_info']['expressomail']['email_server']['imapDefaultSpamFolder'].'";'; |
---|
| 193 | $script .= 'var token_param = "'.$var_tokens.'";'; |
---|
| 194 | $script .= 'var locale = "'.$GLOBALS['phpgw']->common->getPreferredLanguage().'";'; |
---|
| 195 | $script .= 'var account_id = ' . $GLOBALS['phpgw_info']['user']['account_id'] . ';var expresso_offline = false;</script>'; |
---|
| 196 | $script .= '</script>'; |
---|
[2517] | 197 | |
---|
[2529] | 198 | $update_version = $GLOBALS['phpgw_info']['flags']['update_version']; |
---|
[2517] | 199 | |
---|
[2529] | 200 | echo $script |
---|
| 201 | . $GLOBALS[ 'phpgw' ] -> common -> get_java_script( ) |
---|
| 202 | . '<script language="Javascript">expresso.connector.updateVersion = "'. $update_version . '";init();</script>'; |
---|
[2] | 203 | ?> |
---|
[98] | 204 | <!-----Expresso Mail - Version Updated:<?=$update_version?>--------> |
---|