summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGELOG1
-rw-r--r--program/js/app.js21
-rw-r--r--program/localization/en_US/messages.inc1
-rw-r--r--program/localization/pl_PL/messages.inc1
-rw-r--r--program/steps/settings/manage_folders.inc2
5 files changed, 22 insertions, 4 deletions
diff --git a/CHANGELOG b/CHANGELOG
index b9cfdf13a..9601ac02e 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -4,6 +4,7 @@ CHANGELOG RoundCube Webmail
2008/05/30 (alec)
----------
- Support for subfolders in default/protected folders (#1484665)
+- Disallowed delimiter in folder name (#1484803)
2008/05/29 (alec)
----------
diff --git a/program/js/app.js b/program/js/app.js
index bebf561a7..5f8d125f6 100644
--- a/program/js/app.js
+++ b/program/js/app.js
@@ -2647,12 +2647,20 @@ function rcube_webmail()
var form;
if ((form = this.gui_objects.editform) && form.elements['_folder_name'])
+ {
name = form.elements['_folder_name'].value;
- if (this.env.folder && name != '')
- name = this.env.folder+this.env.delimiter+name;
- if (name)
+ if (name.indexOf(this.env.delimiter)>=0)
+ {
+ alert(this.get_label('forbiddencharacter'));
+ return false;
+ }
+
+ if (this.env.folder && name != '')
+ name = this.env.folder+this.env.delimiter+name;
+
this.http_post('create-folder', '_name='+urlencode(name), true);
+ }
else if (form.elements['_folder_name'])
form.elements['_folder_name'].focus();
};
@@ -2716,8 +2724,15 @@ function rcube_webmail()
var newname = this.name_input ? this.name_input.value : null;
if (this.edit_folder && newname)
{
+ if (newname.indexOf(this.env.delimiter)>=0)
+ {
+ alert(this.get_label('forbiddencharacter'));
+ return false;
+ }
+
if (this.name_input.__parent)
newname = this.name_input.__parent + this.env.delimiter + newname;
+
this.http_post('rename-folder', '_folder_oldname='+urlencode(this.env.subscriptionrows[this.edit_folder][0])+'&_folder_newname='+urlencode(newname));
}
}
diff --git a/program/localization/en_US/messages.inc b/program/localization/en_US/messages.inc
index 4a3554142..108b3565f 100644
--- a/program/localization/en_US/messages.inc
+++ b/program/localization/en_US/messages.inc
@@ -78,5 +78,6 @@ $messages['receiptsent'] = 'Successfully sent a read receipt';
$messages['errorsendingreceipt'] = 'Could not send the receipt';
$messages['nodeletelastidentity'] = 'You cannot delete this identity, it\'s your last one.';
$messages['addsubfolderhint'] = 'This folder will be created as subfolder of the currently selected one';
+$messages['forbiddencharacter'] = 'Folder name contains forbidden character';
?> \ No newline at end of file
diff --git a/program/localization/pl_PL/messages.inc b/program/localization/pl_PL/messages.inc
index 3b9605f7c..be8d04d0b 100644
--- a/program/localization/pl_PL/messages.inc
+++ b/program/localization/pl_PL/messages.inc
@@ -83,5 +83,6 @@ $messages['receiptsent'] = 'Pomyślnie wysłano potwierdzenie dostarczenia';
$messages['errorsendingreceipt'] = 'Nie można wysłać potwierdzenia';
$messages['nodeletelastidentity'] = 'Nie można skasować tej tożsamości, ponieważ jest ostatnią.';
$messages['addsubfolderhint'] = 'Ten folder zostanie utworzony jako podfolder aktualnie wybranego.';
+$messages['forbiddencharacter'] = 'Nazwa folderu zawiera niedozwolony znak';
?> \ No newline at end of file
diff --git a/program/steps/settings/manage_folders.inc b/program/steps/settings/manage_folders.inc
index 54d8dfeaa..b725d8cb5 100644
--- a/program/steps/settings/manage_folders.inc
+++ b/program/steps/settings/manage_folders.inc
@@ -341,7 +341,7 @@ $OUTPUT->add_handlers(array(
));
// add some labels to client
-rcube_add_label('deletefolderconfirm','addsubfolderhint');
+rcube_add_label('deletefolderconfirm','addsubfolderhint','forbiddencharacter');
$OUTPUT->send('managefolders');
?>