Commit 921c650e authored by Sebastian Kummer's avatar Sebastian Kummer

ZP-932 z-push-admins actions lastsync and list on a user indicate if the

device has already short folder ids or not.

Released under the Affero GNU General Public License (AGPL) version 3.
parent 0449fa9e
...@@ -715,6 +715,24 @@ class ASDevice extends StateObject { ...@@ -715,6 +715,24 @@ class ASDevice extends StateObject {
return $backendid; 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 * Gets the supported fields transmitted previousely by the device
* for a certain folder * for a certain folder
......
...@@ -438,7 +438,7 @@ class ZPushAdminCLI { ...@@ -438,7 +438,7 @@ class ZPushAdminCLI {
echo "\tno devices found\n"; echo "\tno devices found\n";
else { else {
echo "All known devices and users and their last synchronization time\n\n"; 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"; echo "-----------------------------------------------------------------------------------------------------\n";
} }
...@@ -446,7 +446,9 @@ class ZPushAdminCLI { ...@@ -446,7 +446,9 @@ class ZPushAdminCLI {
$users = ZPushAdmin::ListUsers($deviceId); $users = ZPushAdmin::ListUsers($deviceId);
foreach ($users as $user) { foreach ($users as $user) {
$device = ZPushAdmin::GetDeviceDetails($deviceId, $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 { ...@@ -819,6 +821,7 @@ class ZPushAdminCLI {
echo "First sync:\t\t". strftime("%Y-%m-%d %H:%M", $device->GetFirstSyncTime()) ."\n"; 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 "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 "Total folders:\t\t". count($folders). "\n";
echo "Short folder Ids:\t". ($device->HasFolderIdMapping() ? "Yes":"No") ."\n";
echo "Synchronized folders:\t". $synchedFolders; echo "Synchronized folders:\t". $synchedFolders;
if ($syncedFoldersInProgress > 0) if ($syncedFoldersInProgress > 0)
echo " (". $syncedFoldersInProgress. " in progress)"; 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