Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 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
18 changes: 12 additions & 6 deletions admin/activesync.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,17 +59,17 @@
switch ($actionID) {
case 'wipe':
$state->setDeviceRWStatus($deviceID, Horde_ActiveSync::RWSTATUS_PENDING);
$GLOBALS['notification']->push(_("A device wipe has been requested. Device will be wiped on next syncronization attempt."), 'horde.success');
$GLOBALS['notification']->push(_("A full device wipe has been requested. The device will be reset on the next synchronization."), 'horde.success');
break;

case 'accountwipe':
$device = $state->loadDeviceInfo($deviceID);
if (!Horde_ActiveSync::deviceSupportsAccountOnlyWipe($device->version ?? null)) {
$GLOBALS['notification']->push(_("Account-only wipe is only available for devices that support EAS 16.1 or newer."), 'horde.error');
$GLOBALS['notification']->push(_("Account-only wipe requires a device with EAS 16.1 or newer."), 'horde.error');
break;
}
$state->setDeviceRWStatus($deviceID, Horde_ActiveSync::RWSTATUS_ACCOUNTONLY_PENDING);
$GLOBALS['notification']->push(_("An account-only wipe has been requested. The account will be removed on next synchronization attempt."), 'horde.success');
$GLOBALS['notification']->push(_("An account-only wipe has been requested. The account will be removed from the device on the next synchronization."), 'horde.success');
break;

case 'cancelwipe':
Expand Down Expand Up @@ -140,7 +140,7 @@
$view->reset = $selfurl->copy()->add('reset', 1);
$devs = [];
$js = [];
$collections = [];
$rows = [];
foreach (array_values($devices) as $device) {
$dev = $state->loadDeviceInfo($device['device_id'], $device['device_user']);
try {
Expand All @@ -166,10 +166,16 @@
_("Last synckey") => $c['lastsynckey'],
];
}
$collections[] = $collection;
$rows[] = [
'device' => $dev,
'collections' => $collection,
];
}
$rows = Horde_ActiveSync_DeviceTable::sortRows($rows, true);
$view->entries = Horde_ActiveSync_DeviceTable::toEntries($rows, true);
$view->groupByUser = true;
$view->devices = $devs;
$view->collections = $collections;
$view->collections = array_column($rows, 'collections');
$view->isAdmin = true;

$page_output->addScriptFile('activesyncadmin.js', 'horde');
Expand Down
93 changes: 93 additions & 0 deletions lib/ActiveSync/DeviceTable.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
<?php

/**
* Helpers for rendering ActiveSync device tables.
*
* Copyright 2026 Horde LLC (http://www.horde.org/)
*
* @license http://www.horde.org/licenses/lgpl LGPL-2
* @package Horde
*/

/**
* Build sorted, optionally grouped device table entries for templates.
*/
class Horde_ActiveSync_DeviceTable
{
/**
* Sort device rows.
*
* @param array<int, array{device: Horde_ActiveSync_Device, collections: array}> $rows
* @param bool $byUser If true, sort by username first.
*/
public static function sortRows(array $rows, bool $byUser = true): array
{
usort(
$rows,
function (array $a, array $b) use ($byUser) {
if ($byUser) {
$cmp = strcasecmp($a['device']->user, $b['device']->user);
if ($cmp !== 0) {
return $cmp;
}
}

$cmp = strcasecmp($a['device']->deviceType, $b['device']->deviceType);
if ($cmp !== 0) {
return $cmp;
}

return strcasecmp($a['device']->id, $b['device']->id);
}
);

return $rows;
}

/**
* Convert rows to template entries, optionally with user group headers.
*
* @param array<int, array{device: Horde_ActiveSync_Device, collections: array}> $rows
*
* @return array<int, array<string, mixed>>
*/
public static function toEntries(array $rows, bool $groupByUser = false): array
{
if (!$groupByUser) {
$entries = [];
foreach ($rows as $row) {
$entries[] = [
'type' => 'device',
'device' => $row['device'],
'collections' => $row['collections'],
];
}

return $entries;
}

$groups = [];
foreach ($rows as $row) {
$groups[$row['device']->user][] = $row;
}
ksort($groups, SORT_NATURAL | SORT_FLAG_CASE);

$entries = [];
foreach ($groups as $user => $userRows) {
$entries[] = [
'type' => 'header',
'user' => $user,
'count' => count($userRows),
];
foreach ($userRows as $row) {
$entries[] = [
'type' => 'device',
'device' => $row['device'],
'collections' => $row['collections'],
];
}
}

return $entries;
}
}
15 changes: 10 additions & 5 deletions lib/Prefs/Special/Activesync.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public function display(Horde_Core_Prefs_Ui $ui)
$view->reset = $selfurl->copy()->add('reset', 1);
$devs = [];
$js = [];
$collections = [];
$rows = [];
foreach ($devices as $device) {
$dev = $state->loadDeviceInfo($device['device_id'], $registry->getAuth());
try {
Expand All @@ -72,9 +72,14 @@ public function display(Horde_Core_Prefs_Ui $ui)
_("Last synckey") => $c['lastsynckey'],
];
}
$collections[] = $collection;
$rows[] = [
'device' => $dev,
'collections' => $collection,
];
}
$view->collections = $collections;
$rows = Horde_ActiveSync_DeviceTable::sortRows($rows, false);
$view->entries = Horde_ActiveSync_DeviceTable::toEntries($rows, false);
$view->collections = array_column($rows, 'collections');
// Identities
if (!$prefs->isLocked('activesync_identity')) {
$ident = $GLOBALS['injector']
Expand Down Expand Up @@ -119,10 +124,10 @@ public function update(Horde_Core_Prefs_Ui $ui)
}
$device = $state->loadDeviceInfo($ui->vars->accountwipeid, $auth);
if (!Horde_ActiveSync::deviceSupportsAccountOnlyWipe($device->version ?? null)) {
$notification->push(_("Account-only wipe is only available for devices that support EAS 16.1 or newer."), 'horde.error');
$notification->push(_("Account-only wipe requires a device with EAS 16.1 or newer."), 'horde.error');
} else {
$state->setDeviceRWStatus($ui->vars->accountwipeid, Horde_ActiveSync::RWSTATUS_ACCOUNTONLY_PENDING);
$notification->push(sprintf(_("An account-only remote wipe for device id %s has been initiated. The device will remove this account during the next synchronisation."), $ui->vars->accountwipeid));
$notification->push(sprintf(_("An account-only wipe for device %s has been initiated. The account will be removed during the next synchronisation."), $ui->vars->accountwipeid));
}
} elseif ($ui->vars->cancelwipe) {
if (!$state->deviceExists($ui->vars->cancelwipe, $auth)) {
Expand Down
Binary file modified locale/ar/LC_MESSAGES/horde.mo
Binary file not shown.
10 changes: 10 additions & 0 deletions locale/ar/LC_MESSAGES/horde.po
Original file line number Diff line number Diff line change
Expand Up @@ -4141,3 +4141,13 @@ msgstr "فشل"
#: lib/Block/weatherdotcom.php:6
msgid "weather.com"
msgstr ""

msgid "Wipe entire device"
msgstr "مسح الجهاز بالكامل"

msgid "Wipe account"
msgstr "مسح الحساب"

msgid "NOTE: \"Wipe entire device\" may reset the device to factory defaults. \"Wipe account\" deletes only the Exchange account on the device — not on the server."
msgstr "ملاحظة: قد يؤدي «مسح الجهاز بالكامل» إلى إعادة ضبط الجهاز على إعدادات المصنع. «مسح الحساب» يحذف حساب Exchange على الجهاز فقط — وليس على الخادم."

Binary file modified locale/bg/LC_MESSAGES/horde.mo
Binary file not shown.
10 changes: 10 additions & 0 deletions locale/bg/LC_MESSAGES/horde.po
Original file line number Diff line number Diff line change
Expand Up @@ -4226,3 +4226,13 @@ msgstr "провалено"
#: lib/Block/weatherdotcom.php:6
msgid "weather.com"
msgstr ""

msgid "Wipe entire device"
msgstr "Изтриване на цялото устройство"

msgid "Wipe account"
msgstr "Изтриване на акаунта"

msgid "NOTE: \"Wipe entire device\" may reset the device to factory defaults. \"Wipe account\" deletes only the Exchange account on the device — not on the server."
msgstr "БЕЛЕЖКА: „Изтриване на цялото устройство“ може да нулира устройството до фабрични настройки. „Изтриване на акаунта“ изтрива само Exchange акаунта на устройството — не на сървъра."

Binary file modified locale/bs/LC_MESSAGES/horde.mo
Binary file not shown.
10 changes: 10 additions & 0 deletions locale/bs/LC_MESSAGES/horde.po
Original file line number Diff line number Diff line change
Expand Up @@ -4332,3 +4332,13 @@ msgstr "Nekategorisano"
#: lib/Block/weatherdotcom.php:6
msgid "weather.com"
msgstr "weather.com"

msgid "Wipe entire device"
msgstr "Brisanje cijelog uređaja"

msgid "Wipe account"
msgstr "Brisanje računa"

msgid "NOTE: \"Wipe entire device\" may reset the device to factory defaults. \"Wipe account\" deletes only the Exchange account on the device — not on the server."
msgstr "NAPOMENA: „Brisanje cijelog uređaja“ može vratiti uređaj na tvorničke postavke. „Brisanje računa“ briše samo Exchange račun na uređaju — ne na serveru."

Binary file modified locale/ca/LC_MESSAGES/horde.mo
Binary file not shown.
10 changes: 10 additions & 0 deletions locale/ca/LC_MESSAGES/horde.po
Original file line number Diff line number Diff line change
Expand Up @@ -4311,3 +4311,13 @@ msgstr "unificat"
#: lib/Block/weatherdotcom.php:6
msgid "weather.com"
msgstr "weather.com"

msgid "Wipe entire device"
msgstr "Esborrar el dispositiu sencer"

msgid "Wipe account"
msgstr "Esborrar el compte"

msgid "NOTE: \"Wipe entire device\" may reset the device to factory defaults. \"Wipe account\" deletes only the Exchange account on the device — not on the server."
msgstr "NOTA: «Esborrar el dispositiu sencer» pot restablir el dispositiu a la configuració de fàbrica. «Esborrar el compte» suprimeix només el compte Exchange al dispositiu — no al servidor."

Binary file modified locale/cs/LC_MESSAGES/horde.mo
Binary file not shown.
10 changes: 10 additions & 0 deletions locale/cs/LC_MESSAGES/horde.po
Original file line number Diff line number Diff line change
Expand Up @@ -3909,3 +3909,13 @@ msgstr "pro potvrzení napište heslo dvakrát"
#: admin/config/diff.php:61 admin/config/diff.php:71
msgid "unified"
msgstr "sjednocený"

msgid "Wipe entire device"
msgstr "Vymazat celé zařízení"

msgid "Wipe account"
msgstr "Vymazat účet"

msgid "NOTE: \"Wipe entire device\" may reset the device to factory defaults. \"Wipe account\" deletes only the Exchange account on the device — not on the server."
msgstr "POZNÁMKA: „Vymazat celé zařízení“ může obnovit tovární nastavení zařízení. „Vymazat účet“ smaže pouze účet Exchange v zařízení — ne na serveru."

Binary file modified locale/da/LC_MESSAGES/horde.mo
Binary file not shown.
10 changes: 10 additions & 0 deletions locale/da/LC_MESSAGES/horde.po
Original file line number Diff line number Diff line change
Expand Up @@ -3858,3 +3858,13 @@ msgstr "samlet"
#: lib/Block/Weather.php:35
msgid "weather"
msgstr "weather"

msgid "Wipe entire device"
msgstr "Slet hele enheden"

msgid "Wipe account"
msgstr "Slet konto"

msgid "NOTE: \"Wipe entire device\" may reset the device to factory defaults. \"Wipe account\" deletes only the Exchange account on the device — not on the server."
msgstr "BEMÆRK: „Slet hele enheden“ kan nulstille enheden til fabriksindstillinger. „Slet konto“ sletter kun Exchange-kontoen på enheden — ikke på serveren."

Binary file modified locale/de/LC_MESSAGES/horde.mo
Binary file not shown.
85 changes: 85 additions & 0 deletions locale/de/LC_MESSAGES/horde.po
Original file line number Diff line number Diff line change
Expand Up @@ -4173,3 +4173,88 @@ msgstr "Geben Sie das Passwort ein zweites Mal zur Bestätigung ein"
#: admin/config/diff.php:61 admin/config/diff.php:71
msgid "unified"
msgstr "unified"

#: templates/activesync/device_table.html.php:59
msgid "Cancel wipe"
msgstr "Löschung abbrechen"

#: templates/activesync/device_table.html.php:52
#: templates/activesync/device_table.html.php:54
#: templates/activesync/device_table.html.php:62
msgid "Remove device state"
msgstr "Gerätestatus entfernen"

#: templates/activesync/device_table.html.php:15
msgid "Device wipe pending"
msgstr "Voll-Wipe ausstehend"

#: templates/activesync/device_table.html.php:17
msgid "Account wipe pending"
msgstr "Konto-Löschung ausstehend"

#: templates/activesync/device_table.html.php:19
msgid "Device wiped. Remove device state to allow the device to reconnect."
msgstr ""
"Gerät vollständig gelöscht. Entfernen Sie den Gerätestatus, damit sich das "
"Gerät erneut verbinden kann."

#: templates/activesync/device_table.html.php:21
msgid "Account wiped. Remove device state to allow the device to reconnect."
msgstr ""
"Konto gelöscht. Entfernen Sie den Gerätestatus, damit sich das Gerät erneut "
"verbinden kann."

#: admin/activesync.php:62
msgid "A full device wipe has been requested. The device will be reset on the next synchronization."
msgstr ""
"Voll-Wipe wurde angefordert. Das Gerät wird beim nächsten Sync "
"zurückgesetzt."

#: admin/activesync.php:68 lib/Prefs/Special/Activesync.php:122
msgid "Account-only wipe requires a device with EAS 16.1 or newer."
msgstr ""
"Nur-Konto-Löschung erfordert ein Gerät mit EAS 16.1 oder neuer."

#: admin/activesync.php:72
msgid "An account-only wipe has been requested. The account will be removed from the device on the next synchronization."
msgstr ""
"Nur-Konto-Löschung wurde angefordert. Das Konto wird beim nächsten Sync vom "
"Gerät entfernt."

#: lib/Prefs/Special/Activesync.php:125
msgid "An account-only wipe for device %s has been initiated. The account will be removed during the next synchronisation."
msgstr ""
"Nur-Konto-Löschung für Gerät %s wurde gestartet. Das Konto wird beim "
"nächsten Sync entfernt."

#: templates/prefs/activesync.html.php:37
msgid ""
"NOTE: \"Wipe device on device (full)\" may reset the device to factory "
"defaults. \"Wipe account on device\" deletes only the Exchange account on "
"the device — not on the server."
msgstr ""
"Hinweis: „Gerät am Gerät löschen (Voll-Wipe)“ kann das Gerät auf "
"Werkseinstellungen zurücksetzen. „Konto am Gerät löschen“ löscht nur das "
"Exchange-Konto auf dem Gerät — nicht auf dem Server."

#: templates/activesync/device_table.html.php:59
msgid "%d collection"
msgid_plural "%d collections"
msgstr[0] "%d Collection"
msgstr[1] "%d Collections"

#: templates/activesync/device_table.html.php:33
msgid "%d device"
msgid_plural "%d devices"
msgstr[0] "%d Gerät"
msgstr[1] "%d Geräte"

msgid "Wipe entire device"
msgstr "Gesamtes Gerät löschen"

msgid "Wipe account"
msgstr "Konto löschen"

msgid "NOTE: \"Wipe entire device\" may reset the device to factory defaults. \"Wipe account\" deletes only the Exchange account on the device — not on the server."
msgstr "Hinweis: „Gesamtes Gerät löschen“ kann das Gerät auf Werkseinstellungen zurücksetzen. „Konto löschen“ löscht nur das Exchange-Konto auf dem Gerät — nicht auf dem Server."

Binary file modified locale/el/LC_MESSAGES/horde.mo
Binary file not shown.
10 changes: 10 additions & 0 deletions locale/el/LC_MESSAGES/horde.po
Original file line number Diff line number Diff line change
Expand Up @@ -3913,3 +3913,13 @@ msgstr "Γράψτε τον κωδικό δύο φορές για επιβεβα
#: admin/config/diff.php:61 admin/config/diff.php:71
msgid "unified"
msgstr "ενοποιημένα"

msgid "Wipe entire device"
msgstr "Διαγραφή ολόκληρης της συσκευής"

msgid "Wipe account"
msgstr "Διαγραφή λογαριασμού"

msgid "NOTE: \"Wipe entire device\" may reset the device to factory defaults. \"Wipe account\" deletes only the Exchange account on the device — not on the server."
msgstr "ΣΗΜΕΙΩΣΗ: Το «Διαγραφή ολόκληρης της συσκευής» μπορεί να επαναφέρει τη συσκευή στις εργοστασιακές ρυθμίσεις. Το «Διαγραφή λογαριασμού» διαγράφει μόνο τον λογαριασμό Exchange στη συσκευή — όχι στον διακομιστή."

Binary file modified locale/es/LC_MESSAGES/horde.mo
Binary file not shown.
10 changes: 10 additions & 0 deletions locale/es/LC_MESSAGES/horde.po
Original file line number Diff line number Diff line change
Expand Up @@ -3922,3 +3922,13 @@ msgstr "unificado"
#: lib/Block/Weather.php:35
msgid "weather"
msgstr "tiempo"

msgid "Wipe entire device"
msgstr "Borrar dispositivo completo"

msgid "Wipe account"
msgstr "Borrar cuenta"

msgid "NOTE: \"Wipe entire device\" may reset the device to factory defaults. \"Wipe account\" deletes only the Exchange account on the device — not on the server."
msgstr "NOTA: «Borrar dispositivo completo» puede restablecer el dispositivo a los valores de fábrica. «Borrar cuenta» elimina solo la cuenta Exchange en el dispositivo — no en el servidor."

Binary file modified locale/et/LC_MESSAGES/horde.mo
Binary file not shown.
10 changes: 10 additions & 0 deletions locale/et/LC_MESSAGES/horde.po
Original file line number Diff line number Diff line change
Expand Up @@ -4242,3 +4242,13 @@ msgstr "ühitatud"
#: lib/Block/Weatherdotcom.php:34
msgid "weather.com"
msgstr "weather.com"

msgid "Wipe entire device"
msgstr "Kustuta kogu seade"

msgid "Wipe account"
msgstr "Kustuta konto"

msgid "NOTE: \"Wipe entire device\" may reset the device to factory defaults. \"Wipe account\" deletes only the Exchange account on the device — not on the server."
msgstr "MÄRKUS: „Kustuta kogu seade“ võib seadme tehaseseadetele taastada. „Kustuta konto“ kustutab ainult Exchange’i konto seadmes — mitte serveris."

Binary file modified locale/eu/LC_MESSAGES/horde.mo
Binary file not shown.
Loading