Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix error in Provision when using SecurePIM client #6

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions lib/Syncroton/Command/Provision.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,17 +62,17 @@ public function handle()
$this->_device->remotewipe = self::REMOTEWIPE_CONFIRMED;
}

// try to fetch element from Settings namespace
// try to fetch element from Settings namespace
$settings = $xml->children('uri:Settings');
if (isset($settings->DeviceInformation) && isset($settings->DeviceInformation->Set)) {
$this->_deviceInformation = new Syncroton_Model_DeviceInformation($settings->DeviceInformation->Set);

$this->_device->model = $this->_deviceInformation->model;
$this->_device->imei = $this->_deviceInformation->iMEI;
$this->_device->friendlyname = $this->_deviceInformation->friendlyName;
$this->_device->os = $this->_deviceInformation->oS;
$this->_device->oslanguage = $this->_deviceInformation->oSLanguage;
$this->_device->phonenumber = $this->_deviceInformation->phoneNumber;
$this->_device->model = $this->_deviceInformation->model;
$this->_device->imei = $this->_deviceInformation->iMEI;
$this->_device->friendlyname = $this->_deviceInformation->friendlyName;
$this->_device->os = $this->_deviceInformation->oS;
$this->_device->oslanguage = $this->_deviceInformation->oSLanguage;
$this->_device->phonenumber = $this->_deviceInformation->phoneNumber;
}

if ($this->_device->isDirty()) {
Expand All @@ -95,19 +95,19 @@ public function getResponse()
if ($this->_logger instanceof Zend_Log)
$this->_logger->debug(__METHOD__ . '::' . __LINE__ . ' PolicyType: ' . $this->_policyType . ' PolicyKey: ' . $this->_sendPolicyKey);

if($this->_sendPolicyKey === NULL) {
if (!$this->_sendPolicyKey) {
$this->_sendPolicy();
} elseif ($this->_sendPolicyKey == $this->_device->policykey) {
$this->_acknowledgePolicy();
}
}
}
}

return $this->_outputDom;
}

/**
* function the send policy to client
*
*
* 4131 (Enforce password on device) 0: enabled 1: disabled
* 4133 (Unlock from computer) 0: disabled 1: enabled
* AEFrequencyType 0: no inactivity time 1: inactivity time is set
Expand All @@ -120,7 +120,7 @@ public function getResponse()
*/
protected function _sendPolicy()
{
if ($this->_logger instanceof Zend_Log)
if ($this->_logger instanceof Zend_Log)
$this->_logger->info(__METHOD__ . '::' . __LINE__ . ' send policy to device');

$provision = $sync = $this->_outputDom->documentElement;
Expand Down