Commit 8cabbd51 authored by Sebastian Kummer's avatar Sebastian Kummer

Merge pull request #238 in ZP/z-push from...

Merge pull request #238 in ZP/z-push from feature/ZP-932-z-push-admin-should-list-old-longid to develop

* commit '921c650e':
  ZP-932 z-push-admins actions lastsync and list on a user indicate if the device has already short folder ids or not.
parents e8421fdc 921c650e
......@@ -715,6 +715,24 @@ class ASDevice extends StateObject {
return $backendid;
}
/**
* Indicates if the device has a folderid mapping (short ids).
*
* @access public
* @return boolean
*/
public function HasFolderIdMapping() {
if (is_array($this->backend2folderidCache)) {
return true;
}
foreach ($this->contentData as $folderid => $data) {
if (isset($data[self::FOLDERBACKENDID])) {
return true;
}
}
return false;
}
/**
* Gets the supported fields transmitted previousely by the device
* for a certain folder
......
......@@ -438,7 +438,7 @@ class ZPushAdminCLI {
echo "\tno devices found\n";
else {
echo "All known devices and users and their last synchronization time\n\n";
echo str_pad("Device id", 36). str_pad("Synchronized user", 31)."Last sync time\n";
echo str_pad("Device id", 36) . str_pad("Synchronized user", 31) . str_pad("Last sync time", 20) . "Short Ids\n";
echo "-----------------------------------------------------------------------------------------------------\n";
}
......@@ -446,7 +446,9 @@ class ZPushAdminCLI {
$users = ZPushAdmin::ListUsers($deviceId);
foreach ($users as $user) {
$device = ZPushAdmin::GetDeviceDetails($deviceId, $user);
echo str_pad($deviceId, 36) . str_pad($user, 30) . " " . ($device->GetLastSyncTime() ? strftime("%Y-%m-%d %H:%M", $device->GetLastSyncTime()) : "never") . "\n";
$lastsync = $device->GetLastSyncTime() ? strftime("%Y-%m-%d %H:%M", $device->GetLastSyncTime()) : "never";
$hasShortFolderIds = $device->HasFolderIdMapping() ? "Yes":"No";
echo str_pad($deviceId, 36) . str_pad($user, 30) . " " . str_pad($lastsync, 20) . $hasShortFolderIds . "\n";
}
}
}
......@@ -819,6 +821,7 @@ class ZPushAdminCLI {
echo "First sync:\t\t". strftime("%Y-%m-%d %H:%M", $device->GetFirstSyncTime()) ."\n";
echo "Last sync:\t\t". ($device->GetLastSyncTime() ? strftime("%Y-%m-%d %H:%M", $device->GetLastSyncTime()) : "never")."\n";
echo "Total folders:\t\t". count($folders). "\n";
echo "Short folder Ids:\t". ($device->HasFolderIdMapping() ? "Yes":"No") ."\n";
echo "Synchronized folders:\t". $synchedFolders;
if ($syncedFoldersInProgress > 0)
echo " (". $syncedFoldersInProgress. " in progress)";
......
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