Commit 392bddc0 authored by Etienne CHAMPETIER's avatar Etienne CHAMPETIER

ZP-802 fix default Settings() responses.

Released under the Affero GNU General Public License (AGPL) version 3.
parent d8e7289b
...@@ -183,8 +183,22 @@ abstract class Backend implements IBackend { ...@@ -183,8 +183,22 @@ abstract class Backend implements IBackend {
* @return SyncObject $settings * @return SyncObject $settings
*/ */
public function Settings($settings) { public function Settings($settings) {
if ($settings instanceof SyncOOF || $settings instanceof SyncUserInformation) if ($settings instanceof SyncOOF) {
$isget = !empty($settings->bodytype);
$settings = new SyncOOF();
if ($isget) {
//oof get
$settings->oofstate = 0;
$settings->Status = SYNC_SETTINGSSTATUS_SUCCESS;
} else {
//oof set
$settings->Status = SYNC_SETTINGSSTATUS_PROTOCOLLERROR;
}
}
if ($settings instanceof SyncUserInformation) {
$settings->emailaddresses = array(ZPush::GetBackend()->GetUserDetails(Request::GetAuthUser())['emailaddress']);
$settings->Status = SYNC_SETTINGSSTATUS_SUCCESS; $settings->Status = SYNC_SETTINGSSTATUS_SUCCESS;
}
return $settings; return $settings;
} }
......
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