Commit 346bf9d9 authored by Sebastian Kummer's avatar Sebastian Kummer

Merge pull request #516 in ZP/z-push from develop to release/2.3

* commit '9e4f0a3e':
  ZP-1195 Use full path.
  ZP-1195 Call Request::GetUser() only once.
  ZP-1195 Expose GetDeviceDetails() via WebserviceDevice.
  ZP-1163 Look only for the file without the relative path.
  ZP-1168 Always initialize wait time with 0.
  ZP-1189 Fix license inconsistency in Net/Socket.php
  ZP-1193 Update license in Net/SMTP.php to BSD-2-clause
  ZP-1163 Check if config exists before including it.
  ZP-1190 Install manpages in rpm packages
  ZP-1190 Install manpages in debian packages
  ZP-1190 Manpage for z-push-admin
  ZP-1190 Manpage for z-push-gab2contacts
  ZP-1190 Manpage for z-push-gabsync
  ZP-1190 Add links to wiki pages
  ZP-1190 Manpage for z-push-admin
  ZP-1190 Manpage for z-push-top
  ZP-1189 Update license in Net Socket
  ZP-1187 Mail/sendmail.php: PEAR bug 21082: Use BSD license
  ZP-1187 Mail/sendmail.php: update header
parents 7f10b0a0 9e4f0a3e
man/z-push-admin.1
man/z-push-top.1
......@@ -375,6 +375,10 @@ install -Dpm 644 config/apache2/z-push.conf \
install -Dpm 644 config/apache2/z-push-autodiscover.conf \
"$b/%apache_dir/conf.d/z-push-autodiscover.conf";
# MANPAGES
mkdir -p "$b/%_mandir/man1"
cp man/*.1 "$b/%_mandir/man1"
%post -n %name-config-apache
%if 0%{?suse_version}
service apache2 reload || true
......@@ -438,6 +442,9 @@ install -Dpm 644 config/apache2/z-push-autodiscover.conf \
%_bindir/z-push-admin
%_bindir/z-push-top
%_mandir/man1/z-push-admin.1*
%_mandir/man1/z-push-top.1*
# CALDAV
%files -n %name-backend-caldav
%defattr(-, root, root)
......@@ -528,6 +535,7 @@ install -Dpm 644 config/apache2/z-push-autodiscover.conf \
%config(noreplace) %attr(0640,root,apache) %_sysconfdir/z-push/gabsync.conf.php
%endif
%_bindir/z-push-gabsync
%_mandir/man1/z-push-gabsync.1*
%files -n %name-kopano-gab2contacts
%defattr(-, root, root)
......@@ -541,6 +549,7 @@ install -Dpm 644 config/apache2/z-push-autodiscover.conf \
%config(noreplace) %attr(0640,root,apache) %_sysconfdir/z-push/gab2contacts.conf.php
%endif
%_bindir/z-push-gab2contacts
%_mandir/man1/z-push-gab2contacts.1*
%files -n %name-kopano
......
.TH Z-PUSH-ADMIN 1
.SH NAME
z-push-admin \(em device and user administration for Z-push
.SH SYNOPSIS
.B \fBz-push-admin\fP \fB\-a\fP \fIlist\fP [\fB\-u\fP \fIUSER\fP | \fB\-d\fP \fIDEVICE\fP]
.PP
.B \fBz-push-admin\fP \fB\-a\fP \fIlastsync\fP
.PP
.B \fBz-push-admin\fP \fB\-a\fP \fIwipe\fP \fB\-u\fP \fIUSER\fP | \fB\-d\fP \fIDEVICE\fP|\fB\-u\fP \fIUSER\fP \fB\-d\fP \fIDEVICE\fP
.PP
.B \fBz-push-admin\fP \fB\-a\fP \fIremove\fP \fB\-u\fP \fIUSER\fP | \fB\-d\fP \fIDEVICE\fP | \fB\-u\fP \fIUSER\fP \fB\-d\fP \fIDEVICE\fP
.PP
.B \fBz-push-admin\fP \fB\-a\fP \fIresync\fP \fB\-t\fP \fITYPE\fP | \fB\-t\fP \fITYPE\fP \fB\-u\fP \fIUSER\fP | \fB\-t\fP \fITYPE\fP \fB\-u\fP \fIUSER\fP \fB\-d\fP \fIDEVICE\fP
.PP
.B \fBz-push-admin\fP \fB\-a\fP \fIresync\fP \fB\-t\fP \fIFOLDERID\fP \fB\-u\fP \fIUSER\fP
.PP
.B \fBz-push-admin\fP \fB\-a\fP \fIresync\fP \fB\-t\fP \fIhierarchy\fP \fB\-u\fP \fIUSER\fP \fB\-d\fP \fIDEVICE\fP
.PP
.B \fBz-push-admin\fP \fB\-a\fP \fIclearloop\fP [\fB\-d\fP \fIDEVICE\fP | \fB\-d\fP \fIDEVICE\fP \fB\-u\fP \fIUSER\fP]
.PP
.B \fBz-push-admin\fP \fB\-a\fP \fIfixstates\fP
.SH DESCRIPTION
\fBz-push-admin\fP can be used to manage the users and devices that sync their
email, contacts and calendar items with Z-push.
.SH OPTIONS
.SS list
The \fIlist\fP action lists synchronized devices. When no extra options are
given, the command returns a listing of all synchronized devices. If the
selection is narrowed by specifying a username (\fB\-u\fP \fIUSER\fP) or
a device id (\fB\-d\fP \fIDEVICE\fP) or both, the command lists
extended information about the selected device(s).
.SS lastsync
The \fIlastsync\fP action lists all devices and synchronized users and the
time that the last synchronization took place.
.SS wipe
The \fIwipe\fP action sends the wipe command to the selected device. The
device decides how to handle this command: some devices only remove the
account from the device, other devices do a factory reset, or even empty
the complete storage. Use with caution.
.SS remove
The \fIremove\fP action removes state data. When a username is specified
(\fB\-u\fP \fIUSER\fP), the state data of all devices of that user is removed.
When a device id is specified (\fB\-d\fP \fIDEVICE\fP), the state data of all
users for that device is removed. When both are specified, the state data is
removed for a specific user on a specific device.
.SS resync
The \fIresync\fP action triggers a resynchronization of specific data. With
the options, it is possible to select which data exactly is synchronized.
When a username (\fB\-u\fP \fIUSER\fP) and device id (\fB\-d\fP \fIDEVICE\fP)
are specified, all data of this user on this device is resynchronized. By
specifying a folder type (\fB\-t\fP \fITYPE\fP), only folders of this type are
synchronized. Valid types are \fBemail\fP, \fBcalendar\fP, \fBcontact\fP,
\fBtask\fP, \fBnote\fP and \fBgab\fP.
The \fB\-t\fP option can also be used to specify a folder id to resynchronize
only a specific folder, or \fBhierarchy\fP to resynchronize the folder list.
.SS clearloop
The \fIclearloop\fP action clears the loop detection data, either for all
users and devices, or (with \fB\-d\fP \fIDEVICE\fP and \fB\-u\fP \fIUSER\fP)
for a specific user on a specific device.
Loop detection is Z-push's automatic mechanism for avoiding problems where a
device requests the same item over and over again. With the clearloop action
this mechanism is reset.
.SS fixstates
The \fIfixstates\fP action checks the state of all users and devices and fixes
potential problems.
.SH SEE ALSO
https://wiki.z-hub.io/display/ZP/Tools:+z-push-admin
.TH Z-PUSH-GAB2CONTACTS 1
.SH NAME
z-push-gab2contacts \(em synchronize Global Address Book data to a contact folder
.SH SYNOPSIS
.B \fBz-push-gab2contacts\fP \fB\-a\fP \fIsync\fP
.PP
.B \fBz-push-gab2contacts\fP \fB\-a\fP \fIdelete\fP
.PP
.SH DESCRIPTION
\fBz-push-gab2contacts\fP can be used to synchronize the Global Address Book
(GAB) to a normal contacts folder. This way the GAB can be easily synchronized
to mobile devices.
.SH OPTIONS
.SS sync
The \fIsync\fP action updates the contact folder with the contacts from the
GAB. Contacts created manually in the contact folder are not touched.
.SS delete
The \fIdelete\fP action deletes the contacts from the contacts folder that
were created by synchronization from the GAB.
.TH Z-PUSH-GABSYNC 1
.SH NAME
z-push-gabsync \(em synchronize Global Address Book data
.SH SYNOPSIS
.B \fBz-push-gabsync\fP \fB\-a\fP \fIsimulate\fP [\fB\-t\fP \fITARGET-GAB\fP]
.PP
.B \fBz-push-gabsync\fP \fB\-a\fP \fIsync\fP [\fB\-t\fP \fITARGET-GAB\fP]
.PP
.B \fBz-push-gabsync\fP \fB\-a\fP \fIsync-one\fP \fB\-u\fP \fIUNIQUE-ID\fP [\fB\-t\fP \fITARGET-GAB\fP]
.PP
.B \fBz-push-gabsync\fP \fB\-a\fP \fIclear-all\fP [\fB\-t\fP \fITARGET-GAB\fP]
.PP
.B \fBz-push-gabsync\fP \fB\-a\fP \fIdelete-all\fP [\fB\-t\fP \fITARGET-GAB\fP]
.PP
.SH DESCRIPTION
\fBz-push-gabsync\fP can be used to synchronize Global Address Book (GAB) data
with clients that use the Kopano Outlook Extension (KOE).
.SH OPTIONS
In multi-tenant or hosted environments, multiple GABs exist. To perform an
action only for a specific tenant, the name of the GAB can be passed with
the \fB\-t\fP \fITARGET-GAB\fP option.
.SS simulate
The \fIsimulate\fP action simulates synchronization of the the Global Address
Book (GAB) entries, and prints out statistics and configuration suggestions.
.SS sync-one
The \fIsync\fP action synchronizes the GAB to an address book in Outlook.
.SS sync-one
The \fIsync-one\fP action synchronizes a single GAB entry. The \fB\-u\fP
\fIUNIQUE-ID\fP option must be used to select which entry to synchronize.
.SS clear-all
The \fIclear-all\fP action removes all entries from the synchronized folder in
Outlook.
.SS delete-all
The \fIdelete-all\fP action removes all entries from the synchronized folder
in Outlook, and also removes the folder itself.
.TH Z-PUSH-TOP 1
.SH NAME
z-push-top \(em top-like overview of Z-push
.SH SYNOPSIS
.B \fBz-push-top\fP
.SH DESCRIPTION
\fBz-push-top\fP is a live top-like overview of what Z-push is doing.
.SH OPTIONS
None.
.SH USAGE
When \fBz-push-top\fP is running you can specify certain actions and options which can be executed (listed below). This help information can also be shown inside z-push-top by hitting \fBhelp\fP or \fBh\fP.
.SS h,help
Displays this information.
.SS q,quit,:q
Exits z-push-top.
.SS w,wide
Tries not to truncate data. Automatically done if more than 180 columns available.
.SS f:VAL,filter:VAL
Only display connections which contain VAL. This value is case-insensitive.
.SS f:,filter:
Without a search word: resets the filter.
.SS l:STR,log:STR
Issues 'less +G' on the logfile, after grepping on the optional STR.
.SS t:STR,tail:STR
Issues 'tail -f' on the logfile, grepping for optional STR.
.SS e:STR,error:STR
Issues 'tail -f' on the error logfile, grepping for optional STR.
.SS r,reset
Resets 'wide' or 'filter'.
.SS o:,option:
Sets display options. Valid options are:
.TP
.BI p,push
Lists/does not list active and open push connections.
.TP
.BI a,action
Lists only active connections.
.TP
.BI u,unknown
Lists only unknown connections.
.TP
.BI 10,20
Lists terminated connections for 10 or 20 seconds. Any other number can be used.
.TP
.BI d,default
Use default display options.
.SH SEE ALSO
https://wiki.z-hub.io/display/ZP/Tools:+z-push-top
<?php
//
// +----------------------------------------------------------------------+
// | PHP Version 4 |
// +----------------------------------------------------------------------+
// | Copyright (c) 1997-2003 The PHP Group |
// +----------------------------------------------------------------------+
// | This source file is subject to version 2.02 of the PHP license, |
// | that is bundled with this package in the file LICENSE, and is |
// | available at through the world-wide-web at |
// | http://www.php.net/license/2_02.txt. |
// | If you did not receive a copy of the PHP license and are unable to |
// | obtain it through the world-wide-web, please send a note to |
// | license@php.net so we can mail you a copy immediately. |
// +----------------------------------------------------------------------+
// | Author: Chuck Hagenbuch <chuck@horde.org> |
// +----------------------------------------------------------------------+
/**
* Sendmail implementation of the PEAR Mail interface.
*
* PHP version 5
*
* LICENSE:
*
* Copyright (c) 2010, Chuck Hagenbuch
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* o Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* o Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* o The names of the authors may not be used to endorse or promote
* products derived from this software without specific prior written
* permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* @category Mail
* @package Mail
* @author Jon Parise <jon@php.net>
* @author Chuck Hagenbuch <chuck@horde.org>
* @copyright 2010 Chuck Hagenbuch
* @license http://opensource.org/licenses/bsd-license.php New BSD License
* @version CVS: $Id$
* @link http://pear.php.net/package/Mail/
*/
/**
* Z-Push changes
......
......@@ -3,15 +3,33 @@
// +----------------------------------------------------------------------+
// | PHP Version 5 and 7 |
// +----------------------------------------------------------------------+
// | Copyright (c) 1997-2015 The PHP Group |
// +----------------------------------------------------------------------+
// | This source file is subject to version 3.01 of the PHP license, |
// | that is bundled with this package in the file LICENSE, and is |
// | available at through the world-wide-web at |
// | http://www.php.net/license/3_01.txt. |
// | If you did not receive a copy of the PHP license and are unable to |
// | obtain it through the world-wide-web, please send a note to |
// | license@php.net so we can mail you a copy immediately. |
// | Copyright (c) 1997-2017 Jon Parise and Chuck Hagenbuch |
// | All rights reserved. |
// | |
// | Redistribution and use in source and binary forms, with or without |
// | modification, are permitted provided that the following conditions |
// | are met: |
// | |
// | 1. Redistributions of source code must retain the above copyright |
// | notice, this list of conditions and the following disclaimer. |
// | |
// | 2. Redistributions in binary form must reproduce the above copyright |
// | notice, this list of conditions and the following disclaimer in |
// | the documentation and/or other materials provided with the |
// | distribution. |
// | |
// | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
// | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
// | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS |
// | FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE |
// | COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, |
// | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, |
// | BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
// | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER |
// | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT |
// | LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN |
// | ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
// | POSSIBILITY OF SUCH DAMAGE. |
// +----------------------------------------------------------------------+
// | Authors: Chuck Hagenbuch <chuck@horde.org> |
// | Jon Parise <jon@php.net> |
......@@ -42,6 +60,7 @@
* @author Chuck Hagenbuch <chuck@horde.org>
* @author Jon Parise <jon@php.net>
* @author Damian Alejandro Fernandez Sosa <damlists@cnba.uba.ar>
* @license http://opensource.org/licenses/bsd-license.php BSD-2-Clause
*
* @example basic.php A basic implementation of the Net_SMTP package.
*/
......
......@@ -4,25 +4,39 @@
*
* PHP Version 4
*
* Copyright (c) 1997-2013 The PHP Group
* LICENSE:
*
* This source file is subject to version 2.0 of the PHP license,
* that is bundled with this package in the file LICENSE, and is
* available at through the world-wide-web at
* http://www.php.net/license/2_02.txt.
* If you did not receive a copy of the PHP license and are unable to
* obtain it through the world-wide-web, please send a note to
* license@php.net so we can mail you a copy immediately.
* Copyright (c) 1997-2003 The PHP Group
* All rights reserved.
*
* Authors: Stig Bakken <ssb@php.net>
* Chuck Hagenbuch <chuck@horde.org>
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* o Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* o Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* @category Net
* @package Net_Socket
* @author Stig Bakken <ssb@php.net>
* @author Chuck Hagenbuch <chuck@horde.org>
* @copyright 1997-2003 The PHP Group
* @license http://www.php.net/license/2_02.txt PHP 2.02
* @license http://opensource.org/licenses/bsd-license.php BSD-2-Clause
* @link http://pear.php.net/packages/Net_Socket
*/
......@@ -57,7 +71,7 @@ define('NET_SOCKET_ERROR', 4);
* @author Stig Bakken <ssb@php.net>
* @author Chuck Hagenbuch <chuck@horde.org>
* @copyright 1997-2003 The PHP Group
* @license http://www.php.net/license/2_02.txt PHP 2.02
* @license http://opensource.org/licenses/bsd-license.php BSD-2-Clause
* @link http://pear.php.net/packages/Net_Socket
*/
//class Net_Socket extends PEAR
......
......@@ -27,7 +27,13 @@
*************************************************/
// config file
require_once("backend/kopano/config.php");
$config_path = stream_resolve_include_path(__DIR__."/config.php");
if ($config_path !== false) {
require_once($config_path);
}
else {
ZLog::Write(LOGLEVEL_WARN, "Kopano backend config file can not be found");
}
// include PHP-MAPI classes
include_once('backend/kopano/mapi/mapi.util.php');
......
......@@ -38,7 +38,7 @@ abstract class RequestProcessor {
static protected $encoder;
static protected $userIsAuthenticated;
static protected $specialHeaders;
static protected $waitTime;
static protected $waitTime = 0;
/**
* Authenticates the remote user
......
......@@ -28,7 +28,7 @@
class WebserviceDevice {
/**
* Returns a list of all known devices of the Request::GetGETUser()
* Returns a list of all known devices of the Request::GetGETUser().
*
* @access public
* @return array
......@@ -48,7 +48,22 @@ class WebserviceDevice {
}
/**
* Remove all state data for a device of the Request::GetGETUser()
* Returns the details of a given deviceid of the Request::GetGETUser().
*
* @access public
* @return ASDevice object
*/
public function GetDeviceDetails($deviceId) {
$user = Request::GetGETUser();
$deviceId = preg_replace("/[^A-Za-z0-9]/", "", $deviceId);
ZLog::Write(LOGLEVEL_INFO, sprintf("WebserviceDevice::GetDeviceDetails('%s'): getting device details from state of user '%s'", $deviceId, $user));
ZPush::GetTopCollector()->AnnounceInformation(sprintf("Retrieved details of device '%s'", $deviceId), true);
return ZPushAdmin::GetDeviceDetails($deviceId, $user);
}
/**
* Remove all state data for a device of the Request::GetGETUser().
*
* @param string $deviceId the device id
*
......@@ -70,7 +85,7 @@ class WebserviceDevice {
}
/**
* Marks a device of the Request::GetGETUser() to be remotely wiped
* Marks a device of the Request::GetGETUser() to be remotely wiped.
*
* @param string $deviceId the device id
*
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment