source: trunk/zpush/config.php @ 7629

Revision 7629, 14.0 KB checked in by cristiano, 11 years ago (diff)

Ticket #3209 - Correcao da pasta enviados para pegar preferencia do usuario

Line 
1<?php
2/***********************************************
3* File      :   config.php
4* Project   :   Z-Push
5* Descr     :   Main configuration file
6*
7* Created   :   01.10.2007
8*
9* Copyright 2007 - 2012 Zarafa Deutschland GmbH
10*
11* This program is free software: you can redistribute it and/or modify
12* it under the terms of the GNU Affero General Public License, version 3,
13* as published by the Free Software Foundation with the following additional
14* term according to sec. 7:
15*
16* According to sec. 7 of the GNU Affero General Public License, version 3,
17* the terms of the AGPL are supplemented with the following terms:
18*
19* "Zarafa" is a registered trademark of Zarafa B.V.
20* "Z-Push" is a registered trademark of Zarafa Deutschland GmbH
21* The licensing of the Program under the AGPL does not imply a trademark license.
22* Therefore any rights, title and interest in our trademarks remain entirely with us.
23*
24* However, if you propagate an unmodified version of the Program you are
25* allowed to use the term "Z-Push" to indicate that you distribute the Program.
26* Furthermore you may use our trademarks where it is necessary to indicate
27* the intended purpose of a product or service provided you use it in accordance
28* with honest practices in industrial or commercial matters.
29* If you want to propagate modified versions of the Program under the name "Z-Push",
30* you may only do so if you have a written permission by Zarafa Deutschland GmbH
31* (to acquire a permission please contact Zarafa at trademark@zarafa.com).
32*
33* This program is distributed in the hope that it will be useful,
34* but WITHOUT ANY WARRANTY; without even the implied warranty of
35* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
36* GNU Affero General Public License for more details.
37*
38* You should have received a copy of the GNU Affero General Public License
39* along with this program.  If not, see <http://www.gnu.org/licenses/>.
40*
41* Consult LICENSE file for details
42************************************************/
43
44/**********************************************************************************
45 *  Default settings
46 */
47    // Defines the default time zone, change e.g. to "Europe/London" if necessary
48    define('TIMEZONE', '');
49
50    // Defines the base path on the server
51    define('BASE_PATH', dirname($_SERVER['SCRIPT_FILENAME']). '/');
52
53    // Try to set unlimited timeout
54    define('SCRIPT_TIMEOUT', 0);
55
56    //Max size of attachments to display inline. Default is 2 MB
57    define('MAX_EMBEDDED_SIZE', 2097152);
58
59
60/**********************************************************************************
61 *  Default FileStateMachine settings
62 */
63    define('STATE_DIR', __DIR__.'/states/');
64
65
66/**********************************************************************************
67 *  Logging settings
68 *  Possible LOGLEVEL and LOGUSERLEVEL values are:
69 *  LOGLEVEL_OFF            - no logging
70 *  LOGLEVEL_FATAL          - log only critical errors
71 *  LOGLEVEL_ERROR          - logs events which might require corrective actions
72 *  LOGLEVEL_WARN           - might lead to an error or require corrective actions in the future
73 *  LOGLEVEL_INFO           - usually completed actions
74 *  LOGLEVEL_DEBUG          - debugging information, typically only meaningful to developers
75 *  LOGLEVEL_WBXML          - also prints the WBXML sent to/from the device
76 *  LOGLEVEL_DEVICEID       - also prints the device id for every log entry
77 *  LOGLEVEL_WBXMLSTACK     - also prints the contents of WBXML stack
78 *
79 *  The verbosity increases from top to bottom. More verbose levels include less verbose
80 *  ones, e.g. setting to LOGLEVEL_DEBUG will also output LOGLEVEL_FATAL, LOGLEVEL_ERROR,
81 *  LOGLEVEL_WARN and LOGLEVEL_INFO level entries.
82 */
83    define('LOGFILEDIR', __DIR__.'/logs/');
84    define('LOGFILE', LOGFILEDIR . 'z-push.log');
85    define('LOGERRORFILE', LOGFILEDIR . 'z-push-error.log');
86    define('LOGLEVEL', LOGLEVEL_WARN);
87    define('LOGAUTHFAIL', false);
88
89
90    // To save e.g. WBXML data only for selected users, add the usernames to the array
91    // The data will be saved into a dedicated file per user in the LOGFILEDIR
92    define('LOGUSERLEVEL', LOGLEVEL_DEVICEID);
93    $specialLogUsers = array();
94
95
96/**********************************************************************************
97 *  Mobile settings
98 */
99    // Device Provisioning
100    define('PROVISIONING', true);
101
102    // This option allows the 'loose enforcement' of the provisioning policies for older
103    // devices which don't support provisioning (like WM 5 and HTC Android Mail) - dw2412 contribution
104    // false (default) - Enforce provisioning for all devices
105    // true - allow older devices, but enforce policies on devices which support it
106    define('LOOSE_PROVISIONING', false);
107
108    // Default conflict preference
109    // Some devices allow to set if the server or PIM (mobile)
110    // should win in case of a synchronization conflict
111    //   SYNC_CONFLICT_OVERWRITE_SERVER - Server is overwritten, PIM wins
112    //   SYNC_CONFLICT_OVERWRITE_PIM    - PIM is overwritten, Server wins (default)
113    define('SYNC_CONFLICT_DEFAULT', SYNC_CONFLICT_OVERWRITE_PIM);
114
115    // Global limitation of items to be synchronized
116    // The mobile can define a sync back period for calendar and email items
117    // For large stores with many items the time period could be limited to a max value
118    // If the mobile transmits a wider time period, the defined max value is used
119    // Applicable values:
120    //   SYNC_FILTERTYPE_ALL (default, no limitation)
121    //   SYNC_FILTERTYPE_1DAY, SYNC_FILTERTYPE_3DAYS, SYNC_FILTERTYPE_1WEEK, SYNC_FILTERTYPE_2WEEKS,
122    //   SYNC_FILTERTYPE_1MONTH, SYNC_FILTERTYPE_3MONTHS, SYNC_FILTERTYPE_6MONTHS
123    define('SYNC_FILTERTIME_MAX', SYNC_FILTERTYPE_ALL);
124
125    // Interval in seconds before checking if there are changes on the server when in Ping.
126    // It means the highest time span before a change is pushed to a mobile. Set it to
127    // a higher value if you have a high load on the server.
128    define('PING_INTERVAL', 30);
129
130    // Interval in seconds to force a re-check of potentially missed notifications when
131    // using a changes sink. Default are 300 seconds (every 5 min).
132    // This can also be disabled by setting it to false
133    define('SINK_FORCERECHECK', 300);
134
135    // Set the fileas (save as) order for contacts in the webaccess/webapp/outlook.
136    // It will only affect new/modified contacts on the mobile which then are synced to the server.
137    // Possible values are:
138    // SYNC_FILEAS_FIRSTLAST    - fileas will be "Firstname Middlename Lastname"
139    // SYNC_FILEAS_LASTFIRST    - fileas will be "Lastname, Firstname Middlename"
140    // SYNC_FILEAS_COMPANYONLY  - fileas will be "Company"
141    // SYNC_FILEAS_COMPANYLAST  - fileas will be "Company (Lastname, Firstname Middlename)"
142    // SYNC_FILEAS_COMPANYFIRST - fileas will be "Company (Firstname Middlename Lastname)"
143    // SYNC_FILEAS_LASTCOMPANY  - fileas will be "Lastname, Firstname Middlename (Company)"
144    // SYNC_FILEAS_FIRSTCOMPANY - fileas will be "Firstname Middlename Lastname (Company)"
145    // The company-fileas will only be set if a contact has a company set. If one of
146    // company-fileas is selected and a contact doesn't have a company set, it will default
147    // to SYNC_FILEAS_FIRSTLAST or SYNC_FILEAS_LASTFIRST (depending on if last or first
148    // option is selected for company).
149    // If SYNC_FILEAS_COMPANYONLY is selected and company of the contact is not set
150    // SYNC_FILEAS_LASTFIRST will be used
151    define('FILEAS_ORDER', SYNC_FILEAS_LASTFIRST);
152
153    // Amount of items to be synchronized per request
154    // Normally this value is requested by the mobile. Common values are 5, 25, 50 or 100.
155    // Exporting too much items can cause mobile timeout on busy systems.
156    // Z-Push will use the lowest value, either set here or by the mobile.
157    // default: 100 - value used if mobile does not limit amount of items
158    define('SYNC_MAX_ITEMS', 100);
159
160/**********************************************************************************
161 *  Backend settings
162 */
163    // The data providers that we are using (see configuration below)
164    define('BACKEND_PROVIDER', "BackendExpresso");
165
166
167    //Expresso location
168    define('EXPRESSO_PATH', __DIR__.'/..');
169
170
171    // ************************
172    //  BackendZarafa settings
173    // ************************
174    // Defines the server to which we want to connect
175    //define('MAPI_SERVER', 'file:///var/run/zarafa');
176
177
178    // ************************
179    //  BackendIMAP settings
180    // ************************
181    // Defines the server to which we want to connect
182    define('IMAP_SERVER', 'localhost');
183    // connecting to default port (143)
184    define('IMAP_PORT', 143);
185    // best cross-platform compatibility (see http://php.net/imap_open for options)
186    define('IMAP_OPTIONS', '/notls/norsh');
187    // overwrite the "from" header if it isn't set when sending emails
188    // options: 'username'    - the username will be set (usefull if your login is equal to your emailaddress)
189    //        'domain'    - the value of the "domain" field is used
190    //        '@mydomain.com' - the username is used and the given string will be appended
191    define('IMAP_DEFAULTFROM', '');
192    // copy outgoing mail to this folder. If not set z-push will try the default folders
193    define('IMAP_SENTFOLDER', 'INBOX/Sent');
194    // forward messages inline (default false - as attachment)
195    define('IMAP_INLINE_FORWARD', false);
196    // use imap_mail() to send emails (default) - if false mail() is used
197    define('IMAP_USE_IMAPMAIL', true);
198
199
200    // ************************
201    //  BackendMaildir settings
202    // ************************
203    define('MAILDIR_BASE', '/tmp');
204    define('MAILDIR_SUBDIR', 'Maildir');
205
206    // **********************
207    //  BackendVCardDir settings
208    // **********************
209    define('VCARDDIR_DIR', '/home/%u/.kde/share/apps/kabc/stdvcf');
210
211
212/**********************************************************************************
213 *  Search provider settings
214 *
215 *  Alternative backend to perform SEARCH requests (GAL search)
216 *  By default the main Backend defines the preferred search functionality.
217 *  If set, the Search Provider will always be preferred.
218 *  Use 'BackendSearchLDAP' to search in a LDAP directory (see backend/searchldap/config.php)
219 */
220    define('SEARCH_PROVIDER', '');
221    // Time in seconds for the server search. Setting it too high might result in timeout.
222    // Setting it too low might not return all results. Default is 10.
223    define('SEARCH_WAIT', 10);
224    // The maximum number of results to send to the client. Setting it too high
225    // might result in timeout. Default is 10.
226    define('SEARCH_MAXRESULTS', 10);
227
228
229/**********************************************************************************
230 *  Synchronize additional folders to all mobiles
231 *
232 *  With this feature, special folders can be synchronized to all mobiles.
233 *  This is useful for e.g. global company contacts.
234 *
235 *  This feature is supported only by certain devices, like iPhones.
236 *  Check the compatibility list for supported devices:
237 *      http://z-push.sf.net/compatibility
238 *
239 *  To synchronize a folder, add a section setting all parameters as below:
240 *      store:      the ressource where the folder is located.
241 *                  Zarafa users use 'SYSTEM' for the 'Public Folder'
242 *      folderid:   folder id of the folder to be synchronized
243 *      name:       name to be displayed on the mobile device
244 *      type:       supported types are:
245 *                      SYNC_FOLDER_TYPE_USER_CONTACT
246 *                      SYNC_FOLDER_TYPE_USER_APPOINTMENT
247 *                      SYNC_FOLDER_TYPE_USER_TASK
248 *                      SYNC_FOLDER_TYPE_USER_MAIL
249 *
250 *  Additional notes:
251 *  - on Zarafa systems use backend/zarafa/listfolders.php script to get a list
252 *    of available folders
253 *
254 *  - all Z-Push users must have full writing permissions (secretary rights) so
255 *    the configured folders can be synchronized to the mobile
256 *
257 *  - this feature is only partly suitable for multi-tenancy environments,
258 *    as ALL users from ALL tenents need access to the configured store & folder.
259 *    When configuring a public folder, this will cause problems, as each user has
260 *    a different public folder in his tenant, so the folder are not available.
261
262 *  - changing this configuration could cause HIGH LOAD on the system, as all
263 *    connected devices will be updated and load the data contained in the
264 *    added/modified folders.
265 */
266
267    $additionalFolders = array(
268        // demo entry for the synchronization of contacts from the public folder.
269        // uncomment (remove '/*' '*/') and fill in the folderid
270/*
271        array(
272            'store'     => "SYSTEM",
273            'folderid'  => "",
274            'name'      => "Public Contacts",
275            'type'      => SYNC_FOLDER_TYPE_USER_CONTACT,
276        ),
277*/
278    );
279
280    $ldapConfig = parse_ini_file(EXPRESSO_PATH . '/prototype/config/OpenLDAP.srv' , true );
281    $ldapConfig =  $ldapConfig['config'];
282    $con = ldap_connect( $ldapConfig['host'] );
283
284    ldap_set_option( $con , LDAP_OPT_PROTOCOL_VERSION , 3 );
285
286    if( isset( $ldapConfig['user'] ) && isset( $ldapConfig['password'] ) )
287        ldap_bind( $con , $ldapConfig['user'], $ldapConfig['password'] );
288
289    $GLOBALS['connections']['ldap'] = $con;
290
291    $dbConfig = parse_ini_file(EXPRESSO_PATH . '/prototype/config/PostgreSQL.srv' , true );
292    $dbConfig = $dbConfig['config'];
293
294    $rs = '';
295    $rs .= ( isset($dbConfig['host']) && $dbConfig['host'] )  ? ' host='.$dbConfig['host'] : '' ;
296    $rs .= ( isset($dbConfig['user']) && $dbConfig['user'] )  ? ' user='.$dbConfig['user'] : '' ;
297    $rs .= ( isset($dbConfig['password']) && $dbConfig['password'] )  ? ' password='.$dbConfig['password'] : '' ;
298    $rs .= ( isset($dbConfig['dbname']) && $dbConfig['dbname'] )  ? ' dbname='.$dbConfig['dbname'] : '' ;
299    $rs .= ( isset($dbConfig['port']) && $dbConfig['port'] )  ? ' port='.$dbConfig['port'] : '' ;
300
301    $GLOBALS['connections']['db'] = pg_connect( $rs );
302    $rs = pg_query( $GLOBALS['connections']['db'], 'SELECT app_id FROM phpgw_applications WHERE app_name = \'zpush\'' );
303    $row = pg_fetch_assoc( $rs );
304
305
306    if(!$row)
307       die('Modulo Z-push não Instalado');
308
309
310?>
Note: See TracBrowser for help on using the repository browser.