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
fe394c67
Commit
fe394c67
authored
Feb 16, 2016
by
Sebastian Kummer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ZO-35 added support for groups (members + memberOf), room and equipment,
fixed bug opening other store than public.
parent
8c098890
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
43 additions
and
3 deletions
+43
-3
gabentry.php
tools/gab-sync/lib/gabentry.php
+9
-0
zarafa.php
tools/gab-sync/lib/zarafa.php
+34
-3
No files found.
tools/gab-sync/lib/gabentry.php
View file @
fe394c67
...
@@ -11,6 +11,15 @@
...
@@ -11,6 +11,15 @@
class
GABEntry
{
class
GABEntry
{
const
CONTACT
=
"contact"
;
const
GROUP
=
"group"
;
const
ROOM
=
"room"
;
const
EQUIPMENT
=
"equipment"
;
public
$type
;
// contact, group, room or equipment
public
$memberOf
;
// groups the item is a member of
public
$members
;
// if this is a group, a list of its members
// GABEntry variable MAPI Property Default LDAP parameter
// GABEntry variable MAPI Property Default LDAP parameter
public
$account
;
// PR_ACCOUNT username
public
$account
;
// PR_ACCOUNT username
public
$displayName
;
// PR_DISPLAY_NAME
public
$displayName
;
// PR_DISPLAY_NAME
...
...
tools/gab-sync/lib/zarafa.php
View file @
fe394c67
...
@@ -195,6 +195,9 @@ class Zarafa extends SyncWorker {
...
@@ -195,6 +195,9 @@ class Zarafa extends SyncWorker {
* @return array of GABEntry
* @return array of GABEntry
*/
*/
protected
function
GetGAB
(
$uniqueId
=
false
)
{
protected
function
GetGAB
(
$uniqueId
=
false
)
{
// get all the groups
$groups
=
mapi_zarafa_getgrouplist
(
$this
->
store
);
$data
=
array
();
$data
=
array
();
$addrbook
=
mapi_openaddressbook
(
$this
->
session
);
$addrbook
=
mapi_openaddressbook
(
$this
->
session
);
...
@@ -245,10 +248,38 @@ class Zarafa extends SyncWorker {
...
@@ -245,10 +248,38 @@ class Zarafa extends SyncWorker {
PR_BUSINESS_ADDRESS_POST_OFFICE_BOX
,
PR_BUSINESS_ADDRESS_POST_OFFICE_BOX
,
PR_INITIALS
,
PR_INITIALS
,
PR_LANGUAGE
,
PR_LANGUAGE
,
PR_EMS_AB_THUMBNAIL_PHOTO
PR_EMS_AB_THUMBNAIL_PHOTO
,
PR_DISPLAY_TYPE_EX
));
));
foreach
(
$gabentries
as
$entry
)
{
foreach
(
$gabentries
as
$entry
)
{
$a
=
new
GABEntry
();
$a
=
new
GABEntry
();
$a
->
type
=
GABEnty
::
Contact
;
$a
->
memberOf
=
array
();
$memberOf
=
mapi_zarafa_getgrouplistofuser
(
$this
->
store
,
$entry
[
PR_ENTRYID
]);
if
(
is_array
(
$memberOf
))
{
$a
->
memberOf
=
array_keys
(
$memberOf
);
}
// is this a group?
if
(
array_key_exists
(
$entry
[
PR_ACCOUNT
],
$groups
))
{
$a
->
type
=
GABEnty
::
GROUP
;
$users
=
mapi_zarafa_getuserlistofgroup
(
$this
->
store
,
$groups
[
$entry
[
PR_ACCOUNT
]][
'groupid'
]);
if
(
isset
(
$users
[
$entry
[
PR_ACCOUNT
]][
'emailaddress'
]))
{
$a
->
smtpAddress
=
$users
[
$entry
[
PR_ACCOUNT
]][
'emailaddress'
];
}
$a
->
members
=
array_keys
(
$users
);
// remove the group from itself
$key
=
array_search
(
$entry
[
PR_ACCOUNT
],
$a
->
members
);
if
(
$key
!==
false
)
{
unset
(
$a
->
members
[
$key
]);
}
}
else
if
(
isset
(
$entry
[
PR_DISPLAY_TYPE
])
&&
$entry
[
PR_DISPLAY_TYPE_EX
]
==
DT_ROOM
)
{
$a
->
type
=
GABEnty
::
ROOM
;
}
else
if
(
isset
(
$entry
[
PR_DISPLAY_TYPE
])
&&
$entry
[
PR_DISPLAY_TYPE_EX
]
==
DT_EQUIPMENT
)
{
$a
->
type
=
GABEnty
::
EQUIPMENT
;
}
if
(
isset
(
$entry
[
PR_ACCOUNT
]))
$a
->
account
=
$entry
[
PR_ACCOUNT
];
if
(
isset
(
$entry
[
PR_ACCOUNT
]))
$a
->
account
=
$entry
[
PR_ACCOUNT
];
if
(
isset
(
$entry
[
PR_DISPLAY_NAME
]))
$a
->
displayName
=
$entry
[
PR_DISPLAY_NAME
];
if
(
isset
(
$entry
[
PR_DISPLAY_NAME
]))
$a
->
displayName
=
$entry
[
PR_DISPLAY_NAME
];
...
@@ -452,8 +483,8 @@ class Zarafa extends SyncWorker {
...
@@ -452,8 +483,8 @@ class Zarafa extends SyncWorker {
// the default store root
// the default store root
if
(
$this
->
mainUser
==
HIDDEN_FOLDERSTORE
)
{
if
(
$this
->
mainUser
==
HIDDEN_FOLDERSTORE
)
{
$parentprops
=
mapi_getprops
(
$this
->
store
,
array
(
PR_IPM_SUBTREE_ENTRYID
));
$parentprops
=
mapi_getprops
(
$this
->
store
,
array
(
PR_IPM_SUBTREE_ENTRYID
));
if
(
isset
(
$parentprops
[
PR_IPM_
PUBLIC_FOLDERS
_ENTRYID
]))
if
(
isset
(
$parentprops
[
PR_IPM_
SUBTREE
_ENTRYID
]))
$parentfentryid
=
$parentprops
[
PR_IPM_
PUBLIC_FOLDERS
_ENTRYID
];
$parentfentryid
=
$parentprops
[
PR_IPM_
SUBTREE
_ENTRYID
];
}
}
// get the main public folder
// get the main public folder
else
{
else
{
...
...
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