Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Z
z-push
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Björn Fischer
z-push
Commits
ed5b5180
Commit
ed5b5180
authored
Jan 31, 2016
by
Sebastian Kummer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ZO-28 Fixed a few log messages. Remove storeCache. Terminate in case
store can not be found or opened.
parent
43d05f43
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
18 deletions
+9
-18
zarafa.php
tools/gab-sync/lib/zarafa.php
+9
-18
No files found.
tools/gab-sync/lib/zarafa.php
View file @
ed5b5180
...
...
@@ -66,7 +66,7 @@ class Zarafa extends SyncWorker {
// mapi_folder_createfolder() fails if a folder with this name already exists -> MAPI_E_COLLISION
$newfolder
=
mapi_folder_createfolder
(
$parentfolder
,
HIDDEN_FOLDERNAME
,
""
);
if
(
mapi_last_hresult
())
$this
->
Terminate
(
sprintf
(
"Zarafa->CreateHidden
Public
Folder(): Error, mapi_folder_createfolder() failed: 0x%08X"
,
mapi_last_hresult
()));
$this
->
Terminate
(
sprintf
(
"Zarafa->CreateHiddenFolder(): Error, mapi_folder_createfolder() failed: 0x%08X"
,
mapi_last_hresult
()));
// TODO: set PR_HIDDEN
mapi_setprops
(
$newfolder
,
array
(
PR_CONTAINER_CLASS
=>
"IPF.Appointment"
));
...
...
@@ -78,7 +78,7 @@ class Zarafa extends SyncWorker {
return
$sourcekey
;
}
else
$this
->
Terminate
(
sprintf
(
"Zarafa->CreateHidden
Public
Folder(): Error, folder created but PR_SOURCE_KEY not available: 0x%08X"
,
mapi_last_hresult
()));
$this
->
Terminate
(
sprintf
(
"Zarafa->CreateHiddenFolder(): Error, folder created but PR_SOURCE_KEY not available: 0x%08X"
,
mapi_last_hresult
()));
return
false
;
}
...
...
@@ -95,11 +95,11 @@ class Zarafa extends SyncWorker {
$folderentryid
=
mapi_msgstore_entryidfromsourcekey
(
$this
->
store
,
hex2bin
(
$folderid
));
if
(
mapi_last_hresult
())
$this
->
Terminate
(
sprintf
(
"Zarafa->Delete
sHiddenPublic
Folder(): Error, could not get PR_ENTRYID for hidden folder: 0x%08X"
,
mapi_last_hresult
()));
$this
->
Terminate
(
sprintf
(
"Zarafa->Delete
Hidden
Folder(): Error, could not get PR_ENTRYID for hidden folder: 0x%08X"
,
mapi_last_hresult
()));
mapi_folder_deletefolder
(
$parentfolder
,
$folderentryid
);
if
(
mapi_last_hresult
())
$this
->
Terminate
(
sprintf
(
"Zarafa->Delete
sHiddenPublic
Folder(): Error, mapi_folder_deletefolder() failed: 0x%08X"
,
mapi_last_hresult
()));
$this
->
Terminate
(
sprintf
(
"Zarafa->Delete
Hidden
Folder(): Error, mapi_folder_deletefolder() failed: 0x%08X"
,
mapi_last_hresult
()));
return
true
;
}
...
...
@@ -206,7 +206,7 @@ class Zarafa extends SyncWorker {
$addrbook
=
mapi_openaddressbook
(
$this
->
session
);
$result
=
mapi_last_hresult
();
if
(
$result
)
$this
->
Terminate
(
sprintf
(
"Zarafa->Get
Full
GAB: Error opening addressbook 0x%08X"
,
$result
));
$this
->
Terminate
(
sprintf
(
"Zarafa->GetGAB: Error opening addressbook 0x%08X"
,
$result
));
if
(
$addrbook
)
$ab_entryid
=
mapi_ab_getdefaultdir
(
$addrbook
);
...
...
@@ -216,7 +216,7 @@ class Zarafa extends SyncWorker {
$table
=
mapi_folder_getcontentstable
(
$ab_dir
);
if
(
!
$table
)
$this
->
Terminate
(
sprintf
(
"Zarafa->Get
Full
GAB: error, could not open addressbook: 0x%08X"
,
$result
));
$this
->
Terminate
(
sprintf
(
"Zarafa->GetGAB: error, could not open addressbook: 0x%08X"
,
$result
));
// restrict the table if we should only return one
if
(
$uniqueId
)
{
...
...
@@ -402,11 +402,6 @@ class Zarafa extends SyncWorker {
* @return boolean
*/
private
function
openMessageStore
(
$user
)
{
// During PING requests the operations store has to be switched constantly
// the cache prevents the same store opened several times
if
(
isset
(
$this
->
storeCache
[
$user
]))
return
$this
->
storeCache
[
$user
];
$entryid
=
false
;
$return_public
=
false
;
...
...
@@ -441,19 +436,15 @@ class Zarafa extends SyncWorker {
$store
=
@
mapi_openmsgstore
(
$this
->
session
,
$entryid
);
if
(
!
$store
)
{
$this
->
Log
(
sprintf
(
"Zarafa->openMessageStore('%s'): Could not open store
"
,
$user
));
$this
->
Terminate
(
sprintf
(
"Zarafa->openMessageStore(): Could not open store for '%s'. Aborting.
"
,
$user
));
return
false
;
}
// add this store to the cache
if
(
!
isset
(
$this
->
storeCache
[
$user
]))
$this
->
storeCache
[
$user
]
=
$store
;
$this
->
Log
(
sprintf
(
"ZarafaBackend->openMessageStore('%s'): Found '%s' store: '%s'"
,
$user
,
((
$return_public
)
?
'PUBLIC'
:
'DEFAULT'
),
$store
));
$this
->
Log
(
sprintf
(
"Zarafa->openMessageStore(): Found '%s' store of user '%s': '%s'"
,
((
$return_public
)
?
'PUBLIC'
:
'DEFAULT'
),
$user
,
$store
));
return
$store
;
}
else
{
$this
->
Log
(
sprintf
(
"ZarafaBackend->openMessageStore('%s'): No store found for this user
"
,
$user
));
$this
->
Terminate
(
sprintf
(
"Zarafa->openMessageStore(): No store found for user '%s'. Aborting.
"
,
$user
));
return
false
;
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment