Reset SOGo data and added option to reset EAS device cache for users
parent
d9d2500501
commit
8d596080de
|
@ -4609,6 +4609,46 @@ function mailbox_delete_mailbox($postarray) {
|
||||||
'msg' => sprintf($lang['success']['mailbox_removed'], htmlspecialchars($username))
|
'msg' => sprintf($lang['success']['mailbox_removed'], htmlspecialchars($username))
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
function mailbox_reset_eas($username) {
|
||||||
|
global $lang;
|
||||||
|
global $pdo;
|
||||||
|
|
||||||
|
(isset($postarray['username'])) ? $username = $postarray['username'] : $username = $_SESSION['mailcow_cc_username'];
|
||||||
|
|
||||||
|
if (!filter_var($username, FILTER_VALIDATE_EMAIL)) {
|
||||||
|
$_SESSION['return'] = array(
|
||||||
|
'type' => 'danger',
|
||||||
|
'msg' => sprintf($lang['danger']['access_denied'])
|
||||||
|
);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!hasMailboxObjectAccess($_SESSION['mailcow_cc_username'], $_SESSION['mailcow_cc_role'], $username)) {
|
||||||
|
$_SESSION['return'] = array(
|
||||||
|
'type' => 'danger',
|
||||||
|
'msg' => sprintf($lang['danger']['access_denied'])
|
||||||
|
);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
$stmt = $pdo->prepare("DELETE FROM `sogo_cache_folder` WHERE `c_uid` = :username");
|
||||||
|
$stmt->execute(array(
|
||||||
|
':username' => $username
|
||||||
|
));
|
||||||
|
}
|
||||||
|
catch (PDOException $e) {
|
||||||
|
$_SESSION['return'] = array(
|
||||||
|
'type' => 'danger',
|
||||||
|
'msg' => 'MySQL: '.$e
|
||||||
|
);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
$_SESSION['return'] = array(
|
||||||
|
'type' => 'success',
|
||||||
|
'msg' => sprintf($lang['success']['eas_reset'], htmlspecialchars($username))
|
||||||
|
);
|
||||||
|
}
|
||||||
function mailbox_delete_resource($postarray) {
|
function mailbox_delete_resource($postarray) {
|
||||||
global $lang;
|
global $lang;
|
||||||
global $pdo;
|
global $pdo;
|
||||||
|
@ -4630,9 +4670,37 @@ function mailbox_delete_resource($postarray) {
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$stmt = $pdo->prepare("DELETE FROM `mailbox` WHERE `username` = :name");
|
$stmt = $pdo->prepare("DELETE FROM `mailbox` WHERE `username` = :username");
|
||||||
$stmt->execute(array(
|
$stmt->execute(array(
|
||||||
':name' => $name
|
':username' => $name
|
||||||
|
));
|
||||||
|
$stmt = $pdo->prepare("DELETE FROM `sogo_user_profile` WHERE `c_uid` = :username");
|
||||||
|
$stmt->execute(array(
|
||||||
|
':username' => $name
|
||||||
|
));
|
||||||
|
$stmt = $pdo->prepare("DELETE FROM `sogo_cache_folder` WHERE `c_uid` = :username");
|
||||||
|
$stmt->execute(array(
|
||||||
|
':username' => $name
|
||||||
|
));
|
||||||
|
$stmt = $pdo->prepare("DELETE FROM `sogo_acl` WHERE `c_object` LIKE '%/" . $name . "/%' OR `c_uid` = :username");
|
||||||
|
$stmt->execute(array(
|
||||||
|
':username' => $name
|
||||||
|
));
|
||||||
|
$stmt = $pdo->prepare("DELETE FROM `sogo_store` WHERE `c_folder_id` IN (SELECT `c_folder_id` FROM `sogo_folder_info` WHERE `c_path2` = :username)");
|
||||||
|
$stmt->execute(array(
|
||||||
|
':username' => $name
|
||||||
|
));
|
||||||
|
$stmt = $pdo->prepare("DELETE FROM `sogo_quick_contact` WHERE `c_folder_id` IN (SELECT `c_folder_id` FROM `sogo_folder_info` WHERE `c_path2` = :username)");
|
||||||
|
$stmt->execute(array(
|
||||||
|
':username' => $name
|
||||||
|
));
|
||||||
|
$stmt = $pdo->prepare("DELETE FROM `sogo_quick_appointment` WHERE `c_folder_id` IN (SELECT `c_folder_id` FROM `sogo_folder_info` WHERE `c_path2` = :username)");
|
||||||
|
$stmt->execute(array(
|
||||||
|
':username' => $name
|
||||||
|
));
|
||||||
|
$stmt = $pdo->prepare("DELETE FROM `sogo_folder_info` WHERE `c_path2` = :username");
|
||||||
|
$stmt->execute(array(
|
||||||
|
':username' => $name
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
catch (PDOException $e) {
|
catch (PDOException $e) {
|
||||||
|
|
|
@ -77,6 +77,9 @@ if (isset($_SESSION['mailcow_cc_role']) && $_SESSION['mailcow_cc_role'] == "user
|
||||||
if (isset($_POST["edit_user_account"])) {
|
if (isset($_POST["edit_user_account"])) {
|
||||||
edit_user_account($_POST);
|
edit_user_account($_POST);
|
||||||
}
|
}
|
||||||
|
if (isset($_POST["mailbox_reset_eas"])) {
|
||||||
|
mailbox_reset_eas($_POST);
|
||||||
|
}
|
||||||
if (isset($_POST["edit_spam_score"])) {
|
if (isset($_POST["edit_spam_score"])) {
|
||||||
edit_spam_score($_POST);
|
edit_spam_score($_POST);
|
||||||
}
|
}
|
||||||
|
|
|
@ -78,6 +78,7 @@ $lang['success']['alias_removed'] = 'Alias-Adresse %s wurde entfernt';
|
||||||
$lang['success']['alias_domain_removed'] = 'Alias-Domain %s wurde entfernt';
|
$lang['success']['alias_domain_removed'] = 'Alias-Domain %s wurde entfernt';
|
||||||
$lang['success']['domain_admin_removed'] = 'Domain-Administrator %s wurde entfernt';
|
$lang['success']['domain_admin_removed'] = 'Domain-Administrator %s wurde entfernt';
|
||||||
$lang['success']['mailbox_removed'] = 'Mailbox %s wurde entfernt';
|
$lang['success']['mailbox_removed'] = 'Mailbox %s wurde entfernt';
|
||||||
|
$lang['success']['eas_reset'] = "ActiveSync Gerät des Benutzers %s wurden zurückgesetzt";
|
||||||
$lang['success']['resource_removed'] = 'Ressource %s wurde entfernt';
|
$lang['success']['resource_removed'] = 'Ressource %s wurde entfernt';
|
||||||
$lang['danger']['max_quota_in_use'] = 'Mailbox Speicherplatzlimit muss größer oder gleich %d MiB sein';
|
$lang['danger']['max_quota_in_use'] = 'Mailbox Speicherplatzlimit muss größer oder gleich %d MiB sein';
|
||||||
$lang['danger']['domain_quota_m_in_use'] = 'Domain Speicherplatzlimit muss größer oder gleich %d MiB sein';
|
$lang['danger']['domain_quota_m_in_use'] = 'Domain Speicherplatzlimit muss größer oder gleich %d MiB sein';
|
||||||
|
@ -156,6 +157,9 @@ $lang['user']['tag_in_subject'] = 'In Betreff';
|
||||||
$lang['user']['tag_help_explain'] = 'Als Unterordner: Es wird ein Ordner mit dem Namen des Tags unterhalb der Inbox erstellt ("INBOX/Facebook").<br />
|
$lang['user']['tag_help_explain'] = 'Als Unterordner: Es wird ein Ordner mit dem Namen des Tags unterhalb der Inbox erstellt ("INBOX/Facebook").<br />
|
||||||
In Betreff: Der Name des Tags wird dem Betreff angefügt, etwa "[Facebook] Meine Neuigkeiten".';
|
In Betreff: Der Name des Tags wird dem Betreff angefügt, etwa "[Facebook] Meine Neuigkeiten".';
|
||||||
$lang['user']['tag_help_example'] = 'Beispiel für eine getaggte E-Mail-Adresse: ich<b>+Facebook</b>@example.org';
|
$lang['user']['tag_help_example'] = 'Beispiel für eine getaggte E-Mail-Adresse: ich<b>+Facebook</b>@example.org';
|
||||||
|
$lang['user']['eas_reset'] = 'ActiveSync Geräte-Cache zurücksetzen';
|
||||||
|
$lang['user']['eas_reset_now'] = 'Jetzt zurücksetzen';
|
||||||
|
$lang['user']['eas_reset_help'] = 'In vielen Fällen kann ein ActiveSync Profil durch das Zurücksetzen des Caches repariert werden.<br /><b>Vorsicht:</b> Alle Elemente werden erneut heruntergeladen!';
|
||||||
|
|
||||||
$lang['user']['encryption'] = 'Verschlüsselung';
|
$lang['user']['encryption'] = 'Verschlüsselung';
|
||||||
$lang['user']['username'] = 'Benutzername';
|
$lang['user']['username'] = 'Benutzername';
|
||||||
|
|
|
@ -80,6 +80,7 @@ $lang['success']['alias_removed'] = "Alias-Adresse %s has been removed";
|
||||||
$lang['success']['alias_domain_removed'] = "Alias domain %s has been removed";
|
$lang['success']['alias_domain_removed'] = "Alias domain %s has been removed";
|
||||||
$lang['success']['domain_admin_removed'] = "Domain administrator %s has been removed";
|
$lang['success']['domain_admin_removed'] = "Domain administrator %s has been removed";
|
||||||
$lang['success']['mailbox_removed'] = "Mailbox %s has been removed";
|
$lang['success']['mailbox_removed'] = "Mailbox %s has been removed";
|
||||||
|
$lang['success']['eas_reset'] = "ActiveSync devices for user %s were reset";
|
||||||
$lang['success']['resource_removed'] = "Resource %s has been removed";
|
$lang['success']['resource_removed'] = "Resource %s has been removed";
|
||||||
$lang['danger']['max_quota_in_use'] = "Mailbox quota must be greater or equal to %d MiB";
|
$lang['danger']['max_quota_in_use'] = "Mailbox quota must be greater or equal to %d MiB";
|
||||||
$lang['danger']['domain_quota_m_in_use'] = "Domain quota must be greater or equal to %s MiB";
|
$lang['danger']['domain_quota_m_in_use'] = "Domain quota must be greater or equal to %s MiB";
|
||||||
|
@ -158,6 +159,9 @@ $lang['user']['tag_in_subject'] = 'In subject';
|
||||||
$lang['user']['tag_help_explain'] = 'In subfolder: a new subfolder named after the tag will be created below INBOX ("INBOX/Facebook").<br />
|
$lang['user']['tag_help_explain'] = 'In subfolder: a new subfolder named after the tag will be created below INBOX ("INBOX/Facebook").<br />
|
||||||
In subject: the tags name will be prepended to the mails subject, example: "[Facebook] Meine Neuigkeiten".';
|
In subject: the tags name will be prepended to the mails subject, example: "[Facebook] Meine Neuigkeiten".';
|
||||||
$lang['user']['tag_help_example'] = 'Example for a tagged email address: ich<b>+Facebook</b>@example.org';
|
$lang['user']['tag_help_example'] = 'Example for a tagged email address: ich<b>+Facebook</b>@example.org';
|
||||||
|
$lang['user']['eas_reset'] = 'Reset ActiveSync device cache';
|
||||||
|
$lang['user']['eas_reset_now'] = 'Reset now';
|
||||||
|
$lang['user']['eas_reset_help'] = 'In many cases a device cache reset will help to recover a broken ActiveSync profile.<br /><b>Attention:</b> All elements will be redownloaded!';
|
||||||
|
|
||||||
$lang['user']['encryption'] = 'Encyrption';
|
$lang['user']['encryption'] = 'Encyrption';
|
||||||
$lang['user']['username'] = 'Username';
|
$lang['user']['username'] = 'Username';
|
||||||
|
|
|
@ -112,6 +112,16 @@ elseif (isset($_SESSION['mailcow_cc_role']) && $_SESSION['mailcow_cc_role'] == '
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
<?php // Rest EAS devices ?>
|
||||||
|
<form class="form-horizontal" role="form" method="post">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-3 col-xs-5 text-right"><?=$lang['user']['eas_reset'];?>:</div>
|
||||||
|
<div class="col-md-9 col-xs-7">
|
||||||
|
<button type="submit" name="mailbox_reset_eas" id="mailbox_reset_eas" value="1" class="btn btn-xs btn-default"><?=$lang['user']['eas_reset_now'];?></button>
|
||||||
|
<p class="help-block"><?=$lang['user']['eas_reset_help'];?></p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue