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
5407bc5d
Commit
5407bc5d
authored
Mar 30, 2016
by
Sebastian Kummer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ZO-71 Save data from the OL plugin and display it in every Outlook
request and in z-push-admin.
parent
1a43ed4f
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
83 additions
and
1 deletion
+83
-1
asdevice.php
src/lib/core/asdevice.php
+3
-0
devicemanager.php
src/lib/core/devicemanager.php
+12
-1
request.php
src/lib/request/request.php
+61
-0
z-push-admin.php
src/z-push-admin.php
+7
-0
No files found.
src/lib/core/asdevice.php
View file @
5407bc5d
...
@@ -69,6 +69,9 @@ class ASDevice extends StateObject {
...
@@ -69,6 +69,9 @@ class ASDevice extends StateObject {
'announcedASversion'
=>
false
,
'announcedASversion'
=>
false
,
'foldersynccomplete'
=>
true
,
'foldersynccomplete'
=>
true
,
'additionalfolders'
=>
array
(),
'additionalfolders'
=>
array
(),
'olpluginversion'
=>
false
,
'olpluginbuild'
=>
false
,
'olpluginbuilddate'
=>
false
,
);
);
static
private
$loadedData
;
static
private
$loadedData
;
...
...
src/lib/core/devicemanager.php
View file @
5407bc5d
...
@@ -100,6 +100,10 @@ class DeviceManager {
...
@@ -100,6 +100,10 @@ class DeviceManager {
$this
->
stateManager
->
SetDevice
(
$this
->
device
);
$this
->
stateManager
->
SetDevice
(
$this
->
device
);
$this
->
additionalFoldersHash
=
$this
->
getAdditionalFoldersHash
();
$this
->
additionalFoldersHash
=
$this
->
getAdditionalFoldersHash
();
if
(
$this
->
IsOutlookClient
())
{
ZLog
::
Write
(
LOGLEVEL_DEBUG
,
sprintf
(
"Acacia OL Plugin: %s / %s / %s"
,
$this
->
device
->
GetOLPluginVersion
(),
$this
->
device
->
GetOLPluginBuild
(),
strftime
(
"%Y-%m-%d %H:%M"
,
$this
->
device
->
GetOLPluginBuildDate
())));
}
}
}
/**
/**
...
@@ -149,6 +153,13 @@ class DeviceManager {
...
@@ -149,6 +153,13 @@ class DeviceManager {
$this
->
device
->
SetUserAgent
(
Request
::
GetUserAgent
());
$this
->
device
->
SetUserAgent
(
Request
::
GetUserAgent
());
$this
->
device
->
SetASVersion
(
Request
::
GetProtocolVersion
());
$this
->
device
->
SetASVersion
(
Request
::
GetProtocolVersion
());
// update data from the OL plugin (if available)
if
(
Request
::
HasOLPluginStats
())
{
$this
->
device
->
SetOLPluginVersion
(
Request
::
GetOLPluginVersion
());
$this
->
device
->
SetOLPluginBuild
(
Request
::
GetOLPluginBuild
());
$this
->
device
->
SetOLPluginBuildDate
(
Request
::
GetOLPluginBuildDate
());
}
// data to be saved
// data to be saved
$data
=
$this
->
device
->
GetData
();
$data
=
$this
->
device
->
GetData
();
if
(
$data
&&
Request
::
IsValidDeviceID
())
{
if
(
$data
&&
Request
::
IsValidDeviceID
())
{
...
@@ -659,7 +670,7 @@ class DeviceManager {
...
@@ -659,7 +670,7 @@ class DeviceManager {
* @return boolean
* @return boolean
*/
*/
public
function
IsOutlookClient
()
{
public
function
IsOutlookClient
()
{
if
(
Request
::
GetDeviceType
()
==
"WindowsOutlook"
)
{
if
(
Request
::
GetDeviceType
()
==
"WindowsOutlook"
&&
$this
->
device
->
GetOLPluginVersion
()
!==
false
)
{
return
true
;
return
true
;
}
}
return
false
;
return
false
;
...
...
src/lib/request/request.php
View file @
5407bc5d
...
@@ -54,6 +54,7 @@ class Request {
...
@@ -54,6 +54,7 @@ class Request {
const
NUMBERS_ONLY
=
4
;
const
NUMBERS_ONLY
=
4
;
const
NUMBERSDOT_ONLY
=
5
;
const
NUMBERSDOT_ONLY
=
5
;
const
HEX_EXTENDED
=
6
;
const
HEX_EXTENDED
=
6
;
const
ISO8601
=
7
;
/**
/**
* Command parameters for base64 encoded requests (AS >= 12.1)
* Command parameters for base64 encoded requests (AS >= 12.1)
...
@@ -93,6 +94,9 @@ class Request {
...
@@ -93,6 +94,9 @@ class Request {
static
private
$occurence
;
//TODO
static
private
$occurence
;
//TODO
static
private
$saveInSent
;
static
private
$saveInSent
;
static
private
$acceptMultipart
;
static
private
$acceptMultipart
;
static
private
$olPluginVersion
;
static
private
$olPluginBuild
;
static
private
$olPluginBuildDate
;
/**
/**
...
@@ -232,6 +236,13 @@ class Request {
...
@@ -232,6 +236,13 @@ class Request {
ZLog
::
Write
(
LOGLEVEL_DEBUG
,
sprintf
(
"Request::ProcessHeaders() ASVersion: %s"
,
self
::
$asProtocolVersion
));
ZLog
::
Write
(
LOGLEVEL_DEBUG
,
sprintf
(
"Request::ProcessHeaders() ASVersion: %s"
,
self
::
$asProtocolVersion
));
if
(
isset
(
self
::
$headers
[
"x-push-plugin"
]))
{
list
(
$version
,
$build
,
$buildDate
)
=
explode
(
"/"
,
self
::
$headers
[
"x-push-plugin"
]);
self
::
$olPluginVersion
=
self
::
filterEvilInput
(
$version
,
self
::
NUMBERSDOT_ONLY
);
self
::
$olPluginBuild
=
self
::
filterEvilInput
(
$build
,
self
::
HEX_ONLY
);
self
::
$olPluginBuildDate
=
strtotime
(
self
::
filterEvilInput
(
$buildDate
,
self
::
ISO8601
));
}
if
(
defined
(
'USE_X_FORWARDED_FOR_HEADER'
)
&&
USE_X_FORWARDED_FOR_HEADER
==
true
&&
isset
(
self
::
$headers
[
"x-forwarded-for"
]))
{
if
(
defined
(
'USE_X_FORWARDED_FOR_HEADER'
)
&&
USE_X_FORWARDED_FOR_HEADER
==
true
&&
isset
(
self
::
$headers
[
"x-forwarded-for"
]))
{
$forwardedIP
=
self
::
filterEvilInput
(
self
::
$headers
[
"x-forwarded-for"
],
self
::
NUMBERSDOT_ONLY
);
$forwardedIP
=
self
::
filterEvilInput
(
self
::
$headers
[
"x-forwarded-for"
],
self
::
NUMBERSDOT_ONLY
);
if
(
$forwardedIP
)
{
if
(
$forwardedIP
)
{
...
@@ -627,6 +638,7 @@ class Request {
...
@@ -627,6 +638,7 @@ class Request {
else
if
(
$filter
==
self
::
NUMBERS_ONLY
)
$re
=
"/[^0-9]/"
;
else
if
(
$filter
==
self
::
NUMBERS_ONLY
)
$re
=
"/[^0-9]/"
;
else
if
(
$filter
==
self
::
NUMBERSDOT_ONLY
)
$re
=
"/[^0-9\.]/"
;
else
if
(
$filter
==
self
::
NUMBERSDOT_ONLY
)
$re
=
"/[^0-9\.]/"
;
else
if
(
$filter
==
self
::
HEX_EXTENDED
)
$re
=
"/[^A-Fa-f0-9\:]/"
;
else
if
(
$filter
==
self
::
HEX_EXTENDED
)
$re
=
"/[^A-Fa-f0-9\:]/"
;
else
if
(
$filter
==
self
::
ISO8601
)
$re
=
"/[^\d
{
8}T\d{6
}
Z]/"
;
return
(
$re
)
?
preg_replace
(
$re
,
$replacevalue
,
$input
)
:
''
;
return
(
$re
)
?
preg_replace
(
$re
,
$replacevalue
,
$input
)
:
''
;
}
}
...
@@ -645,4 +657,53 @@ class Request {
...
@@ -645,4 +657,53 @@ class Request {
fclose
(
$input
);
fclose
(
$input
);
return
$wbxml
;
return
$wbxml
;
}
}
/**
* Indicates if the request contained the OL plugin stats header.
*
* @access public
* @return boolean
*/
static
public
function
HasOLPluginStats
()
{
return
isset
(
self
::
$olPluginVersion
)
&&
isset
(
self
::
$olPluginBuild
)
&&
isset
(
self
::
$olPluginBuildDate
);
}
/**
* Returns the version number of the OL plugin informed by the stats header.
*
* @access public
* @return string
*/
static
public
function
GetOLPluginVersion
()
{
if
(
isset
(
self
::
$olPluginVersion
))
return
self
::
$olPluginVersion
;
else
return
self
::
UNKNOWN
;
}
/**
* Returns the build of the OL plugin informed by the stats header.
*
* @access public
* @return string
*/
static
public
function
GetOLPluginBuild
()
{
if
(
isset
(
self
::
$olPluginBuild
))
return
self
::
$olPluginBuild
;
else
return
self
::
UNKNOWN
;
}
/**
* Returns the build date of the OL plugin informed by the stats header.
*
* @access public
* @return string
*/
static
public
function
GetOLPluginBuildDate
()
{
if
(
isset
(
self
::
$olPluginBuildDate
))
return
self
::
$olPluginBuildDate
;
else
return
self
::
UNKNOWN
;
}
}
}
src/z-push-admin.php
View file @
5407bc5d
...
@@ -861,6 +861,13 @@ class ZPushAdminCLI {
...
@@ -861,6 +861,13 @@ class ZPushAdminCLI {
echo
"WipeRequest by:
\t\t
"
.
(
$device
->
GetWipeRequestedBy
()
?
$device
->
GetWipeRequestedBy
()
:
"not set"
)
.
"
\n
"
;
echo
"WipeRequest by:
\t\t
"
.
(
$device
->
GetWipeRequestedBy
()
?
$device
->
GetWipeRequestedBy
()
:
"not set"
)
.
"
\n
"
;
echo
"Wiped on:
\t\t
"
.
(
$device
->
GetWipeActionOn
()
?
strftime
(
"%Y-%m-%d %H:%M"
,
$device
->
GetWipeActionOn
())
:
"not set"
)
.
"
\n
"
;
echo
"Wiped on:
\t\t
"
.
(
$device
->
GetWipeActionOn
()
?
strftime
(
"%Y-%m-%d %H:%M"
,
$device
->
GetWipeActionOn
())
:
"not set"
)
.
"
\n
"
;
if
(
$device
->
GetOLPluginVersion
())
{
echo
"Acacia OL Plugin:
\n
"
;
echo
"
\t
Version:
\t
"
.
$device
->
GetOLPluginVersion
()
.
"
\n
"
;
echo
"
\t
Build:
\t\t
"
.
$device
->
GetOLPluginBuild
()
.
"
\n
"
;
echo
"
\t
Build Date:
\t
"
.
strftime
(
"%Y-%m-%d %H:%M"
,
$device
->
GetOLPluginBuildDate
())
.
"
\n
"
;
}
echo
"Attention needed:
\t
"
;
echo
"Attention needed:
\t
"
;
if
(
$device
->
GetDeviceError
())
if
(
$device
->
GetDeviceError
())
...
...
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