From d89dea7000bbffb959302a724b003de28d753787 Mon Sep 17 00:00:00 2001 From: Ilia Ross Date: Fri, 15 Sep 2023 21:09:09 +0300 Subject: [PATCH 1/3] Fix Sent folder to be non-editable https://github.com/virtualmin/Virtualmin-Config/commit/b5c94dfc6671d47ffd569a3a843a0763f2d9af97#commitcomment-127407219 --- mailbox/list_folders.cgi | 4 ++-- mailbox/list_ifolders.cgi | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/mailbox/list_folders.cgi b/mailbox/list_folders.cgi index feee0ba1..7db714dc 100755 --- a/mailbox/list_folders.cgi +++ b/mailbox/list_folders.cgi @@ -42,8 +42,8 @@ print &ui_columns_start([ "", foreach my $f (@folders) { my @cols; my $deletable = 0; - if ($f->{'inbox'} || $f->{'drafts'} || $f->{'spam'}) { - # Inbox, drafs or spam folder which cannot be edited + if ($f->{'inbox'} || $f->{'drafts'} || $f->{'sent'} || $f->{'spam'}) { + # Inbox, drafs, sent or spam folder which cannot be edited push(@cols, &html_escape($f->{'name'})); } elsif ($f->{'type'} == 2) { diff --git a/mailbox/list_ifolders.cgi b/mailbox/list_ifolders.cgi index 4fca0ec7..64f7ea07 100755 --- a/mailbox/list_ifolders.cgi +++ b/mailbox/list_ifolders.cgi @@ -28,8 +28,8 @@ print &ui_columns_start([ "", foreach my $f (@folders) { my @cols; my $deletable = 0; - if ($f->{'inbox'} || $f->{'drafts'} || $f->{'spam'}) { - # Inbox, drafs or spam folder which cannot be edited + if ($f->{'inbox'} || $f->{'drafts'} || $f->{'sent'} || $f->{'spam'}) { + # Inbox, drafs, sent or spam folder which cannot be edited push(@cols, &html_escape($f->{'name'})); push(@cols, "IMAP"); push(@cols, &nice_size(&folder_size($f))); From f4f3207dc7d86d74f51bc4589fc7653ce7acdee0 Mon Sep 17 00:00:00 2001 From: Ilia Ross Date: Fri, 15 Sep 2023 21:10:20 +0300 Subject: [PATCH 2/3] Fix to remove debug line --- mailbox/list_folders.cgi | 1 - 1 file changed, 1 deletion(-) diff --git a/mailbox/list_folders.cgi b/mailbox/list_folders.cgi index 7db714dc..81c6039c 100755 --- a/mailbox/list_folders.cgi +++ b/mailbox/list_folders.cgi @@ -38,7 +38,6 @@ print &ui_columns_start([ "", $text{'folders_type'}, $text{'folders_size'}, $text{'folders_action'} ], undef, 0, \@tds); - # var_dump(\@folders); foreach my $f (@folders) { my @cols; my $deletable = 0; From 84a5eb1c9f448cc5c568148d8660627adc3064ef Mon Sep 17 00:00:00 2001 From: Ilia Ross Date: Fri, 15 Sep 2023 21:28:03 +0300 Subject: [PATCH 3/3] Fix order for consistency --- mailbox/list_folders.cgi | 2 +- mailbox/list_ifolders.cgi | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/mailbox/list_folders.cgi b/mailbox/list_folders.cgi index 81c6039c..26b9f4c0 100755 --- a/mailbox/list_folders.cgi +++ b/mailbox/list_folders.cgi @@ -41,7 +41,7 @@ print &ui_columns_start([ "", foreach my $f (@folders) { my @cols; my $deletable = 0; - if ($f->{'inbox'} || $f->{'drafts'} || $f->{'sent'} || $f->{'spam'}) { + if ($f->{'inbox'} || $f->{'sent'} || $f->{'drafts'} || $f->{'spam'}) { # Inbox, drafs, sent or spam folder which cannot be edited push(@cols, &html_escape($f->{'name'})); } diff --git a/mailbox/list_ifolders.cgi b/mailbox/list_ifolders.cgi index 64f7ea07..70637b42 100755 --- a/mailbox/list_ifolders.cgi +++ b/mailbox/list_ifolders.cgi @@ -28,7 +28,7 @@ print &ui_columns_start([ "", foreach my $f (@folders) { my @cols; my $deletable = 0; - if ($f->{'inbox'} || $f->{'drafts'} || $f->{'sent'} || $f->{'spam'}) { + if ($f->{'inbox'} || $f->{'sent'} || $f->{'drafts'} || $f->{'spam'}) { # Inbox, drafs, sent or spam folder which cannot be edited push(@cols, &html_escape($f->{'name'})); push(@cols, "IMAP");