diff options
Diffstat (limited to 'plugins')
208 files changed, 5110 insertions, 3280 deletions
diff --git a/plugins/acl/acl.php b/plugins/acl/acl.php index 938287b1a..a840bcd58 100644 --- a/plugins/acl/acl.php +++ b/plugins/acl/acl.php @@ -9,18 +9,18 @@ * * Copyright (C) 2011-2012, Kolab Systems AG * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 - * as published by the Free Software Foundation. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see http://www.gnu.org/licenses/. */ class acl extends rcube_plugin @@ -148,6 +148,7 @@ class acl extends rcube_plugin // Load localization and include scripts $this->load_config(); + $this->specials = $this->rc->config->get('acl_specials', $this->specials); $this->add_texts('localization/', array('deleteconfirm', 'norights', 'nouser', 'deleting', 'saving')); $this->include_script('acl.js'); @@ -384,7 +385,6 @@ class acl extends rcube_plugin $table->add_header(array('class' => 'acl'.$key, 'title' => $label), $label); } - $i = 1; $js_table = array(); foreach ($acl as $user => $rights) { if ($this->rc->storage->conn->user == $user) { @@ -433,8 +433,9 @@ class acl extends rcube_plugin $acl = trim(rcube_utils::get_input_value('_acl', rcube_utils::INPUT_GPC)); $oldid = trim(rcube_utils::get_input_value('_old', rcube_utils::INPUT_GPC)); - $acl = array_intersect(str_split($acl), $this->rights_supported()); - $users = $oldid ? array($user) : explode(',', $user); + $acl = array_intersect(str_split($acl), $this->rights_supported()); + $users = $oldid ? array($user) : explode(',', $user); + $result = 0; foreach ($users as $user) { $user = trim($user); diff --git a/plugins/acl/config.inc.php.dist b/plugins/acl/config.inc.php.dist index f957a233a..d0e1a0932 100644 --- a/plugins/acl/config.inc.php.dist +++ b/plugins/acl/config.inc.php.dist @@ -16,4 +16,10 @@ $rcmail_config['acl_users_field'] = 'mail'; // The LDAP search filter will be &'d with search queries $rcmail_config['acl_users_filter'] = ''; +// Include the following 'special' access control subjects in the ACL dialog; +// Defaults to array('anyone', 'anonymous') (not when set to an empty array) +// Example: array('anyone') to exclude 'anonymous'. +// Set to an empty array to exclude all special aci subjects. +$rcmail_config['acl_specials'] = array('anyone', 'anonymous'); + ?> diff --git a/plugins/acl/localization/cs_CZ.inc b/plugins/acl/localization/cs_CZ.inc index acf80aca9..167788b4c 100644 --- a/plugins/acl/localization/cs_CZ.inc +++ b/plugins/acl/localization/cs_CZ.inc @@ -21,7 +21,7 @@ $labels['myrights'] = 'Přístupová práva'; $labels['username'] = 'Uživatel:'; $labels['advanced'] = 'pokročilý režim'; $labels['newuser'] = 'Přidat záznam'; -$labels['actions'] = 'Access right actions...'; +$labels['actions'] = 'Přístupové právo akce ...'; $labels['anyone'] = 'Všichni uživatelé (kdokoli)'; $labels['anonymous'] = 'Hosté (anonymní)'; $labels['identifier'] = 'Identifikátor'; diff --git a/plugins/acl/localization/en_US.inc b/plugins/acl/localization/en_US.inc index 033ac29b2..3c61266be 100644 --- a/plugins/acl/localization/en_US.inc +++ b/plugins/acl/localization/en_US.inc @@ -89,7 +89,7 @@ $messages['saving'] = 'Saving access rights...'; $messages['updatesuccess'] = 'Successfully changed access rights'; $messages['deletesuccess'] = 'Successfully deleted access rights'; $messages['createsuccess'] = 'Successfully added access rights'; -$messages['updateerror'] = 'Ubable to update access rights'; +$messages['updateerror'] = 'Unable to update access rights'; $messages['deleteerror'] = 'Unable to delete access rights'; $messages['createerror'] = 'Unable to add access rights'; $messages['deleteconfirm'] = 'Are you sure, you want to remove access rights of selected user(s)?'; diff --git a/plugins/acl/localization/et_EE.inc b/plugins/acl/localization/et_EE.inc index f89e7d6b7..ceec4cd0c 100644 --- a/plugins/acl/localization/et_EE.inc +++ b/plugins/acl/localization/et_EE.inc @@ -73,8 +73,8 @@ $labels['longacli'] = 'Messages can be written or copied to the folder'; $labels['longaclp'] = 'Messages can be posted to this folder'; $labels['longaclc'] = 'Folders can be created (or renamed) directly under this folder'; $labels['longaclk'] = 'Folders can be created (or renamed) directly under this folder'; -$labels['longacld'] = 'Messages Delete flag can be changed'; -$labels['longaclt'] = 'Messages Delete flag can be changed'; +$labels['longacld'] = 'Kirja kustutamis lippu saab muuta'; +$labels['longaclt'] = 'Kirja kustutamis lippu saab muuta'; $labels['longacle'] = 'Kirju saab eemaldada'; $labels['longaclx'] = 'Seda kausta ei saa kustutada ega ümber nimetada'; $labels['longacla'] = 'Selle kausta ligipääsuõigusi saab muuta'; diff --git a/plugins/acl/localization/gl_ES.inc b/plugins/acl/localization/gl_ES.inc index a287a413e..2349975de 100644 --- a/plugins/acl/localization/gl_ES.inc +++ b/plugins/acl/localization/gl_ES.inc @@ -26,74 +26,74 @@ $labels['anyone'] = 'Tódolos usuarios (calquera)'; $labels['anonymous'] = 'Invitados (anónimo)'; $labels['identifier'] = 'Identificador'; -$labels['acll'] = 'Lookup'; +$labels['acll'] = 'Bloquear'; $labels['aclr'] = 'Ler mensaxes'; -$labels['acls'] = 'Keep Seen state'; -$labels['aclw'] = 'Write flags'; -$labels['acli'] = 'Insert (Copy into)'; -$labels['aclp'] = 'Post'; -$labels['aclc'] = 'Create subfolders'; -$labels['aclk'] = 'Create subfolders'; +$labels['acls'] = 'Manter o estado coma visto'; +$labels['aclw'] = 'Marcas de lectura'; +$labels['acli'] = 'Engadir (Copiar en)'; +$labels['aclp'] = 'Envío'; +$labels['aclc'] = 'Crear subcartafoles'; +$labels['aclk'] = 'Crear subcartafoles'; $labels['acld'] = 'Borrar mensaxes'; $labels['aclt'] = 'Borrar mensaxes'; -$labels['acle'] = 'Expunge'; +$labels['acle'] = 'Expurga'; $labels['aclx'] = 'Eliminar carpeta'; $labels['acla'] = 'Administrar'; -$labels['aclfull'] = 'Full control'; -$labels['aclother'] = 'Other'; -$labels['aclread'] = 'Read'; -$labels['aclwrite'] = 'Write'; -$labels['acldelete'] = 'Delete'; +$labels['aclfull'] = 'Control total'; +$labels['aclother'] = 'Outros'; +$labels['aclread'] = 'Lectura'; +$labels['aclwrite'] = 'Escritura'; +$labels['acldelete'] = 'Borrado'; -$labels['shortacll'] = 'Lookup'; -$labels['shortaclr'] = 'Read'; -$labels['shortacls'] = 'Keep'; -$labels['shortaclw'] = 'Write'; -$labels['shortacli'] = 'Insert'; -$labels['shortaclp'] = 'Post'; -$labels['shortaclc'] = 'Create'; -$labels['shortaclk'] = 'Create'; -$labels['shortacld'] = 'Delete'; -$labels['shortaclt'] = 'Delete'; -$labels['shortacle'] = 'Expunge'; -$labels['shortaclx'] = 'Folder delete'; +$labels['shortacll'] = 'Busca'; +$labels['shortaclr'] = 'Ler'; +$labels['shortacls'] = 'Manter'; +$labels['shortaclw'] = 'Escribir'; +$labels['shortacli'] = 'Insertar'; +$labels['shortaclp'] = 'Envío'; +$labels['shortaclc'] = 'Crear'; +$labels['shortaclk'] = 'Crear'; +$labels['shortacld'] = 'Borrar'; +$labels['shortaclt'] = 'Borrar'; +$labels['shortacle'] = 'Expurga'; +$labels['shortaclx'] = 'Borrar cartafol'; $labels['shortacla'] = 'Administrar'; -$labels['shortaclother'] = 'Other'; -$labels['shortaclread'] = 'Read'; -$labels['shortaclwrite'] = 'Write'; -$labels['shortacldelete'] = 'Delete'; +$labels['shortaclother'] = 'Outros'; +$labels['shortaclread'] = 'Lectura'; +$labels['shortaclwrite'] = 'Escritura'; +$labels['shortacldelete'] = 'Borrado'; -$labels['longacll'] = 'The folder is visible on lists and can be subscribed to'; -$labels['longaclr'] = 'The folder can be opened for reading'; -$labels['longacls'] = 'Messages Seen flag can be changed'; -$labels['longaclw'] = 'Messages flags and keywords can be changed, except Seen and Deleted'; -$labels['longacli'] = 'Messages can be written or copied to the folder'; -$labels['longaclp'] = 'Messages can be posted to this folder'; -$labels['longaclc'] = 'Folders can be created (or renamed) directly under this folder'; -$labels['longaclk'] = 'Folders can be created (or renamed) directly under this folder'; -$labels['longacld'] = 'Messages Delete flag can be changed'; -$labels['longaclt'] = 'Messages Delete flag can be changed'; -$labels['longacle'] = 'Messages can be expunged'; -$labels['longaclx'] = 'The folder can be deleted or renamed'; -$labels['longacla'] = 'The folder access rights can be changed'; +$labels['longacll'] = 'O cartafol é visible e pode ser suscrito'; +$labels['longaclr'] = 'Pódese abrir o cartafol para lectura'; +$labels['longacls'] = 'Pódese mudar o marcador de Mensaxes Enviadas'; +$labels['longaclw'] = 'Pódense mudar marcadores e palabras chave agás Olladas e Borradas'; +$labels['longacli'] = 'Pódense escreber ou copiar as mensaxes a este cartafol'; +$labels['longaclp'] = 'Pódense enviar as mensaxes a este cartafol'; +$labels['longaclc'] = 'Pódense crear (ou renomear) os cartafois directamente baixo deste cartafol'; +$labels['longaclk'] = 'Pódense crear (ou renomear) os cartafois directamente baixo deste cartafol'; +$labels['longacld'] = 'Pódense mudar as mensaxes coa marca de Borrado'; +$labels['longaclt'] = 'Pódense mudar as mensaxes coa marca de Borrado'; +$labels['longacle'] = 'Pódense eliminar as mensaxes'; +$labels['longaclx'] = 'Pódese borrar ou renomear o cartafol'; +$labels['longacla'] = 'Pódense mudar os dereitos de acceso ao cartafol'; -$labels['longaclfull'] = 'Full control including folder administration'; -$labels['longaclread'] = 'The folder can be opened for reading'; -$labels['longaclwrite'] = 'Messages can be marked, written or copied to the folder'; -$labels['longacldelete'] = 'Messages can be deleted'; +$labels['longaclfull'] = 'Control total inclúe administración de cartafois'; +$labels['longaclread'] = 'Pódese abrir o cartafol para lectura'; +$labels['longaclwrite'] = 'Pódense marcar, escribir ou copiar as mensaxes no cartafol'; +$labels['longacldelete'] = 'Pódense borrar as mensaxes'; -$messages['deleting'] = 'Deleting access rights...'; -$messages['saving'] = 'Saving access rights...'; -$messages['updatesuccess'] = 'Successfully changed access rights'; -$messages['deletesuccess'] = 'Successfully deleted access rights'; -$messages['createsuccess'] = 'Successfully added access rights'; -$messages['updateerror'] = 'Ubable to update access rights'; -$messages['deleteerror'] = 'Unable to delete access rights'; -$messages['createerror'] = 'Unable to add access rights'; -$messages['deleteconfirm'] = 'Are you sure, you want to remove access rights of selected user(s)?'; -$messages['norights'] = 'No rights has been specified!'; -$messages['nouser'] = 'No username has been specified!'; +$messages['deleting'] = 'Borrando dereitos de acceso...'; +$messages['saving'] = 'Gardando dereitos de acceso...'; +$messages['updatesuccess'] = 'Mudados con éxito os dereitos de acceso'; +$messages['deletesuccess'] = 'Borrados con éxito os dereitos de acceso'; +$messages['createsuccess'] = 'Engadidos con éxito os dereitos de acceso'; +$messages['updateerror'] = 'Non se poden actualizar os dereitos de acceso'; +$messages['deleteerror'] = 'Non se poden borrar os dereitos de acceso'; +$messages['createerror'] = 'Non se poden engadir dereitos de acceso'; +$messages['deleteconfirm'] = 'De certo quere eliminar os dereitos de acceso do usuario(s) escollido?'; +$messages['norights'] = 'Non se especificaron permisos!'; +$messages['nouser'] = 'Non se especificou o nome de usuario!'; ?> diff --git a/plugins/acl/localization/he_IL.inc b/plugins/acl/localization/he_IL.inc index d7b027a40..9ca305d32 100644 --- a/plugins/acl/localization/he_IL.inc +++ b/plugins/acl/localization/he_IL.inc @@ -89,7 +89,7 @@ $messages['saving'] = 'זכויות גישה נשמרות...'; $messages['updatesuccess'] = 'זכויות גישה שונו בהצלחה'; $messages['deletesuccess'] = 'זכויות גישה נמחקו בהצלחה'; $messages['createsuccess'] = 'זכויות גישה נוספו בהצלחה'; -$messages['updateerror'] = 'לא ניתן לעדכן זכויות גישה'; +$messages['updateerror'] = 'לא ניתן לעדכן הרשאות גישה'; $messages['deleteerror'] = 'לא ניתן למחוק זכויות גישה'; $messages['createerror'] = 'לא ניתן להוסיף זכויות גישה'; $messages['deleteconfirm'] = 'האם ודאי שברצונך להסיר זכויות גישה של המשתמש(ים) שנבחרו?'; diff --git a/plugins/acl/localization/it_IT.inc b/plugins/acl/localization/it_IT.inc index b4927fb3f..11d905387 100644 --- a/plugins/acl/localization/it_IT.inc +++ b/plugins/acl/localization/it_IT.inc @@ -41,7 +41,7 @@ $labels['aclx'] = 'Elimina cartella'; $labels['acla'] = 'Amministra'; $labels['aclfull'] = 'Controllo completo'; -$labels['aclother'] = 'Altri'; +$labels['aclother'] = 'Altro'; $labels['aclread'] = 'Lettura'; $labels['aclwrite'] = 'Scrittura'; $labels['acldelete'] = 'Elimina'; @@ -57,10 +57,10 @@ $labels['shortaclk'] = 'Crea'; $labels['shortacld'] = 'Elimina'; $labels['shortaclt'] = 'Elimina'; $labels['shortacle'] = 'Elimina'; -$labels['shortaclx'] = 'Cancella cartella'; +$labels['shortaclx'] = 'Elimina cartella'; $labels['shortacla'] = 'Amministra'; -$labels['shortaclother'] = 'Altri'; +$labels['shortaclother'] = 'Altro'; $labels['shortaclread'] = 'Lettura'; $labels['shortaclwrite'] = 'Scrittura'; $labels['shortacldelete'] = 'Elimina'; diff --git a/plugins/acl/localization/ko_KR.inc b/plugins/acl/localization/ko_KR.inc index 85e33725d..524427a4e 100644 --- a/plugins/acl/localization/ko_KR.inc +++ b/plugins/acl/localization/ko_KR.inc @@ -19,81 +19,81 @@ $labels['sharing'] = '공유'; $labels['myrights'] = '접근 권한'; $labels['username'] = '사용자:'; -$labels['advanced'] = 'advanced mode'; +$labels['advanced'] = '고급 모드'; $labels['newuser'] = '엔트리 추가'; -$labels['actions'] = 'Access right actions...'; -$labels['anyone'] = 'All users (anyone)'; -$labels['anonymous'] = 'Guests (anonymous)'; +$labels['actions'] = '접근 권한 동작...'; +$labels['anyone'] = '모든 사용자 (아무나)'; +$labels['anonymous'] = '방문자 (익명)'; $labels['identifier'] = '식별자'; -$labels['acll'] = 'Lookup'; -$labels['aclr'] = 'Read messages'; +$labels['acll'] = '조회'; +$labels['aclr'] = '읽은 메시지'; $labels['acls'] = '읽은 상태로 유지'; -$labels['aclw'] = 'Write flags'; -$labels['acli'] = 'Insert (Copy into)'; +$labels['aclw'] = '쓰기 깃발'; +$labels['acli'] = '삽입 (복사할 위치)'; $labels['aclp'] = '게시'; $labels['aclc'] = '하위 폴더 만들기'; $labels['aclk'] = '하위 폴더 만들기'; $labels['acld'] = '메시지 삭제'; $labels['aclt'] = '메시지 삭제'; -$labels['acle'] = 'Expunge'; +$labels['acle'] = '영구 제거'; $labels['aclx'] = '폴더 삭제'; $labels['acla'] = '관리자'; -$labels['aclfull'] = 'Full control'; -$labels['aclother'] = 'Other'; -$labels['aclread'] = 'Read'; -$labels['aclwrite'] = 'Write'; -$labels['acldelete'] = 'Delete'; +$labels['aclfull'] = '전체 제어권'; +$labels['aclother'] = '기타'; +$labels['aclread'] = '읽기'; +$labels['aclwrite'] = '쓰기'; +$labels['acldelete'] = '삭제'; -$labels['shortacll'] = 'Lookup'; -$labels['shortaclr'] = 'Read'; -$labels['shortacls'] = 'Keep'; -$labels['shortaclw'] = 'Write'; -$labels['shortacli'] = 'Insert'; +$labels['shortacll'] = '조회'; +$labels['shortaclr'] = '읽기'; +$labels['shortacls'] = '보관'; +$labels['shortaclw'] = '쓰기'; +$labels['shortacli'] = '삽입'; $labels['shortaclp'] = '게시'; -$labels['shortaclc'] = 'Create'; -$labels['shortaclk'] = 'Create'; -$labels['shortacld'] = 'Delete'; -$labels['shortaclt'] = 'Delete'; -$labels['shortacle'] = 'Expunge'; +$labels['shortaclc'] = '생성'; +$labels['shortaclk'] = '생성'; +$labels['shortacld'] = '삭제'; +$labels['shortaclt'] = '삭제'; +$labels['shortacle'] = '지움'; $labels['shortaclx'] = '폴더 삭제'; -$labels['shortacla'] = '관리자'; +$labels['shortacla'] = '관리'; -$labels['shortaclother'] = 'Other'; -$labels['shortaclread'] = 'Read'; -$labels['shortaclwrite'] = 'Write'; -$labels['shortacldelete'] = 'Delete'; +$labels['shortaclother'] = '기타'; +$labels['shortaclread'] = '읽기'; +$labels['shortaclwrite'] = '쓱'; +$labels['shortacldelete'] = '삭제'; -$labels['longacll'] = 'The folder is visible on lists and can be subscribed to'; -$labels['longaclr'] = 'The folder can be opened for reading'; -$labels['longacls'] = 'Messages Seen flag can be changed'; -$labels['longaclw'] = 'Messages flags and keywords can be changed, except Seen and Deleted'; -$labels['longacli'] = '폴더에 메시지를 복사하거나 작성할 수 있음'; -$labels['longaclp'] = '이 폴더로 메시지를 게시할 수 있음'; -$labels['longaclc'] = '이 폴더의 바로 밑에 폴더를 생성(또는 이름 변경)할 수 있음'; -$labels['longaclk'] = '이 폴더의 바로 밑에 폴더를 생성(또는 이름 변경)할 수 있음'; -$labels['longacld'] = '메시지 삭제 플래그가 변경될 수 있음'; -$labels['longaclt'] = '메시지 삭제 플래그가 변경될 수 있음'; -$labels['longacle'] = 'Messages can be expunged'; -$labels['longaclx'] = '폴더를 삭제하거나 이름 변경 할 수 있음'; +$labels['longacll'] = '폴더가 목록에 나타나고 다음 사용자가 구독할 수 있음:'; +$labels['longaclr'] = '읽기 위해 폴더를 열 수 있음'; +$labels['longacls'] = '읽은 메시지 깃발이 변경될 수 있음'; +$labels['longaclw'] = '메시지 깃발 및 키워드를 변경할 수 있음, 다만 읽음 및 삭제됨은 제외'; +$labels['longacli'] = '메시지를 폴더에 복사하거나 작성할 수 있음'; +$labels['longaclp'] = '메시지를 이 폴더로 게시할 수 있음'; +$labels['longaclc'] = '이 폴더의 바로 아래에 폴더를 생성(또는 이름 변경)할 수 있음'; +$labels['longaclk'] = '이 폴더의 바로 아래에 폴더를 생성(또는 이름 변경)할 수 있음'; +$labels['longacld'] = '메시지 삭제 깃발이 변경될 수 있음'; +$labels['longaclt'] = '메시지 삭제 깃발이 변경될 수 있음'; +$labels['longacle'] = '메시지가 영구 제거될 수 있음'; +$labels['longaclx'] = '폴더를 삭제하거나 이름을 변경 할 수 있음'; $labels['longacla'] = '폴더의 접근 권한을 변경할 수 있음'; $labels['longaclfull'] = '폴더 관리를 포함한 모든 제어권'; -$labels['longaclread'] = 'The folder can be opened for reading'; -$labels['longaclwrite'] = '메시지에 표시하거나, 폴더로 메시지를 복사하거나 작성할 수 있음'; +$labels['longaclread'] = '폴더를 열어 읽을 수 있음'; +$labels['longaclwrite'] = '메시지에 표시하거나, 폴더로 이동하거나 복사할 수 있음'; $labels['longacldelete'] = '메시지를 삭제할 수 있음'; -$messages['deleting'] = '접근 권한 삭제 중...'; -$messages['saving'] = '접근 권한 저장 중...'; -$messages['updatesuccess'] = '접근 권한을 변경하는데 성공 함.'; -$messages['deletesuccess'] = '접근 권한을 삭제하는데 성공 함.'; -$messages['createsuccess'] = '접근 권한을 추가하는데 성공 함.'; -$messages['updateerror'] = '접근 권한을 갱신할 수 없음.'; +$messages['deleting'] = '접근 권한을 삭제하는 중...'; +$messages['saving'] = '접근 권한을 저장하는 중...'; +$messages['updatesuccess'] = '접근 권한을 성공적으로 변경함.'; +$messages['deletesuccess'] = '접근 권한을 성공적으로 삭제함.'; +$messages['createsuccess'] = '접근 권한을 성공적으로 추가함.'; +$messages['updateerror'] = '접근 권한을 업데이트할 수 없음.'; $messages['deleteerror'] = '접근 권한을 삭제할 수 없음.'; $messages['createerror'] = '접근 권한을 추가할 수 없음.'; -$messages['deleteconfirm'] = '선택한 사용자(들)의 접근 권한을 삭제하고자 하는 것이 확실 합니까?'; +$messages['deleteconfirm'] = '정말로 선택한 사용자의 접근 권한을 삭제하시겠습니까?'; $messages['norights'] = '지정된 권한이 없음!'; -$messages['nouser'] = '지정된 username이 없음!'; +$messages['nouser'] = '지정된 사용자명이 없음!'; ?> diff --git a/plugins/acl/localization/lb_LU.inc b/plugins/acl/localization/lb_LU.inc new file mode 100644 index 000000000..b9891931c --- /dev/null +++ b/plugins/acl/localization/lb_LU.inc @@ -0,0 +1,99 @@ +<?php + +/* + +-----------------------------------------------------------------------+ + | plugins/acl/localization/<lang>.inc | + | | + | Localization file of the Roundcube Webmail ACL plugin | + | Copyright (C) 2012-2013, The Roundcube Dev Team | + | | + | Licensed under the GNU General Public License version 3 or | + | any later version with exceptions for skins & plugins. | + | See the README file for a full license statement. | + | | + +-----------------------------------------------------------------------+ + + For translation see https://www.transifex.com/projects/p/roundcube-webmail/resource/plugin-acl/ +*/ + +$labels['sharing'] = 'Sharing'; +$labels['myrights'] = 'Zougrëffsrechter'; +$labels['username'] = 'Benotzer:'; +$labels['advanced'] = 'avancéierte Modus'; +$labels['newuser'] = 'Element dobäisetzen'; +$labels['actions'] = 'Optioune fir d\'Zougrëffsrechter'; +$labels['anyone'] = 'All d\'Benotzer (jiddwereen)'; +$labels['anonymous'] = 'Gaascht (anonym)'; +$labels['identifier'] = 'Identifiant'; + +$labels['acll'] = 'Noschloen'; +$labels['aclr'] = 'Messagë liesen'; +$labels['acls'] = 'Lies-Status behalen'; +$labels['aclw'] = 'Write flags'; +$labels['acli'] = 'Insert (Copy into)'; +$labels['aclp'] = 'Post'; +$labels['aclc'] = 'Create subfolders'; +$labels['aclk'] = 'Create subfolders'; +$labels['acld'] = 'Messagë läschen'; +$labels['aclt'] = 'Messagë läschen'; +$labels['acle'] = 'Ausläschen'; +$labels['aclx'] = 'Dossier läschen'; +$labels['acla'] = 'Administréieren'; + +$labels['aclfull'] = 'Voll Kontroll'; +$labels['aclother'] = 'Aner'; +$labels['aclread'] = 'Liesen'; +$labels['aclwrite'] = 'Schreiwen'; +$labels['acldelete'] = 'Läschen'; + +$labels['shortacll'] = 'Noschloen'; +$labels['shortaclr'] = 'Liesen'; +$labels['shortacls'] = 'Halen'; +$labels['shortaclw'] = 'Schreiwen'; +$labels['shortacli'] = 'Drasetze'; +$labels['shortaclp'] = 'Schécken'; +$labels['shortaclc'] = 'Erstellen'; +$labels['shortaclk'] = 'Erstellen'; +$labels['shortacld'] = 'Läschen'; +$labels['shortaclt'] = 'Läschen'; +$labels['shortacle'] = 'Ausläschen'; +$labels['shortaclx'] = 'Dossier läschen'; +$labels['shortacla'] = 'Administréieren'; + +$labels['shortaclother'] = 'Aner'; +$labels['shortaclread'] = 'Liesen'; +$labels['shortaclwrite'] = 'Schreiwen'; +$labels['shortacldelete'] = 'Läschen'; + +$labels['longacll'] = 'The folder is visible on lists and can be subscribed to'; +$labels['longaclr'] = 'The folder can be opened for reading'; +$labels['longacls'] = 'Messages Seen flag can be changed'; +$labels['longaclw'] = 'Messages flags and keywords can be changed, except Seen and Deleted'; +$labels['longacli'] = 'Messages can be written or copied to the folder'; +$labels['longaclp'] = 'Messages can be posted to this folder'; +$labels['longaclc'] = 'Folders can be created (or renamed) directly under this folder'; +$labels['longaclk'] = 'Folders can be created (or renamed) directly under this folder'; +$labels['longacld'] = 'Messages Delete flag can be changed'; +$labels['longaclt'] = 'Messages Delete flag can be changed'; +$labels['longacle'] = 'Messages can be expunged'; +$labels['longaclx'] = 'The folder can be deleted or renamed'; +$labels['longacla'] = 'The folder access rights can be changed'; + +$labels['longaclfull'] = 'Full control including folder administration'; +$labels['longaclread'] = 'The folder can be opened for reading'; +$labels['longaclwrite'] = 'Messages can be marked, written or copied to the folder'; +$labels['longacldelete'] = 'Messagë kënne geläscht ginn'; + +$messages['deleting'] = 'Zougrëffsrechter gi geläscht...'; +$messages['saving'] = 'Zougrëffsrechter gi gespäichert...'; +$messages['updatesuccess'] = 'Rechter erfollegräich geännert'; +$messages['deletesuccess'] = 'Rechter erfollegräich geläscht'; +$messages['createsuccess'] = 'Rechter erfollegräich dobäigesat'; +$messages['updateerror'] = 'D\'Zougrëffsrechter kënnen net aktualiséiert ginn'; +$messages['deleteerror'] = 'Rechter kënnen net geläscht ginn'; +$messages['createerror'] = 'Zougrëffsrechter kënnen net dobäigesat ginn'; +$messages['deleteconfirm'] = 'Bass du dir sécher, dass du d\'Zougrëffsrechter fir déi ausgewielte Benotzer wëlls ewechhuelen?'; +$messages['norights'] = 'Et goufe keng Rechter uginn! '; +$messages['nouser'] = 'Et gouf kee Benotzernumm uginn!'; + +?> diff --git a/plugins/acl/localization/lt_LT.inc b/plugins/acl/localization/lt_LT.inc index 6507504e2..59393012f 100644 --- a/plugins/acl/localization/lt_LT.inc +++ b/plugins/acl/localization/lt_LT.inc @@ -70,7 +70,7 @@ $labels['longaclr'] = 'Aplanką galima peržiūrėti'; $labels['longacls'] = 'Pranešimų vėliavėlė "Matyta" gali būti pakeista'; $labels['longaclw'] = 'Pranešimų vėliavėlės ir raktažodžiai gali būti pakeisti, išskyrus "Matytas" ir "Ištrintas"'; $labels['longacli'] = 'Pranešimai gali būti įrašyti arba nukopijuoti į aplanką'; -$labels['longaclp'] = 'Messages can be posted to this folder'; +$labels['longaclp'] = 'Į šį aplanką galima dėti laiškus.'; $labels['longaclc'] = 'Nauji aplankai gali būti kuriami (arba pervadinami) šioje direktorijoje'; $labels['longaclk'] = 'Nauji aplankai gali būti kuriami (arba pervadinami) šioje direktorijoje'; $labels['longacld'] = 'Pranešimų vėliavėlė "Ištrintas" gali būti pakeista'; diff --git a/plugins/acl/localization/pl_PL.inc b/plugins/acl/localization/pl_PL.inc index 73c0fc4fb..69a5e0c05 100644 --- a/plugins/acl/localization/pl_PL.inc +++ b/plugins/acl/localization/pl_PL.inc @@ -89,7 +89,7 @@ $messages['saving'] = 'Zapisywanie praw dostępu...'; $messages['updatesuccess'] = 'Pomyślnie zmieniono prawa dostępu'; $messages['deletesuccess'] = 'Pomyślnie usunięto prawa dostępu'; $messages['createsuccess'] = 'Pomyślnie dodano prawa dostępu'; -$messages['updateerror'] = 'Nie udało się zmienić praw dostępu'; +$messages['updateerror'] = 'Nie udało się zaktualizować praw dostępu'; $messages['deleteerror'] = 'Nie udało się usunąć praw dostępu'; $messages['createerror'] = 'Nie udało się dodać praw dostępu'; $messages['deleteconfirm'] = 'Czy na pewno chcesz usunąć prawa wybranym użytkownikom?'; diff --git a/plugins/acl/localization/tr_TR.inc b/plugins/acl/localization/tr_TR.inc index 1569b5926..f3d60324b 100644 --- a/plugins/acl/localization/tr_TR.inc +++ b/plugins/acl/localization/tr_TR.inc @@ -89,7 +89,7 @@ $messages['saving'] = 'Erişim hakları saklanıyor...'; $messages['updatesuccess'] = 'Erişim hakları başarıyla değiştirildi'; $messages['deletesuccess'] = 'Erişim hakları başarıyla silindi'; $messages['createsuccess'] = 'Erişim hakları başarıyla eklendi'; -$messages['updateerror'] = 'Erişim haklarını güncellenemedi'; +$messages['updateerror'] = 'Erişim hakları güncellenemedi'; $messages['deleteerror'] = 'Erişim haklarını silinemedi'; $messages['createerror'] = 'Erişim hakları eklenemedi'; $messages['deleteconfirm'] = 'Seçilen kullanıcılar için erişim haklarını silmek istediğinizden emin misiniz?'; diff --git a/plugins/acl/localization/zh_CN.inc b/plugins/acl/localization/zh_CN.inc index 0c5171664..ebf314043 100644 --- a/plugins/acl/localization/zh_CN.inc +++ b/plugins/acl/localization/zh_CN.inc @@ -16,12 +16,12 @@ For translation see https://www.transifex.com/projects/p/roundcube-webmail/resource/plugin-acl/ */ -$labels['sharing'] = '共享中'; +$labels['sharing'] = '共享'; $labels['myrights'] = '访问权限'; $labels['username'] = '用户:'; $labels['advanced'] = '高级模式'; -$labels['newuser'] = '添加条目'; -$labels['actions'] = 'Access right actions...'; +$labels['newuser'] = '新增条目'; +$labels['actions'] = '权限设置...'; $labels['anyone'] = '所有用户(任何人)'; $labels['anonymous'] = '来宾(匿名)'; $labels['identifier'] = '标识符'; @@ -29,7 +29,7 @@ $labels['identifier'] = '标识符'; $labels['acll'] = '查找'; $labels['aclr'] = '读取消息'; $labels['acls'] = '保存已读状态'; -$labels['aclw'] = 'Write flags'; +$labels['aclw'] = '写入标志'; $labels['acli'] = '插入(复制至)'; $labels['aclp'] = '发送'; $labels['aclc'] = '创建子文件夹'; @@ -41,15 +41,15 @@ $labels['aclx'] = '删除文件夹'; $labels['acla'] = '管理'; $labels['aclfull'] = '全部控制'; -$labels['aclother'] = '其他'; -$labels['aclread'] = '阅读'; -$labels['aclwrite'] = '撰写'; +$labels['aclother'] = '其它'; +$labels['aclread'] = '读取'; +$labels['aclwrite'] = '写入'; $labels['acldelete'] = '删除'; $labels['shortacll'] = '查找'; -$labels['shortaclr'] = '阅读'; -$labels['shortacls'] = '保留'; -$labels['shortaclw'] = '撰写'; +$labels['shortaclr'] = '读取'; +$labels['shortacls'] = '保存'; +$labels['shortaclw'] = '写入'; $labels['shortacli'] = '插入'; $labels['shortaclp'] = '发送'; $labels['shortaclc'] = '新建'; @@ -61,22 +61,22 @@ $labels['shortaclx'] = '删除文件夹'; $labels['shortacla'] = '管理'; $labels['shortaclother'] = '其他'; -$labels['shortaclread'] = 'Read'; -$labels['shortaclwrite'] = '撰写'; +$labels['shortaclread'] = '读取'; +$labels['shortaclwrite'] = '写入'; $labels['shortacldelete'] = '删除'; $labels['longacll'] = '该文件夹在列表上可见且可被订阅'; $labels['longaclr'] = '该文件夹可被打开阅读'; $labels['longacls'] = 'Messages Seen flag can be changed'; $labels['longaclw'] = 'Messages flags and keywords can be changed, except Seen and Deleted'; -$labels['longacli'] = 'Messages can be written or copied to the folder'; +$labels['longacli'] = '消息可写或可被复制至文件夹中'; $labels['longaclp'] = 'Messages can be posted to this folder'; $labels['longaclc'] = 'Folders can be created (or renamed) directly under this folder'; $labels['longaclk'] = 'Folders can be created (or renamed) directly under this folder'; $labels['longacld'] = 'Messages Delete flag can be changed'; $labels['longaclt'] = 'Messages Delete flag can be changed'; $labels['longacle'] = '消息可被清除'; -$labels['longaclx'] = '该文件夹可悲删除或重命名'; +$labels['longaclx'] = '该文件夹可被删除或重命名'; $labels['longacla'] = '文件夹访问权限可被修改'; $labels['longaclfull'] = 'Full control including folder administration'; diff --git a/plugins/acl/localization/zh_TW.inc b/plugins/acl/localization/zh_TW.inc index 3125c286f..821f7b321 100644 --- a/plugins/acl/localization/zh_TW.inc +++ b/plugins/acl/localization/zh_TW.inc @@ -65,10 +65,10 @@ $labels['shortaclread'] = '讀取'; $labels['shortaclwrite'] = '寫入'; $labels['shortacldelete'] = '刪除'; -$labels['longacll'] = 'The folder is visible on lists and can be subscribed to'; +$labels['longacll'] = '此資料夾權限可以訂閱和瀏覽'; $labels['longaclr'] = '資料夾能被打開與讀取'; $labels['longacls'] = '能修改訊息標幟'; -$labels['longaclw'] = 'Messages flags and keywords can be changed, except Seen and Deleted'; +$labels['longaclw'] = '內容旗標和關鍵字可以變更,不包含已檢視和刪除的'; $labels['longacli'] = '訊息能寫入或複製到資料夾'; $labels['longaclp'] = '訊息能被投遞到這個資料夾'; $labels['longaclc'] = '這個資料夾之下可以建子資料夾(或重新命名)'; diff --git a/plugins/acl/package.xml b/plugins/acl/package.xml index 52e234f37..98460e82f 100644 --- a/plugins/acl/package.xml +++ b/plugins/acl/package.xml @@ -22,7 +22,7 @@ <release>stable</release> <api>stable</api> </stability> - <license uri="http://www.gnu.org/licenses/gpl-2.0.html">GNU GPLv2</license> + <license uri="http://www.gnu.org/licenses/gpl.html">GNU GPLv3+</license> <notes>-</notes> <contents> <dir baseinstalldir="/" name="/"> diff --git a/plugins/additional_message_headers/additional_message_headers.php b/plugins/additional_message_headers/additional_message_headers.php index 80c58d58b..a43018176 100644 --- a/plugins/additional_message_headers/additional_message_headers.php +++ b/plugins/additional_message_headers/additional_message_headers.php @@ -6,7 +6,7 @@ * Very simple plugin which will add additional headers * to or remove them from outgoing messages. * - * Enable the plugin in config/main.inc.php and add your desired headers: + * Enable the plugin in config.inc.php and add your desired headers: * $rcmail_config['additional_message_headers'] = array('User-Agent'); * * @version @package_version@ @@ -24,7 +24,7 @@ class additional_message_headers extends rcube_plugin function message_headers($args) { - $this->load_config(); + $this->load_config(); // additional email headers $additional_headers = rcmail::get_instance()->config->get('additional_message_headers',array()); @@ -39,5 +39,3 @@ class additional_message_headers extends rcube_plugin return $args; } } - -?> diff --git a/plugins/archive/archive.js b/plugins/archive/archive.js index eee41d336..3500b9fe4 100644 --- a/plugins/archive/archive.js +++ b/plugins/archive/archive.js @@ -7,18 +7,16 @@ function rcmail_archive(prop) { if (!rcmail.env.uid && (!rcmail.message_list || !rcmail.message_list.get_selection().length)) return; - + if (rcmail.env.mailbox.indexOf(rcmail.env.archive_folder) != 0) { if (!rcmail.env.archive_type) { // simply move to archive folder (if no partition type is set) - rcmail.command('moveto', rcmail.env.archive_folder); + rcmail.command('move', rcmail.env.archive_folder); } else { // let the server sort the messages to the according subfolders - rcmail.http_post( - 'plugin.move2archive', - { _uid: rcmail.message_list.get_selection().join(','), _mbox: rcmail.env.mailbox } - ); + var post_data = { _uid: rcmail.message_list.get_selection().join(','), _mbox: rcmail.env.mailbox }; + rcmail.http_post('plugin.move2archive', post_data); } } } @@ -26,16 +24,15 @@ function rcmail_archive(prop) // callback for app-onload event if (window.rcmail) { rcmail.addEventListener('init', function(evt) { - // register command (directly enable in message view mode) rcmail.register_command('plugin.archive', rcmail_archive, (rcmail.env.uid && rcmail.env.mailbox != rcmail.env.archive_folder)); - + // add event-listener to message list if (rcmail.message_list) - rcmail.message_list.addEventListener('select', function(list){ + rcmail.message_list.addEventListener('select', function(list) { rcmail.enable_command('plugin.archive', (list.get_selection().length > 0 && rcmail.env.mailbox != rcmail.env.archive_folder)); }); - + // set css style for archive folder var li; if (rcmail.env.archive_folder && (li = rcmail.get_folder_li(rcmail.env.archive_folder, '', true))) @@ -48,4 +45,3 @@ if (window.rcmail) { }); }) } - diff --git a/plugins/archive/archive.php b/plugins/archive/archive.php index 38b4f9fcb..7a81606ab 100644 --- a/plugins/archive/archive.php +++ b/plugins/archive/archive.php @@ -41,7 +41,7 @@ class archive extends rcube_plugin 'domain' => $this->ID, ), 'toolbar'); - + // register hook to localize the archive folder $this->add_hook('render_mailboxlist', array($this, 'render_mailboxlist')); @@ -75,10 +75,10 @@ class archive extends rcube_plugin { $rcmail = rcmail::get_instance(); $archive_folder = $rcmail->config->get('archive_mbox'); - $localize_name = $rcmail->config->get('archive_localize_name', true); + $show_real_name = $rcmail->config->get('show_real_foldernames'); // set localized name for the configured archive folder - if ($archive_folder && $localize_name) { + if ($archive_folder && !$show_real_name) { if (isset($p['list'][$archive_folder])) $p['list'][$archive_folder]['name'] = $this->gettext('archivefolder'); else // search in subfolders diff --git a/plugins/archive/localization/az_AZ.inc b/plugins/archive/localization/az_AZ.inc index 8aab6f2da..19a409d41 100644 --- a/plugins/archive/localization/az_AZ.inc +++ b/plugins/archive/localization/az_AZ.inc @@ -20,15 +20,15 @@ $labels = array(); $labels['buttontext'] = 'Arxiv'; $labels['buttontitle'] = 'Mesajı arxivə göndər'; $labels['archived'] = 'Arxivə göndərildi'; -$labels['archivedreload'] = 'Successfully archived. Reload the page to see the new archive folders.'; -$labels['archiveerror'] = 'Some messages could not be archived'; +$labels['archivedreload'] = 'Müvəffəqiyyətlə arxivləşdirildi. Yeni arxiv qovluqlarını görmək üçün səhifəni yeniləyin.'; +$labels['archiveerror'] = 'Bəzi məktublar arxivləşdirilə bilinmirlər'; $labels['archivefolder'] = 'Arxiv'; -$labels['settingstitle'] = 'Archive'; -$labels['archivetype'] = 'Divide archive by'; -$labels['archivetypeyear'] = 'Year (e.g. Archive/2012)'; -$labels['archivetypemonth'] = 'Month (e.g. Archive/2012/06)'; -$labels['archivetypefolder'] = 'Original folder'; -$labels['archivetypesender'] = 'Sender email'; -$labels['unkownsender'] = 'unknown'; +$labels['settingstitle'] = 'Arxiv'; +$labels['archivetype'] = 'Arxivi böl: '; +$labels['archivetypeyear'] = 'İl (məs. Arxiv/2012)'; +$labels['archivetypemonth'] = 'Ay (məs. Arxiv/2012/06)'; +$labels['archivetypefolder'] = 'Orijinal qovluq'; +$labels['archivetypesender'] = 'Göndərənin E-Poçtu'; +$labels['unkownsender'] = 'naməlum'; ?> diff --git a/plugins/archive/localization/bg_BG.inc b/plugins/archive/localization/bg_BG.inc index fd32931c2..b7be242e0 100644 --- a/plugins/archive/localization/bg_BG.inc +++ b/plugins/archive/localization/bg_BG.inc @@ -20,15 +20,15 @@ $labels = array(); $labels['buttontext'] = 'Архивиране'; $labels['buttontitle'] = 'Архивиране на съобщението'; $labels['archived'] = 'Архивирането е успешно'; -$labels['archivedreload'] = 'Successfully archived. Reload the page to see the new archive folders.'; -$labels['archiveerror'] = 'Some messages could not be archived'; +$labels['archivedreload'] = 'Успешно архивирано. Презаредете страницата за да видите архивираните папки.'; +$labels['archiveerror'] = 'Някои съобщения не бяха архивирани'; $labels['archivefolder'] = 'Архивиране'; -$labels['settingstitle'] = 'Archive'; -$labels['archivetype'] = 'Divide archive by'; -$labels['archivetypeyear'] = 'Year (e.g. Archive/2012)'; -$labels['archivetypemonth'] = 'Month (e.g. Archive/2012/06)'; -$labels['archivetypefolder'] = 'Original folder'; -$labels['archivetypesender'] = 'Sender email'; -$labels['unkownsender'] = 'unknown'; +$labels['settingstitle'] = 'Архив'; +$labels['archivetype'] = 'Раздели архива по'; +$labels['archivetypeyear'] = 'Година (пр. Архив/2012)'; +$labels['archivetypemonth'] = 'Месец (пр. Архив/2012/06)'; +$labels['archivetypefolder'] = 'Оригинална папка'; +$labels['archivetypesender'] = 'Email адрес на изпращача'; +$labels['unkownsender'] = 'неизвестно'; ?> diff --git a/plugins/archive/localization/ca_ES.inc b/plugins/archive/localization/ca_ES.inc index fde7d358e..04ade1dbf 100644 --- a/plugins/archive/localization/ca_ES.inc +++ b/plugins/archive/localization/ca_ES.inc @@ -20,15 +20,15 @@ $labels = array(); $labels['buttontext'] = 'Arxiva'; $labels['buttontitle'] = 'Arxiva aquest missatge'; $labels['archived'] = 'Arxivat correctament'; -$labels['archivedreload'] = 'Successfully archived. Reload the page to see the new archive folders.'; -$labels['archiveerror'] = 'Some messages could not be archived'; +$labels['archivedreload'] = 'Arxivat correctament. Recarregueu la pàgina per veure les noves carpetes de l\'arxiu.'; +$labels['archiveerror'] = 'Alguns missatges no han pogut ser arxivats'; $labels['archivefolder'] = 'Arxiva'; -$labels['settingstitle'] = 'Archive'; -$labels['archivetype'] = 'Divide archive by'; -$labels['archivetypeyear'] = 'Year (e.g. Archive/2012)'; -$labels['archivetypemonth'] = 'Month (e.g. Archive/2012/06)'; -$labels['archivetypefolder'] = 'Original folder'; -$labels['archivetypesender'] = 'Sender email'; -$labels['unkownsender'] = 'unknown'; +$labels['settingstitle'] = 'Arxiu'; +$labels['archivetype'] = 'Dividir arxiu per'; +$labels['archivetypeyear'] = 'Any (p.ex. Arxiu/2012)'; +$labels['archivetypemonth'] = 'Mes (p.ex. Arxiu/2012/06)'; +$labels['archivetypefolder'] = 'Carpeta original'; +$labels['archivetypesender'] = 'Adreça del remitent'; +$labels['unkownsender'] = 'desconegut'; ?> diff --git a/plugins/archive/localization/cs_CZ.inc b/plugins/archive/localization/cs_CZ.inc index 2f2fd95d5..e71aa5fa6 100644 --- a/plugins/archive/localization/cs_CZ.inc +++ b/plugins/archive/localization/cs_CZ.inc @@ -20,15 +20,15 @@ $labels = array(); $labels['buttontext'] = 'Archiv'; $labels['buttontitle'] = 'Archivovat zprávu'; $labels['archived'] = 'Úspěšně vloženo do archivu'; -$labels['archivedreload'] = 'Successfully archived. Reload the page to see the new archive folders.'; -$labels['archiveerror'] = 'Some messages could not be archived'; +$labels['archivedreload'] = 'Úspěšně archivovány. Obnovte stránku, abyste uviděli nové složky v archivu.'; +$labels['archiveerror'] = 'Některé zprávy nelze archivovat'; $labels['archivefolder'] = 'Archiv'; -$labels['settingstitle'] = 'Archive'; -$labels['archivetype'] = 'Divide archive by'; -$labels['archivetypeyear'] = 'Year (e.g. Archive/2012)'; -$labels['archivetypemonth'] = 'Month (e.g. Archive/2012/06)'; -$labels['archivetypefolder'] = 'Original folder'; -$labels['archivetypesender'] = 'Sender email'; -$labels['unkownsender'] = 'unknown'; +$labels['settingstitle'] = 'Archiv'; +$labels['archivetype'] = 'Rozdělit archiv podle'; +$labels['archivetypeyear'] = 'Rok (např. Archiv/2012)'; +$labels['archivetypemonth'] = 'Měsíc (např. Archiv/2012/06)'; +$labels['archivetypefolder'] = 'Původní složka'; +$labels['archivetypesender'] = 'E-mail odesílatele'; +$labels['unkownsender'] = 'neznámý'; ?> diff --git a/plugins/archive/localization/cy_GB.inc b/plugins/archive/localization/cy_GB.inc index fa8e19756..454c26da5 100644 --- a/plugins/archive/localization/cy_GB.inc +++ b/plugins/archive/localization/cy_GB.inc @@ -20,15 +20,15 @@ $labels = array(); $labels['buttontext'] = 'Archif'; $labels['buttontitle'] = 'Archifo\'r neges hwn'; $labels['archived'] = 'Archifwyd yn llwyddiannus'; -$labels['archivedreload'] = 'Successfully archived. Reload the page to see the new archive folders.'; -$labels['archiveerror'] = 'Some messages could not be archived'; +$labels['archivedreload'] = 'Archifwyd yn llwyddiannus. Ail-lwythwch y dudalen i weld ffolderi archif newydd.'; +$labels['archiveerror'] = 'Nid oedd yn bosib archifo rhai negeseuon'; $labels['archivefolder'] = 'Archif'; -$labels['settingstitle'] = 'Archive'; -$labels['archivetype'] = 'Divide archive by'; -$labels['archivetypeyear'] = 'Year (e.g. Archive/2012)'; -$labels['archivetypemonth'] = 'Month (e.g. Archive/2012/06)'; -$labels['archivetypefolder'] = 'Original folder'; -$labels['archivetypesender'] = 'Sender email'; -$labels['unkownsender'] = 'unknown'; +$labels['settingstitle'] = 'Archif'; +$labels['archivetype'] = 'Rhannu archif gyda'; +$labels['archivetypeyear'] = 'Blwyddyn (e.g. Archif/2012)'; +$labels['archivetypemonth'] = 'Mis (e.g. Archif/2012/06)'; +$labels['archivetypefolder'] = 'Ffolder gwreiddiol'; +$labels['archivetypesender'] = 'Ebost anfonwr'; +$labels['unkownsender'] = 'anhysbys'; ?> diff --git a/plugins/archive/localization/da_DK.inc b/plugins/archive/localization/da_DK.inc index d4a88cab4..ac67700a4 100644 --- a/plugins/archive/localization/da_DK.inc +++ b/plugins/archive/localization/da_DK.inc @@ -20,15 +20,15 @@ $labels = array(); $labels['buttontext'] = 'Arkiv'; $labels['buttontitle'] = 'Arkivér denne besked'; $labels['archived'] = 'Succesfuldt arkiveret.'; -$labels['archivedreload'] = 'Successfully archived. Reload the page to see the new archive folders.'; -$labels['archiveerror'] = 'Some messages could not be archived'; +$labels['archivedreload'] = 'Arkivering lykkedes. Genindlæs siden for at se den nye arkiv mappe.'; +$labels['archiveerror'] = 'Nogle meddelelser kunne ikke arkiveres'; $labels['archivefolder'] = 'Arkiv'; -$labels['settingstitle'] = 'Archive'; -$labels['archivetype'] = 'Divide archive by'; -$labels['archivetypeyear'] = 'Year (e.g. Archive/2012)'; -$labels['archivetypemonth'] = 'Month (e.g. Archive/2012/06)'; -$labels['archivetypefolder'] = 'Original folder'; -$labels['archivetypesender'] = 'Sender email'; -$labels['unkownsender'] = 'unknown'; +$labels['settingstitle'] = 'Arkiver'; +$labels['archivetype'] = 'Del arkiv med'; +$labels['archivetypeyear'] = 'År (f.eks. Arkiv/2012)'; +$labels['archivetypemonth'] = 'Måned (f.eks. Arkiv/2012/06)'; +$labels['archivetypefolder'] = 'Original mappe'; +$labels['archivetypesender'] = 'Afsenders email'; +$labels['unkownsender'] = 'ukendt'; ?> diff --git a/plugins/archive/localization/el_GR.inc b/plugins/archive/localization/el_GR.inc index 57a98abc8..6da9f7dbf 100644 --- a/plugins/archive/localization/el_GR.inc +++ b/plugins/archive/localization/el_GR.inc @@ -20,15 +20,15 @@ $labels = array(); $labels['buttontext'] = 'Αρχειοθέτηση'; $labels['buttontitle'] = 'Αρχειοθέτηση μηνύματος'; $labels['archived'] = 'Αρχειοθετήθηκε με επιτυχία'; -$labels['archivedreload'] = 'Successfully archived. Reload the page to see the new archive folders.'; -$labels['archiveerror'] = 'Some messages could not be archived'; +$labels['archivedreload'] = 'Επιτυχής αρχειοθετηση. Ανανέωση της σελίδας για να δείτε τους νέους φακέλους αρχειοθέτησης. '; +$labels['archiveerror'] = 'Ορισμένα μηνύματα δεν μπορεσαν να αρχειοθετηθουν. '; $labels['archivefolder'] = 'Αρχειοθέτηση'; -$labels['settingstitle'] = 'Archive'; -$labels['archivetype'] = 'Divide archive by'; -$labels['archivetypeyear'] = 'Year (e.g. Archive/2012)'; -$labels['archivetypemonth'] = 'Month (e.g. Archive/2012/06)'; -$labels['archivetypefolder'] = 'Original folder'; -$labels['archivetypesender'] = 'Sender email'; -$labels['unkownsender'] = 'unknown'; +$labels['settingstitle'] = 'Αρχειοθέτηση'; +$labels['archivetype'] = 'Χασμα αρχειου απο'; +$labels['archivetypeyear'] = 'Χρονος (π.χ. Αρχειο/2012)'; +$labels['archivetypemonth'] = 'Μηνας (π.χ. Αρχειο/2012/06)'; +$labels['archivetypefolder'] = 'Αυθεντικος φακελος'; +$labels['archivetypesender'] = 'Αποστολέας email'; +$labels['unkownsender'] = 'άγνωστο'; ?> diff --git a/plugins/archive/localization/es_AR.inc b/plugins/archive/localization/es_AR.inc index ad9e84add..5fb082497 100644 --- a/plugins/archive/localization/es_AR.inc +++ b/plugins/archive/localization/es_AR.inc @@ -20,15 +20,15 @@ $labels = array(); $labels['buttontext'] = 'Archivo'; $labels['buttontitle'] = 'Archivar este mensaje'; $labels['archived'] = 'Mensaje Archivado'; -$labels['archivedreload'] = 'Successfully archived. Reload the page to see the new archive folders.'; -$labels['archiveerror'] = 'Some messages could not be archived'; +$labels['archivedreload'] = 'Archivado satisfactoriamente. Recarga la página para ver las nuevas capetas archivadas.'; +$labels['archiveerror'] = 'Algunos mensajes no pudieron archivarse'; $labels['archivefolder'] = 'Archivo'; -$labels['settingstitle'] = 'Archive'; -$labels['archivetype'] = 'Divide archive by'; -$labels['archivetypeyear'] = 'Year (e.g. Archive/2012)'; -$labels['archivetypemonth'] = 'Month (e.g. Archive/2012/06)'; -$labels['archivetypefolder'] = 'Original folder'; -$labels['archivetypesender'] = 'Sender email'; -$labels['unkownsender'] = 'unknown'; +$labels['settingstitle'] = 'Archivo'; +$labels['archivetype'] = 'Separar archivo por'; +$labels['archivetypeyear'] = 'Año (ej. Archivo/2012)'; +$labels['archivetypemonth'] = 'Mes (ej. Archivo/2012/06)'; +$labels['archivetypefolder'] = 'Carpeta original'; +$labels['archivetypesender'] = 'Remitente del correo'; +$labels['unkownsender'] = 'desconocido'; ?> diff --git a/plugins/archive/localization/gl_ES.inc b/plugins/archive/localization/gl_ES.inc index 09b64b2ab..55180fefe 100644 --- a/plugins/archive/localization/gl_ES.inc +++ b/plugins/archive/localization/gl_ES.inc @@ -20,15 +20,15 @@ $labels = array(); $labels['buttontext'] = 'Arquivo'; $labels['buttontitle'] = 'Arquivar esta mensaxe'; $labels['archived'] = 'Aquivouse a mensaxe'; -$labels['archivedreload'] = 'Successfully archived. Reload the page to see the new archive folders.'; -$labels['archiveerror'] = 'Some messages could not be archived'; +$labels['archivedreload'] = 'Arquivado correctamente. Recargue a páxina para ver os novos cartafoles de arquivado.'; +$labels['archiveerror'] = 'Non se puideron arquivar algunhas mensaxes'; $labels['archivefolder'] = 'Arquivo'; -$labels['settingstitle'] = 'Archive'; -$labels['archivetype'] = 'Divide archive by'; -$labels['archivetypeyear'] = 'Year (e.g. Archive/2012)'; -$labels['archivetypemonth'] = 'Month (e.g. Archive/2012/06)'; -$labels['archivetypefolder'] = 'Original folder'; -$labels['archivetypesender'] = 'Sender email'; -$labels['unkownsender'] = 'unknown'; +$labels['settingstitle'] = 'Arquivar'; +$labels['archivetype'] = 'Dividir o arquivo por'; +$labels['archivetypeyear'] = 'Ano (p.ex. Arquivo/2012)'; +$labels['archivetypemonth'] = 'Mes (p.ex. Arquivo/2012/06)'; +$labels['archivetypefolder'] = 'Cartafol orixe'; +$labels['archivetypesender'] = 'Enderezo do remitente'; +$labels['unkownsender'] = 'descoñecido'; ?> diff --git a/plugins/archive/localization/he_IL.inc b/plugins/archive/localization/he_IL.inc index 834e46729..37bcaaa3f 100644 --- a/plugins/archive/localization/he_IL.inc +++ b/plugins/archive/localization/he_IL.inc @@ -20,15 +20,15 @@ $labels = array(); $labels['buttontext'] = 'ארכיון'; $labels['buttontitle'] = 'משלוח ההודעה לארכיב'; $labels['archived'] = 'עדכון הארכיון הצליח'; -$labels['archivedreload'] = 'Successfully archived. Reload the page to see the new archive folders.'; -$labels['archiveerror'] = 'Some messages could not be archived'; +$labels['archivedreload'] = 'נשמר בהצלחה בארכיב. יש לרענו את הדף כדי לראות את התיקיות החדשות בארכיב.'; +$labels['archiveerror'] = 'לא ניתן היה להעביר לארכיב חלק מההודעות'; $labels['archivefolder'] = 'ארכיון'; -$labels['settingstitle'] = 'Archive'; -$labels['archivetype'] = 'Divide archive by'; -$labels['archivetypeyear'] = 'Year (e.g. Archive/2012)'; -$labels['archivetypemonth'] = 'Month (e.g. Archive/2012/06)'; -$labels['archivetypefolder'] = 'Original folder'; -$labels['archivetypesender'] = 'Sender email'; -$labels['unkownsender'] = 'unknown'; +$labels['settingstitle'] = 'ארכיב'; +$labels['archivetype'] = 'לחלק את הארכיב על ידי'; +$labels['archivetypeyear'] = 'שנה ( לדוגמה, ארכיב/2012/96 )'; +$labels['archivetypemonth'] = 'חודש ( לדוגמה, ארכיב/2012/96 )'; +$labels['archivetypefolder'] = 'תיקיה מקורית'; +$labels['archivetypesender'] = 'שולח ההודעה'; +$labels['unkownsender'] = 'לא ידוע'; ?> diff --git a/plugins/archive/localization/hu_HU.inc b/plugins/archive/localization/hu_HU.inc index e95c2d0d2..970a24184 100644 --- a/plugins/archive/localization/hu_HU.inc +++ b/plugins/archive/localization/hu_HU.inc @@ -20,15 +20,15 @@ $labels = array(); $labels['buttontext'] = 'Archiválás'; $labels['buttontitle'] = 'Üzenet archiválása'; $labels['archived'] = 'Sikeres archiválás'; -$labels['archivedreload'] = 'Successfully archived. Reload the page to see the new archive folders.'; -$labels['archiveerror'] = 'Some messages could not be archived'; +$labels['archivedreload'] = 'Az arhiválás sikeres. Frissitsd az oldalt, hogy lásd a létrejött arhivum mappákat.'; +$labels['archiveerror'] = 'Néhány üzenetet nem sikerült arhiválni'; $labels['archivefolder'] = 'Archiválás'; -$labels['settingstitle'] = 'Archive'; -$labels['archivetype'] = 'Divide archive by'; -$labels['archivetypeyear'] = 'Year (e.g. Archive/2012)'; -$labels['archivetypemonth'] = 'Month (e.g. Archive/2012/06)'; -$labels['archivetypefolder'] = 'Original folder'; -$labels['archivetypesender'] = 'Sender email'; +$labels['settingstitle'] = 'Archiválás'; +$labels['archivetype'] = 'Arhívum tovább bontása a következő szerint'; +$labels['archivetypeyear'] = 'Év ( pl Arhívum/2012)'; +$labels['archivetypemonth'] = 'Honap ( pl Arhívum/2012/06)'; +$labels['archivetypefolder'] = 'Eredeti mappa'; +$labels['archivetypesender'] = 'Feladó'; $labels['unkownsender'] = 'ismeretlen'; ?> diff --git a/plugins/archive/localization/ko_KR.inc b/plugins/archive/localization/ko_KR.inc index 96a7ac404..4226420a0 100644 --- a/plugins/archive/localization/ko_KR.inc +++ b/plugins/archive/localization/ko_KR.inc @@ -19,16 +19,16 @@ $labels = array(); $labels['buttontext'] = '보관'; $labels['buttontitle'] = '이 메시지를 보관'; -$labels['archived'] = '성공적으로 보관 됨'; -$labels['archivedreload'] = 'Successfully archived. Reload the page to see the new archive folders.'; -$labels['archiveerror'] = 'Some messages could not be archived'; +$labels['archived'] = '성공적으로 보관됨'; +$labels['archivedreload'] = '성공적으로 보관됨. 페이지를 다시 불러와서 새 보관 폴더를 확인하세요.'; +$labels['archiveerror'] = '일부 메시지가 보관되지 않음'; $labels['archivefolder'] = '보관'; -$labels['settingstitle'] = 'Archive'; -$labels['archivetype'] = 'Divide archive by'; -$labels['archivetypeyear'] = 'Year (e.g. Archive/2012)'; -$labels['archivetypemonth'] = 'Month (e.g. Archive/2012/06)'; -$labels['archivetypefolder'] = 'Original folder'; -$labels['archivetypesender'] = 'Sender email'; -$labels['unkownsender'] = 'unknown'; +$labels['settingstitle'] = '보관'; +$labels['archivetype'] = '보관된 메시지 정리 기준'; +$labels['archivetypeyear'] = '연도 (예: 보관 편지함/2012)'; +$labels['archivetypemonth'] = '월 (예: 보관 편지함/2012/06)'; +$labels['archivetypefolder'] = '원본 폴더'; +$labels['archivetypesender'] = '발신인 이메일'; +$labels['unkownsender'] = '알 수 없음'; ?> diff --git a/plugins/archive/localization/lb_LU.inc b/plugins/archive/localization/lb_LU.inc new file mode 100644 index 000000000..6e9e6db22 --- /dev/null +++ b/plugins/archive/localization/lb_LU.inc @@ -0,0 +1,34 @@ +<?php + +/* + +-----------------------------------------------------------------------+ + | plugins/archive/localization/<lang>.inc | + | | + | Localization file of the Roundcube Webmail Archive plugin | + | Copyright (C) 2013, The Roundcube Dev Team | + | | + | Licensed under the GNU General Public License version 3 or | + | any later version with exceptions for skins & plugins. | + | See the README file for a full license statement. | + | | + +-----------------------------------------------------------------------+ + + For translation see https://www.transifex.com/projects/p/roundcube-webmail/resource/plugin-archive/ +*/ + +$labels = array(); +$labels['buttontext'] = 'Archivéieren'; +$labels['buttontitle'] = 'Dëse Message archivéieren'; +$labels['archived'] = 'Erfollegräich archivéiert'; +$labels['archivedreload'] = 'Erfollegräich archivéiert. Lued d\'Säit nei fir déi neisten Archiv-Dossieren ze gesinn.'; +$labels['archiveerror'] = 'Verschidde Messagë konnten net archivéiert ginn'; +$labels['archivefolder'] = 'Archiv'; +$labels['settingstitle'] = 'Archiv'; +$labels['archivetype'] = 'Archiv dividéieren duerch'; +$labels['archivetypeyear'] = 'Joer (z.B. Archiv/2013)'; +$labels['archivetypemonth'] = 'Mount (z.B. Archiv/2013/06)'; +$labels['archivetypefolder'] = 'Original-Dossier'; +$labels['archivetypesender'] = 'Sender-E-Mail'; +$labels['unkownsender'] = 'onbekannt'; + +?> diff --git a/plugins/archive/localization/lt_LT.inc b/plugins/archive/localization/lt_LT.inc index 36046277a..069a65665 100644 --- a/plugins/archive/localization/lt_LT.inc +++ b/plugins/archive/localization/lt_LT.inc @@ -20,15 +20,15 @@ $labels = array(); $labels['buttontext'] = 'Archyvuoti'; $labels['buttontitle'] = 'Perkelti šį laišką į archyvą'; $labels['archived'] = 'Laiškas sėkmingai perkeltas į archyvą'; -$labels['archivedreload'] = 'Successfully archived. Reload the page to see the new archive folders.'; -$labels['archiveerror'] = 'Some messages could not be archived'; +$labels['archivedreload'] = 'Sėkmingai perkelta į archyvą. Iš naujo įkelkite puslapį, kad pamatytumėt pasikeitimus.'; +$labels['archiveerror'] = 'Į archyvą nepavyko perkelti keleto laiškų.'; $labels['archivefolder'] = 'Archyvuoti'; -$labels['settingstitle'] = 'Archive'; -$labels['archivetype'] = 'Divide archive by'; -$labels['archivetypeyear'] = 'Year (e.g. Archive/2012)'; -$labels['archivetypemonth'] = 'Month (e.g. Archive/2012/06)'; -$labels['archivetypefolder'] = 'Original folder'; -$labels['archivetypesender'] = 'Sender email'; -$labels['unkownsender'] = 'unknown'; +$labels['settingstitle'] = 'Archyvuoti'; +$labels['archivetype'] = 'Padalinti archyvą pagal'; +$labels['archivetypeyear'] = 'Metai (pvz. Archyvas/2012)'; +$labels['archivetypemonth'] = 'Mėnesis (pvz. Archyvas/2012/06)'; +$labels['archivetypefolder'] = 'Tikrasis aplankas'; +$labels['archivetypesender'] = 'Siuntėjo el. pašto adresas'; +$labels['unkownsender'] = 'nežinomas'; ?> diff --git a/plugins/archive/localization/lv_LV.inc b/plugins/archive/localization/lv_LV.inc index ad2812fba..d4c892705 100644 --- a/plugins/archive/localization/lv_LV.inc +++ b/plugins/archive/localization/lv_LV.inc @@ -18,17 +18,17 @@ $labels = array(); $labels['buttontext'] = 'Arhīvs'; -$labels['buttontitle'] = 'Arhivēt vēstuli'; -$labels['archived'] = 'Vēstule sekmīgi arhivēta'; -$labels['archivedreload'] = 'Successfully archived. Reload the page to see the new archive folders.'; -$labels['archiveerror'] = 'Some messages could not be archived'; +$labels['buttontitle'] = 'Arhivēt šo vēstuli'; +$labels['archived'] = 'Vēstule veiksmīgi arhivēta'; +$labels['archivedreload'] = 'Arhīvs veiksmīgi izveidots. Lai redzētu jaunās arhīva mapes, pārlādējiet lapu.'; +$labels['archiveerror'] = 'Dažas vēstules nebija iespējams arhivēt'; $labels['archivefolder'] = 'Arhīvs'; -$labels['settingstitle'] = 'Archive'; -$labels['archivetype'] = 'Divide archive by'; -$labels['archivetypeyear'] = 'Year (e.g. Archive/2012)'; -$labels['archivetypemonth'] = 'Month (e.g. Archive/2012/06)'; -$labels['archivetypefolder'] = 'Original folder'; -$labels['archivetypesender'] = 'Sender email'; -$labels['unkownsender'] = 'unknown'; +$labels['settingstitle'] = 'Arhīvs'; +$labels['archivetype'] = 'Sadalīt arhīvu pa'; +$labels['archivetypeyear'] = 'Gadiem (piem. Arhīvs/2012)'; +$labels['archivetypemonth'] = 'Mēnešiem (piem. Arhīvs/2012/06)'; +$labels['archivetypefolder'] = 'Sākotnējā mape'; +$labels['archivetypesender'] = 'Sūtītāja e-pasts'; +$labels['unkownsender'] = 'nezināms'; ?> diff --git a/plugins/archive/localization/sl_SI.inc b/plugins/archive/localization/sl_SI.inc index 94d1f68b1..b49fe93ab 100644 --- a/plugins/archive/localization/sl_SI.inc +++ b/plugins/archive/localization/sl_SI.inc @@ -20,15 +20,15 @@ $labels = array(); $labels['buttontext'] = 'Arhiv'; $labels['buttontitle'] = 'Arhiviraj to sporočilo'; $labels['archived'] = 'Sporočilo je bilo uspešno arhivirano'; -$labels['archivedreload'] = 'Successfully archived. Reload the page to see the new archive folders.'; -$labels['archiveerror'] = 'Some messages could not be archived'; +$labels['archivedreload'] = 'Uspešno shranjeno v arhiv. Za pregled map v Arhivu ponovno naložite stran.'; +$labels['archiveerror'] = 'Nekaterih sporočil ni bilo mogoče arhivirati'; $labels['archivefolder'] = 'Arhiv'; -$labels['settingstitle'] = 'Archive'; -$labels['archivetype'] = 'Divide archive by'; -$labels['archivetypeyear'] = 'Year (e.g. Archive/2012)'; -$labels['archivetypemonth'] = 'Month (e.g. Archive/2012/06)'; -$labels['archivetypefolder'] = 'Original folder'; -$labels['archivetypesender'] = 'Sender email'; -$labels['unkownsender'] = 'unknown'; +$labels['settingstitle'] = 'Arhiv'; +$labels['archivetype'] = 'Razdeli arhiv glede na'; +$labels['archivetypeyear'] = 'Leto (npr. Arhiv/2012)'; +$labels['archivetypemonth'] = 'Mesec (npr. Arhiv/2012/06)'; +$labels['archivetypefolder'] = 'Izvorna mapa'; +$labels['archivetypesender'] = 'Naslov pošiljatelja'; +$labels['unkownsender'] = 'neznan'; ?> diff --git a/plugins/archive/localization/tr_TR.inc b/plugins/archive/localization/tr_TR.inc index 765498301..b6960ea89 100644 --- a/plugins/archive/localization/tr_TR.inc +++ b/plugins/archive/localization/tr_TR.inc @@ -20,15 +20,15 @@ $labels = array(); $labels['buttontext'] = 'Arşiv'; $labels['buttontitle'] = 'Bu postayı arşivle'; $labels['archived'] = 'Başarıyla arşivlendi'; -$labels['archivedreload'] = 'Successfully archived. Reload the page to see the new archive folders.'; -$labels['archiveerror'] = 'Some messages could not be archived'; +$labels['archivedreload'] = 'Başarıyla arşivlendi. Yeni arşiv dosyalarını görmek için sayfayı yenileyin.'; +$labels['archiveerror'] = 'Bazı mesajlar arşivlenemedi.'; $labels['archivefolder'] = 'Arşiv'; -$labels['settingstitle'] = 'Archive'; -$labels['archivetype'] = 'Divide archive by'; -$labels['archivetypeyear'] = 'Year (e.g. Archive/2012)'; -$labels['archivetypemonth'] = 'Month (e.g. Archive/2012/06)'; -$labels['archivetypefolder'] = 'Original folder'; -$labels['archivetypesender'] = 'Sender email'; -$labels['unkownsender'] = 'unknown'; +$labels['settingstitle'] = 'Arşiv'; +$labels['archivetype'] = 'Arşivi bunla böl'; +$labels['archivetypeyear'] = 'Yıl (Arşiv/2012)'; +$labels['archivetypemonth'] = 'Ay(Arşiv/2012/06)'; +$labels['archivetypefolder'] = 'Özgün dosya'; +$labels['archivetypesender'] = 'E-Posta Göndericisi'; +$labels['unkownsender'] = 'bilinmeyen'; ?> diff --git a/plugins/archive/localization/zh_TW.inc b/plugins/archive/localization/zh_TW.inc index a434f3184..6eac3a391 100644 --- a/plugins/archive/localization/zh_TW.inc +++ b/plugins/archive/localization/zh_TW.inc @@ -20,15 +20,15 @@ $labels = array(); $labels['buttontext'] = '封存'; $labels['buttontitle'] = '封存此信件'; $labels['archived'] = '已成功封存'; -$labels['archivedreload'] = 'Successfully archived. Reload the page to see the new archive folders.'; -$labels['archiveerror'] = 'Some messages could not be archived'; +$labels['archivedreload'] = '封存動作完成.重新載入頁面瀏覽新的封存資料夾'; +$labels['archiveerror'] = '部分資訊無法完成封存'; $labels['archivefolder'] = '封存'; -$labels['settingstitle'] = 'Archive'; -$labels['archivetype'] = 'Divide archive by'; -$labels['archivetypeyear'] = 'Year (e.g. Archive/2012)'; -$labels['archivetypemonth'] = 'Month (e.g. Archive/2012/06)'; -$labels['archivetypefolder'] = 'Original folder'; -$labels['archivetypesender'] = 'Sender email'; -$labels['unkownsender'] = 'unknown'; +$labels['settingstitle'] = '封存'; +$labels['archivetype'] = '封存檔案切割方式'; +$labels['archivetypeyear'] = '年分(例如: 封存/2012)'; +$labels['archivetypemonth'] = '月份(例如: 封存/2012/06)'; +$labels['archivetypefolder'] = '原始資料夾'; +$labels['archivetypesender'] = '寄件者電子信箱'; +$labels['unkownsender'] = '未知'; ?> diff --git a/plugins/attachment_reminder/attachment_reminder.js b/plugins/attachment_reminder/attachment_reminder.js new file mode 100755 index 000000000..50d661b3b --- /dev/null +++ b/plugins/attachment_reminder/attachment_reminder.js @@ -0,0 +1,68 @@ +/* Attachment Reminder plugin script */ + +function rcmail_get_compose_message() +{ + var msg; + + if (window.tinyMCE && (ed = tinyMCE.get(rcmail.env.composebody))) { + msg = ed.getContent(); + msg = msg.replace(/<blockquote[^>]*>(.|[\r\n])*<\/blockquote>/gmi, ''); + } + else { + msg = $('#' + rcmail.env.composebody).val(); + msg = msg.replace(/^>.*$/gmi, ''); + } + + return msg; +}; + +function rcmail_check_message(msg) +{ + var i, rx, keywords = rcmail.gettext('keywords', 'attachment_reminder').split(",").concat([".doc", ".pdf"]); + + $.each(keywords, function(n) { return RegExp.escape(n); }); + rx = new RegExp('(' + keywords.join('|') + ')', 'i'); + + return msg.search(rx) != -1; +}; + +function rcmail_have_attachments() +{ + return rcmail.env.attachments && $('li', rcmail.gui_objects.attachmentlist).length; +}; + +function rcmail_attachment_reminder_dialog() +{ + var buttons = {}; + + buttons[rcmail.gettext('addattachment')] = function() { + $(this).remove(); + if (window.UI && UI.show_uploadform) // Larry skin + UI.show_uploadform(); + else if (window.rcmail_ui && rcmail_ui.show_popup) // classic skin + rcmail_ui.show_popup('uploadmenu', true); + }; + buttons[rcmail.gettext('send')] = function(e) { + $(this).remove(); + rcmail.env.attachment_reminder = true; + rcmail.command('send', '', e); + }; + + rcmail.env.attachment_reminder = false; + rcmail.show_popup_dialog(rcmail.gettext('attachment_reminder.forgotattachment'), '', buttons); +}; + + +if (window.rcmail) { + rcmail.addEventListener('beforesend', function(evt) { + var msg = rcmail_get_compose_message(), + subject = $('#compose-subject').val(); + + if (!rcmail.env.attachment_reminder && !rcmail_have_attachments() + && (rcmail_check_message(msg) || rcmail_check_message(subject)) + ) { + rcmail_attachment_reminder_dialog(); + return false; + } + }); +} diff --git a/plugins/attachment_reminder/attachment_reminder.php b/plugins/attachment_reminder/attachment_reminder.php new file mode 100755 index 000000000..84cc5f3b3 --- /dev/null +++ b/plugins/attachment_reminder/attachment_reminder.php @@ -0,0 +1,84 @@ +<?php +/** + * Attachement Reminder + * + * A plugin that reminds a user to attach the files + * + * @version @package_version@ + * @author Thomas Yu - Sian, Liu + * @author Aleksander Machniak <machniak@kolabsys.com> + * + * Copyright (C) 2013 Thomas Yu - Sian, Liu + * Copyright (C) 2013, Kolab Systems AG + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/> + */ + +class attachment_reminder extends rcube_plugin +{ + public $task = 'mail|settings'; + public $noajax = true; + + + function init() + { + $rcmail = rcube::get_instance(); + + if ($rcmail->task == 'mail' && $rcmail->action == 'compose') { + if ($rcmail->config->get('attachment_reminder')) { + $this->include_script('attachment_reminder.js'); + $this->add_texts('localization/', array('keywords', 'forgotattachment')); + $rcmail->output->add_label('addattachment', 'send'); + } + } + + if ($rcmail->task == 'settings') { + $dont_override = $rcmail->config->get('dont_override', array()); + + if (!in_array('attachment_reminder', $dont_override)) { + $this->add_hook('preferences_list', array($this, 'prefs_list')); + $this->add_hook('preferences_save', array($this, 'prefs_save')); + } + } + } + + function prefs_list($args) + { + if ($args['section'] == 'compose') { + $this->add_texts('localization/'); + $reminder = rcube::get_instance()->config->get('attachment_reminder'); + $field_id = 'rcmfd_attachment_reminder'; + $checkbox = new html_checkbox(array('name' => '_attachment_reminder', 'id' => $field_id, 'value' => 1)); + + $args['blocks']['main']['options']['attachment_reminder'] = array( + 'title' => html::label($field_id, rcube::Q($this->gettext('reminderoption'))), + 'content' => $checkbox->show($reminder ? 1 : 0), + ); + } + + return $args; + } + + function prefs_save($args) + { + if ($args['section'] == 'compose') { + $dont_override = rcube::get_instance()->config->get('dont_override', array()); + if (!in_array('attachment_reminder', $dont_override)) { + $args['prefs']['attachment_reminder'] = !empty($_POST['_attachment_reminder']); + } + } + return $args; + } + +} diff --git a/plugins/attachment_reminder/localization/de_CH.inc b/plugins/attachment_reminder/localization/de_CH.inc new file mode 100644 index 000000000..ad9f8d4f4 --- /dev/null +++ b/plugins/attachment_reminder/localization/de_CH.inc @@ -0,0 +1,22 @@ +<?php + +/* + +-----------------------------------------------------------------------+ + | plugins/attachment_reminder/localization/<lang>.inc | + | | + | Localization file of the Roundcube Webmail Archive plugin | + | Copyright (C) 2013, The Roundcube Dev Team | + | | + | Licensed under the GNU General Public License version 3 or | + | any later version with exceptions for skins & plugins. | + | See the README file for a full license statement. | + | | + +-----------------------------------------------------------------------+ + + For translation see https://www.transifex.com/projects/p/roundcube-webmail/resource/plugin-attachment_reminder/ +*/ + +$messages = array(); +$messages['forgotattachment'] = "Haben Sie möglicherweise vergessen eine Datei anzuhängen?"; +$messages['reminderoption'] = "Vor vergessenen Anhängen warnen"; +$messages['keywords'] = "anbei,anhang,angehängt,angefügt,beigefügt,beliegend"; diff --git a/plugins/attachment_reminder/localization/de_DE.inc b/plugins/attachment_reminder/localization/de_DE.inc new file mode 100644 index 000000000..7de41d1fc --- /dev/null +++ b/plugins/attachment_reminder/localization/de_DE.inc @@ -0,0 +1,6 @@ +<?php + +$messages = array(); +$messages['forgotattachment'] = "Haben Sie möglicherweise vergessen eine Datei anzuhängen?"; +$messages['reminderoption'] = "Remind about forgotten attachments"; +$messages['keywords'] = "anbei,im anhang,angehängt,angefügt,beigefügt,beliegend"; diff --git a/plugins/attachment_reminder/localization/en_US.inc b/plugins/attachment_reminder/localization/en_US.inc new file mode 100644 index 000000000..488b0df37 --- /dev/null +++ b/plugins/attachment_reminder/localization/en_US.inc @@ -0,0 +1,22 @@ +<?php + +/* + +-----------------------------------------------------------------------+ + | plugins/attachment_reminder/localization/<lang>.inc | + | | + | Localization file of the Roundcube Webmail Archive plugin | + | Copyright (C) 2013, The Roundcube Dev Team | + | | + | Licensed under the GNU General Public License version 3 or | + | any later version with exceptions for skins & plugins. | + | See the README file for a full license statement. | + | | + +-----------------------------------------------------------------------+ + + For translation see https://www.transifex.com/projects/p/roundcube-webmail/resource/plugin-attachment_reminder/ +*/ + +$messages = array(); +$messages['forgotattachment'] = "Did you forget to attach a file?"; +$messages['reminderoption'] = "Remind about forgotten attachments"; +$messages['keywords'] = "attachment,file,attach,attached,attaching,enclosed,CV,cover letter"; diff --git a/plugins/attachment_reminder/localization/es_ES.inc b/plugins/attachment_reminder/localization/es_ES.inc new file mode 100644 index 000000000..79225d77e --- /dev/null +++ b/plugins/attachment_reminder/localization/es_ES.inc @@ -0,0 +1,6 @@ +<?php + +$messages = array(); +$messages['forgotattachment'] = "¿Olvidó adjuntar un fichero al mensaje?"; +$messages['reminderoption'] = "Remind about forgotten attachments"; +$messages['keywords'] = "adjunto"; diff --git a/plugins/attachment_reminder/localization/fr_FR.inc b/plugins/attachment_reminder/localization/fr_FR.inc new file mode 100644 index 000000000..78522c2e1 --- /dev/null +++ b/plugins/attachment_reminder/localization/fr_FR.inc @@ -0,0 +1,6 @@ +<?php + +$messages = array(); +$messages['forgotattachment'] = "Avez vous oublié d'attacher un fichier ?"; +$messages['reminderoption'] = "Remind about forgotten attachments"; +$messages['keywords'] = "joins,joint,attaché,CV"; diff --git a/plugins/attachment_reminder/localization/it_IT.inc b/plugins/attachment_reminder/localization/it_IT.inc new file mode 100644 index 000000000..d326a6065 --- /dev/null +++ b/plugins/attachment_reminder/localization/it_IT.inc @@ -0,0 +1,6 @@ +<?php + +$messages = array(); +$messages['forgotattachment'] = "Sembra che tu abbia dimenticato di allegare un file!\nPremere Annulla per inviare lo stesso.\nOK per tornare al messaggio senza inviare."; +$messages['reminderoption'] = "Remind about forgotten attachments"; +$messages['keywords'] = "allegato,allegati,allegata,allegate,allega,allego,alleghi,attaccato,file,attachment,attach"; diff --git a/plugins/attachment_reminder/localization/lb_LU.inc b/plugins/attachment_reminder/localization/lb_LU.inc new file mode 100644 index 000000000..cdfe031d1 --- /dev/null +++ b/plugins/attachment_reminder/localization/lb_LU.inc @@ -0,0 +1,22 @@ +<?php + +/* + +-----------------------------------------------------------------------+ + | plugins/attachment_reminder/localization/<lang>.inc | + | | + | Localization file of the Roundcube Webmail Archive plugin | + | Copyright (C) 2013, The Roundcube Dev Team | + | | + | Licensed under the GNU General Public License version 3 or | + | any later version with exceptions for skins & plugins. | + | See the README file for a full license statement. | + | | + +-----------------------------------------------------------------------+ + + For translation see https://www.transifex.com/projects/p/roundcube-webmail/resource/plugin-attachment_reminder/ +*/ + +$messages = array(); +$messages['forgotattachment'] = "Hues du vergiess e Fichier drunzehänken?"; +$messages['reminderoption'] = "U vergiessen Unhäng erënneren"; +$messages['keywords'] = "Attachment,Fichier,Unhank,Unhang,Unhäng,ugehaangen,unhänken,attachment,file,attach,attached,attaching,enclosed,CV,cover letter,fichier joint"; diff --git a/plugins/attachment_reminder/localization/nl_NL.inc b/plugins/attachment_reminder/localization/nl_NL.inc new file mode 100644 index 000000000..d80bfe9a9 --- /dev/null +++ b/plugins/attachment_reminder/localization/nl_NL.inc @@ -0,0 +1,6 @@ +<?php + +$messages = array(); +$messages['forgotattachment'] = "Ben je vergeten het bestand bij te voegen?"; +$messages['reminderoption'] = "Remind about forgotten attachments"; +$messages['keywords'] = "attachment,bestand,bijgaand,bijgaande,brief,bijgevoegd,bijgesloten,CV"; diff --git a/plugins/attachment_reminder/localization/pl_PL.inc b/plugins/attachment_reminder/localization/pl_PL.inc new file mode 100644 index 000000000..96f4f4989 --- /dev/null +++ b/plugins/attachment_reminder/localization/pl_PL.inc @@ -0,0 +1,6 @@ +<?php + +$messages = array(); +$messages['forgotattachment'] = "Czy nie zapomniałeś załączyć pliku?"; +$messages['reminderoption'] = "Włącz przypominanie o brakującym załączniku"; +$messages['keywords'] = "załącznik,plik,załącz,CV"; diff --git a/plugins/attachment_reminder/localization/zh_CN.inc b/plugins/attachment_reminder/localization/zh_CN.inc new file mode 100644 index 000000000..367191ffb --- /dev/null +++ b/plugins/attachment_reminder/localization/zh_CN.inc @@ -0,0 +1,6 @@ +<?php + +$messages = array(); +$messages['forgotattachment'] = "您似乎忘記加入附件了,你確定要寄出?"; +$messages['reminderoption'] = "Remind about forgotten attachments"; +$messages['keywords'] = "附件,附加,附檔,附上,附加檔案"; diff --git a/plugins/attachment_reminder/localization/zh_TW.inc b/plugins/attachment_reminder/localization/zh_TW.inc new file mode 100644 index 000000000..367191ffb --- /dev/null +++ b/plugins/attachment_reminder/localization/zh_TW.inc @@ -0,0 +1,6 @@ +<?php + +$messages = array(); +$messages['forgotattachment'] = "您似乎忘記加入附件了,你確定要寄出?"; +$messages['reminderoption'] = "Remind about forgotten attachments"; +$messages['keywords'] = "附件,附加,附檔,附上,附加檔案"; diff --git a/plugins/attachment_reminder/package.xml b/plugins/attachment_reminder/package.xml new file mode 100644 index 000000000..78768d534 --- /dev/null +++ b/plugins/attachment_reminder/package.xml @@ -0,0 +1,67 @@ +<?xml version="1.0" encoding="UTF-8"?> +<package xmlns="http://pear.php.net/dtd/package-2.0" xmlns:tasks="http://pear.php.net/dtd/tasks-1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" packagerversion="1.9.0" version="2.0" xsi:schemaLocation="http://pear.php.net/dtd/tasks-1.0 + http://pear.php.net/dtd/tasks-1.0.xsd + http://pear.php.net/dtd/package-2.0 + http://pear.php.net/dtd/package-2.0.xsd"> + <name>Attachment Reminder</name> + <summary>Roundcube plugin that prompts you if it looks like you wanted to attach a file but you didn't.</summary> + <description> + This Roundcube plugin reminds the user to attach a file if the composed message text indicates that there should be any. + </description> + <lead> + <name>Aleksander Machniak</name> + <user>alec</user> + <email>alec@alec.pl</email> + <active>yes</active> + </lead> + <lead> + <name>Thomas Yu - Sian, Liu</name> + <active>yes</active> + </lead> + <date>2013-05-20</date> + <version> + <release>1.1</release> + <api>1.0</api> + </version> + <stability> + <release>stable</release> + <api>stable</api> + </stability> + <license uri="http://www.gnu.org/licenses/gpl.html">GNU GPLv3+</license> + <notes>-</notes> + <contents> + <dir baseinstalldir="/" name="/"> + <file name="attachment_reminder.php" role="php"> + <tasks:replace from="@name@" to="name" type="package-info"/> + <tasks:replace from="@package_version@" to="version" type="package-info"/> + </file> + <file name="attachment_reminder.js" role="data"> + <tasks:replace from="@name@" to="name" type="package-info"/> + <tasks:replace from="@package_version@" to="version" type="package-info"/> + </file> + + <file name="localization/de_CH.inc" role="data"></file> + <file name="localization/de_DE.inc" role="data"></file> + <file name="localization/en_US.inc" role="data"></file> + <file name="localization/es_ES.inc" role="data"></file> + <file name="localization/fr_FR.inc" role="data"></file> + <file name="localization/it_IT.inc" role="data"></file> + <file name="localization/nl_NL.inc" role="data"></file> + <file name="localization/pl_PL.inc" role="data"></file> + <file name="localization/zh_CN.inc" role="data"></file> + <file name="localization/zh_TW.inc" role="data"></file> + </dir> + <!-- / --> + </contents> + <dependencies> + <required> + <php> + <min>5.2.1</min> + </php> + <pearinstaller> + <min>1.7.0</min> + </pearinstaller> + </required> + </dependencies> + <phprelease/> +</package> diff --git a/plugins/autologon/autologon.php b/plugins/autologon/autologon.php index 63ffb943e..9c7d5b6fc 100644 --- a/plugins/autologon/autologon.php +++ b/plugins/autologon/autologon.php @@ -19,8 +19,6 @@ class autologon extends rcube_plugin function startup($args) { - $rcmail = rcmail::get_instance(); - // change action to login if (empty($_SESSION['user_id']) && !empty($_GET['_autologin']) && $this->is_localhost()) $args['action'] = 'login'; @@ -37,7 +35,7 @@ class autologon extends rcube_plugin $args['cookiecheck'] = false; $args['valid'] = true; } - + return $args; } diff --git a/plugins/database_attachments/config.inc.php.dist b/plugins/database_attachments/config.inc.php.dist new file mode 100644 index 000000000..b23a9a1be --- /dev/null +++ b/plugins/database_attachments/config.inc.php.dist @@ -0,0 +1,12 @@ +<?php + +// By default this plugin stores attachments in filesystem +// and copies them into sql database. +// You can change it to use 'memcache' or 'apc'. +$rcmail_config['database_attachments_cache'] = 'db'; + +// Attachment data expires after specied TTL time in seconds (max.2592000). +// Default is 12 hours. +$rcmail_config['database_attachments_cache_ttl'] = 12 * 60 * 60; + +?> diff --git a/plugins/database_attachments/database_attachments.php b/plugins/database_attachments/database_attachments.php index 2511dbbb2..47e2b5222 100644 --- a/plugins/database_attachments/database_attachments.php +++ b/plugins/database_attachments/database_attachments.php @@ -1,6 +1,6 @@ <?php /** - * Filesystem Attachments + * Database Attachments * * This plugin which provides database backed storage for temporary * attachment file handling. The primary advantage of this plugin @@ -16,18 +16,11 @@ require_once('plugins/filesystem_attachments/filesystem_attachments.php'); class database_attachments extends filesystem_attachments { + // Cache object + protected $cache; // A prefix for the cache key used in the session and in the key field of the cache table - private $cache_prefix = "db_attach"; - - /** - * Helper method to generate a unique key for the given attachment file - */ - private function _key($args) - { - $uname = $args['path'] ? $args['path'] : $args['name']; - return $this->cache_prefix . $args['group'] . md5(mktime() . $uname . $_SESSION['user_id']); - } + protected $prefix = "db_attach"; /** * Save a newly uploaded attachment @@ -35,23 +28,17 @@ class database_attachments extends filesystem_attachments function upload($args) { $args['status'] = false; - $rcmail = rcmail::get_instance(); - $key = $this->_key($args); - $data = file_get_contents($args['path']); + $cache = $this->get_cache(); + $key = $this->_key($args); + $data = file_get_contents($args['path']); - if ($data === false) + if ($data === false) { return $args; + } - $data = base64_encode($data); - - $status = $rcmail->db->query( - "INSERT INTO ".$rcmail->db->table_name('cache') - ." (created, user_id, cache_key, data)" - ." VALUES (".$rcmail->db->now().", ?, ?, ?)", - $_SESSION['user_id'], - $key, - $data); + $data = base64_encode($data); + $status = $cache->write($key, $data); if ($status) { $args['id'] = $key; @@ -68,26 +55,20 @@ class database_attachments extends filesystem_attachments function save($args) { $args['status'] = false; - $rcmail = rcmail::get_instance(); - $key = $this->_key($args); + $cache = $this->get_cache(); + $key = $this->_key($args); if ($args['path']) { $args['data'] = file_get_contents($args['path']); - if ($args['data'] === false) + if ($args['data'] === false) { return $args; + } } - $data = base64_encode($args['data']); - - $status = $rcmail->db->query( - "INSERT INTO ".$rcmail->db->table_name('cache') - ." (created, user_id, cache_key, data)" - ." VALUES (".$rcmail->db->now().", ?, ?, ?)", - $_SESSION['user_id'], - $key, - $data); + $data = base64_encode($args['data']); + $status = $cache->write($key, $data); if ($status) { $args['id'] = $key; @@ -104,13 +85,9 @@ class database_attachments extends filesystem_attachments function remove($args) { $args['status'] = false; - $rcmail = rcmail::get_instance(); - $status = $rcmail->db->query( - "DELETE FROM ".$rcmail->db->table_name('cache') - ." WHERE user_id = ?" - ." AND cache_key = ?", - $_SESSION['user_id'], - $args['id']); + + $cache = $this->get_cache(); + $status = $cache->remove($args['id']); if ($status) { $args['status'] = true; @@ -135,18 +112,11 @@ class database_attachments extends filesystem_attachments */ function get($args) { - $rcmail = rcmail::get_instance(); - - $sql_result = $rcmail->db->query( - "SELECT data" - ." FROM ".$rcmail->db->table_name('cache') - ." WHERE user_id=?" - ." AND cache_key=?", - $_SESSION['user_id'], - $args['id']); - - if ($sql_arr = $rcmail->db->fetch_assoc($sql_result)) { - $args['data'] = base64_decode($sql_arr['data']); + $cache = $this->get_cache(); + $data = $cache->read($args['id']); + + if ($data) { + $args['data'] = base64_decode($data); $args['status'] = true; } @@ -158,12 +128,36 @@ class database_attachments extends filesystem_attachments */ function cleanup($args) { - $prefix = $this->cache_prefix . $args['group']; - $rcmail = rcmail::get_instance(); - $rcmail->db->query( - "DELETE FROM ".$rcmail->db->table_name('cache') - ." WHERE user_id = ?" - ." AND cache_key LIKE '{$prefix}%'", - $_SESSION['user_id']); + $cache = $this->get_cache(); + $cache->remove($args['group'], true); + } + + /** + * Helper method to generate a unique key for the given attachment file + */ + protected function _key($args) + { + $uname = $args['path'] ? $args['path'] : $args['name']; + return $args['group'] . md5(mktime() . $uname . $_SESSION['user_id']); + } + + /** + * Initialize and return cache object + */ + protected function get_cache() + { + if (!$this->cache) { + $this->load_config(); + + $rcmail = rcube::get_instance(); + $ttl = 12 * 60 * 60; // default: 12 hours + $ttl = $rcmail->config->get('database_attachments_cache_ttl', $ttl); + $type = $rcmail->config->get('database_attachments_cache', 'db'); + + // Init SQL cache (disable cache data serialization) + $this->cache = $rcmail->get_cache($this->prefix, 'db', $ttl, false); + } + + return $this->cache; } } diff --git a/plugins/database_attachments/package.xml b/plugins/database_attachments/package.xml index 40db858a4..44adc219e 100644 --- a/plugins/database_attachments/package.xml +++ b/plugins/database_attachments/package.xml @@ -5,7 +5,7 @@ http://pear.php.net/dtd/package-2.0.xsd"> <name>database_attachments</name> <channel>pear.roundcube.net</channel> - <summary>SQL database storage for uploaded attachments</summary> + <summary>Database storage for uploaded attachments</summary> <description> This plugin which provides database backed storage for temporary attachment file handling. The primary advantage of this plugin @@ -24,9 +24,9 @@ <email>ziba@umich.edu</email> <active>yes</active> </developer> - <date>2011-11-21</date> + <date>2013-06-13</date> <version> - <release>1.0</release> + <release>1.1</release> <api>1.0</api> </version> <stability> diff --git a/plugins/debug_logger/debug_logger.php b/plugins/debug_logger/debug_logger.php index 87a163785..deb6deb91 100644 --- a/plugins/debug_logger/debug_logger.php +++ b/plugins/debug_logger/debug_logger.php @@ -12,7 +12,7 @@ * which can redirect messages to files. The resulting log files * provide timing and tag quantity results. * - * Enable the plugin in config/main.inc.php and add your desired + * Enable the plugin in config.inc.php and add your desired * log types and files. * * @version @package_version@ @@ -21,7 +21,7 @@ * * Example: * - * config/main.inc.php: + * config.inc.php: * * // $rcmail_config['debug_logger'][type of logging] = name of file in log_dir * // The 'master' log includes timing information diff --git a/plugins/debug_logger/runlog/runlog.php b/plugins/debug_logger/runlog/runlog.php index c9f672615..0c766a13c 100644 --- a/plugins/debug_logger/runlog/runlog.php +++ b/plugins/debug_logger/runlog/runlog.php @@ -194,7 +194,7 @@ class runlog { public function print_totals(){ $totals = array(); - foreach ( $this->run_log as $k => $entry ) { + foreach ($this->run_log as $entry) { if ( $entry['type'] == 'start' && $entry['ended'] == true) { $totals[$entry['value']]['duration'] += $entry['duration']; $totals[$entry['value']]['count'] += 1; diff --git a/plugins/enigma/enigma.php b/plugins/enigma/enigma.php index c96b94620..25520a27d 100644 --- a/plugins/enigma/enigma.php +++ b/plugins/enigma/enigma.php @@ -47,6 +47,8 @@ class enigma extends rcube_plugin $rcmail = rcmail::get_instance(); $this->rc = $rcmail; + $section = rcube_utils::get_input_value('_section', rcube_utils::INPUT_GET); + if ($this->rc->task == 'mail') { // message parse/display hooks $this->add_hook('message_part_structure', array($this, 'parse_structure')); @@ -79,7 +81,6 @@ class enigma extends rcube_plugin $this->register_action('plugin.enigma', array($this, 'preferences_ui')); // grab keys/certs management iframe requests - $section = rcube_utils::get_input_value('_section', rcube_utils::INPUT_GET); if ($this->rc->action == 'edit-prefs' && preg_match('/^enigma(certs|keys)/', $section)) { $this->load_ui(); $this->ui->init($section); @@ -148,7 +149,7 @@ class enigma extends rcube_plugin */ function parse_structure($p) { - $struct = $p['structure']; +// $struct = $p['structure']; if ($p['mimetype'] == 'text/plain' || $p['mimetype'] == 'application/pgp') { $this->parse_plain($p); @@ -390,7 +391,7 @@ class enigma extends rcube_plugin function message_load($p) { $this->message = $p['object']; - + // handle attachments vcard attachments foreach ((array)$this->message->attachments as $attachment) { if ($this->is_keys_part($attachment)) { @@ -398,7 +399,7 @@ class enigma extends rcube_plugin } } // the same with message bodies - foreach ((array)$this->message->parts as $idx => $part) { + foreach ((array)$this->message->parts as $part) { if ($this->is_keys_part($part)) { $this->keys_parts[] = $part->mime_id; $this->keys_bodies[] = $part->mime_id; diff --git a/plugins/enigma/lib/enigma_engine.php b/plugins/enigma/lib/enigma_engine.php index 220d6c0b3..8a64c07ff 100644 --- a/plugins/enigma/lib/enigma_engine.php +++ b/plugins/enigma/lib/enigma_engine.php @@ -374,17 +374,15 @@ class enigma_engine { // @TODO: Handle big bodies using (temp) files // @TODO: caching of verification result - - $sig = $this->pgp_driver->verify($msg_body, $sig_body); + $sig = $this->pgp_driver->verify($msg_body, $sig_body); - if (($sig instanceof enigma_error) && $sig->getCode() != enigma_error::E_KEYNOTFOUND) - rcube::raise_error(array( + if (($sig instanceof enigma_error) && $sig->getCode() != enigma_error::E_KEYNOTFOUND) + rcube::raise_error(array( 'code' => 600, 'type' => 'php', 'file' => __FILE__, 'line' => __LINE__, - 'message' => "Enigma plugin: " . $error->getMessage() + 'message' => "Enigma plugin: " . $sig->getMessage() ), true, false); -//print_r($sig); return $sig; } @@ -399,11 +397,9 @@ class enigma_engine { // @TODO: Handle big bodies using (temp) files // @TODO: caching of verification result - + $key = ''; $pass = ''; // @TODO $result = $this->pgp_driver->decrypt($msg_body, $key, $pass); -//print_r($result); - if ($result instanceof enigma_error) { $err_code = $result->getCode(); if (!in_array($err_code, array(enigma_error::E_KEYNOTFOUND, enigma_error::E_BADPASS))) @@ -430,7 +426,7 @@ class enigma_engine { $this->load_pgp_driver(); $result = $this->pgp_driver->list_keys($pattern); - + if ($result instanceof enigma_error) { rcube::raise_error(array( 'code' => 600, 'type' => 'php', @@ -438,7 +434,7 @@ class enigma_engine 'message' => "Enigma plugin: " . $result->getMessage() ), true, false); } - + return $result; } @@ -501,9 +497,11 @@ class enigma_engine $uid = rcube_utils::get_input_value('_uid', rcube_utils::INPUT_POST); $mbox = rcube_utils::get_input_value('_mbox', rcube_utils::INPUT_POST); $mime_id = rcube_utils::get_input_value('_part', rcube_utils::INPUT_POST); + $storage = $this->rc->get_storage(); if ($uid && $mime_id) { - $part = $this->rc->storage->get_message_part($uid, $mime_id); + $storage->set_folder($mbox); + $part = $storage->get_message_part($uid, $mime_id); } if ($part && is_array($result = $this->import_key($part))) { @@ -532,16 +530,4 @@ class enigma_engine $uid, $part->mime_id, $part); } } - - /** - * Adds CSS style file to the page header. - */ - private function add_css() - { - $skin = $this->rc->config->get('skin'); - if (!file_exists($this->home . "/skins/$skin/enigma.css")) - $skin = 'default'; - - $this->include_stylesheet("skins/$skin/enigma.css"); - } } diff --git a/plugins/enigma/lib/enigma_ui.php b/plugins/enigma/lib/enigma_ui.php index 47366b7e8..adb619d0c 100644 --- a/plugins/enigma/lib/enigma_ui.php +++ b/plugins/enigma/lib/enigma_ui.php @@ -176,8 +176,7 @@ class enigma_ui $search = rcube_utils::get_input_value('_q', rcube_utils::INPUT_GPC); // define list of cols to be displayed - $a_show_cols = array('name'); - $result = array(); +// $a_show_cols = array('name'); // Get the list $list = $this->enigma->engine->list_keys($search); @@ -200,7 +199,7 @@ class enigma_ui $size = count($list); // Add rows - foreach($list as $idx => $key) { + foreach ($list as $key) { $this->rc->output->command('enigma_add_list_row', array('name' => rcube::Q($key->name), 'id' => $key->id)); } diff --git a/plugins/enigma/skins/classic/templates/keys.html b/plugins/enigma/skins/classic/templates/keys.html index 4271eccb7..f581c457b 100644 --- a/plugins/enigma/skins/classic/templates/keys.html +++ b/plugins/enigma/skins/classic/templates/keys.html @@ -13,7 +13,7 @@ } </style> </head> -<body class="iframe" onload="rcube_init_mail_ui()"> +<body class="iframe"> <div id="prefs-title" class="boxtitle"><roundcube:label name="enigma.enigmakeys" /></div> <div id="prefs-details" class="boxcontent"> @@ -72,5 +72,9 @@ </ul> </div> +<script type="text/javascript"> +rcube_init_mail_ui(); +</script> + </body> </html> diff --git a/plugins/example_addressbook/example_addressbook.php b/plugins/example_addressbook/example_addressbook.php index a15461f44..31077adf7 100644 --- a/plugins/example_addressbook/example_addressbook.php +++ b/plugins/example_addressbook/example_addressbook.php @@ -5,6 +5,9 @@ require_once(dirname(__FILE__) . '/example_addressbook_backend.php'); /** * Sample plugin to add a new address book * with just a static list of contacts + * + * @license GNU GPLv3+ + * @author Thomas Bruederli */ class example_addressbook extends rcube_plugin { diff --git a/plugins/filesystem_attachments/filesystem_attachments.php b/plugins/filesystem_attachments/filesystem_attachments.php index fa147795f..8d995ca0d 100644 --- a/plugins/filesystem_attachments/filesystem_attachments.php +++ b/plugins/filesystem_attachments/filesystem_attachments.php @@ -13,6 +13,7 @@ * require_once('plugins/filesystem_attachments/filesystem_attachments.php'); * class myCustom_attachments extends filesystem_attachments * + * @license GNU GPLv3+ * @author Ziba Scott <ziba@umich.edu> * @author Thomas Bruederli <roundcube@gmail.com> * @@ -60,6 +61,7 @@ class filesystem_attachments extends rcube_plugin $args['id'] = $this->file_id(); $args['path'] = $tmpfname; $args['status'] = true; + @chmod($tmpfname, 0600); // set correct permissions (#1488996) // Note the file for later cleanup $_SESSION['plugins']['filesystem_attachments'][$group][] = $tmpfname; diff --git a/plugins/filesystem_attachments/package.xml b/plugins/filesystem_attachments/package.xml index 031a74297..49ec51934 100644 --- a/plugins/filesystem_attachments/package.xml +++ b/plugins/filesystem_attachments/package.xml @@ -34,7 +34,7 @@ <release>stable</release> <api>stable</api> </stability> - <license uri="http://www.gnu.org/licenses/gpl-2.0.html">GNU GPLv2</license> + <license uri="http://www.gnu.org/licenses/gpl.html">GNU GPLv3+</license> <notes>-</notes> <contents> <dir baseinstalldir="/" name="/"> diff --git a/plugins/help/config.inc.php.dist b/plugins/help/config.inc.php.dist index d440dbbcc..1dbc21753 100644 --- a/plugins/help/config.inc.php.dist +++ b/plugins/help/config.inc.php.dist @@ -1,5 +1,35 @@ <?php // Help content iframe source -// $rcmail_config['help_source'] = 'http://trac.roundcube.net/wiki'; -$rcmail_config['help_source'] = ''; +// %l will be replaced by the language code resolved using the 'help_language_map' option +$rcmail_config['help_source'] = 'http://roundcube.net/doc/help/0.9/%l/'; + +// Map task/action combinations to deep-links +// Use '<task>/<action>' or only '<task>' strings as keys +// The values will be appended to the 'help_source' URL +$rcmail_config['help_index_map'] = array( + 'login' => 'login.html', + 'mail' => 'mail/index.html', + 'mail/compose' => 'mail/compose.html', + 'addressbook' => 'addressbook/index.html', + 'settings' => 'settings/index.html', + 'settings/preferences' => 'settings/preferences.html', + 'settings/folders' => 'settings/folders.html', + 'settings/identities' => 'settings/identities.html', +); + +// Map to translate Roundcube language codes into help document languages +// The '*' entry will be used as default +$rcmail_config['help_language_map'] = array('*' => 'en_US'); + +// Enter an absolute URL to a page displaying information about this webmail +// Alternatively, create a HTML file under <this-plugin-dir>/content/about.html +$rcmail_config['help_about_url'] = null; + +// Enter an absolute URL to a page displaying information about this webmail +// Alternatively, put your license text to <this-plugin-dir>/content/license.html +$rcmail_config['help_license_url'] = null; + +// Determine whether to open the help in a new window +$rcmail_config['help_open_extwin'] = false; + diff --git a/plugins/help/content/about.html b/plugins/help/content/about.html deleted file mode 100644 index 6e9632bec..000000000 --- a/plugins/help/content/about.html +++ /dev/null @@ -1,27 +0,0 @@ -<div id="helpabout" class="readtext"> -<h2 align="center">Copyright © 2005-2012, The Roundcube Dev Team</h2> - -<p> -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License (with exceptions -for skins & plugins) as published by the Free Software Foundation, -either version 3 of the License, or (at your option) any later version. -</p> -<p> -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. -</p> -<p> -You should have received a copy of the GNU General Public License -along with this program. If not, see <a href="http://www.gnu.org/licenses/">www.gnu.org/licenses</a>. -</p> - -<p> -For more details about licensing and the expections for skins and plugins -see <a href="http://roundcube.net/license">roundcube.net/license</a>. -</p> - -<p><br/>Website: <a href="http://roundcube.net">roundcube.net</a></p> -</div> diff --git a/plugins/help/content/license.html b/plugins/help/content/license.html index 371dbffe1..9034d46f8 100644 --- a/plugins/help/content/license.html +++ b/plugins/help/content/license.html @@ -655,7 +655,7 @@ the “copyright” line and a pointer to where the full notice is found GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program. If not, see <http://www.gnu.org/licenses/>. + along with this program. If not, see <http://www.gnu.org/licenses/>. </pre> <p>Also add information on how to contact you by electronic and paper mail.</p> diff --git a/plugins/help/help.js b/plugins/help/help.js new file mode 100644 index 000000000..59a93c537 --- /dev/null +++ b/plugins/help/help.js @@ -0,0 +1,25 @@ +/* + * Help plugin client script + * @version 1.4 + */ + +// hook into switch-task event to open the help window +if (window.rcmail) { + rcmail.addEventListener('beforeswitch-task', function(prop) { + // catch clicks to help task button + if (prop == 'help') { + if (rcmail.task == 'help') // we're already there + return false; + + var url = rcmail.url('help/index', { _rel: rcmail.task + (rcmail.env.action ? '/'+rcmail.env.action : '') }); + if (rcmail.env.help_open_extwin) { + rcmail.open_window(url, 1020, false); + } + else { + rcmail.redirect(url, false); + } + + return false; + } + }); +} diff --git a/plugins/help/help.php b/plugins/help/help.php index 4b11dceb3..37fd908a3 100644 --- a/plugins/help/help.php +++ b/plugins/help/help.php @@ -1,9 +1,10 @@ <?php /** - * Help Plugin + * Roundcube Help Plugin * * @author Aleksander 'A.L.E.C' Machniak + * @author Thomas Bruederli <thomas@roundcube.net> * @license GNU GPLv3+ * * Configuration (see config.inc.php.dist) @@ -21,8 +22,7 @@ class help extends rcube_plugin function init() { - $rcmail = rcmail::get_instance(); - + $this->load_config(); $this->add_texts('localization/', false); // register task @@ -33,6 +33,8 @@ class help extends rcube_plugin $this->register_action('about', array($this, 'action')); $this->register_action('license', array($this, 'action')); + $rcmail = rcmail::get_instance(); + // add taskbar button $this->add_button(array( 'command' => 'help', @@ -42,6 +44,9 @@ class help extends rcube_plugin 'label' => 'help.help', ), 'taskbar'); + $this->include_script('help.js'); + $rcmail->output->set_env('help_open_extwin', $rcmail->config->get('help_open_extwin', false), true); + // add style for taskbar button (must be here) and Help UI $skin_path = $this->local_skin_path(); if (is_file($this->home . "/$skin_path/help.css")) { @@ -53,11 +58,10 @@ class help extends rcube_plugin { $rcmail = rcmail::get_instance(); - $this->load_config(); - // register UI objects $rcmail->output->add_handlers(array( 'helpcontent' => array($this, 'content'), + 'tablink' => array($this, 'tablink'), )); if ($rcmail->action == 'about') @@ -70,20 +74,52 @@ class help extends rcube_plugin $rcmail->output->send('help.help'); } + function tablink($attrib) + { + $rcmail = rcmail::get_instance(); + $attrib['name'] = 'helplink' . $attrib['action']; + $attrib['href'] = $rcmail->url(array('_action' => $attrib['action'], '_extwin' => !empty($_REQUEST['_extwin']) ? 1 : null)); + return $rcmail->output->button($attrib); + } + function content($attrib) { $rcmail = rcmail::get_instance(); - if ($rcmail->action == 'about') { - return @file_get_contents($this->home.'/content/about.html'); - } - else if ($rcmail->action == 'license') { - return @file_get_contents($this->home.'/content/license.html'); + switch ($rcmail->action) { + case 'about': + if (is_readable($this->home . '/content/about.html')) { + return @file_get_contents($this->home . '/content/about.html'); + } + $default = $rcmail->url(array('_task' => 'settings', '_action' => 'about', '_framed' => 1)); + $src = $rcmail->config->get('help_about_url', $default); + break; + + case 'license': + if (is_readable($this->home . '/content/license.html')) { + return @file_get_contents($this->home . '/content/license.html'); + } + $src = $rcmail->config->get('help_license_url', 'http://www.gnu.org/licenses/gpl-3.0-standalone.html'); + break; + + default: + $src = $rcmail->config->get('help_source'); + + // resolve task/action for depp linking + $index_map = $rcmail->config->get('help_index_map', array()); + $rel = $_REQUEST['_rel']; + list($task,$action) = explode('/', $rel); + if ($add = $index_map[$rel]) + $src .= $add; + else if ($add = $index_map[$task]) + $src .= $add; + break; } // default content: iframe - if ($src = $rcmail->config->get('help_source')) - $attrib['src'] = $src; + if (!empty($src)) { + $attrib['src'] = $this->resolve_language($src); + } if (empty($attrib['id'])) $attrib['id'] = 'rcmailhelpcontent'; @@ -93,4 +129,13 @@ class help extends rcube_plugin return $rcmail->output->frame($attrib); } + + private function resolve_language($path) + { + // resolve language placeholder + $rcmail = rcmail::get_instance(); + $langmap = $rcmail->config->get('help_language_map', array('*' => 'en_US')); + $lang = !empty($langmap[$_SESSION['language']]) ? $langmap[$_SESSION['language']] : $langmap['*']; + return str_replace('%l', $lang, $path); + } } diff --git a/plugins/help/localization/de_DE.inc b/plugins/help/localization/de_DE.inc index 70c50646e..250657da6 100644 --- a/plugins/help/localization/de_DE.inc +++ b/plugins/help/localization/de_DE.inc @@ -18,7 +18,7 @@ $labels = array(); $labels['help'] = 'Hilfe'; -$labels['about'] = 'Über'; +$labels['about'] = 'Über'; $labels['license'] = 'Lizenz'; ?> diff --git a/plugins/help/localization/gl_ES.inc b/plugins/help/localization/gl_ES.inc index 432623751..e3e9e36ca 100644 --- a/plugins/help/localization/gl_ES.inc +++ b/plugins/help/localization/gl_ES.inc @@ -19,6 +19,6 @@ $labels = array(); $labels['help'] = 'Axuda'; $labels['about'] = 'Acerca de'; -$labels['license'] = 'Licencia'; +$labels['license'] = 'Licenza'; ?> diff --git a/plugins/help/localization/ko_KR.inc b/plugins/help/localization/ko_KR.inc index a589d0ce1..836da6639 100644 --- a/plugins/help/localization/ko_KR.inc +++ b/plugins/help/localization/ko_KR.inc @@ -19,6 +19,6 @@ $labels = array(); $labels['help'] = '도움말'; $labels['about'] = '정보'; -$labels['license'] = '라이센스'; +$labels['license'] = '라이선스'; ?> diff --git a/plugins/help/localization/lb_LU.inc b/plugins/help/localization/lb_LU.inc new file mode 100644 index 000000000..0a7ec6eef --- /dev/null +++ b/plugins/help/localization/lb_LU.inc @@ -0,0 +1,24 @@ +<?php + +/* + +-----------------------------------------------------------------------+ + | plugins/help/localization/<lang>.inc | + | | + | Localization file of the Roundcube Webmail Help plugin | + | Copyright (C) 2012-2013, The Roundcube Dev Team | + | | + | Licensed under the GNU General Public License version 3 or | + | any later version with exceptions for skins & plugins. | + | See the README file for a full license statement. | + | | + +-----------------------------------------------------------------------+ + + For translation see https://www.transifex.com/projects/p/roundcube-webmail/resource/plugin-help/ +*/ + +$labels = array(); +$labels['help'] = 'Hëllef'; +$labels['about'] = 'Iwwert'; +$labels['license'] = 'Lizenz'; + +?> diff --git a/plugins/help/localization/zh_CN.inc b/plugins/help/localization/zh_CN.inc index 5d6272eea..59719477b 100644 --- a/plugins/help/localization/zh_CN.inc +++ b/plugins/help/localization/zh_CN.inc @@ -19,6 +19,6 @@ $labels = array(); $labels['help'] = '帮助'; $labels['about'] = '关于'; -$labels['license'] = '许可协议'; +$labels['license'] = '授权信息'; ?> diff --git a/plugins/help/package.xml b/plugins/help/package.xml index 889efd17d..d39143ba1 100644 --- a/plugins/help/package.xml +++ b/plugins/help/package.xml @@ -5,7 +5,7 @@ http://pear.php.net/dtd/package-2.0.xsd"> <name>help</name> <channel>pear.roundcube.net</channel> - <summary>Help for Roundcube</summary> + <summary>Online Help for Roundcube</summary> <description>Plugin adds a new item (Help) in taskbar.</description> <lead> <name>Aleksander Machniak</name> @@ -13,10 +13,10 @@ <email>alec@alec.pl</email> <active>yes</active> </lead> - <date>2012-11-11</date> + <date>2013-07-03</date> <version> - <release>1.3</release> - <api>1.2</api> + <release>1.4</release> + <api>1.4</api> </version> <stability> <release>stable</release> @@ -31,7 +31,6 @@ <tasks:replace from="@package_version@" to="version" type="package-info"/> </file> <file name="config.inc.php.dist" role="data"></file> - <file name="content/about.html" role="data"></file> <file name="content/license.html" role="data"></file> <file name="localization/bs_BA.inc" role="data"></file> <file name="localization/ca_ES.inc" role="data"></file> diff --git a/plugins/help/skins/classic/help.css b/plugins/help/skins/classic/help.css index 8f67f111e..c45b8f0b0 100644 --- a/plugins/help/skins/classic/help.css +++ b/plugins/help/skins/classic/help.css @@ -5,9 +5,23 @@ background-image: url('help.gif'); } +.extwin #tabsbar +{ + top: 21px; + left: 20px; + right: 100px; + border-bottom: 0; +} + +.closelink { + position: absolute; + top: 20px; + right: 20px; +} + .help-box { - overflow: auto; + overflow: auto; background-color: #F2F2F2; } diff --git a/plugins/help/skins/classic/templates/help.html b/plugins/help/skins/classic/templates/help.html index 2e430ecf3..3d5b22869 100644 --- a/plugins/help/skins/classic/templates/help.html +++ b/plugins/help/skins/classic/templates/help.html @@ -7,23 +7,28 @@ <script type="text/javascript"> function help_init_settings_tabs() { - var action, tab = '#helptabdefault'; + var action, tab = '#helptabindex'; if (window.rcmail && (action = rcmail.env.action)) { - tab = '#helptab' + (action ? action : 'default'); + tab = '#helptab' + (action ? action : 'index'); } $(tab).addClass('tablink-selected'); } </script> </head> +<roundcube:if condition="env:extwin" /> +<body class="extwin"> +<roundcube:object name="message" id="message" /> +<roundcube:button name="close" type="link" label="close" class="closelink" onclick="self.close()" /> +<roundcube:else /> <body> - <roundcube:include file="/includes/taskbar.html" /> <roundcube:include file="/includes/header.html" /> +<roundcube:endif /> <div id="tabsbar"> -<span id="helptabdefault" class="tablink"><roundcube:button name="helpdefault" href="?_task=help" type="link" label="help.help" title="help.help" /></span> -<span id="helptababout" class="tablink"><roundcube:button name="helpabout" href="?_task=help&_action=about" type="link" label="help.about" title="help.about" class="tablink" /></span> -<span id="helptablicense" class="tablink"><roundcube:button name="helplicense" href="?_task=help&_action=license" type="link" label="help.license" title="help.license" class="tablink" /></span> +<span id="helptabindex" class="tablink"><roundcube:object name="tablink" action="index" type="link" label="help.help" title="help.help" /></span> +<span id="helptababout" class="tablink"><roundcube:object name="tablink" action="about" type="link" label="help.about" title="help.about" class="tablink" /></span> +<span id="helptablicense" class="tablink"><roundcube:object name="tablink" action="license" type="link" label="help.license" title="help.license" class="tablink" /></span> <roundcube:container name="helptabs" id="helptabsbar" /> <script type="text/javascript"> if (window.rcmail) rcmail.add_onload(help_init_settings_tabs);</script> </div> diff --git a/plugins/help/skins/larry/help.css b/plugins/help/skins/larry/help.css index c2e369af6..d9af6e15e 100644 --- a/plugins/help/skins/larry/help.css +++ b/plugins/help/skins/larry/help.css @@ -39,7 +39,6 @@ background: url(help.png) center -130px no-repeat; } -.iframebox.help_about, .iframebox.help_license { overflow: auto; } diff --git a/plugins/help/skins/larry/templates/help.html b/plugins/help/skins/larry/templates/help.html index 39caaa62f..bfd3f1141 100644 --- a/plugins/help/skins/larry/templates/help.html +++ b/plugins/help/skins/larry/templates/help.html @@ -4,16 +4,16 @@ <title><roundcube:object name="pagetitle" /></title> <roundcube:include file="/includes/links.html" /> </head> -<body> +<roundcube:if condition="env:extwin" /><body class="extwin"><roundcube:else /><body><roundcube:endif /> <roundcube:include file="/includes/header.html" /> <div id="mainscreen"> <div id="helptoolbar" class="toolbar"> -<roundcube:button name="helpdefault" href="?_task=help" type="link" label="help.help" title="help.help" class="button help" /> -<roundcube:button name="helpabout" href="?_task=help&_action=about" type="link" label="help.about" title="help.about" class="button about" /> -<roundcube:button name="helplicense" href="?_task=help&_action=license" type="link" label="help.license" title="help.license" class="button license" /> +<roundcube:object name="tablink" action="index" type="link" label="help.help" title="help.help" class="button help" /> +<roundcube:object name="tablink" action="about" type="link" label="help.about" title="help.about" class="button about" /> +<roundcube:object name="tablink" action="license" type="link" label="help.license" title="help.license" class="button license" /> <roundcube:container name="helptabs" id="helptabsbar" /> </div> diff --git a/plugins/hide_blockquote/localization/lb_LU.inc b/plugins/hide_blockquote/localization/lb_LU.inc new file mode 100644 index 000000000..98e0f6936 --- /dev/null +++ b/plugins/hide_blockquote/localization/lb_LU.inc @@ -0,0 +1,24 @@ +<?php + +/* + +-----------------------------------------------------------------------+ + | plugins/hide_blockquote/localization/<lang>.inc | + | | + | Localization file of the Roundcube Webmail Hide-Blockquote plugin | + | Copyright (C) 2012-2013, The Roundcube Dev Team | + | | + | Licensed under the GNU General Public License version 3 or | + | any later version with exceptions for skins & plugins. | + | See the README file for a full license statement. | + | | + +-----------------------------------------------------------------------+ + + For translation see https://www.transifex.com/projects/p/roundcube-webmail/resource/plugin-hide_blockquote/ +*/ + +$labels = array(); +$labels['hide'] = 'Verstoppen'; +$labels['show'] = 'Weisen'; +$labels['quotelimit'] = 'Zitat verstoppe wann d\'Zeilenunzuel méi grouss ass ewéi'; + +?> diff --git a/plugins/http_authentication/http_authentication.php b/plugins/http_authentication/http_authentication.php index 57227cb03..2631537a0 100644 --- a/plugins/http_authentication/http_authentication.php +++ b/plugins/http_authentication/http_authentication.php @@ -52,7 +52,7 @@ class http_authentication extends rcube_plugin $this->load_config(); $host = rcmail::get_instance()->config->get('http_authentication_host'); - if (is_string($host) && trim($host) !== '') + if (is_string($host) && trim($host) !== '' && empty($args['host'])) $args['host'] = rcube_utils::idn_to_ascii(rcube_utils::parse_host($host)); // Allow entering other user data in login form, diff --git a/plugins/jqueryui/jqueryui.php b/plugins/jqueryui/jqueryui.php index db640d1aa..e9b3c215e 100644 --- a/plugins/jqueryui/jqueryui.php +++ b/plugins/jqueryui/jqueryui.php @@ -8,6 +8,7 @@ * @version 1.9.1 * @author Cor Bosman <roundcube@wa.ter.net> * @author Thomas Bruederli <roundcube@gmail.com> + * @license GNU GPLv3+ */ class jqueryui extends rcube_plugin { diff --git a/plugins/managesieve/Changelog b/plugins/managesieve/Changelog index 32d87a0d8..daee91a70 100644 --- a/plugins/managesieve/Changelog +++ b/plugins/managesieve/Changelog @@ -1,4 +1,9 @@ - Add vacation-seconds extension support (RFC 6131) +- Several script parser code improvements +- Support string list arguments in filter form (#1489018) +- Support date, currendate and index tests - RFC5260 (#1488120) +- Split plugin file into two files +- Fix handling of &, <, > characters in scripts/filter names (#1489208) * version 6.2 [2013-02-17] ----------------------------------------------------------- @@ -205,18 +210,18 @@ - Added it_IT localization * version 1.1 [2009-05-27] ------------------------------------------------------------ +----------------------------------------------------------- - Added new icons - Added support for headers lists (coma-separated) in rules - Added de_CH localization * version 1.0 [2009-05-21] ------------------------------------------------------------ +----------------------------------------------------------- - Rewritten using plugin API - Added hu_HU localization (Tamas Tevesz) * version beta7 (svn-r2300) [2009-03-01] ------------------------------------------------------------ +----------------------------------------------------------- - Added SquirrelMail script auto-import (Jonathan Ernst) - Added 'vacation' support (Jonathan Ernst & alec) - Added 'stop' support (Jonathan Ernst) @@ -225,47 +230,47 @@ - Small style fixes * version 0.2-stable1 (svn-r2205) [2009-01-03] ------------------------------------------------------------ +----------------------------------------------------------- - Fix moving down filter row - Fixes for compressed js files in stable release package - Created patch for svn version r2205 * version 0.2-stable [2008-12-31] ------------------------------------------------------------ +----------------------------------------------------------- - Added ru_RU, fr_FR, zh_CN translation - Fixes for Roundcube 0.2-stable -* version rc0.2beta [2008-09-21] ------------------------------------------------------------ +* version 0.2-beta [2008-09-21] +----------------------------------------------------------- - Small css fixes for IE - Fixes for Roundcube 0.2-beta * version beta6 [2008-08-08] ------------------------------------------------------------ +----------------------------------------------------------- - Added de_DE translation - Fix for Roundcube r1634 * version beta5 [2008-06-10] ------------------------------------------------------------ +----------------------------------------------------------- - Fixed 'exists' operators - Fixed 'not*' operators for custom headers - Fixed filters deleting * version beta4 [2008-06-09] ------------------------------------------------------------ +----------------------------------------------------------- - Fix for Roundcube r1490 * version beta3 [2008-05-22] ------------------------------------------------------------ +----------------------------------------------------------- - Fixed textarea error class setting - Added pagetitle setting - Added option 'managesieve_replace_delimiter' - Fixed errors on IE (still need some css fixes) - + * version beta2 [2008-05-20] ------------------------------------------------------------ +----------------------------------------------------------- - Use 'if' only for first filter and 'elsif' for the rest * version beta1 [2008-05-15] ------------------------------------------------------------ +----------------------------------------------------------- - Initial version for Roundcube r1388. diff --git a/plugins/managesieve/lib/Roundcube/rcube_sieve.php b/plugins/managesieve/lib/Roundcube/rcube_sieve.php index a04e3c2a4..3bd2978da 100644 --- a/plugins/managesieve/lib/Roundcube/rcube_sieve.php +++ b/plugins/managesieve/lib/Roundcube/rcube_sieve.php @@ -6,18 +6,18 @@ * Copyright (C) 2008-2011, The Roundcube Dev Team * Copyright (C) 2011, Kolab Systems AG * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 - * as published by the Free Software Foundation. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see http://www.gnu.org/licenses/. */ // Managesieve Protocol: RFC5804 diff --git a/plugins/managesieve/lib/Roundcube/rcube_sieve_engine.php b/plugins/managesieve/lib/Roundcube/rcube_sieve_engine.php new file mode 100644 index 000000000..e92ba04d6 --- /dev/null +++ b/plugins/managesieve/lib/Roundcube/rcube_sieve_engine.php @@ -0,0 +1,2122 @@ +<?php + +/** + * Managesieve (Sieve Filters) Engine + * + * Engine part of Managesieve plugin implementing UI and backend access. + * + * Copyright (C) 2008-2013, The Roundcube Dev Team + * Copyright (C) 2011-2013, Kolab Systems AG + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see http://www.gnu.org/licenses/. + */ + +class rcube_sieve_engine +{ + private $rc; + private $sieve; + private $errors; + private $form; + private $tips = array(); + private $script = array(); + private $exts = array(); + private $list; + private $active = array(); + private $headers = array( + 'subject' => 'Subject', + 'from' => 'From', + 'to' => 'To', + ); + private $addr_headers = array( + // Required + "from", "to", "cc", "bcc", "sender", "resent-from", "resent-to", + // Additional (RFC 822 / RFC 2822) + "reply-to", "resent-reply-to", "resent-sender", "resent-cc", "resent-bcc", + // Non-standard (RFC 2076, draft-palme-mailext-headers-08.txt) + "for-approval", "for-handling", "for-comment", "apparently-to", "errors-to", + "delivered-to", "return-receipt-to", "x-admin", "read-receipt-to", + "x-confirm-reading-to", "return-receipt-requested", + "registered-mail-reply-requested-by", "mail-followup-to", "mail-reply-to", + "abuse-reports-to", "x-complaints-to", "x-report-abuse-to", + // Undocumented + "x-beenthere", + ); + + const VERSION = '7.0'; + const PROGNAME = 'Roundcube (Managesieve)'; + const PORT = 4190; + + + /** + * Class constructor + */ + function __construct($plugin) + { + $this->rc = rcmail::get_instance(); + $this->plugin = $plugin; + } + + /** + * Loads configuration, initializes plugin (including sieve connection) + */ + function start() + { + // register UI objects + $this->rc->output->add_handlers(array( + 'filterslist' => array($this, 'filters_list'), + 'filtersetslist' => array($this, 'filtersets_list'), + 'filterframe' => array($this, 'filter_frame'), + 'filterform' => array($this, 'filter_form'), + 'filtersetform' => array($this, 'filterset_form'), + )); + + // Get connection parameters + $host = $this->rc->config->get('managesieve_host', 'localhost'); + $port = $this->rc->config->get('managesieve_port'); + $tls = $this->rc->config->get('managesieve_usetls', false); + + $host = rcube_utils::parse_host($host); + $host = rcube_utils::idn_to_ascii($host); + + // remove tls:// prefix, set TLS flag + if (($host = preg_replace('|^tls://|i', '', $host, 1, $cnt)) && $cnt) { + $tls = true; + } + + if (empty($port)) { + $port = getservbyname('sieve', 'tcp'); + if (empty($port)) { + $port = self::PORT; + } + } + + $plugin = $this->rc->plugins->exec_hook('managesieve_connect', array( + 'user' => $_SESSION['username'], + 'password' => $this->rc->decrypt($_SESSION['password']), + 'host' => $host, + 'port' => $port, + 'usetls' => $tls, + 'auth_type' => $this->rc->config->get('managesieve_auth_type'), + 'disabled' => $this->rc->config->get('managesieve_disabled_extensions'), + 'debug' => $this->rc->config->get('managesieve_debug', false), + 'auth_cid' => $this->rc->config->get('managesieve_auth_cid'), + 'auth_pw' => $this->rc->config->get('managesieve_auth_pw'), + )); + + // try to connect to managesieve server and to fetch the script + $this->sieve = new rcube_sieve( + $plugin['user'], + $plugin['password'], + $plugin['host'], + $plugin['port'], + $plugin['auth_type'], + $plugin['usetls'], + $plugin['disabled'], + $plugin['debug'], + $plugin['auth_cid'], + $plugin['auth_pw'] + ); + + if (!($error = $this->sieve->error())) { + // Get list of scripts + $list = $this->list_scripts(); + + if (!empty($_GET['_set']) || !empty($_POST['_set'])) { + $script_name = rcube_utils::get_input_value('_set', rcube_utils::INPUT_GPC, true); + } + else if (!empty($_SESSION['managesieve_current'])) { + $script_name = $_SESSION['managesieve_current']; + } + else { + // get (first) active script + if (!empty($this->active[0])) { + $script_name = $this->active[0]; + } + else if ($list) { + $script_name = $list[0]; + } + // create a new (initial) script + else { + // if script not exists build default script contents + $script_file = $this->rc->config->get('managesieve_default'); + $script_name = $this->rc->config->get('managesieve_script_name'); + + if (empty($script_name)) + $script_name = 'roundcube'; + + if ($script_file && is_readable($script_file)) + $content = file_get_contents($script_file); + + // add script and set it active + if ($this->sieve->save_script($script_name, $content)) { + $this->activate_script($script_name); + $this->list[] = $script_name; + } + } + } + + if ($script_name) { + $this->sieve->load($script_name); + } + + $error = $this->sieve->error(); + } + + // finally set script objects + if ($error) { + switch ($error) { + case SIEVE_ERROR_CONNECTION: + case SIEVE_ERROR_LOGIN: + $this->rc->output->show_message('managesieve.filterconnerror', 'error'); + break; + default: + $this->rc->output->show_message('managesieve.filterunknownerror', 'error'); + break; + } + + rcube::raise_error(array('code' => 403, 'type' => 'php', + 'file' => __FILE__, 'line' => __LINE__, + 'message' => "Unable to connect to managesieve on $host:$port"), true, false); + + // to disable 'Add filter' button set env variable + $this->rc->output->set_env('filterconnerror', true); + $this->script = array(); + } + else { + $this->exts = $this->sieve->get_extensions(); + $this->script = $this->sieve->script->as_array(); + $this->rc->output->set_env('currentset', $this->sieve->current); + $_SESSION['managesieve_current'] = $this->sieve->current; + } + + return $error; + } + + function actions() + { + $error = $this->start(); + + // Handle user requests + if ($action = rcube_utils::get_input_value('_act', rcube_utils::INPUT_GPC)) { + $fid = (int) rcube_utils::get_input_value('_fid', rcube_utils::INPUT_POST); + + if ($action == 'delete' && !$error) { + if (isset($this->script[$fid])) { + if ($this->sieve->script->delete_rule($fid)) + $result = $this->save_script(); + + if ($result === true) { + $this->rc->output->show_message('managesieve.filterdeleted', 'confirmation'); + $this->rc->output->command('managesieve_updatelist', 'del', array('id' => $fid)); + } else { + $this->rc->output->show_message('managesieve.filterdeleteerror', 'error'); + } + } + } + else if ($action == 'move' && !$error) { + if (isset($this->script[$fid])) { + $to = (int) rcube_utils::get_input_value('_to', rcube_utils::INPUT_POST); + $rule = $this->script[$fid]; + + // remove rule + unset($this->script[$fid]); + $this->script = array_values($this->script); + + // add at target position + if ($to >= count($this->script)) { + $this->script[] = $rule; + } + else { + $script = array(); + foreach ($this->script as $idx => $r) { + if ($idx == $to) + $script[] = $rule; + $script[] = $r; + } + $this->script = $script; + } + + $this->sieve->script->content = $this->script; + $result = $this->save_script(); + + if ($result === true) { + $result = $this->list_rules(); + + $this->rc->output->show_message('managesieve.moved', 'confirmation'); + $this->rc->output->command('managesieve_updatelist', 'list', + array('list' => $result, 'clear' => true, 'set' => $to)); + } else { + $this->rc->output->show_message('managesieve.moveerror', 'error'); + } + } + } + else if ($action == 'act' && !$error) { + if (isset($this->script[$fid])) { + $rule = $this->script[$fid]; + $disabled = $rule['disabled'] ? true : false; + $rule['disabled'] = !$disabled; + $result = $this->sieve->script->update_rule($fid, $rule); + + if ($result !== false) + $result = $this->save_script(); + + if ($result === true) { + if ($rule['disabled']) + $this->rc->output->show_message('managesieve.deactivated', 'confirmation'); + else + $this->rc->output->show_message('managesieve.activated', 'confirmation'); + $this->rc->output->command('managesieve_updatelist', 'update', + array('id' => $fid, 'disabled' => $rule['disabled'])); + } else { + if ($rule['disabled']) + $this->rc->output->show_message('managesieve.deactivateerror', 'error'); + else + $this->rc->output->show_message('managesieve.activateerror', 'error'); + } + } + } + else if ($action == 'setact' && !$error) { + $script_name = rcube_utils::get_input_value('_set', rcube_utils::INPUT_GPC, true); + $result = $this->activate_script($script_name); + $kep14 = $this->rc->config->get('managesieve_kolab_master'); + + if ($result === true) { + $this->rc->output->set_env('active_sets', $this->active); + $this->rc->output->show_message('managesieve.setactivated', 'confirmation'); + $this->rc->output->command('managesieve_updatelist', 'setact', + array('name' => $script_name, 'active' => true, 'all' => !$kep14)); + } else { + $this->rc->output->show_message('managesieve.setactivateerror', 'error'); + } + } + else if ($action == 'deact' && !$error) { + $script_name = rcube_utils::get_input_value('_set', rcube_utils::INPUT_GPC, true); + $result = $this->deactivate_script($script_name); + + if ($result === true) { + $this->rc->output->set_env('active_sets', $this->active); + $this->rc->output->show_message('managesieve.setdeactivated', 'confirmation'); + $this->rc->output->command('managesieve_updatelist', 'setact', + array('name' => $script_name, 'active' => false)); + } else { + $this->rc->output->show_message('managesieve.setdeactivateerror', 'error'); + } + } + else if ($action == 'setdel' && !$error) { + $script_name = rcube_utils::get_input_value('_set', rcube_utils::INPUT_GPC, true); + $result = $this->remove_script($script_name); + + if ($result === true) { + $this->rc->output->show_message('managesieve.setdeleted', 'confirmation'); + $this->rc->output->command('managesieve_updatelist', 'setdel', + array('name' => $script_name)); + $this->rc->session->remove('managesieve_current'); + } else { + $this->rc->output->show_message('managesieve.setdeleteerror', 'error'); + } + } + else if ($action == 'setget') { + $script_name = rcube_utils::get_input_value('_set', rcube_utils::INPUT_GPC, true); + $script = $this->sieve->get_script($script_name); + + if (PEAR::isError($script)) + exit; + + $browser = new rcube_browser; + + // send download headers + header("Content-Type: application/octet-stream"); + header("Content-Length: ".strlen($script)); + + if ($browser->ie) + header("Content-Type: application/force-download"); + if ($browser->ie && $browser->ver < 7) + $filename = rawurlencode(abbreviate_string($script_name, 55)); + else if ($browser->ie) + $filename = rawurlencode($script_name); + else + $filename = addcslashes($script_name, '\\"'); + + header("Content-Disposition: attachment; filename=\"$filename.txt\""); + echo $script; + exit; + } + else if ($action == 'list') { + $result = $this->list_rules(); + + $this->rc->output->command('managesieve_updatelist', 'list', array('list' => $result)); + } + else if ($action == 'ruleadd') { + $rid = rcube_utils::get_input_value('_rid', rcube_utils::INPUT_GPC); + $id = $this->genid(); + $content = $this->rule_div($fid, $id, false); + + $this->rc->output->command('managesieve_rulefill', $content, $id, $rid); + } + else if ($action == 'actionadd') { + $aid = rcube_utils::get_input_value('_aid', rcube_utils::INPUT_GPC); + $id = $this->genid(); + $content = $this->action_div($fid, $id, false); + + $this->rc->output->command('managesieve_actionfill', $content, $id, $aid); + } + + $this->rc->output->send(); + } + else if ($this->rc->task == 'mail') { + // Initialize the form + $rules = rcube_utils::get_input_value('r', rcube_utils::INPUT_GET); + if (!empty($rules)) { + $i = 0; + foreach ($rules as $rule) { + list($header, $value) = explode(':', $rule, 2); + $tests[$i] = array( + 'type' => 'contains', + 'test' => 'header', + 'arg1' => $header, + 'arg2' => $value, + ); + $i++; + } + + $this->form = array( + 'join' => count($tests) > 1 ? 'allof' : 'anyof', + 'name' => '', + 'tests' => $tests, + 'actions' => array( + 0 => array('type' => 'fileinto'), + 1 => array('type' => 'stop'), + ), + ); + } + } + + $this->send(); + } + + function save() + { + // Init plugin and handle managesieve connection + $error = $this->start(); + + // get request size limits (#1488648) + $max_post = max(array( + ini_get('max_input_vars'), + ini_get('suhosin.request.max_vars'), + ini_get('suhosin.post.max_vars'), + )); + $max_depth = max(array( + ini_get('suhosin.request.max_array_depth'), + ini_get('suhosin.post.max_array_depth'), + )); + + // check request size limit + if ($max_post && count($_POST, COUNT_RECURSIVE) >= $max_post) { + rcube::raise_error(array( + 'code' => 500, 'type' => 'php', + 'file' => __FILE__, 'line' => __LINE__, + 'message' => "Request size limit exceeded (one of max_input_vars/suhosin.request.max_vars/suhosin.post.max_vars)" + ), true, false); + $this->rc->output->show_message('managesieve.filtersaveerror', 'error'); + } + // check request depth limits + else if ($max_depth && count($_POST['_header']) > $max_depth) { + rcube::raise_error(array( + 'code' => 500, 'type' => 'php', + 'file' => __FILE__, 'line' => __LINE__, + 'message' => "Request size limit exceeded (one of suhosin.request.max_array_depth/suhosin.post.max_array_depth)" + ), true, false); + $this->rc->output->show_message('managesieve.filtersaveerror', 'error'); + } + // filters set add action + else if (!empty($_POST['_newset'])) { + $name = rcube_utils::get_input_value('_name', rcube_utils::INPUT_POST, true); + $copy = rcube_utils::get_input_value('_copy', rcube_utils::INPUT_POST, true); + $from = rcube_utils::get_input_value('_from', rcube_utils::INPUT_POST); + $exceptions = $this->rc->config->get('managesieve_filename_exceptions'); + $kolab = $this->rc->config->get('managesieve_kolab_master'); + $name_uc = mb_strtolower($name); + $list = $this->list_scripts(); + + if (!$name) { + $this->errors['name'] = $this->plugin->gettext('cannotbeempty'); + } + else if (mb_strlen($name) > 128) { + $this->errors['name'] = $this->plugin->gettext('nametoolong'); + } + else if (!empty($exceptions) && in_array($name, (array)$exceptions)) { + $this->errors['name'] = $this->plugin->gettext('namereserved'); + } + else if (!empty($kolab) && in_array($name_uc, array('MASTER', 'USER', 'MANAGEMENT'))) { + $this->errors['name'] = $this->plugin->gettext('namereserved'); + } + else if (in_array($name, $list)) { + $this->errors['name'] = $this->plugin->gettext('setexist'); + } + else if ($from == 'file') { + // from file + if (is_uploaded_file($_FILES['_file']['tmp_name'])) { + $file = file_get_contents($_FILES['_file']['tmp_name']); + $file = preg_replace('/\r/', '', $file); + // for security don't save script directly + // check syntax before, like this... + $this->sieve->load_script($file); + if (!$this->save_script($name)) { + $this->errors['file'] = $this->plugin->gettext('setcreateerror'); + } + } + else { // upload failed + $err = $_FILES['_file']['error']; + + if ($err == UPLOAD_ERR_INI_SIZE || $err == UPLOAD_ERR_FORM_SIZE) { + $msg = $this->rc->gettext(array('name' => 'filesizeerror', + 'vars' => array('size' => + $this->rc->show_bytes(parse_bytes(ini_get('upload_max_filesize')))))); + } + else { + $this->errors['file'] = $this->plugin->gettext('fileuploaderror'); + } + } + } + else if (!$this->sieve->copy($name, $from == 'set' ? $copy : '')) { + $error = 'managesieve.setcreateerror'; + } + + if (!$error && empty($this->errors)) { + // Find position of the new script on the list + $list[] = $name; + asort($list, SORT_LOCALE_STRING); + $list = array_values($list); + $index = array_search($name, $list); + + $this->rc->output->show_message('managesieve.setcreated', 'confirmation'); + $this->rc->output->command('parent.managesieve_updatelist', 'setadd', + array('name' => $name, 'index' => $index)); + } else if ($msg) { + $this->rc->output->command('display_message', $msg, 'error'); + } else if ($error) { + $this->rc->output->show_message($error, 'error'); + } + } + // filter add/edit action + else if (isset($_POST['_name'])) { + $name = trim(rcube_utils::get_input_value('_name', rcube_utils::INPUT_POST, true)); + $fid = trim(rcube_utils::get_input_value('_fid', rcube_utils::INPUT_POST)); + $join = trim(rcube_utils::get_input_value('_join', rcube_utils::INPUT_POST)); + + // and arrays + $headers = rcube_utils::get_input_value('_header', rcube_utils::INPUT_POST); + $cust_headers = rcube_utils::get_input_value('_custom_header', rcube_utils::INPUT_POST); + $ops = rcube_utils::get_input_value('_rule_op', rcube_utils::INPUT_POST); + $sizeops = rcube_utils::get_input_value('_rule_size_op', rcube_utils::INPUT_POST); + $sizeitems = rcube_utils::get_input_value('_rule_size_item', rcube_utils::INPUT_POST); + $sizetargets = rcube_utils::get_input_value('_rule_size_target', rcube_utils::INPUT_POST); + $targets = rcube_utils::get_input_value('_rule_target', rcube_utils::INPUT_POST, true); + $mods = rcube_utils::get_input_value('_rule_mod', rcube_utils::INPUT_POST); + $mod_types = rcube_utils::get_input_value('_rule_mod_type', rcube_utils::INPUT_POST); + $body_trans = rcube_utils::get_input_value('_rule_trans', rcube_utils::INPUT_POST); + $body_types = rcube_utils::get_input_value('_rule_trans_type', rcube_utils::INPUT_POST, true); + $comparators = rcube_utils::get_input_value('_rule_comp', rcube_utils::INPUT_POST); + $indexes = rcube_utils::get_input_value('_rule_index', rcube_utils::INPUT_POST); + $lastindexes = rcube_utils::get_input_value('_rule_index_last', rcube_utils::INPUT_POST); + $dateheaders = rcube_utils::get_input_value('_rule_date_header', rcube_utils::INPUT_POST); + $dateparts = rcube_utils::get_input_value('_rule_date_part', rcube_utils::INPUT_POST); + $act_types = rcube_utils::get_input_value('_action_type', rcube_utils::INPUT_POST, true); + $mailboxes = rcube_utils::get_input_value('_action_mailbox', rcube_utils::INPUT_POST, true); + $act_targets = rcube_utils::get_input_value('_action_target', rcube_utils::INPUT_POST, true); + $area_targets = rcube_utils::get_input_value('_action_target_area', rcube_utils::INPUT_POST, true); + $reasons = rcube_utils::get_input_value('_action_reason', rcube_utils::INPUT_POST, true); + $addresses = rcube_utils::get_input_value('_action_addresses', rcube_utils::INPUT_POST, true); + $intervals = rcube_utils::get_input_value('_action_interval', rcube_utils::INPUT_POST); + $interval_types = rcube_utils::get_input_value('_action_interval_type', rcube_utils::INPUT_POST); + $subject = rcube_utils::get_input_value('_action_subject', rcube_utils::INPUT_POST, true); + $flags = rcube_utils::get_input_value('_action_flags', rcube_utils::INPUT_POST); + $varnames = rcube_utils::get_input_value('_action_varname', rcube_utils::INPUT_POST); + $varvalues = rcube_utils::get_input_value('_action_varvalue', rcube_utils::INPUT_POST); + $varmods = rcube_utils::get_input_value('_action_varmods', rcube_utils::INPUT_POST); + $notifyaddrs = rcube_utils::get_input_value('_action_notifyaddress', rcube_utils::INPUT_POST); + $notifybodies = rcube_utils::get_input_value('_action_notifybody', rcube_utils::INPUT_POST); + $notifymessages = rcube_utils::get_input_value('_action_notifymessage', rcube_utils::INPUT_POST); + $notifyfrom = rcube_utils::get_input_value('_action_notifyfrom', rcube_utils::INPUT_POST); + $notifyimp = rcube_utils::get_input_value('_action_notifyimportance', rcube_utils::INPUT_POST); + + // we need a "hack" for radiobuttons + foreach ($sizeitems as $item) + $items[] = $item; + + $this->form['disabled'] = $_POST['_disabled'] ? true : false; + $this->form['join'] = $join=='allof' ? true : false; + $this->form['name'] = $name; + $this->form['tests'] = array(); + $this->form['actions'] = array(); + + if ($name == '') + $this->errors['name'] = $this->plugin->gettext('cannotbeempty'); + else { + foreach($this->script as $idx => $rule) + if($rule['name'] == $name && $idx != $fid) { + $this->errors['name'] = $this->plugin->gettext('ruleexist'); + break; + } + } + + $i = 0; + // rules + if ($join == 'any') { + $this->form['tests'][0]['test'] = 'true'; + } + else { + foreach ($headers as $idx => $header) { + // targets are indexed differently (assume form order) + $target = $this->strip_value(array_shift($targets), true); + $header = $this->strip_value($header); + $operator = $this->strip_value($ops[$idx]); + $comparator = $this->strip_value($comparators[$idx]); + + if ($header == 'size') { + $sizeop = $this->strip_value($sizeops[$idx]); + $sizeitem = $this->strip_value($items[$idx]); + $sizetarget = $this->strip_value($sizetargets[$idx]); + + $this->form['tests'][$i]['test'] = 'size'; + $this->form['tests'][$i]['type'] = $sizeop; + $this->form['tests'][$i]['arg'] = $sizetarget; + + if ($sizetarget == '') + $this->errors['tests'][$i]['sizetarget'] = $this->plugin->gettext('cannotbeempty'); + else if (!preg_match('/^[0-9]+(K|M|G)?$/i', $sizetarget.$sizeitem, $m)) { + $this->errors['tests'][$i]['sizetarget'] = $this->plugin->gettext('forbiddenchars'); + $this->form['tests'][$i]['item'] = $sizeitem; + } + else + $this->form['tests'][$i]['arg'] .= $m[1]; + } + else if ($header == 'currentdate') { + $datepart = $this->strip_value($dateparts[$idx]); + + if (preg_match('/^not/', $operator)) + $this->form['tests'][$i]['not'] = true; + $type = preg_replace('/^not/', '', $operator); + + if ($type == 'exists') { + $this->errors['tests'][$i]['op'] = true; + } + + $this->form['tests'][$i]['test'] = 'currentdate'; + $this->form['tests'][$i]['type'] = $type; + $this->form['tests'][$i]['part'] = $datepart; + $this->form['tests'][$i]['arg'] = $target; + + if ($type != 'exists') { + if (!count($target)) { + $this->errors['tests'][$i]['target'] = $this->plugin->gettext('cannotbeempty'); + } + else if ($type != 'regex' && $type != 'matches') { + foreach ($target as $arg) { + if (!$this->validate_date_part($datepart, $arg)) { + $this->errors['tests'][$i]['target'] = $this->plugin->gettext('invaliddateformat'); + break; + } + } + } + } + } + else if ($header == 'date') { + $datepart = $this->strip_value($dateparts[$idx]); + $dateheader = $this->strip_value($dateheaders[$idx]); + $index = $this->strip_value($indexes[$idx]); + $indexlast = $this->strip_value($lastindexes[$idx]); + + if (preg_match('/^not/', $operator)) + $this->form['tests'][$i]['not'] = true; + $type = preg_replace('/^not/', '', $operator); + + if ($type == 'exists') { + $this->errors['tests'][$i]['op'] = true; + } + + if (!empty($index) && $mod != 'envelope') { + $this->form['tests'][$i]['index'] = intval($index); + $this->form['tests'][$i]['last'] = !empty($indexlast); + } + + if (empty($dateheader)) { + $dateheader = 'Date'; + } + else if (!preg_match('/^[\x21-\x39\x41-\x7E]+$/i', $dateheader)) { + $this->errors['tests'][$i]['dateheader'] = $this->plugin->gettext('forbiddenchars'); + } + + $this->form['tests'][$i]['test'] = 'date'; + $this->form['tests'][$i]['type'] = $type; + $this->form['tests'][$i]['part'] = $datepart; + $this->form['tests'][$i]['arg'] = $target; + $this->form['tests'][$i]['header'] = $dateheader; + + if ($type != 'exists') { + if (!count($target)) { + $this->errors['tests'][$i]['target'] = $this->plugin->gettext('cannotbeempty'); + } + else if ($type != 'regex' && $type != 'matches') { + foreach ($target as $arg) { + if (!$this->validate_date_part($datepart, $arg)) { + $this->errors['tests'][$i]['target'] = $this->plugin->gettext('invaliddateformat'); + break; + } + } + } + } + } + else if ($header == 'body') { + $trans = $this->strip_value($body_trans[$idx]); + $trans_type = $this->strip_value($body_types[$idx], true); + + if (preg_match('/^not/', $operator)) + $this->form['tests'][$i]['not'] = true; + $type = preg_replace('/^not/', '', $operator); + + if ($type == 'exists') { + $this->errors['tests'][$i]['op'] = true; + } + + $this->form['tests'][$i]['test'] = 'body'; + $this->form['tests'][$i]['type'] = $type; + $this->form['tests'][$i]['arg'] = $target; + + if (empty($target) && $type != 'exists') { + $this->errors['tests'][$i]['target'] = $this->plugin->gettext('cannotbeempty'); + } + else if (preg_match('/^(value|count)-/', $type)) { + foreach ($target as $target_value) { + if (!preg_match('/[0-9]+/', $target_value)) { + $this->errors['tests'][$i]['target'] = $this->plugin->gettext('forbiddenchars'); + } + } + } + + $this->form['tests'][$i]['part'] = $trans; + if ($trans == 'content') { + $this->form['tests'][$i]['content'] = $trans_type; + } + } + else { + $cust_header = $headers = $this->strip_value(array_shift($cust_headers)); + $mod = $this->strip_value($mods[$idx]); + $mod_type = $this->strip_value($mod_types[$idx]); + $index = $this->strip_value($indexes[$idx]); + $indexlast = $this->strip_value($lastindexes[$idx]); + + if (preg_match('/^not/', $operator)) + $this->form['tests'][$i]['not'] = true; + $type = preg_replace('/^not/', '', $operator); + + if (!empty($index) && $mod != 'envelope') { + $this->form['tests'][$i]['index'] = intval($index); + $this->form['tests'][$i]['last'] = !empty($indexlast); + } + + if ($header == '...') { + if (!count($headers)) + $this->errors['tests'][$i]['header'] = $this->plugin->gettext('cannotbeempty'); + else { + foreach ($headers as $hr) { + // RFC2822: printable ASCII except colon + if (!preg_match('/^[\x21-\x39\x41-\x7E]+$/i', $hr)) { + $this->errors['tests'][$i]['header'] = $this->plugin->gettext('forbiddenchars'); + } + } + } + + if (empty($this->errors['tests'][$i]['header'])) + $cust_header = (is_array($headers) && count($headers) == 1) ? $headers[0] : $headers; + } + + if ($type == 'exists') { + $this->form['tests'][$i]['test'] = 'exists'; + $this->form['tests'][$i]['arg'] = $header == '...' ? $cust_header : $header; + } + else { + $test = 'header'; + $header = $header == '...' ? $cust_header : $header; + + if ($mod == 'address' || $mod == 'envelope') { + $found = false; + if (empty($this->errors['tests'][$i]['header'])) { + foreach ((array)$header as $hdr) { + if (!in_array(strtolower(trim($hdr)), $this->addr_headers)) + $found = true; + } + } + if (!$found) + $test = $mod; + } + + $this->form['tests'][$i]['type'] = $type; + $this->form['tests'][$i]['test'] = $test; + $this->form['tests'][$i]['arg1'] = $header; + $this->form['tests'][$i]['arg2'] = $target; + + if (empty($target)) { + $this->errors['tests'][$i]['target'] = $this->plugin->gettext('cannotbeempty'); + } + else if (preg_match('/^(value|count)-/', $type)) { + foreach ($target as $target_value) { + if (!preg_match('/[0-9]+/', $target_value)) { + $this->errors['tests'][$i]['target'] = $this->plugin->gettext('forbiddenchars'); + } + } + } + + if ($mod) { + $this->form['tests'][$i]['part'] = $mod_type; + } + } + } + + if ($header != 'size' && $comparator) { + if (preg_match('/^(value|count)/', $this->form['tests'][$i]['type'])) + $comparator = 'i;ascii-numeric'; + + $this->form['tests'][$i]['comparator'] = $comparator; + } + + $i++; + } + } + + $i = 0; + // actions + foreach($act_types as $idx => $type) { + $type = $this->strip_value($type); + $target = $this->strip_value($act_targets[$idx]); + + switch ($type) { + + case 'fileinto': + case 'fileinto_copy': + $mailbox = $this->strip_value($mailboxes[$idx], false, false); + $this->form['actions'][$i]['target'] = $this->mod_mailbox($mailbox, 'in'); + if ($type == 'fileinto_copy') { + $type = 'fileinto'; + $this->form['actions'][$i]['copy'] = true; + } + break; + + case 'reject': + case 'ereject': + $target = $this->strip_value($area_targets[$idx]); + $this->form['actions'][$i]['target'] = str_replace("\r\n", "\n", $target); + + // if ($target == '') +// $this->errors['actions'][$i]['targetarea'] = $this->plugin->gettext('cannotbeempty'); + break; + + case 'redirect': + case 'redirect_copy': + $this->form['actions'][$i]['target'] = $target; + + if ($this->form['actions'][$i]['target'] == '') + $this->errors['actions'][$i]['target'] = $this->plugin->gettext('cannotbeempty'); + else if (!rcube_utils::check_email($this->form['actions'][$i]['target'])) + $this->errors['actions'][$i]['target'] = $this->plugin->gettext('noemailwarning'); + + if ($type == 'redirect_copy') { + $type = 'redirect'; + $this->form['actions'][$i]['copy'] = true; + } + break; + + case 'addflag': + case 'setflag': + case 'removeflag': + $_target = array(); + if (empty($flags[$idx])) { + $this->errors['actions'][$i]['target'] = $this->plugin->gettext('noflagset'); + } + else { + foreach ($flags[$idx] as $flag) { + $_target[] = $this->strip_value($flag); + } + } + $this->form['actions'][$i]['target'] = $_target; + break; + + case 'vacation': + $reason = $this->strip_value($reasons[$idx]); + $interval_type = $interval_types[$idx] == 'seconds' ? 'seconds' : 'days'; + $this->form['actions'][$i]['reason'] = str_replace("\r\n", "\n", $reason); + $this->form['actions'][$i]['subject'] = $subject[$idx]; + $this->form['actions'][$i]['addresses'] = array_shift($addresses); + $this->form['actions'][$i][$interval_type] = $intervals[$idx]; +// @TODO: vacation :mime, :from, :handle + + foreach ((array)$this->form['actions'][$i]['addresses'] as $aidx => $address) { + if (!rcube_utils::check_email($address)) { + $this->errors['actions'][$i]['addresses'] = $this->plugin->gettext('noemailwarning'); + break; + } + } + + if ($this->form['actions'][$i]['reason'] == '') + $this->errors['actions'][$i]['reason'] = $this->plugin->gettext('cannotbeempty'); + if ($this->form['actions'][$i][$interval_type] && !preg_match('/^[0-9]+$/', $this->form['actions'][$i][$interval_type])) + $this->errors['actions'][$i]['interval'] = $this->plugin->gettext('forbiddenchars'); + break; + + case 'set': + $this->form['actions'][$i]['name'] = $varnames[$idx]; + $this->form['actions'][$i]['value'] = $varvalues[$idx]; + foreach ((array)$varmods[$idx] as $v_m) { + $this->form['actions'][$i][$v_m] = true; + } + + if (empty($varnames[$idx])) { + $this->errors['actions'][$i]['name'] = $this->plugin->gettext('cannotbeempty'); + } + else if (!preg_match('/^[0-9a-z_]+$/i', $varnames[$idx])) { + $this->errors['actions'][$i]['name'] = $this->plugin->gettext('forbiddenchars'); + } + + if (!isset($varvalues[$idx]) || $varvalues[$idx] === '') { + $this->errors['actions'][$i]['value'] = $this->plugin->gettext('cannotbeempty'); + } + break; + + case 'notify': + if (empty($notifyaddrs[$idx])) { + $this->errors['actions'][$i]['address'] = $this->plugin->gettext('cannotbeempty'); + } + else if (!rcube_utils::check_email($notifyaddrs[$idx])) { + $this->errors['actions'][$i]['address'] = $this->plugin->gettext('noemailwarning'); + } + if (!empty($notifyfrom[$idx]) && !rcube_utils::check_email($notifyfrom[$idx])) { + $this->errors['actions'][$i]['from'] = $this->plugin->gettext('noemailwarning'); + } + $this->form['actions'][$i]['address'] = $notifyaddrs[$idx]; + $this->form['actions'][$i]['body'] = $notifybodies[$idx]; + $this->form['actions'][$i]['message'] = $notifymessages[$idx]; + $this->form['actions'][$i]['from'] = $notifyfrom[$idx]; + $this->form['actions'][$i]['importance'] = $notifyimp[$idx]; + break; + } + + $this->form['actions'][$i]['type'] = $type; + $i++; + } + + if (!$this->errors && !$error) { + // zapis skryptu + if (!isset($this->script[$fid])) { + $fid = $this->sieve->script->add_rule($this->form); + $new = true; + } else + $fid = $this->sieve->script->update_rule($fid, $this->form); + + if ($fid !== false) + $save = $this->save_script(); + + if ($save && $fid !== false) { + $this->rc->output->show_message('managesieve.filtersaved', 'confirmation'); + if ($this->rc->task != 'mail') { + $this->rc->output->command('parent.managesieve_updatelist', + isset($new) ? 'add' : 'update', + array( + 'name' => $this->form['name'], + 'id' => $fid, + 'disabled' => $this->form['disabled'] + )); + } + else { + $this->rc->output->command('managesieve_dialog_close'); + $this->rc->output->send('iframe'); + } + } + else { + $this->rc->output->show_message('managesieve.filtersaveerror', 'error'); +// $this->rc->output->send(); + } + } + } + + $this->send(); + } + + private function send() + { + // Handle form action + if (isset($_GET['_framed']) || isset($_POST['_framed'])) { + if (isset($_GET['_newset']) || isset($_POST['_newset'])) { + $this->rc->output->send('managesieve.setedit'); + } + else { + $this->rc->output->send('managesieve.filteredit'); + } + } else { + $this->rc->output->set_pagetitle($this->plugin->gettext('filters')); + $this->rc->output->send('managesieve.managesieve'); + } + } + + // return the filters list as HTML table + function filters_list($attrib) + { + // add id to message list table if not specified + if (!strlen($attrib['id'])) + $attrib['id'] = 'rcmfilterslist'; + + // define list of cols to be displayed + $a_show_cols = array('name'); + + $result = $this->list_rules(); + + // create XHTML table + $out = $this->rc->table_output($attrib, $result, $a_show_cols, 'id'); + + // set client env + $this->rc->output->add_gui_object('filterslist', $attrib['id']); + $this->rc->output->include_script('list.js'); + + // add some labels to client + $this->rc->output->add_label('managesieve.filterdeleteconfirm'); + + return $out; + } + + // return the filters list as <SELECT> + function filtersets_list($attrib, $no_env = false) + { + // add id to message list table if not specified + if (!strlen($attrib['id'])) + $attrib['id'] = 'rcmfiltersetslist'; + + $list = $this->list_scripts(); + + if ($list) { + asort($list, SORT_LOCALE_STRING); + } + + if (!empty($attrib['type']) && $attrib['type'] == 'list') { + // define list of cols to be displayed + $a_show_cols = array('name'); + + if ($list) { + foreach ($list as $idx => $set) { + $scripts['S'.$idx] = $set; + $result[] = array( + 'name' => $set, + 'id' => 'S'.$idx, + 'class' => !in_array($set, $this->active) ? 'disabled' : '', + ); + } + } + + // create XHTML table + $out = $this->rc->table_output($attrib, $result, $a_show_cols, 'id'); + + $this->rc->output->set_env('filtersets', $scripts); + $this->rc->output->include_script('list.js'); + } + else { + $select = new html_select(array('name' => '_set', 'id' => $attrib['id'], + 'onchange' => $this->rc->task != 'mail' ? 'rcmail.managesieve_set()' : '')); + + if ($list) { + foreach ($list as $set) + $select->add($set, $set); + } + + $out = $select->show($this->sieve->current); + } + + // set client env + if (!$no_env) { + $this->rc->output->add_gui_object('filtersetslist', $attrib['id']); + $this->rc->output->add_label('managesieve.setdeleteconfirm'); + } + + return $out; + } + + function filter_frame($attrib) + { + if (!$attrib['id']) + $attrib['id'] = 'rcmfilterframe'; + + $attrib['name'] = $attrib['id']; + + $this->rc->output->set_env('contentframe', $attrib['name']); + $this->rc->output->set_env('blankpage', $attrib['src'] ? + $this->rc->output->abs_url($attrib['src']) : 'program/resources/blank.gif'); + + return $this->rc->output->frame($attrib); + } + + function filterset_form($attrib) + { + if (!$attrib['id']) + $attrib['id'] = 'rcmfiltersetform'; + + $out = '<form name="filtersetform" action="./" method="post" enctype="multipart/form-data">'."\n"; + + $hiddenfields = new html_hiddenfield(array('name' => '_task', 'value' => $this->rc->task)); + $hiddenfields->add(array('name' => '_action', 'value' => 'plugin.managesieve-save')); + $hiddenfields->add(array('name' => '_framed', 'value' => ($_POST['_framed'] || $_GET['_framed'] ? 1 : 0))); + $hiddenfields->add(array('name' => '_newset', 'value' => 1)); + + $out .= $hiddenfields->show(); + + $name = rcube_utils::get_input_value('_name', rcube_utils::INPUT_POST); + $copy = rcube_utils::get_input_value('_copy', rcube_utils::INPUT_POST); + $selected = rcube_utils::get_input_value('_from', rcube_utils::INPUT_POST); + + // filter set name input + $input_name = new html_inputfield(array('name' => '_name', 'id' => '_name', 'size' => 30, + 'class' => ($this->errors['name'] ? 'error' : ''))); + + $out .= sprintf('<label for="%s"><b>%s:</b></label> %s<br /><br />', + '_name', rcube::Q($this->plugin->gettext('filtersetname')), $input_name->show($name)); + + $out .="\n<fieldset class=\"itemlist\"><legend>" . $this->plugin->gettext('filters') . ":</legend>\n"; + $out .= '<input type="radio" id="from_none" name="_from" value="none"' + .(!$selected || $selected=='none' ? ' checked="checked"' : '').'></input>'; + $out .= sprintf('<label for="%s">%s</label> ', 'from_none', rcube::Q($this->plugin->gettext('none'))); + + // filters set list + $list = $this->list_scripts(); + $select = new html_select(array('name' => '_copy', 'id' => '_copy')); + + if (is_array($list)) { + asort($list, SORT_LOCALE_STRING); + + if (!$copy) + $copy = $_SESSION['managesieve_current']; + + foreach ($list as $set) { + $select->add($set, $set); + } + + $out .= '<br /><input type="radio" id="from_set" name="_from" value="set"' + .($selected=='set' ? ' checked="checked"' : '').'></input>'; + $out .= sprintf('<label for="%s">%s:</label> ', 'from_set', rcube::Q($this->plugin->gettext('fromset'))); + $out .= $select->show($copy); + } + + // script upload box + $upload = new html_inputfield(array('name' => '_file', 'id' => '_file', 'size' => 30, + 'type' => 'file', 'class' => ($this->errors['file'] ? 'error' : ''))); + + $out .= '<br /><input type="radio" id="from_file" name="_from" value="file"' + .($selected=='file' ? ' checked="checked"' : '').'></input>'; + $out .= sprintf('<label for="%s">%s:</label> ', 'from_file', rcube::Q($this->plugin->gettext('fromfile'))); + $out .= $upload->show(); + $out .= '</fieldset>'; + + $this->rc->output->add_gui_object('sieveform', 'filtersetform'); + + if ($this->errors['name']) + $this->add_tip('_name', $this->errors['name'], true); + if ($this->errors['file']) + $this->add_tip('_file', $this->errors['file'], true); + + $this->print_tips(); + + return $out; + } + + + function filter_form($attrib) + { + if (!$attrib['id']) + $attrib['id'] = 'rcmfilterform'; + + $fid = rcube_utils::get_input_value('_fid', rcube_utils::INPUT_GPC); + $scr = isset($this->form) ? $this->form : $this->script[$fid]; + + $hiddenfields = new html_hiddenfield(array('name' => '_task', 'value' => $this->rc->task)); + $hiddenfields->add(array('name' => '_action', 'value' => 'plugin.managesieve-save')); + $hiddenfields->add(array('name' => '_framed', 'value' => ($_POST['_framed'] || $_GET['_framed'] ? 1 : 0))); + $hiddenfields->add(array('name' => '_fid', 'value' => $fid)); + + $out = '<form name="filterform" action="./" method="post">'."\n"; + $out .= $hiddenfields->show(); + + // 'any' flag + if (sizeof($scr['tests']) == 1 && $scr['tests'][0]['test'] == 'true' && !$scr['tests'][0]['not']) + $any = true; + + // filter name input + $field_id = '_name'; + $input_name = new html_inputfield(array('name' => '_name', 'id' => $field_id, 'size' => 30, + 'class' => ($this->errors['name'] ? 'error' : ''))); + + if ($this->errors['name']) + $this->add_tip($field_id, $this->errors['name'], true); + + if (isset($scr)) + $input_name = $input_name->show($scr['name']); + else + $input_name = $input_name->show(); + + $out .= sprintf("\n<label for=\"%s\"><b>%s:</b></label> %s\n", + $field_id, rcube::Q($this->plugin->gettext('filtername')), $input_name); + + // filter set selector + if ($this->rc->task == 'mail') { + $out .= sprintf("\n <label for=\"%s\"><b>%s:</b></label> %s\n", + $field_id, rcube::Q($this->plugin->gettext('filterset')), + $this->filtersets_list(array('id' => 'sievescriptname'), true)); + } + + $out .= '<br /><br /><fieldset><legend>' . rcube::Q($this->plugin->gettext('messagesrules')) . "</legend>\n"; + + // any, allof, anyof radio buttons + $field_id = '_allof'; + $input_join = new html_radiobutton(array('name' => '_join', 'id' => $field_id, 'value' => 'allof', + 'onclick' => 'rule_join_radio(\'allof\')', 'class' => 'radio')); + + if (isset($scr) && !$any) + $input_join = $input_join->show($scr['join'] ? 'allof' : ''); + else + $input_join = $input_join->show(); + + $out .= sprintf("%s<label for=\"%s\">%s</label> \n", + $input_join, $field_id, rcube::Q($this->plugin->gettext('filterallof'))); + + $field_id = '_anyof'; + $input_join = new html_radiobutton(array('name' => '_join', 'id' => $field_id, 'value' => 'anyof', + 'onclick' => 'rule_join_radio(\'anyof\')', 'class' => 'radio')); + + if (isset($scr) && !$any) + $input_join = $input_join->show($scr['join'] ? '' : 'anyof'); + else + $input_join = $input_join->show('anyof'); // default + + $out .= sprintf("%s<label for=\"%s\">%s</label>\n", + $input_join, $field_id, rcube::Q($this->plugin->gettext('filteranyof'))); + + $field_id = '_any'; + $input_join = new html_radiobutton(array('name' => '_join', 'id' => $field_id, 'value' => 'any', + 'onclick' => 'rule_join_radio(\'any\')', 'class' => 'radio')); + + $input_join = $input_join->show($any ? 'any' : ''); + + $out .= sprintf("%s<label for=\"%s\">%s</label>\n", + $input_join, $field_id, rcube::Q($this->plugin->gettext('filterany'))); + + $rows_num = isset($scr) ? sizeof($scr['tests']) : 1; + + $out .= '<div id="rules"'.($any ? ' style="display: none"' : '').'>'; + for ($x=0; $x<$rows_num; $x++) + $out .= $this->rule_div($fid, $x); + $out .= "</div>\n"; + + $out .= "</fieldset>\n"; + + // actions + $out .= '<fieldset><legend>' . rcube::Q($this->plugin->gettext('messagesactions')) . "</legend>\n"; + + $rows_num = isset($scr) ? sizeof($scr['actions']) : 1; + + $out .= '<div id="actions">'; + for ($x=0; $x<$rows_num; $x++) + $out .= $this->action_div($fid, $x); + $out .= "</div>\n"; + + $out .= "</fieldset>\n"; + + $this->print_tips(); + + if ($scr['disabled']) { + $this->rc->output->set_env('rule_disabled', true); + } + $this->rc->output->add_label( + 'managesieve.ruledeleteconfirm', + 'managesieve.actiondeleteconfirm' + ); + $this->rc->output->add_gui_object('sieveform', 'filterform'); + + return $out; + } + + function rule_div($fid, $id, $div=true) + { + $rule = isset($this->form) ? $this->form['tests'][$id] : $this->script[$fid]['tests'][$id]; + $rows_num = isset($this->form) ? sizeof($this->form['tests']) : sizeof($this->script[$fid]['tests']); + + // headers select + $select_header = new html_select(array('name' => "_header[]", 'id' => 'header'.$id, + 'onchange' => 'rule_header_select(' .$id .')')); + + foreach ($this->headers as $name => $val) + $select_header->add(rcube::Q($this->plugin->gettext($name)), Q($val)); + $select_header->add(rcube::Q($this->plugin->gettext('...')), '...'); + if (in_array('body', $this->exts)) + $select_header->add(rcube::Q($this->plugin->gettext('body')), 'body'); + $select_header->add(rcube::Q($this->plugin->gettext('size')), 'size'); + if (in_array('date', $this->exts)) { + $select_header->add(rcube::Q($this->plugin->gettext('datetest')), 'date'); + $select_header->add(rcube::Q($this->plugin->gettext('currdate')), 'currentdate'); + } + + if (isset($rule['test'])) { + if (in_array($rule['test'], array('header', 'address', 'envelope')) + && !is_array($rule['arg1']) && in_array($rule['arg1'], $this->headers) + ) { + $test = $rule['arg1']; + } + else if ($rule['test'] == 'exists' + && !is_array($rule['arg']) && in_array($rule['arg'], $this->headers) + ) { + $test = $rule['arg']; + } + else if (in_array($rule['test'], array('size', 'body', 'date', 'currentdate'))) { + $test = $rule['test']; + } + else if ($rule['test'] != 'true') { + $test = '...'; + } + } + + $aout = $select_header->show($test); + + // custom headers input + if (isset($rule['test']) && in_array($rule['test'], array('header', 'address', 'envelope'))) { + $custom = (array) $rule['arg1']; + if (count($custom) == 1 && isset($this->headers[strtolower($custom[0])])) { + unset($custom); + } + } + else if (isset($rule['test']) && $rule['test'] == 'exists') { + $custom = (array) $rule['arg']; + if (count($custom) == 1 && isset($this->headers[strtolower($custom[0])])) { + unset($custom); + } + } + + $tout = $this->list_input($id, 'custom_header', $custom, isset($custom), + $this->error_class($id, 'test', 'header', 'custom_header'), 15) . "\n"; + + // matching type select (operator) + $select_op = new html_select(array('name' => "_rule_op[]", 'id' => 'rule_op'.$id, + 'style' => 'display:' .($rule['test']!='size' ? 'inline' : 'none'), + 'class' => 'operator_selector', + 'onchange' => 'rule_op_select(this, '.$id.')')); + $select_op->add(rcube::Q($this->plugin->gettext('filtercontains')), 'contains'); + $select_op->add(rcube::Q($this->plugin->gettext('filternotcontains')), 'notcontains'); + $select_op->add(rcube::Q($this->plugin->gettext('filteris')), 'is'); + $select_op->add(rcube::Q($this->plugin->gettext('filterisnot')), 'notis'); + $select_op->add(rcube::Q($this->plugin->gettext('filterexists')), 'exists'); + $select_op->add(rcube::Q($this->plugin->gettext('filternotexists')), 'notexists'); + $select_op->add(rcube::Q($this->plugin->gettext('filtermatches')), 'matches'); + $select_op->add(rcube::Q($this->plugin->gettext('filternotmatches')), 'notmatches'); + if (in_array('regex', $this->exts)) { + $select_op->add(rcube::Q($this->plugin->gettext('filterregex')), 'regex'); + $select_op->add(rcube::Q($this->plugin->gettext('filternotregex')), 'notregex'); + } + if (in_array('relational', $this->exts)) { + $select_op->add(rcube::Q($this->plugin->gettext('countisgreaterthan')), 'count-gt'); + $select_op->add(rcube::Q($this->plugin->gettext('countisgreaterthanequal')), 'count-ge'); + $select_op->add(rcube::Q($this->plugin->gettext('countislessthan')), 'count-lt'); + $select_op->add(rcube::Q($this->plugin->gettext('countislessthanequal')), 'count-le'); + $select_op->add(rcube::Q($this->plugin->gettext('countequals')), 'count-eq'); + $select_op->add(rcube::Q($this->plugin->gettext('countnotequals')), 'count-ne'); + $select_op->add(rcube::Q($this->plugin->gettext('valueisgreaterthan')), 'value-gt'); + $select_op->add(rcube::Q($this->plugin->gettext('valueisgreaterthanequal')), 'value-ge'); + $select_op->add(rcube::Q($this->plugin->gettext('valueislessthan')), 'value-lt'); + $select_op->add(rcube::Q($this->plugin->gettext('valueislessthanequal')), 'value-le'); + $select_op->add(rcube::Q($this->plugin->gettext('valueequals')), 'value-eq'); + $select_op->add(rcube::Q($this->plugin->gettext('valuenotequals')), 'value-ne'); + } + + // (current)date part select + if (in_array('date', $this->exts) || in_array('currentdate', $this->exts)) { + $date_parts = array('date', 'iso8601', 'std11', 'julian', 'time', + 'year', 'month', 'day', 'hour', 'minute', 'second', 'weekday', 'zone'); + $select_dp = new html_select(array('name' => "_rule_date_part[]", 'id' => 'rule_date_part'.$id, + 'style' => $rule['test'] == 'currentdate' || $rule['test'] == 'date' ? '' : 'display:none', + 'class' => 'datepart_selector', + )); + + foreach ($date_parts as $part) { + $select_dp->add(rcube::Q($this->plugin->gettext($part)), $part); + } + + $tout .= $select_dp->show($rule['test'] == 'currentdate' || $rule['test'] == 'date' ? $rule['part'] : ''); + } + + // target(s) input + if (in_array($rule['test'], array('header', 'address', 'envelope'))) { + $test = ($rule['not'] ? 'not' : '').($rule['type'] ? $rule['type'] : 'is'); + $target = $rule['arg2']; + } + else if (in_array($rule['test'], array('body', 'date', 'currentdate'))) { + $test = ($rule['not'] ? 'not' : '').($rule['type'] ? $rule['type'] : 'is'); + $target = $rule['arg']; + } + else if ($rule['test'] == 'size') { + $test = ''; + $target = ''; + if (preg_match('/^([0-9]+)(K|M|G)?$/', $rule['arg'], $matches)) { + $sizetarget = $matches[1]; + $sizeitem = $matches[2]; + } + else { + $sizetarget = $rule['arg']; + $sizeitem = $rule['item']; + } + } + else { + $test = ($rule['not'] ? 'not' : '').$rule['test']; + $target = ''; + } + + $tout .= $select_op->show($test); + $tout .= $this->list_input($id, 'rule_target', $target, + $rule['test'] != 'size' && $rule['test'] != 'exists', + $this->error_class($id, 'test', 'target', 'rule_target')) . "\n"; + + $select_size_op = new html_select(array('name' => "_rule_size_op[]", 'id' => 'rule_size_op'.$id)); + $select_size_op->add(rcube::Q($this->plugin->gettext('filterover')), 'over'); + $select_size_op->add(rcube::Q($this->plugin->gettext('filterunder')), 'under'); + + $tout .= '<div id="rule_size' .$id. '" style="display:' . ($rule['test']=='size' ? 'inline' : 'none') .'">'; + $tout .= $select_size_op->show($rule['test']=='size' ? $rule['type'] : ''); + $tout .= '<input type="text" name="_rule_size_target[]" id="rule_size_i'.$id.'" value="'.$sizetarget.'" size="10" ' + . $this->error_class($id, 'test', 'sizetarget', 'rule_size_i') .' /> + <label><input type="radio" name="_rule_size_item['.$id.']" value=""' + . (!$sizeitem ? ' checked="checked"' : '') .' class="radio" />'.$this->rc->gettext('B').'</label> + <label><input type="radio" name="_rule_size_item['.$id.']" value="K"' + . ($sizeitem=='K' ? ' checked="checked"' : '') .' class="radio" />'.$this->rc->gettext('KB').'</label> + <label><input type="radio" name="_rule_size_item['.$id.']" value="M"' + . ($sizeitem=='M' ? ' checked="checked"' : '') .' class="radio" />'.$this->rc->gettext('MB').'</label> + <label><input type="radio" name="_rule_size_item['.$id.']" value="G"' + . ($sizeitem=='G' ? ' checked="checked"' : '') .' class="radio" />'.$this->rc->gettext('GB').'</label>'; + $tout .= '</div>'; + + // Advanced modifiers (address, envelope) + $select_mod = new html_select(array('name' => "_rule_mod[]", 'id' => 'rule_mod_op'.$id, + 'onchange' => 'rule_mod_select(' .$id .')')); + $select_mod->add(rcube::Q($this->plugin->gettext('none')), ''); + $select_mod->add(rcube::Q($this->plugin->gettext('address')), 'address'); + if (in_array('envelope', $this->exts)) + $select_mod->add(rcube::Q($this->plugin->gettext('envelope')), 'envelope'); + + $select_type = new html_select(array('name' => "_rule_mod_type[]", 'id' => 'rule_mod_type'.$id)); + $select_type->add(rcube::Q($this->plugin->gettext('allparts')), 'all'); + $select_type->add(rcube::Q($this->plugin->gettext('domain')), 'domain'); + $select_type->add(rcube::Q($this->plugin->gettext('localpart')), 'localpart'); + if (in_array('subaddress', $this->exts)) { + $select_type->add(rcube::Q($this->plugin->gettext('user')), 'user'); + $select_type->add(rcube::Q($this->plugin->gettext('detail')), 'detail'); + } + + $need_mod = $rule['test'] != 'size' && $rule['test'] != 'body'; + $mout = '<div id="rule_mod' .$id. '" class="adv"' . (!$need_mod ? ' style="display:none"' : '') . '>'; + $mout .= ' <span class="label">' . rcube::Q($this->plugin->gettext('modifier')) . ' </span>'; + $mout .= $select_mod->show($rule['test']); + $mout .= ' <span id="rule_mod_type' . $id . '"'; + $mout .= ' style="display:' . (in_array($rule['test'], array('address', 'envelope')) ? 'inline' : 'none') .'">'; + $mout .= rcube::Q($this->plugin->gettext('modtype')) . ' '; + $mout .= $select_type->show($rule['part']); + $mout .= '</span>'; + $mout .= '</div>'; + + // Advanced modifiers (body transformations) + $select_mod = new html_select(array('name' => "_rule_trans[]", 'id' => 'rule_trans_op'.$id, + 'onchange' => 'rule_trans_select(' .$id .')')); + $select_mod->add(rcube::Q($this->plugin->gettext('text')), 'text'); + $select_mod->add(rcube::Q($this->plugin->gettext('undecoded')), 'raw'); + $select_mod->add(rcube::Q($this->plugin->gettext('contenttype')), 'content'); + + $mout .= '<div id="rule_trans' .$id. '" class="adv"' . ($rule['test'] != 'body' ? ' style="display:none"' : '') . '>'; + $mout .= '<span class="label">' . rcube::Q($this->plugin->gettext('modifier')) . '</span>'; + $mout .= $select_mod->show($rule['part']); + $mout .= '<input type="text" name="_rule_trans_type[]" id="rule_trans_type'.$id + . '" value="'.(is_array($rule['content']) ? implode(',', $rule['content']) : $rule['content']) + .'" size="20"' . ($rule['part'] != 'content' ? ' style="display:none"' : '') + . $this->error_class($id, 'test', 'part', 'rule_trans_type') .' />'; + $mout .= '</div>'; + + // Advanced modifiers (body transformations) + $select_comp = new html_select(array('name' => "_rule_comp[]", 'id' => 'rule_comp_op'.$id)); + $select_comp->add(rcube::Q($this->plugin->gettext('default')), ''); + $select_comp->add(rcube::Q($this->plugin->gettext('octet')), 'i;octet'); + $select_comp->add(rcube::Q($this->plugin->gettext('asciicasemap')), 'i;ascii-casemap'); + if (in_array('comparator-i;ascii-numeric', $this->exts)) { + $select_comp->add(rcube::Q($this->plugin->gettext('asciinumeric')), 'i;ascii-numeric'); + } + + // Comparators + $mout .= '<div id="rule_comp' .$id. '" class="adv"' . ($rule['test'] == 'size' ? ' style="display:none"' : '') . '>'; + $mout .= '<span class="label">' . rcube::Q($this->plugin->gettext('comparator')) . '</span>'; + $mout .= $select_comp->show($rule['comparator']); + $mout .= '</div>'; + + // Date header + if (in_array('date', $this->exts)) { + $mout .= '<div id="rule_date_header_div' .$id. '" class="adv"'. ($rule['test'] != 'date' ? ' style="display:none"' : '') .'>'; + $mout .= '<span class="label">' . rcube::Q($this->plugin->gettext('dateheader')) . '</span>'; + $mout .= '<input type="text" name="_rule_date_header[]" id="rule_date_header'.$id + . '" value="'. Q($rule['test'] == 'date' ? $rule['header'] : '') + . '" size="15"' . $this->error_class($id, 'test', 'dateheader', 'rule_date_header') .' />'; + $mout .= '</div>'; + } + + // Index + if (in_array('index', $this->exts)) { + $need_index = in_array($rule['test'], array('header', ', address', 'date')); + $mout .= '<div id="rule_index_div' .$id. '" class="adv"'. (!$need_index ? ' style="display:none"' : '') .'>'; + $mout .= '<span class="label">' . rcube::Q($this->plugin->gettext('index')) . '</span>'; + $mout .= '<input type="text" name="_rule_index[]" id="rule_index'.$id + . '" value="'. ($rule['index'] ? intval($rule['index']) : '') + . '" size="3"' . $this->error_class($id, 'test', 'index', 'rule_index') .' />'; + $mout .= ' <input type="checkbox" name="_rule_index_last[]" id="rule_index_last'.$id + . '" value="1"' . (!empty($rule['last']) ? ' checked="checked"' : '') . ' />' + . '<label for="rule_index_last'.$id.'">'.rcube::Q($this->plugin->gettext('indexlast')).'</label>'; + $mout .= '</div>'; + } + + // Build output table + $out = $div ? '<div class="rulerow" id="rulerow' .$id .'">'."\n" : ''; + $out .= '<table><tr>'; + $out .= '<td class="advbutton">'; + $out .= '<a href="#" id="ruleadv' . $id .'" title="'. rcube::Q($this->plugin->gettext('advancedopts')). '" + onclick="rule_adv_switch(' . $id .', this)" class="show"> </a>'; + $out .= '</td>'; + $out .= '<td class="rowactions">' . $aout . '</td>'; + $out .= '<td class="rowtargets">' . $tout . "\n"; + $out .= '<div id="rule_advanced' .$id. '" style="display:none">' . $mout . '</div>'; + $out .= '</td>'; + + // add/del buttons + $out .= '<td class="rowbuttons">'; + $out .= '<a href="#" id="ruleadd' . $id .'" title="'. rcube::Q($this->plugin->gettext('add')). '" + onclick="rcmail.managesieve_ruleadd(' . $id .')" class="button add"></a>'; + $out .= '<a href="#" id="ruledel' . $id .'" title="'. rcube::Q($this->plugin->gettext('del')). '" + onclick="rcmail.managesieve_ruledel(' . $id .')" class="button del' . ($rows_num<2 ? ' disabled' : '') .'"></a>'; + $out .= '</td>'; + $out .= '</tr></table>'; + + $out .= $div ? "</div>\n" : ''; + + return $out; + } + + function action_div($fid, $id, $div=true) + { + $action = isset($this->form) ? $this->form['actions'][$id] : $this->script[$fid]['actions'][$id]; + $rows_num = isset($this->form) ? sizeof($this->form['actions']) : sizeof($this->script[$fid]['actions']); + + $out = $div ? '<div class="actionrow" id="actionrow' .$id .'">'."\n" : ''; + + $out .= '<table><tr><td class="rowactions">'; + + // action select + $select_action = new html_select(array('name' => "_action_type[$id]", 'id' => 'action_type'.$id, + 'onchange' => 'action_type_select(' .$id .')')); + if (in_array('fileinto', $this->exts)) + $select_action->add(rcube::Q($this->plugin->gettext('messagemoveto')), 'fileinto'); + if (in_array('fileinto', $this->exts) && in_array('copy', $this->exts)) + $select_action->add(rcube::Q($this->plugin->gettext('messagecopyto')), 'fileinto_copy'); + $select_action->add(rcube::Q($this->plugin->gettext('messageredirect')), 'redirect'); + if (in_array('copy', $this->exts)) + $select_action->add(rcube::Q($this->plugin->gettext('messagesendcopy')), 'redirect_copy'); + if (in_array('reject', $this->exts)) + $select_action->add(rcube::Q($this->plugin->gettext('messagediscard')), 'reject'); + else if (in_array('ereject', $this->exts)) + $select_action->add(rcube::Q($this->plugin->gettext('messagediscard')), 'ereject'); + if (in_array('vacation', $this->exts)) + $select_action->add(rcube::Q($this->plugin->gettext('messagereply')), 'vacation'); + $select_action->add(rcube::Q($this->plugin->gettext('messagedelete')), 'discard'); + if (in_array('imapflags', $this->exts) || in_array('imap4flags', $this->exts)) { + $select_action->add(rcube::Q($this->plugin->gettext('setflags')), 'setflag'); + $select_action->add(rcube::Q($this->plugin->gettext('addflags')), 'addflag'); + $select_action->add(rcube::Q($this->plugin->gettext('removeflags')), 'removeflag'); + } + if (in_array('variables', $this->exts)) { + $select_action->add(rcube::Q($this->plugin->gettext('setvariable')), 'set'); + } + if (in_array('enotify', $this->exts) || in_array('notify', $this->exts)) { + $select_action->add(rcube::Q($this->plugin->gettext('notify')), 'notify'); + } + $select_action->add(rcube::Q($this->plugin->gettext('rulestop')), 'stop'); + + $select_type = $action['type']; + if (in_array($action['type'], array('fileinto', 'redirect')) && $action['copy']) { + $select_type .= '_copy'; + } + + $out .= $select_action->show($select_type); + $out .= '</td>'; + + // actions target inputs + $out .= '<td class="rowtargets">'; + // shared targets + $out .= '<input type="text" name="_action_target['.$id.']" id="action_target' .$id. '" ' + .'value="' .($action['type']=='redirect' ? rcube::Q($action['target'], 'strict', false) : ''). '" size="35" ' + .'style="display:' .($action['type']=='redirect' ? 'inline' : 'none') .'" ' + . $this->error_class($id, 'action', 'target', 'action_target') .' />'; + $out .= '<textarea name="_action_target_area['.$id.']" id="action_target_area' .$id. '" ' + .'rows="3" cols="35" '. $this->error_class($id, 'action', 'targetarea', 'action_target_area') + .'style="display:' .(in_array($action['type'], array('reject', 'ereject')) ? 'inline' : 'none') .'">' + . (in_array($action['type'], array('reject', 'ereject')) ? rcube::Q($action['target'], 'strict', false) : '') + . "</textarea>\n"; + + // vacation + $vsec = in_array('vacation-seconds', $this->exts); + $out .= '<div id="action_vacation' .$id.'" style="display:' .($action['type']=='vacation' ? 'inline' : 'none') .'">'; + $out .= '<span class="label">'. rcube::Q($this->plugin->gettext('vacationreason')) .'</span><br />' + .'<textarea name="_action_reason['.$id.']" id="action_reason' .$id. '" ' + .'rows="3" cols="35" '. $this->error_class($id, 'action', 'reason', 'action_reason') . '>' + . Q($action['reason'], 'strict', false) . "</textarea>\n"; + $out .= '<br /><span class="label">' .rcube::Q($this->plugin->gettext('vacationsubject')) . '</span><br />' + .'<input type="text" name="_action_subject['.$id.']" id="action_subject'.$id.'" ' + .'value="' . (is_array($action['subject']) ? rcube::Q(implode(', ', $action['subject']), 'strict', false) : $action['subject']) . '" size="35" ' + . $this->error_class($id, 'action', 'subject', 'action_subject') .' />'; + $out .= '<br /><span class="label">' .rcube::Q($this->plugin->gettext('vacationaddr')) . '</span><br />' + . $this->list_input($id, 'action_addresses', $action['addresses'], true, + $this->error_class($id, 'action', 'addresses', 'action_addresses'), 30); + $out .= '<br /><span class="label">' . rcube::Q($this->plugin->gettext($vsec ? 'vacationinterval' : 'vacationdays')) . '</span><br />' + .'<input type="text" name="_action_interval['.$id.']" id="action_interval'.$id.'" ' + .'value="' .rcube::Q(isset($action['seconds']) ? $action['seconds'] : $action['days'], 'strict', false) . '" size="2" ' + . $this->error_class($id, 'action', 'interval', 'action_interval') .' />'; + if ($vsec) { + $out .= ' <label><input type="radio" name="_action_interval_type['.$id.']" value="days"' + . (!isset($action['seconds']) ? ' checked="checked"' : '') .' class="radio" />'.$this->plugin->gettext('days').'</label>' + . ' <label><input type="radio" name="_action_interval_type['.$id.']" value="seconds"' + . (isset($action['seconds']) ? ' checked="checked"' : '') .' class="radio" />'.$this->plugin->gettext('seconds').'</label>'; + } + $out .= '</div>'; + + // flags + $flags = array( + 'read' => '\\Seen', + 'answered' => '\\Answered', + 'flagged' => '\\Flagged', + 'deleted' => '\\Deleted', + 'draft' => '\\Draft', + ); + $flags_target = (array)$action['target']; + + $out .= '<div id="action_flags' .$id.'" style="display:' + . (preg_match('/^(set|add|remove)flag$/', $action['type']) ? 'inline' : 'none') . '"' + . $this->error_class($id, 'action', 'flags', 'action_flags') . '>'; + foreach ($flags as $fidx => $flag) { + $out .= '<input type="checkbox" name="_action_flags[' .$id .'][]" value="' . $flag . '"' + . (in_array_nocase($flag, $flags_target) ? 'checked="checked"' : '') . ' />' + . rcube::Q($this->plugin->gettext('flag'.$fidx)) .'<br>'; + } + $out .= '</div>'; + + // set variable + $set_modifiers = array( + 'lower', + 'upper', + 'lowerfirst', + 'upperfirst', + 'quotewildcard', + 'length' + ); + + $out .= '<div id="action_set' .$id.'" style="display:' .($action['type']=='set' ? 'inline' : 'none') .'">'; + $out .= '<span class="label">' .rcube::Q($this->plugin->gettext('setvarname')) . '</span><br />' + .'<input type="text" name="_action_varname['.$id.']" id="action_varname'.$id.'" ' + .'value="' . rcube::Q($action['name']) . '" size="35" ' + . $this->error_class($id, 'action', 'name', 'action_varname') .' />'; + $out .= '<br /><span class="label">' .rcube::Q($this->plugin->gettext('setvarvalue')) . '</span><br />' + .'<input type="text" name="_action_varvalue['.$id.']" id="action_varvalue'.$id.'" ' + .'value="' . rcube::Q($action['value']) . '" size="35" ' + . $this->error_class($id, 'action', 'value', 'action_varvalue') .' />'; + $out .= '<br /><span class="label">' .rcube::Q($this->plugin->gettext('setvarmodifiers')) . '</span><br />'; + foreach ($set_modifiers as $s_m) { + $s_m_id = 'action_varmods' . $id . $s_m; + $out .= sprintf('<input type="checkbox" name="_action_varmods[%s][]" value="%s" id="%s"%s />%s<br>', + $id, $s_m, $s_m_id, + (array_key_exists($s_m, (array)$action) && $action[$s_m] ? ' checked="checked"' : ''), + rcube::Q($this->plugin->gettext('var' . $s_m))); + } + $out .= '</div>'; + + // notify + // skip :options tag - not used by the mailto method + $out .= '<div id="action_notify' .$id.'" style="display:' .($action['type']=='notify' ? 'inline' : 'none') .'">'; + $out .= '<span class="label">' .rcube::Q($this->plugin->gettext('notifyaddress')) . '</span><br />' + .'<input type="text" name="_action_notifyaddress['.$id.']" id="action_notifyaddress'.$id.'" ' + .'value="' . rcube::Q($action['address']) . '" size="35" ' + . $this->error_class($id, 'action', 'address', 'action_notifyaddress') .' />'; + $out .= '<br /><span class="label">'. rcube::Q($this->plugin->gettext('notifybody')) .'</span><br />' + .'<textarea name="_action_notifybody['.$id.']" id="action_notifybody' .$id. '" ' + .'rows="3" cols="35" '. $this->error_class($id, 'action', 'method', 'action_notifybody') . '>' + . rcube::Q($action['body'], 'strict', false) . "</textarea>\n"; + $out .= '<br /><span class="label">' .rcube::Q($this->plugin->gettext('notifysubject')) . '</span><br />' + .'<input type="text" name="_action_notifymessage['.$id.']" id="action_notifymessage'.$id.'" ' + .'value="' . rcube::Q($action['message']) . '" size="35" ' + . $this->error_class($id, 'action', 'message', 'action_notifymessage') .' />'; + $out .= '<br /><span class="label">' .rcube::Q($this->plugin->gettext('notifyfrom')) . '</span><br />' + .'<input type="text" name="_action_notifyfrom['.$id.']" id="action_notifyfrom'.$id.'" ' + .'value="' . rcube::Q($action['from']) . '" size="35" ' + . $this->error_class($id, 'action', 'from', 'action_notifyfrom') .' />'; + $importance_options = array( + 3 => 'notifyimportancelow', + 2 => 'notifyimportancenormal', + 1 => 'notifyimportancehigh' + ); + $select_importance = new html_select(array( + 'name' => '_action_notifyimportance[' . $id . ']', + 'id' => '_action_notifyimportance' . $id, + 'class' => $this->error_class($id, 'action', 'importance', 'action_notifyimportance'))); + foreach ($importance_options as $io_v => $io_n) { + $select_importance->add(rcube::Q($this->plugin->gettext($io_n)), $io_v); + } + $out .= '<br /><span class="label">' . rcube::Q($this->plugin->gettext('notifyimportance')) . '</span><br />'; + $out .= $select_importance->show($action['importance'] ? $action['importance'] : 2); + $out .= '</div>'; + + // mailbox select + if ($action['type'] == 'fileinto') + $mailbox = $this->mod_mailbox($action['target'], 'out'); + else + $mailbox = ''; + + $select = $this->rc->folder_selector(array( + 'realnames' => false, + 'maxlength' => 100, + 'id' => 'action_mailbox' . $id, + 'name' => "_action_mailbox[$id]", + 'style' => 'display:'.(!isset($action) || $action['type']=='fileinto' ? 'inline' : 'none') + )); + $out .= $select->show($mailbox); + $out .= '</td>'; + + // add/del buttons + $out .= '<td class="rowbuttons">'; + $out .= '<a href="#" id="actionadd' . $id .'" title="'. rcube::Q($this->plugin->gettext('add')). '" + onclick="rcmail.managesieve_actionadd(' . $id .')" class="button add"></a>'; + $out .= '<a href="#" id="actiondel' . $id .'" title="'. rcube::Q($this->plugin->gettext('del')). '" + onclick="rcmail.managesieve_actiondel(' . $id .')" class="button del' . ($rows_num<2 ? ' disabled' : '') .'"></a>'; + $out .= '</td>'; + + $out .= '</tr></table>'; + + $out .= $div ? "</div>\n" : ''; + + return $out; + } + + private function genid() + { + return preg_replace('/[^0-9]/', '', microtime(true)); + } + + private function strip_value($str, $allow_html = false, $trim = true) + { + if (is_array($str)) { + foreach ($str as $idx => $val) { + $val = $this->strip_value($val, $allow_html, $trim); + + if ($val === '') { + unset($str[$idx]); + } + } + + return $str; + } + + if (!$allow_html) { + $str = strip_tags($str); + } + + return $trim ? trim($str) : $str; + } + + private function error_class($id, $type, $target, $elem_prefix='') + { + // TODO: tooltips + if (($type == 'test' && ($str = $this->errors['tests'][$id][$target])) || + ($type == 'action' && ($str = $this->errors['actions'][$id][$target])) + ) { + $this->add_tip($elem_prefix.$id, $str, true); + return ' class="error"'; + } + + return ''; + } + + private function add_tip($id, $str, $error=false) + { + if ($error) + $str = html::span('sieve error', $str); + + $this->tips[] = array($id, $str); + } + + private function print_tips() + { + if (empty($this->tips)) + return; + + $script = rcmail_output::JS_OBJECT_NAME.'.managesieve_tip_register('.json_encode($this->tips).');'; + $this->rc->output->add_script($script, 'foot'); + } + + private function list_input($id, $name, $value, $enabled, $class, $size=null) + { + $value = (array) $value; + $value = array_map(array('rcube', 'Q'), $value); + $value = implode("\n", $value); + + return '<textarea data-type="list" name="_' . $name . '['.$id.']" id="' . $name.$id . '"' + . ($enabled ? '' : ' disabled="disabled"') + . ($size ? ' data-size="'.$size.'"' : '') + . $class + . ' style="display:none">' . $value . '</textarea>'; + } + + /** + * Validate input for date part elements + */ + private function validate_date_part($type, $value) + { + // we do simple validation of date/part format + switch ($type) { + case 'date': // yyyy-mm-dd + return preg_match('/^[0-9]{4}-[0-9]{2}-[0-9]{2}$/', $value); + case 'iso8601': + return preg_match('/^[0-9: .,ZWT+-]+$/', $value); + case 'std11': + return preg_match('/^((Sun|Mon|Tue|Wed|Thu|Fri|Sat),\s+)?[0-9]{1,2}\s+' + . '(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s+[0-9]{2,4}\s+' + . '[0-9]{2}:[0-9]{2}(:[0-9]{2})?\s+([+-]*[0-9]{4}|[A-Z]{1,3})$', $value); + case 'julian': + return preg_match('/^[0-9]+$/', $value); + case 'time': // hh:mm:ss + return preg_match('/^[0-9]{2}:[0-9]{2}:[0-9]{2}$/', $value); + case 'year': + return preg_match('/^[0-9]{4}$/', $value); + case 'month': + return preg_match('/^[0-9]{2}$/', $value) && $value > 0 && $value < 13; + case 'day': + return preg_match('/^[0-9]{2}$/', $value) && $value > 0 && $value < 32; + case 'hour': + return preg_match('/^[0-9]{2}$/', $value) && $value < 24; + case 'minute': + return preg_match('/^[0-9]{2}$/', $value) && $value < 60; + case 'second': + // According to RFC5260, seconds can be from 00 to 60 + return preg_match('/^[0-9]{2}$/', $value) && $value < 61; + case 'weekday': + return preg_match('/^[0-9]$/', $value) && $value < 7; + case 'zone': + return preg_match('/^[+-][0-9]{4}$/', $value); + } + } + + /** + * Converts mailbox name from/to UTF7-IMAP from/to internal Sieve encoding + * with delimiter replacement. + * + * @param string $mailbox Mailbox name + * @param string $mode Conversion direction ('in'|'out') + * + * @return string Mailbox name + */ + private function mod_mailbox($mailbox, $mode = 'out') + { + $delimiter = $_SESSION['imap_delimiter']; + $replace_delimiter = $this->rc->config->get('managesieve_replace_delimiter'); + $mbox_encoding = $this->rc->config->get('managesieve_mbox_encoding', 'UTF7-IMAP'); + + if ($mode == 'out') { + $mailbox = rcube_charset::convert($mailbox, $mbox_encoding, 'UTF7-IMAP'); + if ($replace_delimiter && $replace_delimiter != $delimiter) + $mailbox = str_replace($replace_delimiter, $delimiter, $mailbox); + } + else { + $mailbox = rcube_charset::convert($mailbox, 'UTF7-IMAP', $mbox_encoding); + if ($replace_delimiter && $replace_delimiter != $delimiter) + $mailbox = str_replace($delimiter, $replace_delimiter, $mailbox); + } + + return $mailbox; + } + + /** + * List sieve scripts + * + * @return array Scripts list + */ + public function list_scripts() + { + if ($this->list !== null) { + return $this->list; + } + + $this->list = $this->sieve->get_scripts(); + + // Handle active script(s) and list of scripts according to Kolab's KEP:14 + if ($this->rc->config->get('managesieve_kolab_master')) { + + // Skip protected names + foreach ((array)$this->list as $idx => $name) { + $_name = strtoupper($name); + if ($_name == 'MASTER') + $master_script = $name; + else if ($_name == 'MANAGEMENT') + $management_script = $name; + else if($_name == 'USER') + $user_script = $name; + else + continue; + + unset($this->list[$idx]); + } + + // get active script(s), read USER script + if ($user_script) { + $extension = $this->rc->config->get('managesieve_filename_extension', '.sieve'); + $filename_regex = '/'.preg_quote($extension, '/').'$/'; + $_SESSION['managesieve_user_script'] = $user_script; + + $this->sieve->load($user_script); + + foreach ($this->sieve->script->as_array() as $rules) { + foreach ($rules['actions'] as $action) { + if ($action['type'] == 'include' && empty($action['global'])) { + $name = preg_replace($filename_regex, '', $action['target']); + $this->active[] = $name; + } + } + } + } + // create USER script if it doesn't exist + else { + $content = "# USER Management Script\n" + ."#\n" + ."# This script includes the various active sieve scripts\n" + ."# it is AUTOMATICALLY GENERATED. DO NOT EDIT MANUALLY!\n" + ."#\n" + ."# For more information, see http://wiki.kolab.org/KEP:14#USER\n" + ."#\n"; + if ($this->sieve->save_script('USER', $content)) { + $_SESSION['managesieve_user_script'] = 'USER'; + if (empty($this->master_file)) + $this->sieve->activate('USER'); + } + } + } + else if (!empty($this->list)) { + // Get active script name + if ($active = $this->sieve->get_active()) { + $this->active = array($active); + } + + // Hide scripts from config + $exceptions = $this->rc->config->get('managesieve_filename_exceptions'); + if (!empty($exceptions)) { + $this->list = array_diff($this->list, (array)$exceptions); + } + } + + return $this->list; + } + + /** + * Removes sieve script + * + * @param string $name Script name + * + * @return bool True on success, False on failure + */ + public function remove_script($name) + { + $result = $this->sieve->remove($name); + + // Kolab's KEP:14 + if ($result && $this->rc->config->get('managesieve_kolab_master')) { + $this->deactivate_script($name); + } + + return $result; + } + + /** + * Activates sieve script + * + * @param string $name Script name + * + * @return bool True on success, False on failure + */ + public function activate_script($name) + { + // Kolab's KEP:14 + if ($this->rc->config->get('managesieve_kolab_master')) { + $extension = $this->rc->config->get('managesieve_filename_extension', '.sieve'); + $user_script = $_SESSION['managesieve_user_script']; + + // if the script is not active... + if ($user_script && array_search($name, $this->active) === false) { + // ...rewrite USER file adding appropriate include command + if ($this->sieve->load($user_script)) { + $script = $this->sieve->script->as_array(); + $list = array(); + $regexp = '/' . preg_quote($extension, '/') . '$/'; + + // Create new include entry + $rule = array( + 'actions' => array( + 0 => array( + 'target' => $name.$extension, + 'type' => 'include', + 'personal' => true, + ))); + + // get all active scripts for sorting + foreach ($script as $rid => $rules) { + foreach ($rules['actions'] as $action) { + if ($action['type'] == 'include' && empty($action['global'])) { + $target = $extension ? preg_replace($regexp, '', $action['target']) : $action['target']; + $list[] = $target; + } + } + } + $list[] = $name; + + // Sort and find current script position + asort($list, SORT_LOCALE_STRING); + $list = array_values($list); + $index = array_search($name, $list); + + // add rule at the end of the script + if ($index === false || $index == count($list)-1) { + $this->sieve->script->add_rule($rule); + } + // add rule at index position + else { + $script2 = array(); + foreach ($script as $rid => $rules) { + if ($rid == $index) { + $script2[] = $rule; + } + $script2[] = $rules; + } + $this->sieve->script->content = $script2; + } + + $result = $this->sieve->save(); + if ($result) { + $this->active[] = $name; + } + } + } + } + else { + $result = $this->sieve->activate($name); + if ($result) + $this->active = array($name); + } + + return $result; + } + + /** + * Deactivates sieve script + * + * @param string $name Script name + * + * @return bool True on success, False on failure + */ + public function deactivate_script($name) + { + // Kolab's KEP:14 + if ($this->rc->config->get('managesieve_kolab_master')) { + $extension = $this->rc->config->get('managesieve_filename_extension', '.sieve'); + $user_script = $_SESSION['managesieve_user_script']; + + // if the script is active... + if ($user_script && ($key = array_search($name, $this->active)) !== false) { + // ...rewrite USER file removing appropriate include command + if ($this->sieve->load($user_script)) { + $script = $this->sieve->script->as_array(); + $name = $name.$extension; + + foreach ($script as $rid => $rules) { + foreach ($rules['actions'] as $action) { + if ($action['type'] == 'include' && empty($action['global']) + && $action['target'] == $name + ) { + break 2; + } + } + } + + // Entry found + if ($rid < count($script)) { + $this->sieve->script->delete_rule($rid); + $result = $this->sieve->save(); + if ($result) { + unset($this->active[$key]); + } + } + } + } + } + else { + $result = $this->sieve->deactivate(); + if ($result) + $this->active = array(); + } + + return $result; + } + + /** + * Saves current script (adding some variables) + */ + public function save_script($name = null) + { + // Kolab's KEP:14 + if ($this->rc->config->get('managesieve_kolab_master')) { + $this->sieve->script->set_var('EDITOR', self::PROGNAME); + $this->sieve->script->set_var('EDITOR_VERSION', self::VERSION); + } + + return $this->sieve->save($name); + } + + /** + * Returns list of rules from the current script + * + * @return array List of rules + */ + public function list_rules() + { + $result = array(); + $i = 1; + + foreach ($this->script as $idx => $filter) { + if ($filter['type'] != 'if') { + continue; + } + $fname = $filter['name'] ? $filter['name'] : "#$i"; + $result[] = array( + 'id' => $idx, + 'name' => $fname, + 'class' => $filter['disabled'] ? 'disabled' : '', + ); + $i++; + } + + return $result; + } +} diff --git a/plugins/managesieve/lib/Roundcube/rcube_sieve_script.php b/plugins/managesieve/lib/Roundcube/rcube_sieve_script.php index 80f590f4b..a614c3b15 100644 --- a/plugins/managesieve/lib/Roundcube/rcube_sieve_script.php +++ b/plugins/managesieve/lib/Roundcube/rcube_sieve_script.php @@ -6,18 +6,18 @@ * Copyright (C) 2008-2011, The Roundcube Dev Team * Copyright (C) 2011, Kolab Systems AG * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 - * as published by the Free Software Foundation. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see http://www.gnu.org/licenses/. */ class rcube_sieve_script @@ -27,24 +27,26 @@ class rcube_sieve_script private $vars = array(); // "global" variables private $prefix = ''; // script header (comments) private $supported = array( // Sieve extensions supported by class - 'fileinto', // RFC5228 + 'body', // RFC5173 + 'copy', // RFC3894 + 'date', // RFC5260 + 'enotify', // RFC5435 'envelope', // RFC5228 - 'reject', // RFC5429 'ereject', // RFC5429 - 'copy', // RFC3894 - 'vacation', // RFC5230 - 'vacation-seconds', // RFC6131 - 'relational', // RFC3431 - 'regex', // draft-ietf-sieve-regex-01 + 'fileinto', // RFC5228 'imapflags', // draft-melnikov-sieve-imapflags-06 'imap4flags', // RFC5232 'include', // draft-ietf-sieve-include-12 - 'variables', // RFC5229 - 'body', // RFC5173 - 'subaddress', // RFC5233 - 'enotify', // RFC5435 + 'index', // RFC5260 'notify', // draft-ietf-sieve-notify-00 - // @TODO: spamtest+virustest, mailbox, date + 'regex', // draft-ietf-sieve-regex-01 + 'reject', // RFC5429 + 'relational', // RFC3431 + 'subaddress', // RFC5233 + 'vacation', // RFC5230 + 'vacation-seconds', // RFC6131 + 'variables', // RFC5229 + // @TODO: spamtest+virustest, mailbox ); /** @@ -206,7 +208,6 @@ class rcube_sieve_script // rules foreach ($this->content as $rule) { - $extension = ''; $script = ''; $tests = array(); $i = 0; @@ -239,24 +240,8 @@ class rcube_sieve_script $tests[$i] .= ($test['not'] ? 'not ' : ''); $tests[$i] .= 'header'; - if (!empty($test['type'])) { - // relational operator + comparator - if (preg_match('/^(value|count)-([gteqnl]{2})/', $test['type'], $m)) { - array_push($exts, 'relational'); - array_push($exts, 'comparator-i;ascii-numeric'); - - $tests[$i] .= ' :' . $m[1] . ' "' . $m[2] . '" :comparator "i;ascii-numeric"'; - } - else { - $this->add_comparator($test, $tests[$i], $exts); - - if ($test['type'] == 'regex') { - array_push($exts, 'regex'); - } - - $tests[$i] .= ' :' . $test['type']; - } - } + $this->add_index($test, $tests[$i], $exts); + $this->add_operator($test, $tests[$i], $exts); $tests[$i] .= ' ' . self::escape_string($test['arg1']); $tests[$i] .= ' ' . self::escape_string($test['arg2']); @@ -271,6 +256,10 @@ class rcube_sieve_script $tests[$i] .= ($test['not'] ? 'not ' : ''); $tests[$i] .= $test['test']; + if ($test['test'] != 'envelope') { + $this->add_index($test, $tests[$i], $exts); + } + if (!empty($test['part'])) { $tests[$i] .= ' :' . $test['part']; if ($test['part'] == 'user' || $test['part'] == 'detail') { @@ -278,14 +267,7 @@ class rcube_sieve_script } } - $this->add_comparator($test, $tests[$i], $exts); - - if (!empty($test['type'])) { - if ($test['type'] == 'regex') { - array_push($exts, 'regex'); - } - $tests[$i] .= ' :' . $test['type']; - } + $this->add_operator($test, $tests[$i], $exts); $tests[$i] .= ' ' . self::escape_string($test['arg1']); $tests[$i] .= ' ' . self::escape_string($test['arg2']); @@ -296,8 +278,6 @@ class rcube_sieve_script $tests[$i] .= ($test['not'] ? 'not ' : '') . 'body'; - $this->add_comparator($test, $tests[$i], $exts); - if (!empty($test['part'])) { $tests[$i] .= ' :' . $test['part']; @@ -306,14 +286,35 @@ class rcube_sieve_script } } - if (!empty($test['type'])) { - if ($test['type'] == 'regex') { - array_push($exts, 'regex'); - } - $tests[$i] .= ' :' . $test['type']; + $this->add_operator($test, $tests[$i], $exts); + + $tests[$i] .= ' ' . self::escape_string($test['arg']); + break; + + case 'date': + case 'currentdate': + array_push($exts, 'date'); + + $tests[$i] .= ($test['not'] ? 'not ' : '') . $test['test']; + + $this->add_index($test, $tests[$i], $exts); + + if (!empty($test['originalzone']) && $test['test'] == 'date') { + $tests[$i] .= ' :originalzone'; } + else if (!empty($test['zone'])) { + $tests[$i] .= ' :zone ' . self::escape_string($test['zone']); + } + + $this->add_operator($test, $tests[$i], $exts); + if ($test['test'] == 'date') { + $tests[$i] .= ' ' . self::escape_string($test['header']); + } + + $tests[$i] .= ' ' . self::escape_string($test['part']); $tests[$i] .= ' ' . self::escape_string($test['arg']); + break; } $i++; @@ -490,6 +491,8 @@ class rcube_sieve_script unset($exts[$key]); } + sort($exts); // for convenience use always the same order + $output = 'require ["' . implode('","', $exts) . "\"];\n" . $output; } @@ -653,86 +656,85 @@ class rcube_sieve_script break; case 'size': - $size = array('test' => 'size', 'not' => $not); + $test = array('test' => 'size', 'not' => $not); + + $test['arg'] = array_pop($tokens); + for ($i=0, $len=count($tokens); $i<$len; $i++) { if (!is_array($tokens[$i]) && preg_match('/^:(under|over)$/i', $tokens[$i]) ) { - $size['type'] = strtolower(substr($tokens[$i], 1)); - } - else { - $size['arg'] = $tokens[$i]; + $test['type'] = strtolower(substr($tokens[$i], 1)); } } - $tests[] = $size; + $tests[] = $test; break; case 'header': - $header = array('test' => 'header', 'not' => $not, 'arg1' => '', 'arg2' => ''); - for ($i=0, $len=count($tokens); $i<$len; $i++) { - if (!is_array($tokens[$i]) && preg_match('/^:comparator$/i', $tokens[$i])) { - $header['comparator'] = $tokens[++$i]; - } - else if (!is_array($tokens[$i]) && preg_match('/^:(count|value)$/i', $tokens[$i])) { - $header['type'] = strtolower(substr($tokens[$i], 1)) . '-' . $tokens[++$i]; - } - else if (!is_array($tokens[$i]) && preg_match('/^:(is|contains|matches|regex)$/i', $tokens[$i])) { - $header['type'] = strtolower(substr($tokens[$i], 1)); - } - else { - $header['arg1'] = $header['arg2']; - $header['arg2'] = $tokens[$i]; + case 'address': + case 'envelope': + $test = array('test' => $token, 'not' => $not); + + $test['arg2'] = array_pop($tokens); + $test['arg1'] = array_pop($tokens); + + $test += $this->test_tokens($tokens); + + if ($token != 'header' && !empty($tokens)) { + for ($i=0, $len=count($tokens); $i<$len; $i++) { + if (!is_array($tokens[$i]) && preg_match('/^:(localpart|domain|all|user|detail)$/i', $tokens[$i])) { + $test['part'] = strtolower(substr($tokens[$i], 1)); + } } } - $tests[] = $header; + $tests[] = $test; break; - case 'address': - case 'envelope': - $header = array('test' => $token, 'not' => $not, 'arg1' => '', 'arg2' => ''); + case 'body': + $test = array('test' => 'body', 'not' => $not); + + $test['arg'] = array_pop($tokens); + + $test += $this->test_tokens($tokens); + for ($i=0, $len=count($tokens); $i<$len; $i++) { - if (!is_array($tokens[$i]) && preg_match('/^:comparator$/i', $tokens[$i])) { - $header['comparator'] = $tokens[++$i]; - } - else if (!is_array($tokens[$i]) && preg_match('/^:(is|contains|matches|regex)$/i', $tokens[$i])) { - $header['type'] = strtolower(substr($tokens[$i], 1)); - } - else if (!is_array($tokens[$i]) && preg_match('/^:(localpart|domain|all|user|detail)$/i', $tokens[$i])) { - $header['part'] = strtolower(substr($tokens[$i], 1)); - } - else { - $header['arg1'] = $header['arg2']; - $header['arg2'] = $tokens[$i]; + if (!is_array($tokens[$i]) && preg_match('/^:(raw|content|text)$/i', $tokens[$i])) { + $test['part'] = strtolower(substr($tokens[$i], 1)); + + if ($test['part'] == 'content') { + $test['content'] = $tokens[++$i]; + } } } - $tests[] = $header; + $tests[] = $test; break; - case 'body': - $header = array('test' => 'body', 'not' => $not, 'arg' => ''); - for ($i=0, $len=count($tokens); $i<$len; $i++) { - if (!is_array($tokens[$i]) && preg_match('/^:comparator$/i', $tokens[$i])) { - $header['comparator'] = $tokens[++$i]; - } - else if (!is_array($tokens[$i]) && preg_match('/^:(is|contains|matches|regex)$/i', $tokens[$i])) { - $header['type'] = strtolower(substr($tokens[$i], 1)); - } - else if (!is_array($tokens[$i]) && preg_match('/^:(raw|content|text)$/i', $tokens[$i])) { - $header['part'] = strtolower(substr($tokens[$i], 1)); + case 'date': + case 'currentdate': + $test = array('test' => $token, 'not' => $not); - if ($header['part'] == 'content') { - $header['content'] = $tokens[++$i]; - } + $test['arg'] = array_pop($tokens); + $test['part'] = array_pop($tokens); + + if ($token == 'date') { + $test['header'] = array_pop($tokens); + } + + $test += $this->test_tokens($tokens); + + for ($i=0, $len=count($tokens); $i<$len; $i++) { + if (!is_array($tokens[$i]) && preg_match('/^:zone$/i', $tokens[$i])) { + $test['zone'] = $tokens[++$i]; } - else { - $header['arg'] = $tokens[$i]; + else if (!is_array($tokens[$i]) && preg_match('/^:originalzone$/i', $tokens[$i])) { + $test['originalzone'] = true; } } - $tests[] = $header; + $tests[] = $test; break; case 'exists': @@ -784,15 +786,9 @@ class rcube_sieve_script $result = null; while (strlen($content)) { - $tokens = self::tokenize($content, true); + $tokens = self::tokenize($content, true); $separator = array_pop($tokens); - - if (!empty($tokens)) { - $token = array_shift($tokens); - } - else { - $token = $separator; - } + $token = !empty($tokens) ? array_shift($tokens) : $separator; switch ($token) { case 'discard': @@ -803,113 +799,78 @@ class rcube_sieve_script case 'fileinto': case 'redirect': - $copy = false; - $target = ''; + $action = array('type' => $token, 'target' => array_pop($tokens)); + $args = array('copy'); + $action += $this->action_arguments($tokens, $args); - for ($i=0, $len=count($tokens); $i<$len; $i++) { - if (strtolower($tokens[$i]) == ':copy') { - $copy = true; - } - else { - $target = $tokens[$i]; - } - } - - $result[] = array('type' => $token, 'copy' => $copy, - 'target' => $target); - break; - - case 'reject': - case 'ereject': - $result[] = array('type' => $token, 'target' => array_pop($tokens)); + $result[] = $action; break; case 'vacation': - $vacation = array('type' => 'vacation', 'reason' => array_pop($tokens)); - - for ($i=0, $len=count($tokens); $i<$len; $i++) { - $tok = strtolower($tokens[$i]); - if ($tok == ':mime') { - $vacation['mime'] = true; - } - else if ($tok[0] == ':') { - $vacation[substr($tok, 1)] = $tokens[++$i]; - } - } + $action = array('type' => 'vacation', 'reason' => array_pop($tokens)); + $args = array('mime'); + $vargs = array('seconds', 'days', 'addresses', 'subject', 'handle', 'from'); + $action += $this->action_arguments($tokens, $args, $vargs); - $result[] = $vacation; + $result[] = $action; break; + case 'reject': + case 'ereject': case 'setflag': case 'addflag': case 'removeflag': - $result[] = array('type' => $token, - // Flags list: last token (skip optional variable) - 'target' => $tokens[count($tokens)-1] - ); + $result[] = array('type' => $token, 'target' => array_pop($tokens)); break; case 'include': - $include = array('type' => 'include', 'target' => array_pop($tokens)); - - // Parameters: :once, :optional, :global, :personal - for ($i=0, $len=count($tokens); $i<$len; $i++) { - $tok = strtolower($tokens[$i]); - if ($tok[0] == ':') { - $include[substr($tok, 1)] = true; - } - } + $action = array('type' => 'include', 'target' => array_pop($tokens)); + $args = array('once', 'optional', 'global', 'personal'); + $action += $this->action_arguments($tokens, $args); - $result[] = $include; + $result[] = $action; break; case 'set': - $set = array('type' => 'set', 'value' => array_pop($tokens), 'name' => array_pop($tokens)); + $action = array('type' => 'set', 'value' => array_pop($tokens), 'name' => array_pop($tokens)); + $args = array('lower', 'upper', 'lowerfirst', 'upperfirst', 'quotewildcard', 'length'); + $action += $this->action_arguments($tokens, $args); - // Parameters: :lower :upper :lowerfirst :upperfirst :quotewildcard :length - for ($i=0, $len=count($tokens); $i<$len; $i++) { - $tok = strtolower($tokens[$i]); - if ($tok[0] == ':') { - $set[substr($tok, 1)] = true; - } - } - - $result[] = $set; + $result[] = $action; break; case 'require': // skip, will be build according to used commands - // $result[] = array('type' => 'require', 'target' => $tokens); + // $result[] = array('type' => 'require', 'target' => array_pop($tokens)); break; case 'notify': - $notify = array('type' => 'notify'); - $priorities = array(':high' => 1, ':normal' => 2, ':low' => 3); - - // Parameters: :from, :importance, :options, :message - // additional (optional) :method parameter for notify extension - for ($i=0, $len=count($tokens); $i<$len; $i++) { - $tok = strtolower($tokens[$i]); - if ($tok[0] == ':') { - // Here we support only 00 version of notify draft, there - // were a couple regressions in 00 to 04 changelog, we use - // the version used by Cyrus - if (isset($priorities[$tok])) { - $notify['importance'] = $priorities[$tok]; - } - else { - $notify[substr($tok, 1)] = $tokens[++$i]; + $action = array('type' => 'notify'); + $priorities = array('high' => 1, 'normal' => 2, 'low' => 3); + $vargs = array('from', 'importance', 'options', 'message', 'method'); + $args = array_keys($priorities); + $action += $this->action_arguments($tokens, $args, $vargs); + + // Here we support only 00 version of notify draft, there + // were a couple regressions in 00 to 04 changelog, we use + // the version used by Cyrus + if (!isset($action['importance'])) { + foreach ($priorities as $key => $val) { + if (isset($action[$key])) { + $action['importance'] = $val; + unset($action[$key]); } } - else { - // unnamed parameter is a :method in enotify extension - $notify['method'] = $tokens[$i]; - } } - $method_components = parse_url($notify['method']); + // unnamed parameter is a :method in enotify extension + if (!isset($action['method'])) { + $action['method'] = array_pop($tokens); + } + + $method_components = parse_url($action['method']); if ($method_components['scheme'] == 'mailto') { - $notify['address'] = $method_components['path']; + $action['address'] = $method_components['path']; $method_params = array(); if (array_key_exists('query', $method_components)) { parse_str($method_components['query'], $method_params); @@ -919,10 +880,10 @@ class rcube_sieve_script if (ini_get('magic_quotes_gpc') || ini_get('magic_quotes_sybase')) { array_map('stripslashes', $method_params); } - $notify['body'] = (array_key_exists('body', $method_params)) ? $method_params['body'] : ''; + $action['body'] = (array_key_exists('body', $method_params)) ? $method_params['body'] : ''; } - $result[] = $notify; + $result[] = $action; break; } @@ -935,7 +896,7 @@ class rcube_sieve_script } /** - * + * Add comparator to the test */ private function add_comparator($test, &$out, &$exts) { @@ -958,6 +919,111 @@ class rcube_sieve_script } /** + * Add index argument to the test + */ + private function add_index($test, &$out, &$exts) + { + if (!empty($test['index'])) { + array_push($exts, 'index'); + $out .= ' :index ' . intval($test['index']) . ($test['last'] ? ' :last' : ''); + } + } + + /** + * Add operators to the test + */ + private function add_operator($test, &$out, &$exts) + { + if (empty($test['type'])) { + return; + } + + // relational operator + comparator + if (preg_match('/^(value|count)-([gteqnl]{2})/', $test['type'], $m)) { + array_push($exts, 'relational'); + array_push($exts, 'comparator-i;ascii-numeric'); + + $out .= ' :' . $m[1] . ' "' . $m[2] . '" :comparator "i;ascii-numeric"'; + } + else { + $this->add_comparator($test, $out, $exts); + + if ($test['type'] == 'regex') { + array_push($exts, 'regex'); + } + + $out .= ' :' . $test['type']; + } + } + + /** + * Extract test tokens + */ + private function test_tokens(&$tokens) + { + $test = array(); + $result = array(); + + for ($i=0, $len=count($tokens); $i<$len; $i++) { + if (!is_array($tokens[$i]) && preg_match('/^:comparator$/i', $tokens[$i])) { + $test['comparator'] = $tokens[++$i]; + } + else if (!is_array($tokens[$i]) && preg_match('/^:(count|value)$/i', $tokens[$i])) { + $test['type'] = strtolower(substr($tokens[$i], 1)) . '-' . $tokens[++$i]; + } + else if (!is_array($tokens[$i]) && preg_match('/^:(is|contains|matches|regex)$/i', $tokens[$i])) { + $test['type'] = strtolower(substr($tokens[$i], 1)); + } + else if (!is_array($tokens[$i]) && preg_match('/^:index$/i', $tokens[$i])) { + $test['index'] = intval($tokens[++$i]); + if ($tokens[$i+1] && preg_match('/^:last$/i', $tokens[$i+1])) { + $test['last'] = true; + $i++; + } + } + else { + $result[] = $tokens[$i]; + } + } + + $tokens = $result; + + return $test; + } + + /** + * Extract action arguments + */ + private function action_arguments(&$tokens, $bool_args, $val_args = array()) + { + $action = array(); + $result = array(); + + for ($i=0, $len=count($tokens); $i<$len; $i++) { + $tok = $tokens[$i]; + if (!is_array($tok) && $tok[0] == ':') { + $tok = strtolower(substr($tok, 1)); + if (in_array($tok, $bool_args)) { + $action[$tok] = true; + } + else if (in_array($tok, $val_args)) { + $action[$tok] = $tokens[++$i]; + } + else { + $result[] = $tok; + } + } + else { + $result[] = $tok; + } + } + + $tokens = $result; + + return $action; + } + + /** * Escape special chars into quoted string value or multi-line string * or list of strings * @@ -1015,11 +1081,10 @@ class rcube_sieve_script * @param mixed $num Number of tokens to return, 0 for all * or True for all tokens until separator is found. * Separator will be returned as last token. - * @param int $in_list Enable to call recursively inside a list * * @return mixed Tokens array or string if $num=1 */ - static function tokenize(&$str, $num=0, $in_list=false) + static function tokenize(&$str, $num=0) { $result = array(); @@ -1054,7 +1119,7 @@ class rcube_sieve_script // Parenthesized list case '[': $str = substr($str, 1); - $result[] = self::tokenize($str, 0, true); + $result[] = self::tokenize($str, 0); break; case ']': $str = substr($str, 1); diff --git a/plugins/managesieve/localization/az_AZ.inc b/plugins/managesieve/localization/az_AZ.inc index b1bfae5e9..670162552 100644 --- a/plugins/managesieve/localization/az_AZ.inc +++ b/plugins/managesieve/localization/az_AZ.inc @@ -55,7 +55,7 @@ $labels['add'] = 'Əlavə et'; $labels['del'] = 'Sil'; $labels['sender'] = 'Göndərən'; $labels['recipient'] = 'Qəbul edən'; -$labels['vacationaddresses'] = 'Əlavə ünvanlarım üçün siyahı (vergüllər ilə ayrılmış):'; +$labels['vacationaddr'] = 'Əlavə ünvanlarım üçün siyahı:'; $labels['vacationdays'] = 'Məktub neçə müddətdən bir göndərilsin (gündə):'; $labels['vacationinterval'] = 'How often send messages:'; $labels['days'] = 'days'; diff --git a/plugins/managesieve/localization/be_BE.inc b/plugins/managesieve/localization/be_BE.inc index 64f81599e..ff54c0546 100644 --- a/plugins/managesieve/localization/be_BE.inc +++ b/plugins/managesieve/localization/be_BE.inc @@ -55,7 +55,7 @@ $labels['add'] = 'Дадаць'; $labels['del'] = 'Выдаліць'; $labels['sender'] = 'Ад каго'; $labels['recipient'] = 'Каму'; -$labels['vacationaddresses'] = 'Дадатковы спіс атрымальнікаў (праз коску):'; +$labels['vacationaddr'] = 'Дадатковы спіс атрымальнікаў:'; $labels['vacationdays'] = 'Як часта дасылаць паведамленні (ў днях):'; $labels['vacationinterval'] = 'How often send messages:'; $labels['days'] = 'days'; diff --git a/plugins/managesieve/localization/bg_BG.inc b/plugins/managesieve/localization/bg_BG.inc index a8f75df04..e22290cff 100644 --- a/plugins/managesieve/localization/bg_BG.inc +++ b/plugins/managesieve/localization/bg_BG.inc @@ -55,7 +55,7 @@ $labels['add'] = 'Добавяне'; $labels['del'] = 'Изтриване'; $labels['sender'] = 'Подател'; $labels['recipient'] = 'Получател'; -$labels['vacationaddresses'] = 'Допълнителни e-mail адреси (разделени със запетая):'; +$labels['vacationaddr'] = 'Допълнителни e-mail адреси:'; $labels['vacationdays'] = 'Колко често пращате съобщения (в дни):'; $labels['vacationinterval'] = 'How often send messages:'; $labels['days'] = 'days'; diff --git a/plugins/managesieve/localization/bs_BA.inc b/plugins/managesieve/localization/bs_BA.inc index 6d1ec8d2c..df9083129 100644 --- a/plugins/managesieve/localization/bs_BA.inc +++ b/plugins/managesieve/localization/bs_BA.inc @@ -55,11 +55,11 @@ $labels['add'] = 'Dodaj'; $labels['del'] = 'Obriši'; $labels['sender'] = 'Pošiljaoc'; $labels['recipient'] = 'Primaoc'; -$labels['vacationaddresses'] = 'Moje dodatne email adrese (odvojite zarezima):'; +$labels['vacationaddr'] = 'Moje dodatne email adrese:'; $labels['vacationdays'] = 'Frekvencija slanja poruka (u danima):'; -$labels['vacationinterval'] = 'How often send messages:'; -$labels['days'] = 'days'; -$labels['seconds'] = 'seconds'; +$labels['vacationinterval'] = 'Frekvencija slanja poruka:'; +$labels['days'] = 'dana'; +$labels['seconds'] = 'sekundi'; $labels['vacationreason'] = 'Tijelo poruke (razlog za odmor):'; $labels['vacationsubject'] = 'Naslov poruke:'; $labels['rulestop'] = 'Prestani procjenjivati pravila'; diff --git a/plugins/managesieve/localization/ca_ES.inc b/plugins/managesieve/localization/ca_ES.inc index df1cdec89..7ebd2c049 100644 --- a/plugins/managesieve/localization/ca_ES.inc +++ b/plugins/managesieve/localization/ca_ES.inc @@ -55,7 +55,7 @@ $labels['add'] = 'Afegeix'; $labels['del'] = 'Suprimeix'; $labels['sender'] = 'Remitent'; $labels['recipient'] = 'Destinatari/a'; -$labels['vacationaddresses'] = 'Altres adreces electròniques meves (separades per coma)'; +$labels['vacationaddr'] = 'Altres adreces electròniques meves:'; $labels['vacationdays'] = 'Cada quan enviar un missatge (en dies):'; $labels['vacationinterval'] = 'How often send messages:'; $labels['days'] = 'days'; diff --git a/plugins/managesieve/localization/cs_CZ.inc b/plugins/managesieve/localization/cs_CZ.inc index 26baeff2b..c14873bb7 100644 --- a/plugins/managesieve/localization/cs_CZ.inc +++ b/plugins/managesieve/localization/cs_CZ.inc @@ -55,7 +55,7 @@ $labels['add'] = 'Přidej'; $labels['del'] = 'Smaž'; $labels['sender'] = 'Odesílatel'; $labels['recipient'] = 'Příjemce'; -$labels['vacationaddresses'] = 'Moje další e-mailové adresy (aliasy) spojené s tímto účtem (oddělené čárkou):'; +$labels['vacationaddr'] = 'Moje další e-mailové adresy (aliasy) spojené s tímto účtem:'; $labels['vacationdays'] = 'Počet dnů mezi automatickými odpověďmi:'; $labels['vacationinterval'] = 'Prodleva mezi automatickými odpověďmi:'; $labels['days'] = 'dnů'; diff --git a/plugins/managesieve/localization/cy_GB.inc b/plugins/managesieve/localization/cy_GB.inc index 800d14b65..63d2e7100 100644 --- a/plugins/managesieve/localization/cy_GB.inc +++ b/plugins/managesieve/localization/cy_GB.inc @@ -55,7 +55,7 @@ $labels['add'] = 'Ychwanegu'; $labels['del'] = 'Dileu'; $labels['sender'] = 'Anfonwr'; $labels['recipient'] = 'Derbynnwr'; -$labels['vacationaddresses'] = 'Fy chyfeiriadau ebost ychwanegol (gwahanir gyda coma):'; +$labels['vacationaddr'] = 'Fy chyfeiriadau ebost ychwanegol:'; $labels['vacationdays'] = 'Pa mor aml i ddanfon negeseuon (mewn dyddiau):'; $labels['vacationinterval'] = 'How often send messages:'; $labels['days'] = 'days'; diff --git a/plugins/managesieve/localization/da_DK.inc b/plugins/managesieve/localization/da_DK.inc index 6bc43cf58..058481031 100644 --- a/plugins/managesieve/localization/da_DK.inc +++ b/plugins/managesieve/localization/da_DK.inc @@ -55,7 +55,7 @@ $labels['add'] = 'Tilføje'; $labels['del'] = 'Fjern'; $labels['sender'] = 'Afsender'; $labels['recipient'] = 'Modtager'; -$labels['vacationaddresses'] = 'Mine alternative e-mailadresser (kommasepareret):'; +$labels['vacationaddr'] = 'Mine alternative e-mailadresser:'; $labels['vacationdays'] = 'Hvor tit skal besked sendes (i dage):'; $labels['vacationinterval'] = 'How often send messages:'; $labels['days'] = 'days'; diff --git a/plugins/managesieve/localization/de_CH.inc b/plugins/managesieve/localization/de_CH.inc index b30625fe9..19a9b9de3 100644 --- a/plugins/managesieve/localization/de_CH.inc +++ b/plugins/managesieve/localization/de_CH.inc @@ -55,7 +55,7 @@ $labels['add'] = 'Hinzufügen'; $labels['del'] = 'Löschen'; $labels['sender'] = 'Absender'; $labels['recipient'] = 'Empfänger'; -$labels['vacationaddresses'] = 'Zusätzliche Liste von Empfängern (Komma getrennt):'; +$labels['vacationaddr'] = 'Zusätzliche Liste von Empfängern:'; $labels['vacationdays'] = 'Antwort wird erneut gesendet nach (in Tagen):'; $labels['vacationinterval'] = 'Wie oft senden:'; $labels['days'] = 'Tage'; diff --git a/plugins/managesieve/localization/de_DE.inc b/plugins/managesieve/localization/de_DE.inc index 1b741efc6..4894904d6 100644 --- a/plugins/managesieve/localization/de_DE.inc +++ b/plugins/managesieve/localization/de_DE.inc @@ -55,7 +55,7 @@ $labels['add'] = 'Hinzufügen'; $labels['del'] = 'Löschen'; $labels['sender'] = 'Absender'; $labels['recipient'] = 'Empfänger'; -$labels['vacationaddresses'] = 'Zusätzliche Liste von E-Mail Empfängern (Komma getrennt):'; +$labels['vacationaddr'] = 'Zusätzliche Liste von E-Mail Empfängern:'; $labels['vacationdays'] = 'Wie oft sollen Nachrichten gesendet werden (in Tagen):'; $labels['vacationinterval'] = 'How often send messages:'; $labels['days'] = 'days'; diff --git a/plugins/managesieve/localization/el_GR.inc b/plugins/managesieve/localization/el_GR.inc index 714b7240f..e5a1b792d 100644 --- a/plugins/managesieve/localization/el_GR.inc +++ b/plugins/managesieve/localization/el_GR.inc @@ -55,7 +55,7 @@ $labels['add'] = 'Προσθήκη'; $labels['del'] = 'Διαγραφή'; $labels['sender'] = 'Αποστολέας'; $labels['recipient'] = 'Παραλήπτης'; -$labels['vacationaddresses'] = 'Πρόσθετη λίστα email παραληπτών (διαχωρισμένη με κόμματα):'; +$labels['vacationaddr'] = 'Πρόσθετη λίστα email παραληπτών:'; $labels['vacationdays'] = 'Συχνότητα αποστολής μηνυμάτων (σε ημέρες):'; $labels['vacationinterval'] = 'How often send messages:'; $labels['days'] = 'days'; diff --git a/plugins/managesieve/localization/en_GB.inc b/plugins/managesieve/localization/en_GB.inc index 4dd4f7d8b..ff4965ca0 100644 --- a/plugins/managesieve/localization/en_GB.inc +++ b/plugins/managesieve/localization/en_GB.inc @@ -55,7 +55,7 @@ $labels['add'] = 'Add'; $labels['del'] = 'Delete'; $labels['sender'] = 'Sender'; $labels['recipient'] = 'Recipient'; -$labels['vacationaddresses'] = 'Additional list of recipient e-mails (comma separated):'; +$labels['vacationaddr'] = 'Additional list of recipient e-mails:'; $labels['vacationdays'] = 'How often send messages (in days):'; $labels['vacationinterval'] = 'How often send messages:'; $labels['days'] = 'days'; diff --git a/plugins/managesieve/localization/en_US.inc b/plugins/managesieve/localization/en_US.inc index 2b391e0c5..72bbf9d41 100644 --- a/plugins/managesieve/localization/en_US.inc +++ b/plugins/managesieve/localization/en_US.inc @@ -55,7 +55,7 @@ $labels['add'] = 'Add'; $labels['del'] = 'Delete'; $labels['sender'] = 'Sender'; $labels['recipient'] = 'Recipient'; -$labels['vacationaddresses'] = 'My additional e-mail addresse(s) (comma-separated):'; +$labels['vacationaddr'] = 'My additional e-mail addresse(s):'; $labels['vacationdays'] = 'How often send messages (in days):'; $labels['vacationinterval'] = 'How often send messages:'; $labels['days'] = 'days'; @@ -83,13 +83,13 @@ $labels['countisgreaterthanequal'] = 'count is greater than or equal to'; $labels['countislessthan'] = 'count is less than'; $labels['countislessthanequal'] = 'count is less than or equal to'; $labels['countequals'] = 'count is equal to'; -$labels['countnotequals'] = 'count does not equal'; +$labels['countnotequals'] = 'count is not equal to'; $labels['valueisgreaterthan'] = 'value is greater than'; $labels['valueisgreaterthanequal'] = 'value is greater than or equal to'; $labels['valueislessthan'] = 'value is less than'; $labels['valueislessthanequal'] = 'value is less than or equal to'; $labels['valueequals'] = 'value is equal to'; -$labels['valuenotequals'] = 'value does not equal'; +$labels['valuenotequals'] = 'value is not equal to'; $labels['setflags'] = 'Set flags to the message'; $labels['addflags'] = 'Add flags to the message'; $labels['removeflags'] = 'Remove flags from the message'; @@ -121,6 +121,22 @@ $labels['filtercreate'] = 'Create filter'; $labels['usedata'] = 'Use following data in the filter:'; $labels['nextstep'] = 'Next Step'; $labels['...'] = '...'; +$labels['currdate'] = 'Current date'; +$labels['datetest'] = 'Date'; +$labels['dateheader'] = 'header:'; +$labels['year'] = 'year'; +$labels['month'] = 'month'; +$labels['day'] = 'day'; +$labels['date'] = 'date (yyyy-mm-dd)'; +$labels['julian'] = 'date (julian)'; +$labels['hour'] = 'hour'; +$labels['minute'] = 'minute'; +$labels['second'] = 'second'; +$labels['time'] = 'time (hh:mm:ss)'; +$labels['iso8601'] = 'date (ISO8601)'; +$labels['std11'] = 'date (RFC2822)'; +$labels['zone'] = 'time-zone'; +$labels['weekday'] = 'weekday (0-6)'; $labels['advancedopts'] = 'Advanced options'; $labels['body'] = 'Body'; $labels['address'] = 'address'; @@ -140,6 +156,8 @@ $labels['default'] = 'default'; $labels['octet'] = 'strict (octet)'; $labels['asciicasemap'] = 'case insensitive (ascii-casemap)'; $labels['asciinumeric'] = 'numeric (ascii-numeric)'; +$labels['index'] = 'index:'; +$labels['indexlast'] = 'backwards'; $messages = array(); $messages['filterunknownerror'] = 'Unknown server error.'; @@ -173,5 +191,6 @@ $messages['nametoolong'] = 'Name too long.'; $messages['namereserved'] = 'Reserved name.'; $messages['setexist'] = 'Set already exists.'; $messages['nodata'] = 'At least one position must be selected!'; +$messages['invaliddateformat'] = 'Invalid date or date part format'; ?> diff --git a/plugins/managesieve/localization/eo.inc b/plugins/managesieve/localization/eo.inc index 3ce49ddb2..3f54e2391 100644 --- a/plugins/managesieve/localization/eo.inc +++ b/plugins/managesieve/localization/eo.inc @@ -55,7 +55,7 @@ $labels['add'] = 'Aldoni'; $labels['del'] = 'Forigi'; $labels['sender'] = 'Sendanto'; $labels['recipient'] = 'Ricevanto'; -$labels['vacationaddresses'] = 'My additional e-mail addresse(s) (comma-separated):'; +$labels['vacationaddr'] = 'My additional e-mail addresse(s):'; $labels['vacationdays'] = 'How often send messages (in days):'; $labels['vacationinterval'] = 'How often send messages:'; $labels['days'] = 'days'; diff --git a/plugins/managesieve/localization/es_AR.inc b/plugins/managesieve/localization/es_AR.inc index c9c6e70f8..e8d90efcf 100644 --- a/plugins/managesieve/localization/es_AR.inc +++ b/plugins/managesieve/localization/es_AR.inc @@ -55,7 +55,7 @@ $labels['add'] = 'Agregar'; $labels['del'] = 'Eliminar'; $labels['sender'] = 'Remitente'; $labels['recipient'] = 'Destinatario'; -$labels['vacationaddresses'] = 'Lista de direcciones de correo de destinatarios adicionales (separados por comas):'; +$labels['vacationaddr'] = 'Lista de direcciones de correo de destinatarios adicionales:'; $labels['vacationdays'] = 'Cada cuanto enviar mensajes (en días):'; $labels['vacationinterval'] = 'How often send messages:'; $labels['days'] = 'days'; diff --git a/plugins/managesieve/localization/es_ES.inc b/plugins/managesieve/localization/es_ES.inc index 9673a9959..65ed461c4 100644 --- a/plugins/managesieve/localization/es_ES.inc +++ b/plugins/managesieve/localization/es_ES.inc @@ -55,11 +55,11 @@ $labels['add'] = 'Agregar'; $labels['del'] = 'Eliminar'; $labels['sender'] = 'Remitente'; $labels['recipient'] = 'Destinatario'; -$labels['vacationaddresses'] = 'Lista de direcciones de correo de destinatarios adicionales (separados por comas):'; +$labels['vacationaddr'] = 'Mis direcciones de correo electrónico adicionales:'; $labels['vacationdays'] = 'Cada cuánto enviar mensajes (en días):'; -$labels['vacationinterval'] = 'How often send messages:'; -$labels['days'] = 'days'; -$labels['seconds'] = 'seconds'; +$labels['vacationinterval'] = 'Cada cuánto enviar mensajes:'; +$labels['days'] = 'días'; +$labels['seconds'] = 'segundos'; $labels['vacationreason'] = 'Cuerpo del mensaje (razón de vacaciones):'; $labels['vacationsubject'] = 'Asunto del Mensaje:'; $labels['rulestop'] = 'Parar de evaluar reglas'; @@ -83,13 +83,13 @@ $labels['countisgreaterthanequal'] = 'contiene más o igual que'; $labels['countislessthan'] = 'contiene menos que'; $labels['countislessthanequal'] = 'contiene menos o igual que'; $labels['countequals'] = 'contiene igual que'; -$labels['countnotequals'] = 'contiene distinto que'; +$labels['countnotequals'] = 'la cuenta no es igual a'; $labels['valueisgreaterthan'] = 'el valor es mayor que'; $labels['valueisgreaterthanequal'] = 'el valor es mayor o igual que'; $labels['valueislessthan'] = 'el valor es menor que'; $labels['valueislessthanequal'] = 'el valor es menor o igual que'; $labels['valueequals'] = 'el valor es igual que'; -$labels['valuenotequals'] = 'el valor es distinto que'; +$labels['valuenotequals'] = 'el valor no es igual a'; $labels['setflags'] = 'Etiquetar el mensaje'; $labels['addflags'] = 'Agregar etiquetas al mensaje'; $labels['removeflags'] = 'Eliminar etiquetas al mensaje'; @@ -121,6 +121,22 @@ $labels['filtercreate'] = 'Crear Filtro'; $labels['usedata'] = 'Usar los siguientes datos en el filtro:'; $labels['nextstep'] = 'Siguiente paso'; $labels['...'] = '...'; +$labels['currdate'] = 'Fecha actual'; +$labels['datetest'] = 'Fecha'; +$labels['dateheader'] = 'cabecera:'; +$labels['year'] = 'año'; +$labels['month'] = 'mes'; +$labels['day'] = 'día'; +$labels['date'] = 'fecha (aaaa-mm-dd)'; +$labels['julian'] = 'fecha (juliano)'; +$labels['hour'] = 'hora'; +$labels['minute'] = 'minuto'; +$labels['second'] = 'segundo'; +$labels['time'] = 'hora (hh:mm:ss)'; +$labels['iso8601'] = 'fecha (ISO8601)'; +$labels['std11'] = 'fecha (RFC2822)'; +$labels['zone'] = 'zona horaria'; +$labels['weekday'] = 'día de la semana (0-6)'; $labels['advancedopts'] = 'Opciones avanzadas'; $labels['body'] = 'Cuerpo del mensaje'; $labels['address'] = 'dirección'; @@ -140,6 +156,8 @@ $labels['default'] = 'predeterminado'; $labels['octet'] = 'estricto (octeto)'; $labels['asciicasemap'] = 'no sensible a mayúsculas (ascii-casemap)'; $labels['asciinumeric'] = 'numerico (ascii-numeric)'; +$labels['index'] = 'índice:'; +$labels['indexlast'] = 'hacia atrás'; $messages = array(); $messages['filterunknownerror'] = 'Error desconocido de servidor.'; @@ -173,5 +191,6 @@ $messages['nametoolong'] = 'Imposible crear el conjunto de filtros. Nombre demas $messages['namereserved'] = 'Nombre reservado.'; $messages['setexist'] = 'El conjunto ya existe.'; $messages['nodata'] = '¡Al menos una posición debe ser seleccionada!'; +$messages['invaliddateformat'] = 'Fecha o formato de parte de la fecha no válido'; ?> diff --git a/plugins/managesieve/localization/et_EE.inc b/plugins/managesieve/localization/et_EE.inc index 334a65cee..dff15dfb4 100644 --- a/plugins/managesieve/localization/et_EE.inc +++ b/plugins/managesieve/localization/et_EE.inc @@ -55,11 +55,11 @@ $labels['add'] = 'Lisa'; $labels['del'] = 'Kustuta'; $labels['sender'] = 'Saatja'; $labels['recipient'] = 'Saaja'; -$labels['vacationaddresses'] = 'Lisanimekiri saaja e-posti aadressidest (komadega eraldatud):'; +$labels['vacationaddr'] = 'Minu teised e-posti aadress(id):'; $labels['vacationdays'] = 'Kui tihti kirju saata (päevades):'; -$labels['vacationinterval'] = 'How often send messages:'; -$labels['days'] = 'days'; -$labels['seconds'] = 'seconds'; +$labels['vacationinterval'] = 'Kui tihti kirju saata:'; +$labels['days'] = 'päeva'; +$labels['seconds'] = 'sekundit'; $labels['vacationreason'] = 'Kirja sisu (puhkuse põhjus):'; $labels['vacationsubject'] = 'Kirja teema:'; $labels['rulestop'] = 'Peata reeglite otsimine'; @@ -83,7 +83,7 @@ $labels['countisgreaterthanequal'] = 'koguarv on suurem kui või võrdne'; $labels['countislessthan'] = 'koguarv on väiksem'; $labels['countislessthanequal'] = 'koguarv on väiksem kui või võrdne'; $labels['countequals'] = 'koguarv on võrdne'; -$labels['countnotequals'] = 'koguarv ei ole võrdne'; +$labels['countnotequals'] = 'summa ei ole võrdne'; $labels['valueisgreaterthan'] = 'väärtus on suurem kui'; $labels['valueisgreaterthanequal'] = 'väärtus on suurem kui või võrdne'; $labels['valueislessthan'] = 'väärtus on väiksem kui'; @@ -121,6 +121,22 @@ $labels['filtercreate'] = 'Loo filter'; $labels['usedata'] = 'Kasuta filtris järgmisi andmeid:'; $labels['nextstep'] = 'Järgmine samm'; $labels['...'] = '…'; +$labels['currdate'] = 'Praegune kuupäev'; +$labels['datetest'] = 'Kuupäev'; +$labels['dateheader'] = 'päis:'; +$labels['year'] = 'aasta'; +$labels['month'] = 'kuu'; +$labels['day'] = 'päev'; +$labels['date'] = 'kuupäev (aaaa-kk-pp)'; +$labels['julian'] = 'kuupäev (Juliuse)'; +$labels['hour'] = 'tund'; +$labels['minute'] = 'minut'; +$labels['second'] = 'sekund'; +$labels['time'] = 'aeg (tt:mm:ss)'; +$labels['iso8601'] = 'kuupäev (ISO8601)'; +$labels['std11'] = 'kuupäev (RCF2822)'; +$labels['zone'] = 'ajatsoon'; +$labels['weekday'] = 'nädalapäev (0-6)'; $labels['advancedopts'] = 'Lisaseadistused'; $labels['body'] = 'Põhitekst'; $labels['address'] = 'aadress'; @@ -140,6 +156,8 @@ $labels['default'] = 'vaikimisi'; $labels['octet'] = 'range (octet)'; $labels['asciicasemap'] = 'tõstutundetu (ascii-casemap)'; $labels['asciinumeric'] = 'numbriline (ascii-numeric)'; +$labels['index'] = 'indeks:'; +$labels['indexlast'] = 'tagasisuunas'; $messages = array(); $messages['filterunknownerror'] = 'Tundmatu serveri tõrge'; @@ -173,5 +191,6 @@ $messages['nametoolong'] = 'Nimi on liiga pikk.'; $messages['namereserved'] = 'Nimi on reserveeritud.'; $messages['setexist'] = 'Kogum on juba olemas.'; $messages['nodata'] = 'Valitud peab olema vähemalt üks asukoht!'; +$messages['invaliddateformat'] = 'Vigane kuupäev või kuupäeva formaat'; ?> diff --git a/plugins/managesieve/localization/fa_IR.inc b/plugins/managesieve/localization/fa_IR.inc index 91dfcb605..1c8eace27 100644 --- a/plugins/managesieve/localization/fa_IR.inc +++ b/plugins/managesieve/localization/fa_IR.inc @@ -55,7 +55,6 @@ $labels['add'] = 'افزودن'; $labels['del'] = 'حذف'; $labels['sender'] = 'فرستنده'; $labels['recipient'] = 'گیرنده'; -$labels['vacationaddresses'] = 'آدرسهای ایمیل دیگر من (جدا شده با ویرگول):'; $labels['vacationdays'] = 'پیغام ها در چه مواقعی فرستاده شدند (در روزهای):'; $labels['vacationinterval'] = 'How often send messages:'; $labels['days'] = 'days'; diff --git a/plugins/managesieve/localization/fi_FI.inc b/plugins/managesieve/localization/fi_FI.inc index 71856c95f..f006f6d23 100644 --- a/plugins/managesieve/localization/fi_FI.inc +++ b/plugins/managesieve/localization/fi_FI.inc @@ -55,7 +55,7 @@ $labels['add'] = 'Lisää'; $labels['del'] = 'Poista'; $labels['sender'] = 'Lähettäjä'; $labels['recipient'] = 'Vastaanottaja'; -$labels['vacationaddresses'] = 'My additional e-mail addresse(s) (comma-separated):'; +$labels['vacationaddr'] = 'My additional e-mail addresse(s):'; $labels['vacationdays'] = 'How often send messages (in days):'; $labels['vacationinterval'] = 'How often send messages:'; $labels['days'] = 'days'; diff --git a/plugins/managesieve/localization/fr_FR.inc b/plugins/managesieve/localization/fr_FR.inc index 9be9f1054..821f9caab 100644 --- a/plugins/managesieve/localization/fr_FR.inc +++ b/plugins/managesieve/localization/fr_FR.inc @@ -18,7 +18,7 @@ $labels['filters'] = 'Filtres'; -$labels['managefilters'] = 'Gestion des filtres sur les mails entrants'; +$labels['managefilters'] = 'Gérer les filtres sur les courriels entrants'; $labels['filtername'] = 'Nom du filtre'; $labels['newfilter'] = 'Nouveau filtre'; $labels['filteradd'] = 'Ajouter un filtre'; @@ -49,17 +49,17 @@ $labels['messagesendcopy'] = 'Envoyer une copie du message à'; $labels['messagereply'] = 'Répondre avec le message'; $labels['messagedelete'] = 'Supprimer le message'; $labels['messagediscard'] = 'Rejeter avec le message'; -$labels['messagesrules'] = 'Pour les mails entrants:'; +$labels['messagesrules'] = 'Pour les courriels entrants :'; $labels['messagesactions'] = '...exécuter les actions suivantes:'; $labels['add'] = 'Ajouter'; $labels['del'] = 'Supprimer'; $labels['sender'] = 'Expéditeur'; $labels['recipient'] = 'Destinataire'; -$labels['vacationaddresses'] = 'Liste des destinataires (séparés par une virgule) :'; +$labels['vacationaddr'] = 'Mon/Mes adresse(s) de courriel additionnelle(s):'; $labels['vacationdays'] = 'Ne pas renvoyer un message avant (jours) :'; -$labels['vacationinterval'] = 'How often send messages:'; -$labels['days'] = 'days'; -$labels['seconds'] = 'seconds'; +$labels['vacationinterval'] = 'Comment envoyer les messages :'; +$labels['days'] = 'jours'; +$labels['seconds'] = 'secondes'; $labels['vacationreason'] = 'Corps du message (raison de l\'absence) :'; $labels['vacationsubject'] = 'Sujet du message:'; $labels['rulestop'] = 'Arrêter d\'évaluer les prochaines règles'; @@ -83,13 +83,13 @@ $labels['countisgreaterthanequal'] = 'total supérieur ou égal à'; $labels['countislessthan'] = 'total inférieur à'; $labels['countislessthanequal'] = 'total inférieur à'; $labels['countequals'] = 'total égal à'; -$labels['countnotequals'] = 'total différent de'; +$labels['countnotequals'] = 'le comptage n\'est pas égal à'; $labels['valueisgreaterthan'] = 'valeur supérieure à'; $labels['valueisgreaterthanequal'] = 'valeur supérieure ou égale à'; $labels['valueislessthan'] = 'valeur inférieure à'; $labels['valueislessthanequal'] = 'valeur inférieure ou égale à'; $labels['valueequals'] = 'valeur égale à'; -$labels['valuenotequals'] = 'valeur différente de'; +$labels['valuenotequals'] = 'la valeur n\'est pas égale à'; $labels['setflags'] = 'Mettre les marqueurs au message'; $labels['addflags'] = 'Ajouter les marqueurs au message'; $labels['removeflags'] = 'Supprimer les marqueurs du message'; @@ -121,6 +121,22 @@ $labels['filtercreate'] = 'Créer un filtre'; $labels['usedata'] = 'Utiliser les informations suivantes dans le filtre'; $labels['nextstep'] = 'Étape suivante'; $labels['...'] = '...'; +$labels['currdate'] = 'Date actuelle'; +$labels['datetest'] = 'Date'; +$labels['dateheader'] = 'header:'; +$labels['year'] = 'année'; +$labels['month'] = 'mois'; +$labels['day'] = 'jour'; +$labels['date'] = 'date (yyyy-mm-dd)'; +$labels['julian'] = 'date (julien)'; +$labels['hour'] = 'heure'; +$labels['minute'] = 'minute'; +$labels['second'] = 'seconde'; +$labels['time'] = 'heure (hh:mm:ss)'; +$labels['iso8601'] = 'date (ISO8601)'; +$labels['std11'] = 'date (RFC2822)'; +$labels['zone'] = 'fuseau horaire'; +$labels['weekday'] = 'jour de la semaine (0-6)'; $labels['advancedopts'] = 'Options avancées'; $labels['body'] = 'Corps du message'; $labels['address'] = 'adresse'; @@ -140,6 +156,8 @@ $labels['default'] = 'par défaut'; $labels['octet'] = 'strict (octet)'; $labels['asciicasemap'] = 'insensible à la casse (ascii-casemap)'; $labels['asciinumeric'] = 'numérique (ascii-numeric)'; +$labels['index'] = 'index:'; +$labels['indexlast'] = 'retour arrière'; $messages = array(); $messages['filterunknownerror'] = 'Erreur du serveur inconnue'; @@ -165,13 +183,14 @@ $messages['setcreateerror'] = 'Impossible de créer le groupe de filtres. Le ser $messages['setcreated'] = 'Le groupe de filtres a bien été créé.'; $messages['activateerror'] = 'Impossible d\'activer le(s) filtre(s) sélectionné(s). Une erreur serveur s\'est produite.'; $messages['deactivateerror'] = 'Impossible de désactiver le(s) filtre(s) sélectionné(s). Une erreur serveur s\'est produite.'; -$messages['deactivated'] = 'Filtre(s) activé(s) avec succès'; -$messages['activated'] = 'Filtre(s) désactivé(s) avec succès'; +$messages['deactivated'] = 'Filtre(s) désactivé(s) avec succès.'; +$messages['activated'] = 'Filtre(s) activé(s) avec succès.'; $messages['moved'] = 'Filtre déplacé avec succès.'; $messages['moveerror'] = 'Déplacement du filtre sélectionné impossible. Le serveur a renvoyé une erreur.'; $messages['nametoolong'] = 'Nom trop long.'; $messages['namereserved'] = 'Nom réservé.'; $messages['setexist'] = 'Ce groupe existe déjà.'; $messages['nodata'] = 'Au moins un élément doit être selectionné !'; +$messages['invaliddateformat'] = 'Date non valide ou format d\'une partie de la date'; ?> diff --git a/plugins/managesieve/localization/gl_ES.inc b/plugins/managesieve/localization/gl_ES.inc index 3f492ad46..185490a94 100644 --- a/plugins/managesieve/localization/gl_ES.inc +++ b/plugins/managesieve/localization/gl_ES.inc @@ -55,7 +55,7 @@ $labels['add'] = 'Engadir'; $labels['del'] = 'Eliminar'; $labels['sender'] = 'Remitente'; $labels['recipient'] = 'Destinatario'; -$labels['vacationaddresses'] = 'Lista de enderezos de correo de destinatarios adicionais (separados por comas):'; +$labels['vacationaddr'] = 'Lista de enderezos de correo de destinatarios adicionais:'; $labels['vacationdays'] = 'Cada canto enviar mensaxes (en días):'; $labels['vacationinterval'] = 'How often send messages:'; $labels['days'] = 'days'; diff --git a/plugins/managesieve/localization/he_IL.inc b/plugins/managesieve/localization/he_IL.inc index 0b2f67ede..932d4e5d6 100644 --- a/plugins/managesieve/localization/he_IL.inc +++ b/plugins/managesieve/localization/he_IL.inc @@ -55,7 +55,6 @@ $labels['add'] = 'הוספה'; $labels['del'] = 'מחיקה'; $labels['sender'] = 'השולח'; $labels['recipient'] = 'הנמען'; -$labels['vacationaddresses'] = 'כתובות דוא"ל נוספות שלי (מופרדות ע"י פסיקים)'; $labels['vacationdays'] = 'באיזו תדירות ( בימים ) לשלוח הודעות:'; $labels['vacationinterval'] = 'How often send messages:'; $labels['days'] = 'days'; diff --git a/plugins/managesieve/localization/hu_HU.inc b/plugins/managesieve/localization/hu_HU.inc index c7c648ded..ea59fa717 100644 --- a/plugins/managesieve/localization/hu_HU.inc +++ b/plugins/managesieve/localization/hu_HU.inc @@ -55,11 +55,11 @@ $labels['add'] = 'Hozzáadás'; $labels['del'] = 'Törlés'; $labels['sender'] = 'Feladó'; $labels['recipient'] = 'Címzett'; -$labels['vacationaddresses'] = 'További címzettek (vesszővel elválasztva):'; +$labels['vacationaddr'] = 'További címzettek:'; $labels['vacationdays'] = 'Válaszüzenet küldése ennyi naponként:'; -$labels['vacationinterval'] = 'How often send messages:'; -$labels['days'] = 'days'; -$labels['seconds'] = 'seconds'; +$labels['vacationinterval'] = 'Milyen gyakran küld üzeneteket:'; +$labels['days'] = 'napok'; +$labels['seconds'] = 'másodpercek'; $labels['vacationreason'] = 'Levél szövege (automatikus válasz):'; $labels['vacationsubject'] = 'Üzenet tárgya:'; $labels['rulestop'] = 'Műveletek végrehajtásának befejezése'; diff --git a/plugins/managesieve/localization/hy_AM.inc b/plugins/managesieve/localization/hy_AM.inc index 908175f1d..68837b065 100644 --- a/plugins/managesieve/localization/hy_AM.inc +++ b/plugins/managesieve/localization/hy_AM.inc @@ -55,7 +55,7 @@ $labels['add'] = 'Ավելացնել'; $labels['del'] = 'Ջնջել'; $labels['sender'] = 'Ուղարկող'; $labels['recipient'] = 'Ստացող'; -$labels['vacationaddresses'] = 'Իմ հավելյալ էլփոստի հասցեներ (բաժանված ստորակետներով).'; +$labels['vacationaddr'] = 'Իմ հավելյալ էլփոստի հասցեներ.'; $labels['vacationdays'] = 'Ինչ հաճախությամբ ուղարկել հաղորդագրությունները (օրեր)`'; $labels['vacationinterval'] = 'How often send messages:'; $labels['days'] = 'days'; diff --git a/plugins/managesieve/localization/ia.inc b/plugins/managesieve/localization/ia.inc index 45f6e5263..945de27d8 100644 --- a/plugins/managesieve/localization/ia.inc +++ b/plugins/managesieve/localization/ia.inc @@ -55,7 +55,7 @@ $labels['add'] = 'Add'; $labels['del'] = 'Delete'; $labels['sender'] = 'Sender'; $labels['recipient'] = 'Recipient'; -$labels['vacationaddresses'] = 'My additional e-mail addresse(s) (comma-separated):'; +$labels['vacationaddr'] = 'My additional e-mail addresse(s):'; $labels['vacationdays'] = 'How often send messages (in days):'; $labels['vacationinterval'] = 'How often send messages:'; $labels['days'] = 'days'; diff --git a/plugins/managesieve/localization/id_ID.inc b/plugins/managesieve/localization/id_ID.inc index a30c2a0b0..d98a326c1 100644 --- a/plugins/managesieve/localization/id_ID.inc +++ b/plugins/managesieve/localization/id_ID.inc @@ -55,7 +55,7 @@ $labels['add'] = 'Tambah'; $labels['del'] = 'Hapus'; $labels['sender'] = 'Pengirim'; $labels['recipient'] = 'Penerima'; -$labels['vacationaddresses'] = 'Alamat email tambahan saya (dipisahkan koma):'; +$labels['vacationaddr'] = 'Alamat email tambahan saya:'; $labels['vacationdays'] = 'Seberapa sering mengirim pesan (dalam hari):'; $labels['vacationinterval'] = 'How often send messages:'; $labels['days'] = 'days'; diff --git a/plugins/managesieve/localization/it_IT.inc b/plugins/managesieve/localization/it_IT.inc index 6fb2c424f..b54c46d9a 100644 --- a/plugins/managesieve/localization/it_IT.inc +++ b/plugins/managesieve/localization/it_IT.inc @@ -55,7 +55,7 @@ $labels['add'] = 'Aggiungi'; $labels['del'] = 'Elimina'; $labels['sender'] = 'Mittente'; $labels['recipient'] = 'Destinatario'; -$labels['vacationaddresses'] = 'Lista di indirizzi e-mail di destinatari addizionali (separati da virgola):'; +$labels['vacationaddr'] = 'Lista di indirizzi e-mail di destinatari addizionali:'; $labels['vacationdays'] = 'Ogni quanti giorni ribadire il messaggio allo stesso mittente'; $labels['vacationinterval'] = 'How often send messages:'; $labels['days'] = 'days'; diff --git a/plugins/managesieve/localization/ja_JP.inc b/plugins/managesieve/localization/ja_JP.inc index 0cd4f44b9..c8927d3f2 100644 --- a/plugins/managesieve/localization/ja_JP.inc +++ b/plugins/managesieve/localization/ja_JP.inc @@ -55,7 +55,7 @@ $labels['add'] = '追加'; $labels['del'] = '削除'; $labels['sender'] = '送信者'; $labels['recipient'] = '宛先'; -$labels['vacationaddresses'] = '電子メールの宛先の(コンマ区切った)追加のリスト:'; +$labels['vacationaddr'] = '電子メールの宛先の追加のリスト:'; $labels['vacationdays'] = 'メッセージを(1日に)送信する頻度:'; $labels['vacationinterval'] = 'メッセージを送信する頻度:'; $labels['days'] = '日'; diff --git a/plugins/managesieve/localization/ko_KR.inc b/plugins/managesieve/localization/ko_KR.inc index 5ab4fc220..1085f624d 100644 --- a/plugins/managesieve/localization/ko_KR.inc +++ b/plugins/managesieve/localization/ko_KR.inc @@ -55,7 +55,7 @@ $labels['add'] = '추가'; $labels['del'] = '삭제'; $labels['sender'] = '발신인'; $labels['recipient'] = '수신인'; -$labels['vacationaddresses'] = '나의 추가 이메일 주소 (쉼표로 구분됨):'; +$labels['vacationaddr'] = '나의 추가 이메일 주소:'; $labels['vacationdays'] = '메시지 발신 주기 (일):'; $labels['vacationinterval'] = 'How often send messages:'; $labels['days'] = 'days'; diff --git a/plugins/managesieve/localization/lb_LU.inc b/plugins/managesieve/localization/lb_LU.inc new file mode 100644 index 000000000..7494c0eb5 --- /dev/null +++ b/plugins/managesieve/localization/lb_LU.inc @@ -0,0 +1,196 @@ +<?php + +/* + +-----------------------------------------------------------------------+ + | plugins/managesieve/localization/<lang>.inc | + | | + | Localization file of the Roundcube Webmail Managesieve plugin | + | Copyright (C) 2012-2013, The Roundcube Dev Team | + | | + | Licensed under the GNU General Public License version 3 or | + | any later version with exceptions for skins & plugins. | + | See the README file for a full license statement. | + | | + +-----------------------------------------------------------------------+ + + For translation see https://www.transifex.com/projects/p/roundcube-webmail/resource/plugin-managesieve/ +*/ + + +$labels['filters'] = 'Filteren'; +$labels['managefilters'] = 'Filtere geréieren fir Mailen déi erakommen'; +$labels['filtername'] = 'Numm vum Filter'; +$labels['newfilter'] = 'Neie Filter'; +$labels['filteradd'] = 'Filter dobäisetzen'; +$labels['filterdel'] = 'Filter läschen'; +$labels['moveup'] = 'Eropréckelen'; +$labels['movedown'] = 'Erofréckelen'; +$labels['filterallof'] = 'all dës Reegele mussen zoutreffen'; +$labels['filteranyof'] = 'just eng vun de Reegele muss zoutreffen'; +$labels['filterany'] = 'all d\'Messagen'; +$labels['filtercontains'] = 'enthält'; +$labels['filternotcontains'] = 'enthält net'; +$labels['filteris'] = 'ass gläich'; +$labels['filterisnot'] = 'ass net gläich'; +$labels['filterexists'] = 'existéiert'; +$labels['filternotexists'] = 'existéiert net'; +$labels['filtermatches'] = 'matches expression'; +$labels['filternotmatches'] = 'not matches expression'; +$labels['filterregex'] = 'matches regular expression'; +$labels['filternotregex'] = 'not matches regular expression'; +$labels['filterunder'] = 'ënner'; +$labels['filterover'] = 'iwwer'; +$labels['addrule'] = 'Reegel dobäisetzen'; +$labels['delrule'] = 'Reegel läschen'; +$labels['messagemoveto'] = 'Message verréckelen an'; +$labels['messageredirect'] = 'Message ëmleeden an'; +$labels['messagecopyto'] = 'Message kopéieren an'; +$labels['messagesendcopy'] = 'Kopie vum Message schécken un'; +$labels['messagereply'] = 'Mat dësem Message äntweren'; +$labels['messagedelete'] = 'Message läschen'; +$labels['messagediscard'] = 'Discard with message'; +$labels['messagesrules'] = 'For incoming mail:'; +$labels['messagesactions'] = '...execute the following actions:'; +$labels['add'] = 'Dobäisetzen'; +$labels['del'] = 'Läschen'; +$labels['sender'] = 'Ofsender'; +$labels['recipient'] = 'Empfänger'; +$labels['vacationaddr'] = 'My additional e-mail addresse(s):'; +$labels['vacationdays'] = 'How often send messages (in days):'; +$labels['vacationinterval'] = 'How often send messages:'; +$labels['days'] = 'days'; +$labels['seconds'] = 'seconds'; +$labels['vacationreason'] = 'Message body (vacation reason):'; +$labels['vacationsubject'] = 'Message subject:'; +$labels['rulestop'] = 'Stop evaluating rules'; +$labels['enable'] = 'Enable/Disable'; +$labels['filterset'] = 'Filters set'; +$labels['filtersets'] = 'Filter sets'; +$labels['filtersetadd'] = 'Add filters set'; +$labels['filtersetdel'] = 'Delete current filters set'; +$labels['filtersetact'] = 'Activate current filters set'; +$labels['filtersetdeact'] = 'Deactivate current filters set'; +$labels['filterdef'] = 'Filter definition'; +$labels['filtersetname'] = 'Filters set name'; +$labels['newfilterset'] = 'New filters set'; +$labels['active'] = 'active'; +$labels['none'] = 'none'; +$labels['fromset'] = 'from set'; +$labels['fromfile'] = 'from file'; +$labels['filterdisabled'] = 'Filter disabled'; +$labels['countisgreaterthan'] = 'count is greater than'; +$labels['countisgreaterthanequal'] = 'count is greater than or equal to'; +$labels['countislessthan'] = 'count is less than'; +$labels['countislessthanequal'] = 'count is less than or equal to'; +$labels['countequals'] = 'count is equal to'; +$labels['countnotequals'] = 'count is not equal to'; +$labels['valueisgreaterthan'] = 'value is greater than'; +$labels['valueisgreaterthanequal'] = 'value is greater than or equal to'; +$labels['valueislessthan'] = 'value is less than'; +$labels['valueislessthanequal'] = 'value is less than or equal to'; +$labels['valueequals'] = 'value is equal to'; +$labels['valuenotequals'] = 'value is not equal to'; +$labels['setflags'] = 'Set flags to the message'; +$labels['addflags'] = 'Add flags to the message'; +$labels['removeflags'] = 'Remove flags from the message'; +$labels['flagread'] = 'Read'; +$labels['flagdeleted'] = 'Deleted'; +$labels['flaganswered'] = 'Answered'; +$labels['flagflagged'] = 'Flagged'; +$labels['flagdraft'] = 'Draft'; +$labels['setvariable'] = 'Set variable'; +$labels['setvarname'] = 'Variable name:'; +$labels['setvarvalue'] = 'Variable value:'; +$labels['setvarmodifiers'] = 'Modifiers:'; +$labels['varlower'] = 'lower-case'; +$labels['varupper'] = 'upper-case'; +$labels['varlowerfirst'] = 'first character lower-case'; +$labels['varupperfirst'] = 'first character upper-case'; +$labels['varquotewildcard'] = 'quote special characters'; +$labels['varlength'] = 'length'; +$labels['notify'] = 'Send notification'; +$labels['notifyaddress'] = 'To e-mail address:'; +$labels['notifybody'] = 'Notification body:'; +$labels['notifysubject'] = 'Notification subject:'; +$labels['notifyfrom'] = 'Notification sender:'; +$labels['notifyimportance'] = 'Importance:'; +$labels['notifyimportancelow'] = 'low'; +$labels['notifyimportancenormal'] = 'normal'; +$labels['notifyimportancehigh'] = 'high'; +$labels['filtercreate'] = 'Create filter'; +$labels['usedata'] = 'Use following data in the filter:'; +$labels['nextstep'] = 'Next Step'; +$labels['...'] = '...'; +$labels['currdate'] = 'Current date'; +$labels['datetest'] = 'Date'; +$labels['dateheader'] = 'header:'; +$labels['year'] = 'year'; +$labels['month'] = 'month'; +$labels['day'] = 'day'; +$labels['date'] = 'date (yyyy-mm-dd)'; +$labels['julian'] = 'date (julian)'; +$labels['hour'] = 'hour'; +$labels['minute'] = 'minute'; +$labels['second'] = 'second'; +$labels['time'] = 'time (hh:mm:ss)'; +$labels['iso8601'] = 'date (ISO8601)'; +$labels['std11'] = 'date (RFC2822)'; +$labels['zone'] = 'time-zone'; +$labels['weekday'] = 'weekday (0-6)'; +$labels['advancedopts'] = 'Advanced options'; +$labels['body'] = 'Body'; +$labels['address'] = 'address'; +$labels['envelope'] = 'envelope'; +$labels['modifier'] = 'modifier:'; +$labels['text'] = 'text'; +$labels['undecoded'] = 'undecoded (raw)'; +$labels['contenttype'] = 'content type'; +$labels['modtype'] = 'type:'; +$labels['allparts'] = 'all'; +$labels['domain'] = 'domain'; +$labels['localpart'] = 'local part'; +$labels['user'] = 'user'; +$labels['detail'] = 'detail'; +$labels['comparator'] = 'comparator:'; +$labels['default'] = 'default'; +$labels['octet'] = 'strict (octet)'; +$labels['asciicasemap'] = 'case insensitive (ascii-casemap)'; +$labels['asciinumeric'] = 'numeric (ascii-numeric)'; +$labels['index'] = 'index:'; +$labels['indexlast'] = 'backwards'; + +$messages = array(); +$messages['filterunknownerror'] = 'Unknown server error.'; +$messages['filterconnerror'] = 'Unable to connect to server.'; +$messages['filterdeleteerror'] = 'Unable to delete filter. Server error occured.'; +$messages['filterdeleted'] = 'Filter deleted successfully.'; +$messages['filtersaved'] = 'Filter saved successfully.'; +$messages['filtersaveerror'] = 'Unable to save filter. Server error occured.'; +$messages['filterdeleteconfirm'] = 'Do you really want to delete selected filter?'; +$messages['ruledeleteconfirm'] = 'Are you sure, you want to delete selected rule?'; +$messages['actiondeleteconfirm'] = 'Are you sure, you want to delete selected action?'; +$messages['forbiddenchars'] = 'Forbidden characters in field.'; +$messages['cannotbeempty'] = 'Field cannot be empty.'; +$messages['ruleexist'] = 'Filter with specified name already exists.'; +$messages['setactivateerror'] = 'Unable to activate selected filters set. Server error occured.'; +$messages['setdeactivateerror'] = 'Unable to deactivate selected filters set. Server error occured.'; +$messages['setdeleteerror'] = 'Unable to delete selected filters set. Server error occured.'; +$messages['setactivated'] = 'Filters set activated successfully.'; +$messages['setdeactivated'] = 'Filters set deactivated successfully.'; +$messages['setdeleted'] = 'Filters set deleted successfully.'; +$messages['setdeleteconfirm'] = 'Are you sure, you want to delete selected filters set?'; +$messages['setcreateerror'] = 'Unable to create filters set. Server error occured.'; +$messages['setcreated'] = 'Filters set created successfully.'; +$messages['activateerror'] = 'Unable to enable selected filter(s). Server error occured.'; +$messages['deactivateerror'] = 'Unable to disable selected filter(s). Server error occured.'; +$messages['deactivated'] = 'Filter(s) disabled successfully.'; +$messages['activated'] = 'Filter(s) enabled successfully.'; +$messages['moved'] = 'Filter moved successfully.'; +$messages['moveerror'] = 'Unable to move selected filter. Server error occured.'; +$messages['nametoolong'] = 'Name too long.'; +$messages['namereserved'] = 'Reserved name.'; +$messages['setexist'] = 'Set already exists.'; +$messages['nodata'] = 'At least one position must be selected!'; +$messages['invaliddateformat'] = 'Invalid date or date part format'; + +?> diff --git a/plugins/managesieve/localization/lt_LT.inc b/plugins/managesieve/localization/lt_LT.inc index fecd3d6bc..3b6f4eec4 100644 --- a/plugins/managesieve/localization/lt_LT.inc +++ b/plugins/managesieve/localization/lt_LT.inc @@ -55,7 +55,7 @@ $labels['add'] = 'Pridėti'; $labels['del'] = 'Pašalinti'; $labels['sender'] = 'Siuntėjas'; $labels['recipient'] = 'Gavėjas'; -$labels['vacationaddresses'] = 'Papildomas gavėjų adresų sąrašas (skirti kableliais):'; +$labels['vacationaddr'] = 'Papildomas gavėjų adresų sąrašas:'; $labels['vacationdays'] = 'Kaip dažnai išsiųsti laiškus (dienomis):'; $labels['vacationinterval'] = 'How often send messages:'; $labels['days'] = 'days'; diff --git a/plugins/managesieve/localization/lv_LV.inc b/plugins/managesieve/localization/lv_LV.inc index f1f85c2e0..02b4eeffa 100644 --- a/plugins/managesieve/localization/lv_LV.inc +++ b/plugins/managesieve/localization/lv_LV.inc @@ -30,7 +30,7 @@ $labels['filteranyof'] = 'jāatbilst jebkuram no sekojošajiem nosacījumiem'; $labels['filterany'] = 'visām vēstulēm'; $labels['filtercontains'] = 'satur'; $labels['filternotcontains'] = 'nesatur'; -$labels['filteris'] = 'vienāds ar'; +$labels['filteris'] = 'ir vienāds ar'; $labels['filterisnot'] = 'nav vienāds ar'; $labels['filterexists'] = 'eksistē'; $labels['filternotexists'] = 'neeksistē'; @@ -46,20 +46,20 @@ $labels['messagemoveto'] = 'Pārvietot vēstuli uz'; $labels['messageredirect'] = 'Pāradresēt vēstuli uz'; $labels['messagecopyto'] = 'Kopēt vēstuli uz'; $labels['messagesendcopy'] = 'Pārsūtīt vēstules kopiju uz'; -$labels['messagereply'] = 'Atbildēt ar'; +$labels['messagereply'] = 'Atbildēt ar vēstuli'; $labels['messagedelete'] = 'Dzēst vēstuli'; $labels['messagediscard'] = 'Dzēst vēstuli un atbildēt'; $labels['messagesrules'] = 'Ienākošajām vēstulēm:'; -$labels['messagesactions'] = 'Izpildīt sekojošās darbības:'; +$labels['messagesactions'] = '...izpildīt sekojošās darbības:'; $labels['add'] = 'Pievienot'; $labels['del'] = 'Dzēst'; $labels['sender'] = 'Sūtītājs'; $labels['recipient'] = 'Saņēmējs'; -$labels['vacationaddresses'] = 'Ievadiet vienu vai vairākus e-pastu(s), atdalot tos komatu:'; +$labels['vacationaddr'] = 'Mana(s) papildus e-pasta adrese(s):'; $labels['vacationdays'] = 'Cik dienu laikā vienam un tam pašam sūtītājam neatbildēt atkārtoti (piem., 7):'; -$labels['vacationinterval'] = 'How often send messages:'; -$labels['days'] = 'days'; -$labels['seconds'] = 'seconds'; +$labels['vacationinterval'] = 'Cik bieži sūtīt vēstules:'; +$labels['days'] = 'dienas'; +$labels['seconds'] = 'sekundes'; $labels['vacationreason'] = 'Atvaļinājuma paziņojuma teksts:'; $labels['vacationsubject'] = 'Vēstules tēma:'; $labels['rulestop'] = 'Apturēt nosacījumu pārbaudi'; @@ -78,16 +78,16 @@ $labels['none'] = 'nav'; $labels['fromset'] = 'no kopas'; $labels['fromfile'] = 'no faila'; $labels['filterdisabled'] = 'Filtrs atslēgts'; -$labels['countisgreaterthan'] = 'skaits ir lielāks nekā'; -$labels['countisgreaterthanequal'] = 'skaits ir vienāds vai lielāks nekā'; -$labels['countislessthan'] = 'skaits ir mazāks nekā'; -$labels['countislessthanequal'] = 'skaits ir vienāds vai mazāks nekā'; +$labels['countisgreaterthan'] = 'skaits ir lielāks kā'; +$labels['countisgreaterthanequal'] = 'skaits ir vienāds vai lielāks kā'; +$labels['countislessthan'] = 'skaits ir mazāks kā'; +$labels['countislessthanequal'] = 'skaits ir vienāds vai mazāks kā'; $labels['countequals'] = 'skaits ir vienāds ar'; $labels['countnotequals'] = 'skaits nav vienāds ar'; -$labels['valueisgreaterthan'] = 'vērtība ir lielāka nekā'; -$labels['valueisgreaterthanequal'] = 'vērtība ir vienāda vai lielāka nekā'; -$labels['valueislessthan'] = 'vērtība ir mazāka nekā'; -$labels['valueislessthanequal'] = 'vērtība ir vienāda vai mazāka nekā'; +$labels['valueisgreaterthan'] = 'vērtība ir lielāka kā'; +$labels['valueisgreaterthanequal'] = 'vērtība ir vienāda vai lielāka kā'; +$labels['valueislessthan'] = 'vērtība ir mazāka kā'; +$labels['valueislessthanequal'] = 'vērtība ir vienāda vai mazāka kā'; $labels['valueequals'] = 'vērtība ir vienāda ar'; $labels['valuenotequals'] = 'vērtība nav vienāda ar'; $labels['setflags'] = 'Marķēt vēstuli'; @@ -96,82 +96,101 @@ $labels['removeflags'] = 'Noņemt vēstulei marķierus'; $labels['flagread'] = 'Lasītas'; $labels['flagdeleted'] = 'Dzēstas'; $labels['flaganswered'] = 'Atbildētas'; -$labels['flagflagged'] = 'Iezīmētās'; +$labels['flagflagged'] = 'Marķētas'; $labels['flagdraft'] = 'Melnraksts'; -$labels['setvariable'] = 'Set variable'; -$labels['setvarname'] = 'Variable name:'; -$labels['setvarvalue'] = 'Variable value:'; -$labels['setvarmodifiers'] = 'Modifiers:'; -$labels['varlower'] = 'lower-case'; -$labels['varupper'] = 'upper-case'; -$labels['varlowerfirst'] = 'first character lower-case'; -$labels['varupperfirst'] = 'first character upper-case'; -$labels['varquotewildcard'] = 'quote special characters'; -$labels['varlength'] = 'length'; -$labels['notify'] = 'Send notification'; -$labels['notifyaddress'] = 'To e-mail address:'; -$labels['notifybody'] = 'Notification body:'; -$labels['notifysubject'] = 'Notification subject:'; -$labels['notifyfrom'] = 'Notification sender:'; -$labels['notifyimportance'] = 'Importance:'; -$labels['notifyimportancelow'] = 'low'; -$labels['notifyimportancenormal'] = 'normal'; -$labels['notifyimportancehigh'] = 'high'; +$labels['setvariable'] = 'Iestatīt mainīgo'; +$labels['setvarname'] = 'Mainīgā nosaukums:'; +$labels['setvarvalue'] = 'Mainīgā vērtība:'; +$labels['setvarmodifiers'] = 'Modifikatori:'; +$labels['varlower'] = 'mazie burti'; +$labels['varupper'] = 'lielie burti'; +$labels['varlowerfirst'] = 'pirmais burts kā mazais burts'; +$labels['varupperfirst'] = 'pirmais burts kā lielais burts'; +$labels['varquotewildcard'] = '"citēt" speciālās rakstzīmes'; +$labels['varlength'] = 'garums'; +$labels['notify'] = 'Sūtīt paziņojumus'; +$labels['notifyaddress'] = 'Uz e-pasta adresi:'; +$labels['notifybody'] = 'Paziņojuma teksts:'; +$labels['notifysubject'] = 'Paziņojuma tēma:'; +$labels['notifyfrom'] = 'Paziņojuma sūtītājs:'; +$labels['notifyimportance'] = 'Svarīgums:'; +$labels['notifyimportancelow'] = 'zems'; +$labels['notifyimportancenormal'] = 'parasts'; +$labels['notifyimportancehigh'] = 'augsts'; $labels['filtercreate'] = 'Izveidot filtru'; $labels['usedata'] = 'Filtrā izmantot sekojošus datus'; $labels['nextstep'] = 'Nākamais solis'; $labels['...'] = '...'; -$labels['advancedopts'] = 'Paplašināti iestatījumi'; +$labels['currdate'] = 'Pašreizējais datums'; +$labels['datetest'] = 'Datums'; +$labels['dateheader'] = 'galvene:'; +$labels['year'] = 'gads'; +$labels['month'] = 'mēnesis'; +$labels['day'] = 'diena'; +$labels['date'] = 'datums (gggg-mm-dd)'; +$labels['julian'] = 'datums (Jūlija kalendārs)'; +$labels['hour'] = 'stunda'; +$labels['minute'] = 'minūte'; +$labels['second'] = 'sekunde'; +$labels['time'] = 'laiks (hh:mm:ss)'; +$labels['iso8601'] = 'datums (ISO8601)'; +$labels['std11'] = 'datums (RFC2822)'; +$labels['zone'] = 'laikajosla'; +$labels['weekday'] = 'nedēļas diena (0-6)'; +$labels['advancedopts'] = 'Paplašinātie iestatījumi'; $labels['body'] = 'Pamatteksts'; $labels['address'] = 'adresāts'; $labels['envelope'] = 'aploksne'; $labels['modifier'] = 'modifikators:'; $labels['text'] = 'teksts'; -$labels['undecoded'] = 'neatkodēts (jēldati)'; +$labels['undecoded'] = 'neatkodēts (neapstrādāti dati)'; $labels['contenttype'] = 'satura tips'; $labels['modtype'] = 'tips:'; $labels['allparts'] = 'viss'; $labels['domain'] = 'domēns'; -$labels['localpart'] = 'vietējā daļa'; +$labels['localpart'] = 'lokālā daļa'; $labels['user'] = 'lietotājs'; $labels['detail'] = 'detaļas'; -$labels['comparator'] = 'komparators'; -$labels['default'] = 'noklusējums'; -$labels['octet'] = 'strikti (oktets)'; +$labels['comparator'] = 'salīdzinātājs'; +$labels['default'] = 'noklusētā vērtība'; +$labels['octet'] = 'precīzs (oktets)'; $labels['asciicasemap'] = 'reģistrnejutīgs (ascii tabula)'; $labels['asciinumeric'] = 'skaitļu (ascii skaitļu)'; +$labels['index'] = 'indekss:'; +$labels['indexlast'] = '"backwards"'; $messages = array(); -$messages['filterunknownerror'] = 'Nezināma servera kļūda'; -$messages['filterconnerror'] = 'Neizdevās pieslēgties ManageSieve serverim'; -$messages['filterdeleteerror'] = 'Neizdevās dzēst filtru. Servera iekšējā kļūda'; -$messages['filterdeleted'] = 'Filtrs veiksmīgi izdzēsts'; -$messages['filtersaved'] = 'Filtrs veiksmīgi saglabāts'; -$messages['filtersaveerror'] = 'Neizdevās saglabāt filtru. Servera iekšējā kļūda'; -$messages['filterdeleteconfirm'] = 'Vai tiešām vēlaties dzēst atzīmēto filtru?'; -$messages['ruledeleteconfirm'] = 'Vai tiešām vēlaties dzēst atzīmēto nosacījumu?'; -$messages['actiondeleteconfirm'] = 'Vai tiešām vēlaties dzēst atzīmēto darbību?'; -$messages['forbiddenchars'] = 'Lauks satur aizliegtus simbolus'; -$messages['cannotbeempty'] = 'Lauks nedrīkst būt tukšs'; -$messages['ruleexist'] = 'Filter with specified name already exists.'; -$messages['setactivateerror'] = 'Neizdevās aktivizēt atzīmēto filtru kopu. Servera iekšējā kļūda'; -$messages['setdeactivateerror'] = 'Neizdevās deaktivizēt atzīmēto filtru kopu. Servera iekšējā kļūda'; -$messages['setdeleteerror'] = 'Neizdevās izdzēst atzīmēto filtru kopu. Servera iekšējā kļūda'; -$messages['setactivated'] = 'Filtru kopa veiksmīgi aktivizēta'; -$messages['setdeactivated'] = 'Filtru kopa veiksmīgi deaktivizēta'; -$messages['setdeleted'] = 'Filtru kopa veiksmīgi izdzēsta'; -$messages['setdeleteconfirm'] = 'Vai tiešām vēlaties dzēst atzīmēto filtru kopu?'; -$messages['setcreateerror'] = 'Neizdevās izveidot filtru kopu. Servera iekšējā kļūda'; -$messages['setcreated'] = 'Filtru kopa veiksmīgi izveidota'; -$messages['activateerror'] = 'Unable to enable selected filter(s). Server error occured.'; -$messages['deactivateerror'] = 'Unable to disable selected filter(s). Server error occured.'; -$messages['deactivated'] = 'Filter(s) disabled successfully.'; -$messages['activated'] = 'Filter(s) enabled successfully.'; -$messages['moved'] = 'Filter moved successfully.'; -$messages['moveerror'] = 'Unable to move selected filter. Server error occured.'; -$messages['nametoolong'] = 'Neizdevās izveidot filtru kopu. Pārāk garš kopas nosaukums'; -$messages['namereserved'] = 'Reserved name.'; -$messages['setexist'] = 'Set already exists.'; -$messages['nodata'] = 'At least one position must be selected!'; +$messages['filterunknownerror'] = 'Nezināma servera kļūda.'; +$messages['filterconnerror'] = 'Neizdevās pieslēgties ManageSieve serverim.'; +$messages['filterdeleteerror'] = 'Neizdevās izdzēst filtru - servera kļūda.'; +$messages['filterdeleted'] = 'Filtrs veiksmīgi izdzēsts.'; +$messages['filtersaved'] = 'Filtrs veiksmīgi saglabāts.'; +$messages['filtersaveerror'] = 'Neizdevās saglabāt filtru - servera kļūda.'; +$messages['filterdeleteconfirm'] = 'Vai Jūs tiešām vēlaties dzēst atzīmēto filtru?'; +$messages['ruledeleteconfirm'] = 'Vai Jūs tiešām vēlaties dzēst atzīmēto nosacījumu?'; +$messages['actiondeleteconfirm'] = 'Vai Jūs tiešām vēlaties dzēst atzīmēto darbību?'; +$messages['forbiddenchars'] = 'Lauks satur aizliegtus simbolus.'; +$messages['cannotbeempty'] = 'Lauks nedrīkst būt tukšs.'; +$messages['ruleexist'] = 'Filtrs ar tādu nosaukumu jau pastāv.'; +$messages['setactivateerror'] = 'Neizdevās aktivizēt atzīmēto filtru kopu - servera kļūda.'; +$messages['setdeactivateerror'] = 'Neizdevās deaktivizēt atzīmēto filtru kopu - servera kļūda.'; +$messages['setdeleteerror'] = 'Neizdevās izdzēst atzīmēto filtru kopu - servera kļūda.'; +$messages['setactivated'] = 'Filtru kopa veiksmīgi aktivizēta.'; +$messages['setdeactivated'] = 'Filtru kopa veiksmīgi deaktivizēta.'; +$messages['setdeleted'] = 'Filtru kopa veiksmīgi izdzēsta.'; +$messages['setdeleteconfirm'] = 'Vai tiešām Jūs vēlaties dzēst atzīmēto filtru kopu?'; +$messages['setcreateerror'] = 'Neizdevās izveidot filtru kopu - servera kļūda.'; +$messages['setcreated'] = 'Filtru kopa veiksmīgi izveidota.'; +$messages['activateerror'] = 'Nav iespējams ieslēgt izvēlēto(s) filtru(s) - servera kļūda.'; +$messages['deactivateerror'] = 'Nav iespējams atslēgt izvēlēto(s) filtru(s) - servera kļūda.'; +$messages['deactivated'] = 'Filtrs(i) veiksmīgi atslēgts(i).'; +$messages['activated'] = 'Filtrs(i) veiksmīgi ieslēgts(i).'; +$messages['moved'] = 'Filtrs veiksmīgi pārvietots.'; +$messages['moveerror'] = 'Nav iespējams pārvietot izvēlēto filtru - servera kļūda.'; +$messages['nametoolong'] = 'Neizdevās izveidot filtru kopu. Pārāk garš kopas nosaukums.'; +$messages['namereserved'] = 'Rezervētais nosaukums.'; +$messages['setexist'] = 'Kopa jau eksistē.'; +$messages['nodata'] = 'Ir jābūt atzīmētai vismaz vienai pozīcijai!'; +$messages['invaliddateformat'] = 'Nederīgs datums vai datuma formāts'; ?> diff --git a/plugins/managesieve/localization/ml_IN.inc b/plugins/managesieve/localization/ml_IN.inc index 67cd6829f..761b4305b 100644 --- a/plugins/managesieve/localization/ml_IN.inc +++ b/plugins/managesieve/localization/ml_IN.inc @@ -55,7 +55,6 @@ $labels['add'] = 'ചേര്ക്കു'; $labels['del'] = 'നീക്കം ചെയ്യുക'; $labels['sender'] = 'അയചയാള്'; $labels['recipient'] = 'സ്വീകര്ത്താവ്'; -$labels['vacationaddresses'] = 'സ്വീകര്ത്താവിന്റെ ഇമെയില് വിലാസങ്ങളുടെ അധികമുള്ള പട്ടിക (കോമയിട്ട് തിരിച്ച)'; $labels['vacationdays'] = 'എത്ര ഭിവസം കൂടുമ്പോള് സന്ദേശം അയക്കണം:'; $labels['vacationinterval'] = 'How often send messages:'; $labels['days'] = 'days'; diff --git a/plugins/managesieve/localization/mr_IN.inc b/plugins/managesieve/localization/mr_IN.inc index 3339737e0..082ea9bc6 100644 --- a/plugins/managesieve/localization/mr_IN.inc +++ b/plugins/managesieve/localization/mr_IN.inc @@ -55,7 +55,7 @@ $labels['add'] = 'समावेश करा'; $labels['del'] = 'नष्ट करा'; $labels['sender'] = 'प्रेषक'; $labels['recipient'] = 'Recipient'; -$labels['vacationaddresses'] = 'My additional e-mail addresse(s) (comma-separated):'; +$labels['vacationaddr'] = 'My additional e-mail addresse(s):'; $labels['vacationdays'] = 'How often send messages (in days):'; $labels['vacationinterval'] = 'How often send messages:'; $labels['days'] = 'days'; diff --git a/plugins/managesieve/localization/nb_NO.inc b/plugins/managesieve/localization/nb_NO.inc index 39653b8a1..c3bf98f8b 100644 --- a/plugins/managesieve/localization/nb_NO.inc +++ b/plugins/managesieve/localization/nb_NO.inc @@ -55,8 +55,11 @@ $labels['add'] = 'Legg til'; $labels['del'] = 'Slett'; $labels['sender'] = 'Avsender'; $labels['recipient'] = 'Mottaker'; -$labels['vacationaddresses'] = 'Liste med mottakeradresser (adskilt med komma):'; +$labels['vacationaddr'] = 'Liste med mottakeradresser:'; $labels['vacationdays'] = 'Periode mellom meldinger (i dager):'; +$labels['vacationinterval'] = 'Periode mellom meldinger:'; +$labels['days'] = 'dager'; +$labels['seconds'] = 'sekunder'; $labels['vacationreason'] = 'Innhold (begrunnelse for fravær)'; $labels['vacationsubject'] = 'Meldingsemne:'; $labels['rulestop'] = 'Stopp evaluering av regler'; @@ -95,21 +98,21 @@ $labels['flagdeleted'] = 'Slettet'; $labels['flaganswered'] = 'Besvart'; $labels['flagflagged'] = 'Flagget'; $labels['flagdraft'] = 'Utkast'; -$labels['setvariable'] = 'Set variable'; +$labels['setvariable'] = 'Set variabel'; $labels['setvarname'] = 'Variabelnavn:'; -$labels['setvarvalue'] = 'Variable value:'; -$labels['setvarmodifiers'] = 'Modifiers:'; +$labels['setvarvalue'] = 'Variabel verdi:'; +$labels['setvarmodifiers'] = 'Modifikator:'; $labels['varlower'] = 'med små bokstaver'; $labels['varupper'] = 'med store bokstaver'; -$labels['varlowerfirst'] = 'first character lower-case'; -$labels['varupperfirst'] = 'first character upper-case'; -$labels['varquotewildcard'] = 'quote special characters'; +$labels['varlowerfirst'] = 'første tegn liten bokstav'; +$labels['varupperfirst'] = 'første tegn stor bokstav'; +$labels['varquotewildcard'] = 'sitér spesialtegn'; $labels['varlength'] = 'lengde'; $labels['notify'] = 'Send melding'; $labels['notifyaddress'] = 'Til e-postadresse:'; -$labels['notifybody'] = 'Notification body:'; -$labels['notifysubject'] = 'Notification subject:'; -$labels['notifyfrom'] = 'Notification sender:'; +$labels['notifybody'] = 'Varseltekst:'; +$labels['notifysubject'] = 'Varselemne:'; +$labels['notifyfrom'] = 'Varselavsender:'; $labels['notifyimportance'] = 'Viktighet:'; $labels['notifyimportancelow'] = 'lav'; $labels['notifyimportancenormal'] = 'normal'; diff --git a/plugins/managesieve/localization/nl_NL.inc b/plugins/managesieve/localization/nl_NL.inc index 1fd6eee4e..80c2274b1 100644 --- a/plugins/managesieve/localization/nl_NL.inc +++ b/plugins/managesieve/localization/nl_NL.inc @@ -55,7 +55,7 @@ $labels['add'] = 'Toevoegen'; $labels['del'] = 'Verwijderen'; $labels['sender'] = 'Afzender'; $labels['recipient'] = 'Ontvanger'; -$labels['vacationaddresses'] = 'Aanvullende lijst van geadresseerden (gescheiden met komma\'s):'; +$labels['vacationaddr'] = 'Aanvullende lijst van geadresseerden:'; $labels['vacationdays'] = 'Hoe vaak moet een bericht verstuurd worden (in dagen):'; $labels['vacationinterval'] = 'Hoe vaak moet een bericht verstuurd worden:'; $labels['days'] = 'dagen'; diff --git a/plugins/managesieve/localization/nn_NO.inc b/plugins/managesieve/localization/nn_NO.inc index 69af8cde4..03563a72b 100644 --- a/plugins/managesieve/localization/nn_NO.inc +++ b/plugins/managesieve/localization/nn_NO.inc @@ -55,7 +55,7 @@ $labels['add'] = 'Legg til'; $labels['del'] = 'Slett'; $labels['sender'] = 'Avsendar'; $labels['recipient'] = 'Mottakar'; -$labels['vacationaddresses'] = 'Liste med mottakaradresser (komma-separert):'; +$labels['vacationaddr'] = 'Liste med mottakaradresser:'; $labels['vacationdays'] = 'Periode mellom meldingar (i dagar):'; $labels['vacationreason'] = 'Innhald (grunngjeving for fråvær)'; $labels['vacationsubject'] = 'Meldingsemne:'; diff --git a/plugins/managesieve/localization/pl_PL.inc b/plugins/managesieve/localization/pl_PL.inc index f2ec96eb9..799f0fb54 100644 --- a/plugins/managesieve/localization/pl_PL.inc +++ b/plugins/managesieve/localization/pl_PL.inc @@ -55,11 +55,11 @@ $labels['add'] = 'Dodaj'; $labels['del'] = 'Usuń'; $labels['sender'] = 'Nadawca'; $labels['recipient'] = 'Odbiorca'; -$labels['vacationaddresses'] = 'Lista dodatkowych adresów odbiorców (oddzielonych przecinkami):'; +$labels['vacationaddr'] = 'Dodatkowy/e adres(y) e-mail:'; $labels['vacationdays'] = 'Częstotliwość wysyłania wiadomości (w dniach):'; -$labels['vacationinterval'] = 'How often send messages:'; -$labels['days'] = 'days'; -$labels['seconds'] = 'seconds'; +$labels['vacationinterval'] = 'Jak często wysyłać wiadomości:'; +$labels['days'] = 'dni'; +$labels['seconds'] = 'sekundy'; $labels['vacationreason'] = 'Treść (przyczyna nieobecności):'; $labels['vacationsubject'] = 'Temat wiadomości:'; $labels['rulestop'] = 'Przerwij przetwarzanie reguł'; @@ -83,13 +83,13 @@ $labels['countisgreaterthanequal'] = 'ilość jest równa lub większa od'; $labels['countislessthan'] = 'ilość jest mniejsza od'; $labels['countislessthanequal'] = 'ilość jest równa lub mniejsza od'; $labels['countequals'] = 'ilość jest równa'; -$labels['countnotequals'] = 'ilość jest różna od'; +$labels['countnotequals'] = 'ilość nie jest równa'; $labels['valueisgreaterthan'] = 'wartość jest większa od'; $labels['valueisgreaterthanequal'] = 'wartość jest równa lub większa od'; $labels['valueislessthan'] = 'wartość jest mniejsza od'; $labels['valueislessthanequal'] = 'wartość jest równa lub mniejsza od'; $labels['valueequals'] = 'wartość jest równa'; -$labels['valuenotequals'] = 'wartość jest różna od'; +$labels['valuenotequals'] = 'wartość nie jest równa'; $labels['setflags'] = 'Ustaw flagi wiadomości'; $labels['addflags'] = 'Dodaj flagi do wiadomości'; $labels['removeflags'] = 'Usuń flagi wiadomości'; @@ -121,6 +121,22 @@ $labels['filtercreate'] = 'Utwórz filtr'; $labels['usedata'] = 'Użyj następujących danych do utworzenia filtra:'; $labels['nextstep'] = 'Następny krok'; $labels['...'] = '...'; +$labels['currdate'] = 'Bieżąca data'; +$labels['datetest'] = 'Data'; +$labels['dateheader'] = 'nagłówek:'; +$labels['year'] = 'rok'; +$labels['month'] = 'miesiąc'; +$labels['day'] = 'dzień'; +$labels['date'] = 'data (rrrr-mm-dd)'; +$labels['julian'] = 'data (kalendarz juliański)'; +$labels['hour'] = 'godzina'; +$labels['minute'] = 'minuta'; +$labels['second'] = 'sekunda'; +$labels['time'] = 'czas (gg:mm:ss)'; +$labels['iso8601'] = 'data (ISO8601)'; +$labels['std11'] = 'data (RFC2822)'; +$labels['zone'] = 'Strefa czasowa'; +$labels['weekday'] = 'dzień tygodnia (0-6)'; $labels['advancedopts'] = 'Zaawansowane opcje'; $labels['body'] = 'Treść'; $labels['address'] = 'adres'; @@ -140,6 +156,8 @@ $labels['default'] = 'domyślny'; $labels['octet'] = 'dokładny (octet)'; $labels['asciicasemap'] = 'nierozróżniający wielkości liter (ascii-casemap)'; $labels['asciinumeric'] = 'numeryczny (ascii-numeric)'; +$labels['index'] = 'indeks:'; +$labels['indexlast'] = 'wstecz'; $messages = array(); $messages['filterunknownerror'] = 'Nieznany błąd serwera.'; @@ -173,5 +191,6 @@ $messages['nametoolong'] = 'Zbyt długa nazwa.'; $messages['namereserved'] = 'Nazwa zarezerwowana.'; $messages['setexist'] = 'Zbiór już istnieje.'; $messages['nodata'] = 'Należy wybrać co najmniej jedną pozycję!'; +$messages['invaliddateformat'] = 'Nieprawidłowy format daty lub fragmentu daty'; ?> diff --git a/plugins/managesieve/localization/pt_BR.inc b/plugins/managesieve/localization/pt_BR.inc index fb4699fd2..cd96c49ca 100644 --- a/plugins/managesieve/localization/pt_BR.inc +++ b/plugins/managesieve/localization/pt_BR.inc @@ -55,11 +55,11 @@ $labels['add'] = 'Adicionar'; $labels['del'] = 'Excluir'; $labels['sender'] = 'Remetente'; $labels['recipient'] = 'Destinatário'; -$labels['vacationaddresses'] = 'Lista adicional de e-mails destinatários (separado por vírgula):'; +$labels['vacationaddr'] = 'Meus endereços de e-mail adicionais:'; $labels['vacationdays'] = 'Enviar mensagens com que frequência (em dias):'; -$labels['vacationinterval'] = 'How often send messages:'; -$labels['days'] = 'days'; -$labels['seconds'] = 'seconds'; +$labels['vacationinterval'] = 'Como geralmente enviam mensagens:'; +$labels['days'] = 'dias'; +$labels['seconds'] = 'segundos'; $labels['vacationreason'] = 'Corpo da mensagem (motivo de férias):'; $labels['vacationsubject'] = 'Título da mensagem:'; $labels['rulestop'] = 'Parar de avaliar regras'; @@ -121,6 +121,22 @@ $labels['filtercreate'] = 'Criar filtro'; $labels['usedata'] = 'Usar os seguintes dados no filtro:'; $labels['nextstep'] = 'Próximo Passo'; $labels['...'] = '...'; +$labels['currdate'] = 'Data atual'; +$labels['datetest'] = 'Data'; +$labels['dateheader'] = 'cabeçalho:'; +$labels['year'] = 'ano'; +$labels['month'] = 'mês'; +$labels['day'] = 'dia'; +$labels['date'] = 'data (aaaa-mm-dd)'; +$labels['julian'] = 'data (calendário juliano)'; +$labels['hour'] = 'hora'; +$labels['minute'] = 'minuto'; +$labels['second'] = 'segundo'; +$labels['time'] = 'hora (hh:mm:ss)'; +$labels['iso8601'] = 'data (ISO8601)'; +$labels['std11'] = 'data (RFC2822)'; +$labels['zone'] = 'fuso horário'; +$labels['weekday'] = 'dia da semana (0-6)'; $labels['advancedopts'] = 'Opções avançadas'; $labels['body'] = 'Corpo'; $labels['address'] = 'endereço'; @@ -140,6 +156,8 @@ $labels['default'] = 'padrão'; $labels['octet'] = 'estrito (octeto)'; $labels['asciicasemap'] = 'caso insensível (mapa de caracteres ascii)'; $labels['asciinumeric'] = 'numérico (ascii-numeric)'; +$labels['index'] = 'índice:'; +$labels['indexlast'] = 'retroceder'; $messages = array(); $messages['filterunknownerror'] = 'Erro desconhecido de servidor'; @@ -173,5 +191,6 @@ $messages['nametoolong'] = 'Nome muito longo.'; $messages['namereserved'] = 'Nome reservado.'; $messages['setexist'] = 'Conjunto já existe.'; $messages['nodata'] = 'Pelo menos uma posição precisa ser selecionada!'; +$messages['invaliddateformat'] = 'Data inválida'; ?> diff --git a/plugins/managesieve/localization/pt_PT.inc b/plugins/managesieve/localization/pt_PT.inc index bfb3f296a..f51e8bf5e 100644 --- a/plugins/managesieve/localization/pt_PT.inc +++ b/plugins/managesieve/localization/pt_PT.inc @@ -55,7 +55,7 @@ $labels['add'] = 'Adicionar'; $labels['del'] = 'Eliminar'; $labels['sender'] = 'Remetente'; $labels['recipient'] = 'Destinatário'; -$labels['vacationaddresses'] = 'Lista adicional de destinatários de e-mails (separados por vírgula):'; +$labels['vacationaddr'] = 'Lista adicional de destinatários de e-mails:'; $labels['vacationdays'] = 'Enviar mensagens com que frequência (em dias):'; $labels['vacationinterval'] = 'Com que frequência envia mensagens:'; $labels['days'] = 'dias'; diff --git a/plugins/managesieve/localization/ro_RO.inc b/plugins/managesieve/localization/ro_RO.inc index 2c917cbdd..8d6e9c96f 100644 --- a/plugins/managesieve/localization/ro_RO.inc +++ b/plugins/managesieve/localization/ro_RO.inc @@ -55,7 +55,7 @@ $labels['add'] = 'Adaugă'; $labels['del'] = 'Șterge'; $labels['sender'] = 'Expeditor'; $labels['recipient'] = 'Destinatar'; -$labels['vacationaddresses'] = 'Adresele mele de e-mail adiționale (împărțite cu virgulă):'; +$labels['vacationaddr'] = 'Adresele mele de e-mail adiționale:'; $labels['vacationdays'] = 'Cât de des să trimit mesajele (în zile):'; $labels['vacationinterval'] = 'How often send messages:'; $labels['days'] = 'days'; diff --git a/plugins/managesieve/localization/ru_RU.inc b/plugins/managesieve/localization/ru_RU.inc index b05074c22..f922bcf22 100644 --- a/plugins/managesieve/localization/ru_RU.inc +++ b/plugins/managesieve/localization/ru_RU.inc @@ -55,11 +55,11 @@ $labels['add'] = 'Добавить'; $labels['del'] = 'Удалить'; $labels['sender'] = 'Отправитель'; $labels['recipient'] = 'Получатель'; -$labels['vacationaddresses'] = 'Список моих дополнительных адресов (разделённых запятыми):'; +$labels['vacationaddr'] = 'Мои дополнительные адреса:'; $labels['vacationdays'] = 'Как часто отправлять сообщения (в днях):'; -$labels['vacationinterval'] = 'How often send messages:'; -$labels['days'] = 'days'; -$labels['seconds'] = 'seconds'; +$labels['vacationinterval'] = 'Как часто отправлять сообщения:'; +$labels['days'] = 'дней'; +$labels['seconds'] = 'секунд'; $labels['vacationreason'] = 'Текст сообщения (причина отсутствия):'; $labels['vacationsubject'] = 'Тема сообщения:'; $labels['rulestop'] = 'Закончить выполнение'; @@ -121,6 +121,22 @@ $labels['filtercreate'] = 'Создать фильтр'; $labels['usedata'] = 'Использовать следующие данные в фильтре:'; $labels['nextstep'] = 'Далее'; $labels['...'] = '...'; +$labels['currdate'] = 'Текущая дата'; +$labels['datetest'] = 'Дата'; +$labels['dateheader'] = 'заголовок:'; +$labels['year'] = 'год'; +$labels['month'] = 'месяц'; +$labels['day'] = 'день'; +$labels['date'] = 'дата (гггг-мм-дд)'; +$labels['julian'] = 'дата (юлианская)'; +$labels['hour'] = 'час'; +$labels['minute'] = 'минута'; +$labels['second'] = 'секунда'; +$labels['time'] = 'время (чч:мм:сс)'; +$labels['iso8601'] = 'дата (ISO8601)'; +$labels['std11'] = 'дата (RFC2822)'; +$labels['zone'] = 'часовой пояс'; +$labels['weekday'] = 'день недели (0-6)'; $labels['advancedopts'] = 'Дополнительные параметры'; $labels['body'] = 'Тело письма'; $labels['address'] = 'адрес'; @@ -140,6 +156,8 @@ $labels['default'] = 'по умолчанию'; $labels['octet'] = 'Строгий (octet)'; $labels['asciicasemap'] = 'Регистронезависимый (ascii-casemap)'; $labels['asciinumeric'] = 'Числовой (ascii-numeric)'; +$labels['index'] = 'индекс:'; +$labels['indexlast'] = 'наоборот'; $messages = array(); $messages['filterunknownerror'] = 'Неизвестная ошибка сервера'; @@ -173,5 +191,6 @@ $messages['nametoolong'] = 'Невозможно создать набор фи $messages['namereserved'] = 'Зарезервированное имя.'; $messages['setexist'] = 'Набор уже существует.'; $messages['nodata'] = 'Нужно выбрать хотя бы одну позицию!'; +$messages['invaliddateformat'] = 'Неверная дата или формат части даты'; ?> diff --git a/plugins/managesieve/localization/si_LK.inc b/plugins/managesieve/localization/si_LK.inc index afc2e3851..378fcf15d 100644 --- a/plugins/managesieve/localization/si_LK.inc +++ b/plugins/managesieve/localization/si_LK.inc @@ -55,7 +55,6 @@ $labels['add'] = 'එක් කරන්න'; $labels['del'] = 'මකන්න'; $labels['sender'] = 'යවන්නා'; $labels['recipient'] = 'ලබන්නා'; -$labels['vacationaddresses'] = 'My additional e-mail addresse(s) (comma-separated):'; $labels['vacationdays'] = 'How often send messages (in days):'; $labels['vacationinterval'] = 'How often send messages:'; $labels['days'] = 'days'; diff --git a/plugins/managesieve/localization/sk_SK.inc b/plugins/managesieve/localization/sk_SK.inc index f336cf2c5..9bfb2ef8f 100644 --- a/plugins/managesieve/localization/sk_SK.inc +++ b/plugins/managesieve/localization/sk_SK.inc @@ -55,7 +55,7 @@ $labels['add'] = 'Pridaj'; $labels['del'] = 'Zmaž'; $labels['sender'] = 'Odosielateľ'; $labels['recipient'] = 'Adresát'; -$labels['vacationaddresses'] = 'Dodatoční príjemcovia správy (oddelení čiarkami):'; +$labels['vacationaddr'] = 'Dodatoční príjemcovia správy:'; $labels['vacationdays'] = 'Počet dní medzi odoslaním správy:'; $labels['vacationinterval'] = 'How often send messages:'; $labels['days'] = 'days'; diff --git a/plugins/managesieve/localization/sl_SI.inc b/plugins/managesieve/localization/sl_SI.inc index f1c3b983b..aa82078f1 100644 --- a/plugins/managesieve/localization/sl_SI.inc +++ b/plugins/managesieve/localization/sl_SI.inc @@ -55,11 +55,11 @@ $labels['add'] = 'Dodaj'; $labels['del'] = 'Izbriši'; $labels['sender'] = 'Pošiljatelj'; $labels['recipient'] = 'Prejemnik'; -$labels['vacationaddresses'] = 'Dodaten seznam naslovov prejemnikov (ločenih z vejico):'; +$labels['vacationaddr'] = 'Moji dodatni e-naslovi'; $labels['vacationdays'] = 'Kako pogosto naj bodo sporočila poslana (v dnevih):'; -$labels['vacationinterval'] = 'How often send messages:'; -$labels['days'] = 'days'; -$labels['seconds'] = 'seconds'; +$labels['vacationinterval'] = 'Sporočila pošlji na:'; +$labels['days'] = 'dni'; +$labels['seconds'] = 'sekund'; $labels['vacationreason'] = 'Vsebina sporočila (vzrok za odsotnost):'; $labels['vacationsubject'] = 'Zadeva sporočila'; $labels['rulestop'] = 'Prekini z izvajanjem pravil'; @@ -83,13 +83,13 @@ $labels['countisgreaterthanequal'] = 'seštevek je večji ali enak'; $labels['countislessthan'] = 'seštevek je manjši od'; $labels['countislessthanequal'] = 'seštevel je manjši ali enak'; $labels['countequals'] = 'seštevek je enak'; -$labels['countnotequals'] = 'seštevek ni enak'; +$labels['countnotequals'] = 'vsota ne ustreza'; $labels['valueisgreaterthan'] = 'vrednost je večja od'; $labels['valueisgreaterthanequal'] = 'vrednost je večja ali enaka'; $labels['valueislessthan'] = 'vrednost je manjša od'; $labels['valueislessthanequal'] = 'vrednost je manjša ali enaka'; $labels['valueequals'] = 'vrednost je enaka'; -$labels['valuenotequals'] = 'vrednost je neenaka'; +$labels['valuenotequals'] = 'vrednost ni enaka'; $labels['setflags'] = 'Označi sporočilo'; $labels['addflags'] = 'Označi sporočilo'; $labels['removeflags'] = 'Odstrani zaznamke s sporočil'; @@ -121,6 +121,22 @@ $labels['filtercreate'] = 'Ustvari filter'; $labels['usedata'] = 'Pri stvarjanju filtra uporabi naslednje podatke'; $labels['nextstep'] = 'Naslednji korak'; $labels['...'] = '...'; +$labels['currdate'] = 'Današnji datum'; +$labels['datetest'] = 'Datum'; +$labels['dateheader'] = 'glava:'; +$labels['year'] = 'leto'; +$labels['month'] = 'mesec'; +$labels['day'] = 'dan'; +$labels['date'] = 'datum(yyyy-mm-dd)'; +$labels['julian'] = 'datum (julijanski)'; +$labels['hour'] = 'ura'; +$labels['minute'] = 'minuta'; +$labels['second'] = 'sekunda'; +$labels['time'] = 'čas'; +$labels['iso8601'] = 'datum (ISO8601)'; +$labels['std11'] = 'datum (RFC2822)'; +$labels['zone'] = 'časovni pas'; +$labels['weekday'] = 'dan v tednu (0-6)'; $labels['advancedopts'] = 'Dodatne možnosti'; $labels['body'] = 'Vsebina'; $labels['address'] = 'naslov'; @@ -140,6 +156,8 @@ $labels['default'] = 'privzeto'; $labels['octet'] = 'strict (octet)'; $labels['asciicasemap'] = 'ni občutljiv na velike/male črke (ascii-casemap)'; $labels['asciinumeric'] = 'numerično (ascii-numeric)'; +$labels['index'] = 'indeks:'; +$labels['indexlast'] = 'obraten vrstni red'; $messages = array(); $messages['filterunknownerror'] = 'Prišlo je do neznane napake.'; @@ -173,5 +191,6 @@ $messages['nametoolong'] = 'Ime je predolgo.'; $messages['namereserved'] = 'Rezervirano ime.'; $messages['setexist'] = 'Nastavitev filtra že obstaja.'; $messages['nodata'] = 'Izbrana mora biti vsaj ena nastavitev!'; +$messages['invaliddateformat'] = 'Neveljaven datum ali oblika zapisa datuma'; ?> diff --git a/plugins/managesieve/localization/sv_SE.inc b/plugins/managesieve/localization/sv_SE.inc index 49d5b1222..f2aeddd9f 100644 --- a/plugins/managesieve/localization/sv_SE.inc +++ b/plugins/managesieve/localization/sv_SE.inc @@ -55,7 +55,7 @@ $labels['add'] = 'Lägg till'; $labels['del'] = 'Ta bort'; $labels['sender'] = 'Avsändare'; $labels['recipient'] = 'Mottagare'; -$labels['vacationaddresses'] = 'Ytterligare mottagaradresser (avdelade med kommatecken)'; +$labels['vacationaddr'] = 'Ytterligare mottagaradresser:'; $labels['vacationdays'] = 'Antal dagar mellan auto-svar:'; $labels['vacationinterval'] = 'Tid mellan auto-svar:'; $labels['days'] = 'Dagar'; diff --git a/plugins/managesieve/localization/tr_TR.inc b/plugins/managesieve/localization/tr_TR.inc index c36869d29..19bbb2e8e 100644 --- a/plugins/managesieve/localization/tr_TR.inc +++ b/plugins/managesieve/localization/tr_TR.inc @@ -55,8 +55,8 @@ $labels['add'] = 'Ekle'; $labels['del'] = 'Sil'; $labels['sender'] = 'Gönderici'; $labels['recipient'] = 'Alıcı'; -$labels['vacationaddresses'] = 'İlave e-posta adreslerim(virgül ile ayrılmış)'; -$labels['vacationdays'] = 'Ne sıklıkla mesajlar gönderilir(gün)'; +$labels['vacationaddr'] = 'İlave e-posta adreslerim:'; +$labels['vacationdays'] = 'Ne sıklıkla mesajlar gönderilir(gün):'; $labels['vacationinterval'] = 'Ne kadar sıklıkla mesaj gönderirsiniz:'; $labels['days'] = 'günler'; $labels['seconds'] = 'saniyeler'; @@ -165,8 +165,8 @@ $messages['setcreateerror'] = 'Filtre setleri oluşturulamadı. Sunucuda hata ol $messages['setcreated'] = 'Filtre setleri başarıyla oluşturuldu.'; $messages['activateerror'] = 'Seçilen filtre(ler) etkinleştirilemedi. Sunucuda hata oluştu.'; $messages['deactivateerror'] = 'Seçilen filtre(ler) pasifleştirilemedi. Sunucuda hata oluştu.'; -$messages['deactivated'] = 'Filtre(ler) başarıyla etkinleştirildi.'; -$messages['activated'] = 'Filtre(ler) başarıyla iptal edildi.'; +$messages['deactivated'] = 'Filtre(ler) başarıyla iptal edildi.'; +$messages['activated'] = 'Filtre(ler) başarıyla etkinleştirildi.'; $messages['moved'] = 'Filtre başarıyla taşındı.'; $messages['moveerror'] = 'Seçilen filtre(ler) taşınamadı. Sunucuda hata oluştu.'; $messages['nametoolong'] = 'İsim çok uzun.'; diff --git a/plugins/managesieve/localization/uk_UA.inc b/plugins/managesieve/localization/uk_UA.inc index 41623df35..57cab9ea5 100644 --- a/plugins/managesieve/localization/uk_UA.inc +++ b/plugins/managesieve/localization/uk_UA.inc @@ -55,7 +55,7 @@ $labels['add'] = 'Додати'; $labels['del'] = 'Видалити'; $labels['sender'] = 'Відправник'; $labels['recipient'] = 'Отримувач'; -$labels['vacationaddresses'] = 'Додатковий список адрес отримувачів (розділених комою)'; +$labels['vacationaddr'] = 'Додатковий список адрес отримувачів:'; $labels['vacationdays'] = 'Як часто повторювати (у днях):'; $labels['vacationinterval'] = 'How often send messages:'; $labels['days'] = 'days'; diff --git a/plugins/managesieve/localization/vi_VN.inc b/plugins/managesieve/localization/vi_VN.inc index 8d6fcd348..6e65cccf5 100644 --- a/plugins/managesieve/localization/vi_VN.inc +++ b/plugins/managesieve/localization/vi_VN.inc @@ -55,7 +55,7 @@ $labels['add'] = 'Thêm'; $labels['del'] = 'Xoá'; $labels['sender'] = 'Người gửi'; $labels['recipient'] = 'Người nhận'; -$labels['vacationaddresses'] = 'Địa chỉ email bổ sung của tôi ( phân cách bằng dấu phẩy)'; +$labels['vacationaddr'] = 'Địa chỉ email bổ sung của tôi'; $labels['vacationdays'] = 'Số lần gửi thư (trong ngày)'; $labels['vacationreason'] = 'Nội dung chính'; $labels['vacationsubject'] = 'Tiêu đề thư'; diff --git a/plugins/managesieve/localization/zh_CN.inc b/plugins/managesieve/localization/zh_CN.inc index 79b705c54..106fb40fc 100644 --- a/plugins/managesieve/localization/zh_CN.inc +++ b/plugins/managesieve/localization/zh_CN.inc @@ -55,7 +55,7 @@ $labels['add'] = '添加'; $labels['del'] = '删除'; $labels['sender'] = '发件人'; $labels['recipient'] = '收件人'; -$labels['vacationaddresses'] = '收件人地址的附加名单(以半角逗号分隔)'; +$labels['vacationaddr'] = '收件人地址的附加名单'; $labels['vacationdays'] = '发送邮件频率(单位:天):'; $labels['vacationinterval'] = 'How often send messages:'; $labels['days'] = 'days'; diff --git a/plugins/managesieve/localization/zh_TW.inc b/plugins/managesieve/localization/zh_TW.inc index 3f3fc1313..047ebcccc 100644 --- a/plugins/managesieve/localization/zh_TW.inc +++ b/plugins/managesieve/localization/zh_TW.inc @@ -55,7 +55,7 @@ $labels['add'] = '新增'; $labels['del'] = '刪除'; $labels['sender'] = '寄件者'; $labels['recipient'] = '收件者'; -$labels['vacationaddresses'] = '其他收件者(用半形逗號隔開):'; +$labels['vacationaddr'] = '其他收件者:'; $labels['vacationdays'] = '多久回覆一次(單位:天):'; $labels['vacationinterval'] = 'How often send messages:'; $labels['days'] = 'days'; diff --git a/plugins/managesieve/managesieve.js b/plugins/managesieve/managesieve.js index 04b9a76af..5201284fa 100644 --- a/plugins/managesieve/managesieve.js +++ b/plugins/managesieve/managesieve.js @@ -55,6 +55,11 @@ if (window.rcmail) { } $('input[type="text"]:first', rcmail.gui_objects.sieveform).focus(); + + // initialize smart list inputs + $('textarea[data-type="list"]', rcmail.gui_objects.sieveform).each(function() { + smart_field_init(this); + }); } else { rcmail.enable_command('plugin.managesieve-add', 'plugin.managesieve-setadd', !rcmail.env.sieveconnerror); @@ -258,7 +263,7 @@ rcube_webmail.prototype.managesieve_updatelist = function(action, o) var i, row = $('#rcmrow'+this.managesieve_rowid(o.id)); if (o.name) - $('td', row).html(o.name); + $('td', row).text(o.name); if (o.disabled) row.addClass('disabled'); else @@ -273,7 +278,7 @@ rcube_webmail.prototype.managesieve_updatelist = function(action, o) var list = this.filters_list, row = $('<tr><td class="name"></td></tr>'); - $('td', row).html(o.name); + $('td', row).text(o.name); row.attr('id', 'rcmrow'+o.id); if (o.disabled) row.addClass('disabled'); @@ -297,7 +302,7 @@ rcube_webmail.prototype.managesieve_updatelist = function(action, o) tr = document.createElement('TR'); td = document.createElement('TD'); - td.innerHTML = el.name; + $(td).text(el.name); td.className = 'name'; tr.id = 'rcmrow' + el.id; if (el['class']) @@ -346,7 +351,7 @@ rcube_webmail.prototype.managesieve_updatelist = function(action, o) list = this.filtersets_list, row = $('<tr class="disabled"><td class="name"></td></tr>'); - $('td', row).html(o.name); + $('td', row).text(o.name); row.attr('id', 'rcmrow'+id); this.env.filtersets[id] = o.name; @@ -469,6 +474,11 @@ rcube_webmail.prototype.managesieve_rulefill = function(content, id, after) row.className = 'rulerow'; row.innerHTML = content; + // initialize smart list inputs + $('textarea[data-type="list"]', row).each(function() { + smart_field_init(this); + }); + this.managesieve_formbuttons(div); } }; @@ -565,40 +575,45 @@ function rule_header_select(id) var obj = document.getElementById('header' + id), size = document.getElementById('rule_size' + id), op = document.getElementById('rule_op' + id), - target = document.getElementById('rule_target' + id), - header = document.getElementById('custom_header' + id), + header = document.getElementById('custom_header' + id + '_list'), mod = document.getElementById('rule_mod' + id), trans = document.getElementById('rule_trans' + id), - comp = document.getElementById('rule_comp' + id); + comp = document.getElementById('rule_comp' + id), + datepart = document.getElementById('rule_date_part' + id), + dateheader = document.getElementById('rule_date_header_div' + id), + h = obj.value; - if (obj.value == 'size') { + if (h == 'size') { size.style.display = 'inline'; - op.style.display = 'none'; - target.style.display = 'none'; - header.style.display = 'none'; - mod.style.display = 'none'; - trans.style.display = 'none'; - comp.style.display = 'none'; + $.each([op, header, mod, trans, comp], function() { this.style.display = 'none'; }); } else { - header.style.display = obj.value != '...' ? 'none' : 'inline'; + header.style.display = h != '...' ? 'none' : 'inline-block'; size.style.display = 'none'; op.style.display = 'inline'; comp.style.display = ''; - rule_op_select(id); - mod.style.display = obj.value == 'body' ? 'none' : 'block'; - trans.style.display = obj.value == 'body' ? 'block' : 'none'; + mod.style.display = h == 'body' || h == 'currentdate' || h == 'date' ? 'none' : 'block'; + trans.style.display = h == 'body' ? 'block' : 'none'; } - obj.style.width = obj.value == '...' ? '40px' : ''; + if (datepart) + datepart.style.display = h == 'currentdate' || h == 'date' ? 'inline' : 'none'; + if (dateheader) + dateheader.style.display = h == 'date' ? '' : 'none'; + + rule_op_select(op, id, h); + rule_mod_select(id, h); + obj.style.width = h == '...' ? '40px' : ''; }; -function rule_op_select(id) +function rule_op_select(obj, id, header) { - var obj = document.getElementById('rule_op' + id), - target = document.getElementById('rule_target' + id); + var target = document.getElementById('rule_target' + id + '_list'); - target.style.display = obj.value == 'exists' || obj.value == 'notexists' ? 'none' : 'inline'; + if (!header) + header = document.getElementById('header' + id).value; + + target.style.display = obj.value == 'exists' || obj.value == 'notexists' || header == 'size' ? 'none' : 'inline-block'; }; function rule_trans_select(id) @@ -609,12 +624,19 @@ function rule_trans_select(id) target.style.display = obj.value != 'content' ? 'none' : 'inline'; }; -function rule_mod_select(id) +function rule_mod_select(id, header) { var obj = document.getElementById('rule_mod_op' + id), - target = document.getElementById('rule_mod_type' + id); + target = document.getElementById('rule_mod_type' + id), + index = document.getElementById('rule_index_div' + id); + + if (!header) + header = document.getElementById('header' + id).value; target.style.display = obj.value != 'address' && obj.value != 'envelope' ? 'none' : 'inline'; + + if (index) + index.style.display = header != 'body' && header != 'currentdate' && header != 'size' && obj.value != 'envelope' ? '' : 'none'; }; function rule_join_radio(value) @@ -638,8 +660,9 @@ function rule_adv_switch(id, elem) function action_type_select(id) { +console.log(id); var obj = document.getElementById('action_type' + id), - enabled = {}, + v = obj.value, enabled = {}, elems = { mailbox: document.getElementById('action_mailbox' + id), target: document.getElementById('action_target' + id), @@ -650,25 +673,25 @@ function action_type_select(id) notify: document.getElementById('action_notify' + id) }; - if (obj.value == 'fileinto' || obj.value == 'fileinto_copy') { + if (v == 'fileinto' || v == 'fileinto_copy') { enabled.mailbox = 1; } - else if (obj.value == 'redirect' || obj.value == 'redirect_copy') { + else if (v == 'redirect' || v == 'redirect_copy') { enabled.target = 1; } - else if (obj.value.match(/^reject|ereject$/)) { + else if (v.match(/^reject|ereject$/)) { enabled.target_area = 1; } - else if (obj.value.match(/^(add|set|remove)flag$/)) { + else if (v.match(/^(add|set|remove)flag$/)) { enabled.flags = 1; } - else if (obj.value == 'vacation') { + else if (v == 'vacation') { enabled.vacation = 1; } - else if (obj.value == 'set') { + else if (v == 'set') { enabled.set = 1; } - else if (obj.value == 'notify') { + else if (v == 'notify') { enabled.notify = 1; } @@ -677,6 +700,72 @@ function action_type_select(id) } }; +// Inititalizes smart list input +function smart_field_init(field) +{ + var id = field.id + '_list', + area = $('<span class="listarea"></span>'), + list = field.value ? field.value.split("\n") : ['']; + + if ($('#'+id).length) + return; + + // add input rows + $.each(list, function(i, v) { + area.append(smart_field_row(v, field.name, i, $(field).data('size'))); + }); + + area.attr('id', id); + field = $(field); + + if (field.attr('disabled')) + area.hide(); + + field.after(area); + + if (field.hasClass('error')) { + area.addClass('error'); + rcmail.managesieve_tip_register([[id, field.data('tip')]]); + } +}; + +function smart_field_row(value, name, idx, size) +{ + // build row element content + var input, content = '<span class="listelement">' + + '<span class="reset"></span><input type="text"></span>', + elem = $(content), + attrs = {value: value, name: name + '[]'}; + + if (size) + attrs.size = size; + + input = $('input', elem).attr(attrs).keydown(function(e) { + var input = $(this); + // element creation event (on Enter) + if (e.which == 13) { + var name = input.attr('name').replace(/\[\]$/, ''), + dt = (new Date()).getTime(), + elem = smart_field_row('', name, dt, size); + + input.parent().after(elem); + $('input', elem).focus(); + } + }); + + // element deletion event + $('span[class="reset"]', elem).click(function() { + var span = $(this.parentNode); + + if (span.parent().children().length > 1) + span.remove(); + else + $('input', span).val('').focus(); + }); + + return elem; +} + // Register onmouse(leave/enter) events for tips on specified form element rcube_webmail.prototype.managesieve_tip_register = function(tips) { @@ -685,25 +774,26 @@ rcube_webmail.prototype.managesieve_tip_register = function(tips) for (var n in tips) { $('#'+tips[n][0]) - .bind('mouseenter', {str: tips[n][1]}, - function(e) { - var offset = $(this).offset(), - left = offset.left, - top = offset.top - 12, - minwidth = $(this).width(); - - if (framed) { - offset = $((rcmail.env.task == 'mail' ? '#sievefilterform > iframe' : '#filter-box'), parent.document).offset(); - top += offset.top; - left += offset.left; - } - - tip.html(e.data.str) - top -= tip.height(); - - tip.css({left: left, top: top, minWidth: (minwidth-2) + 'px'}).show(); - }) - .bind('mouseleave', function(e) { tip.hide(); }); + .data('tip', tips[n][1]) + .bind('mouseenter', function(e) { + var elem = $(this), + offset = elem.offset(), + left = offset.left, + top = offset.top - 12, + minwidth = elem.width(); + + if (framed) { + offset = $((rcmail.env.task == 'mail' ? '#sievefilterform > iframe' : '#filter-box'), parent.document).offset(); + top += offset.top; + left += offset.left; + } + + tip.html(elem.data('tip')); + top -= tip.height(); + + tip.css({left: left, top: top, minWidth: (minwidth-2) + 'px'}).show(); + }) + .bind('mouseleave', function(e) { tip.hide(); }); } }; diff --git a/plugins/managesieve/managesieve.php b/plugins/managesieve/managesieve.php index 817fa8650..6970193c2 100644 --- a/plugins/managesieve/managesieve.php +++ b/plugins/managesieve/managesieve.php @@ -12,60 +12,28 @@ * * Configuration (see config.inc.php.dist) * - * Copyright (C) 2008-2012, The Roundcube Dev Team - * Copyright (C) 2011-2012, Kolab Systems AG + * Copyright (C) 2008-2013, The Roundcube Dev Team + * Copyright (C) 2011-2013, Kolab Systems AG * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 - * as published by the Free Software Foundation. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see http://www.gnu.org/licenses/. */ class managesieve extends rcube_plugin { public $task = 'mail|settings'; - private $rc; - private $sieve; - private $errors; - private $form; - private $tips = array(); - private $script = array(); - private $exts = array(); - private $list; - private $active = array(); - private $headers = array( - 'subject' => 'Subject', - 'from' => 'From', - 'to' => 'To', - ); - private $addr_headers = array( - // Required - "from", "to", "cc", "bcc", "sender", "resent-from", "resent-to", - // Additional (RFC 822 / RFC 2822) - "reply-to", "resent-reply-to", "resent-sender", "resent-cc", "resent-bcc", - // Non-standard (RFC 2076, draft-palme-mailext-headers-08.txt) - "for-approval", "for-handling", "for-comment", "apparently-to", "errors-to", - "delivered-to", "return-receipt-to", "x-admin", "read-receipt-to", - "x-confirm-reading-to", "return-receipt-requested", - "registered-mail-reply-requested-by", "mail-followup-to", "mail-reply-to", - "abuse-reports-to", "x-complaints-to", "x-report-abuse-to", - // Undocumented - "x-beenthere", - ); - - const VERSION = '6.2'; - const PROGNAME = 'Roundcube (Managesieve)'; - const PORT = 4190; - + private $engine; function init() { @@ -92,10 +60,11 @@ class managesieve extends rcube_plugin /** * Initializes plugin's UI (localization, js script) */ - private function init_ui() + function init_ui() { - if ($this->ui_initialized) + if ($this->ui_initialized) { return; + } // load localization $this->add_texts('localization/', array('filters','managefilters')); @@ -109,6 +78,11 @@ class managesieve extends rcube_plugin */ function mail_task_handler() { + // make sure we're not in ajax request + if ($this->rc->output->type != 'html') { + return; + } + // use jQuery for popup window $this->require_plugin('jqueryui'); @@ -180,352 +154,18 @@ class managesieve extends rcube_plugin } /** - * Loads configuration, initializes plugin (including sieve connection) + * Plugin action handler */ - function managesieve_start() - { - $this->load_config(); - - // register UI objects - $this->rc->output->add_handlers(array( - 'filterslist' => array($this, 'filters_list'), - 'filtersetslist' => array($this, 'filtersets_list'), - 'filterframe' => array($this, 'filter_frame'), - 'filterform' => array($this, 'filter_form'), - 'filtersetform' => array($this, 'filterset_form'), - )); - - // Add include path for internal classes - $include_path = $this->home . '/lib' . PATH_SEPARATOR; - $include_path .= ini_get('include_path'); - set_include_path($include_path); - - // Get connection parameters - $host = $this->rc->config->get('managesieve_host', 'localhost'); - $port = $this->rc->config->get('managesieve_port'); - $tls = $this->rc->config->get('managesieve_usetls', false); - - $host = rcube_utils::parse_host($host); - $host = rcube_utils::idn_to_ascii($host); - - // remove tls:// prefix, set TLS flag - if (($host = preg_replace('|^tls://|i', '', $host, 1, $cnt)) && $cnt) { - $tls = true; - } - - if (empty($port)) { - $port = getservbyname('sieve', 'tcp'); - if (empty($port)) { - $port = self::PORT; - } - } - - $plugin = $this->rc->plugins->exec_hook('managesieve_connect', array( - 'user' => $_SESSION['username'], - 'password' => $this->rc->decrypt($_SESSION['password']), - 'host' => $host, - 'port' => $port, - 'usetls' => $tls, - 'auth_type' => $this->rc->config->get('managesieve_auth_type'), - 'disabled' => $this->rc->config->get('managesieve_disabled_extensions'), - 'debug' => $this->rc->config->get('managesieve_debug', false), - 'auth_cid' => $this->rc->config->get('managesieve_auth_cid'), - 'auth_pw' => $this->rc->config->get('managesieve_auth_pw'), - )); - - // try to connect to managesieve server and to fetch the script - $this->sieve = new rcube_sieve( - $plugin['user'], - $plugin['password'], - $plugin['host'], - $plugin['port'], - $plugin['auth_type'], - $plugin['usetls'], - $plugin['disabled'], - $plugin['debug'], - $plugin['auth_cid'], - $plugin['auth_pw'] - ); - - if (!($error = $this->sieve->error())) { - // Get list of scripts - $list = $this->list_scripts(); - - if (!empty($_GET['_set']) || !empty($_POST['_set'])) { - $script_name = rcube_utils::get_input_value('_set', rcube_utils::INPUT_GPC, true); - } - else if (!empty($_SESSION['managesieve_current'])) { - $script_name = $_SESSION['managesieve_current']; - } - else { - // get (first) active script - if (!empty($this->active[0])) { - $script_name = $this->active[0]; - } - else if ($list) { - $script_name = $list[0]; - } - // create a new (initial) script - else { - // if script not exists build default script contents - $script_file = $this->rc->config->get('managesieve_default'); - $script_name = $this->rc->config->get('managesieve_script_name'); - - if (empty($script_name)) - $script_name = 'roundcube'; - - if ($script_file && is_readable($script_file)) - $content = file_get_contents($script_file); - - // add script and set it active - if ($this->sieve->save_script($script_name, $content)) { - $this->activate_script($script_name); - $this->list[] = $script_name; - } - } - } - - if ($script_name) { - $this->sieve->load($script_name); - } - - $error = $this->sieve->error(); - } - - // finally set script objects - if ($error) { - switch ($error) { - case SIEVE_ERROR_CONNECTION: - case SIEVE_ERROR_LOGIN: - $this->rc->output->show_message('managesieve.filterconnerror', 'error'); - break; - default: - $this->rc->output->show_message('managesieve.filterunknownerror', 'error'); - break; - } - - rcube::raise_error(array('code' => 403, 'type' => 'php', - 'file' => __FILE__, 'line' => __LINE__, - 'message' => "Unable to connect to managesieve on $host:$port"), true, false); - - // to disable 'Add filter' button set env variable - $this->rc->output->set_env('filterconnerror', true); - $this->script = array(); - } - else { - $this->exts = $this->sieve->get_extensions(); - $this->script = $this->sieve->script->as_array(); - $this->rc->output->set_env('currentset', $this->sieve->current); - $_SESSION['managesieve_current'] = $this->sieve->current; - } - - return $error; - } - function managesieve_actions() { $this->init_ui(); - - $error = $this->managesieve_start(); - - // Handle user requests - if ($action = rcube_utils::get_input_value('_act', rcube_utils::INPUT_GPC)) { - $fid = (int) rcube_utils::get_input_value('_fid', rcube_utils::INPUT_POST); - - if ($action == 'delete' && !$error) { - if (isset($this->script[$fid])) { - if ($this->sieve->script->delete_rule($fid)) - $result = $this->save_script(); - - if ($result === true) { - $this->rc->output->show_message('managesieve.filterdeleted', 'confirmation'); - $this->rc->output->command('managesieve_updatelist', 'del', array('id' => $fid)); - } else { - $this->rc->output->show_message('managesieve.filterdeleteerror', 'error'); - } - } - } - else if ($action == 'move' && !$error) { - if (isset($this->script[$fid])) { - $to = (int) rcube_utils::get_input_value('_to', rcube_utils::INPUT_POST); - $rule = $this->script[$fid]; - - // remove rule - unset($this->script[$fid]); - $this->script = array_values($this->script); - - // add at target position - if ($to >= count($this->script)) { - $this->script[] = $rule; - } - else { - $script = array(); - foreach ($this->script as $idx => $r) { - if ($idx == $to) - $script[] = $rule; - $script[] = $r; - } - $this->script = $script; - } - - $this->sieve->script->content = $this->script; - $result = $this->save_script(); - - if ($result === true) { - $result = $this->list_rules(); - - $this->rc->output->show_message('managesieve.moved', 'confirmation'); - $this->rc->output->command('managesieve_updatelist', 'list', - array('list' => $result, 'clear' => true, 'set' => $to)); - } else { - $this->rc->output->show_message('managesieve.moveerror', 'error'); - } - } - } - else if ($action == 'act' && !$error) { - if (isset($this->script[$fid])) { - $rule = $this->script[$fid]; - $disabled = $rule['disabled'] ? true : false; - $rule['disabled'] = !$disabled; - $result = $this->sieve->script->update_rule($fid, $rule); - - if ($result !== false) - $result = $this->save_script(); - - if ($result === true) { - if ($rule['disabled']) - $this->rc->output->show_message('managesieve.deactivated', 'confirmation'); - else - $this->rc->output->show_message('managesieve.activated', 'confirmation'); - $this->rc->output->command('managesieve_updatelist', 'update', - array('id' => $fid, 'disabled' => $rule['disabled'])); - } else { - if ($rule['disabled']) - $this->rc->output->show_message('managesieve.deactivateerror', 'error'); - else - $this->rc->output->show_message('managesieve.activateerror', 'error'); - } - } - } - else if ($action == 'setact' && !$error) { - $script_name = rcube_utils::get_input_value('_set', rcube_utils::INPUT_GPC, true); - $result = $this->activate_script($script_name); - $kep14 = $this->rc->config->get('managesieve_kolab_master'); - - if ($result === true) { - $this->rc->output->set_env('active_sets', $this->active); - $this->rc->output->show_message('managesieve.setactivated', 'confirmation'); - $this->rc->output->command('managesieve_updatelist', 'setact', - array('name' => $script_name, 'active' => true, 'all' => !$kep14)); - } else { - $this->rc->output->show_message('managesieve.setactivateerror', 'error'); - } - } - else if ($action == 'deact' && !$error) { - $script_name = rcube_utils::get_input_value('_set', rcube_utils::INPUT_GPC, true); - $result = $this->deactivate_script($script_name); - - if ($result === true) { - $this->rc->output->set_env('active_sets', $this->active); - $this->rc->output->show_message('managesieve.setdeactivated', 'confirmation'); - $this->rc->output->command('managesieve_updatelist', 'setact', - array('name' => $script_name, 'active' => false)); - } else { - $this->rc->output->show_message('managesieve.setdeactivateerror', 'error'); - } - } - else if ($action == 'setdel' && !$error) { - $script_name = rcube_utils::get_input_value('_set', rcube_utils::INPUT_GPC, true); - $result = $this->remove_script($script_name); - - if ($result === true) { - $this->rc->output->show_message('managesieve.setdeleted', 'confirmation'); - $this->rc->output->command('managesieve_updatelist', 'setdel', - array('name' => $script_name)); - $this->rc->session->remove('managesieve_current'); - } else { - $this->rc->output->show_message('managesieve.setdeleteerror', 'error'); - } - } - else if ($action == 'setget') { - $script_name = rcube_utils::get_input_value('_set', rcube_utils::INPUT_GPC, true); - $script = $this->sieve->get_script($script_name); - - if (PEAR::isError($script)) - exit; - - $browser = new rcube_browser; - - // send download headers - header("Content-Type: application/octet-stream"); - header("Content-Length: ".strlen($script)); - - if ($browser->ie) - header("Content-Type: application/force-download"); - if ($browser->ie && $browser->ver < 7) - $filename = rawurlencode(abbreviate_string($script_name, 55)); - else if ($browser->ie) - $filename = rawurlencode($script_name); - else - $filename = addcslashes($script_name, '\\"'); - - header("Content-Disposition: attachment; filename=\"$filename.txt\""); - echo $script; - exit; - } - else if ($action == 'list') { - $result = $this->list_rules(); - - $this->rc->output->command('managesieve_updatelist', 'list', array('list' => $result)); - } - else if ($action == 'ruleadd') { - $rid = rcube_utils::get_input_value('_rid', rcube_utils::INPUT_GPC); - $id = $this->genid(); - $content = $this->rule_div($fid, $id, false); - - $this->rc->output->command('managesieve_rulefill', $content, $id, $rid); - } - else if ($action == 'actionadd') { - $aid = rcube_utils::get_input_value('_aid', rcube_utils::INPUT_GPC); - $id = $this->genid(); - $content = $this->action_div($fid, $id, false); - - $this->rc->output->command('managesieve_actionfill', $content, $id, $aid); - } - - $this->rc->output->send(); - } - else if ($this->rc->task == 'mail') { - // Initialize the form - $rules = rcube_utils::get_input_value('r', rcube_utils::INPUT_GET); - if (!empty($rules)) { - $i = 0; - foreach ($rules as $rule) { - list($header, $value) = explode(':', $rule, 2); - $tests[$i] = array( - 'type' => 'contains', - 'test' => 'header', - 'arg1' => $header, - 'arg2' => $value, - ); - $i++; - } - - $this->form = array( - 'join' => count($tests) > 1 ? 'allof' : 'anyof', - 'name' => '', - 'tests' => $tests, - 'actions' => array( - 0 => array('type' => 'fileinto'), - 1 => array('type' => 'stop'), - ), - ); - } - } - - $this->managesieve_send(); + $engine = $this->get_engine(); + $engine->actions(); } + /** + * Forms save action handler + */ function managesieve_save() { // load localization @@ -536,1524 +176,26 @@ class managesieve extends rcube_plugin $this->include_script('managesieve.js'); } - // Init plugin and handle managesieve connection - $error = $this->managesieve_start(); - - // get request size limits (#1488648) - $max_post = max(array( - ini_get('max_input_vars'), - ini_get('suhosin.request.max_vars'), - ini_get('suhosin.post.max_vars'), - )); - $max_depth = max(array( - ini_get('suhosin.request.max_array_depth'), - ini_get('suhosin.post.max_array_depth'), - )); - - // check request size limit - if ($max_post && count($_POST, COUNT_RECURSIVE) >= $max_post) { - rcube::raise_error(array( - 'code' => 500, 'type' => 'php', - 'file' => __FILE__, 'line' => __LINE__, - 'message' => "Request size limit exceeded (one of max_input_vars/suhosin.request.max_vars/suhosin.post.max_vars)" - ), true, false); - $this->rc->output->show_message('managesieve.filtersaveerror', 'error'); - } - // check request depth limits - else if ($max_depth && count($_POST['_header']) > $max_depth) { - rcube::raise_error(array( - 'code' => 500, 'type' => 'php', - 'file' => __FILE__, 'line' => __LINE__, - 'message' => "Request size limit exceeded (one of suhosin.request.max_array_depth/suhosin.post.max_array_depth)" - ), true, false); - $this->rc->output->show_message('managesieve.filtersaveerror', 'error'); - } - // filters set add action - else if (!empty($_POST['_newset'])) { - $name = rcube_utils::get_input_value('_name', rcube_utils::INPUT_POST, true); - $copy = rcube_utils::get_input_value('_copy', rcube_utils::INPUT_POST, true); - $from = rcube_utils::get_input_value('_from', rcube_utils::INPUT_POST); - $exceptions = $this->rc->config->get('managesieve_filename_exceptions'); - $kolab = $this->rc->config->get('managesieve_kolab_master'); - $name_uc = mb_strtolower($name); - $list = $this->list_scripts(); - - if (!$name) { - $this->errors['name'] = $this->gettext('cannotbeempty'); - } - else if (mb_strlen($name) > 128) { - $this->errors['name'] = $this->gettext('nametoolong'); - } - else if (!empty($exceptions) && in_array($name, (array)$exceptions)) { - $this->errors['name'] = $this->gettext('namereserved'); - } - else if (!empty($kolab) && in_array($name_uc, array('MASTER', 'USER', 'MANAGEMENT'))) { - $this->errors['name'] = $this->gettext('namereserved'); - } - else if (in_array($name, $list)) { - $this->errors['name'] = $this->gettext('setexist'); - } - else if ($from == 'file') { - // from file - if (is_uploaded_file($_FILES['_file']['tmp_name'])) { - $file = file_get_contents($_FILES['_file']['tmp_name']); - $file = preg_replace('/\r/', '', $file); - // for security don't save script directly - // check syntax before, like this... - $this->sieve->load_script($file); - if (!$this->save_script($name)) { - $this->errors['file'] = $this->gettext('setcreateerror'); - } - } - else { // upload failed - $err = $_FILES['_file']['error']; - - if ($err == UPLOAD_ERR_INI_SIZE || $err == UPLOAD_ERR_FORM_SIZE) { - $msg = $this->rc->gettext(array('name' => 'filesizeerror', - 'vars' => array('size' => - $this->rc->show_bytes(parse_bytes(ini_get('upload_max_filesize')))))); - } - else { - $this->errors['file'] = $this->gettext('fileuploaderror'); - } - } - } - else if (!$this->sieve->copy($name, $from == 'set' ? $copy : '')) { - $error = 'managesieve.setcreateerror'; - } - - if (!$error && empty($this->errors)) { - // Find position of the new script on the list - $list[] = $name; - asort($list, SORT_LOCALE_STRING); - $list = array_values($list); - $index = array_search($name, $list); - - $this->rc->output->show_message('managesieve.setcreated', 'confirmation'); - $this->rc->output->command('parent.managesieve_updatelist', 'setadd', - array('name' => $name, 'index' => $index)); - } else if ($msg) { - $this->rc->output->command('display_message', $msg, 'error'); - } else if ($error) { - $this->rc->output->show_message($error, 'error'); - } - } - // filter add/edit action - else if (isset($_POST['_name'])) { - $name = trim(rcube_utils::get_input_value('_name', rcube_utils::INPUT_POST, true)); - $fid = trim(rcube_utils::get_input_value('_fid', rcube_utils::INPUT_POST)); - $join = trim(rcube_utils::get_input_value('_join', rcube_utils::INPUT_POST)); - - // and arrays - $headers = rcube_utils::get_input_value('_header', rcube_utils::INPUT_POST); - $cust_headers = rcube_utils::get_input_value('_custom_header', rcube_utils::INPUT_POST); - $ops = rcube_utils::get_input_value('_rule_op', rcube_utils::INPUT_POST); - $sizeops = rcube_utils::get_input_value('_rule_size_op', rcube_utils::INPUT_POST); - $sizeitems = rcube_utils::get_input_value('_rule_size_item', rcube_utils::INPUT_POST); - $sizetargets = rcube_utils::get_input_value('_rule_size_target', rcube_utils::INPUT_POST); - $targets = rcube_utils::get_input_value('_rule_target', rcube_utils::INPUT_POST, true); - $mods = rcube_utils::get_input_value('_rule_mod', rcube_utils::INPUT_POST); - $mod_types = rcube_utils::get_input_value('_rule_mod_type', rcube_utils::INPUT_POST); - $body_trans = rcube_utils::get_input_value('_rule_trans', rcube_utils::INPUT_POST); - $body_types = rcube_utils::get_input_value('_rule_trans_type', rcube_utils::INPUT_POST, true); - $comparators = rcube_utils::get_input_value('_rule_comp', rcube_utils::INPUT_POST); - $act_types = rcube_utils::get_input_value('_action_type', rcube_utils::INPUT_POST, true); - $mailboxes = rcube_utils::get_input_value('_action_mailbox', rcube_utils::INPUT_POST, true); - $act_targets = rcube_utils::get_input_value('_action_target', rcube_utils::INPUT_POST, true); - $area_targets = rcube_utils::get_input_value('_action_target_area', rcube_utils::INPUT_POST, true); - $reasons = rcube_utils::get_input_value('_action_reason', rcube_utils::INPUT_POST, true); - $addresses = rcube_utils::get_input_value('_action_addresses', rcube_utils::INPUT_POST, true); - $intervals = rcube_utils::get_input_value('_action_interval', rcube_utils::INPUT_POST); - $interval_types = rcube_utils::get_input_value('_action_interval_type', rcube_utils::INPUT_POST); - $subject = rcube_utils::get_input_value('_action_subject', rcube_utils::INPUT_POST, true); - $flags = rcube_utils::get_input_value('_action_flags', rcube_utils::INPUT_POST); - $varnames = rcube_utils::get_input_value('_action_varname', rcube_utils::INPUT_POST); - $varvalues = rcube_utils::get_input_value('_action_varvalue', rcube_utils::INPUT_POST); - $varmods = rcube_utils::get_input_value('_action_varmods', rcube_utils::INPUT_POST); - $notifyaddrs = rcube_utils::get_input_value('_action_notifyaddress', rcube_utils::INPUT_POST); - $notifybodies = rcube_utils::get_input_value('_action_notifybody', rcube_utils::INPUT_POST); - $notifymessages = rcube_utils::get_input_value('_action_notifymessage', rcube_utils::INPUT_POST); - $notifyfrom = rcube_utils::get_input_value('_action_notifyfrom', rcube_utils::INPUT_POST); - $notifyimp = rcube_utils::get_input_value('_action_notifyimportance', rcube_utils::INPUT_POST); - - // we need a "hack" for radiobuttons - foreach ($sizeitems as $item) - $items[] = $item; - - $this->form['disabled'] = $_POST['_disabled'] ? true : false; - $this->form['join'] = $join=='allof' ? true : false; - $this->form['name'] = $name; - $this->form['tests'] = array(); - $this->form['actions'] = array(); - - if ($name == '') - $this->errors['name'] = $this->gettext('cannotbeempty'); - else { - foreach($this->script as $idx => $rule) - if($rule['name'] == $name && $idx != $fid) { - $this->errors['name'] = $this->gettext('ruleexist'); - break; - } - } - - $i = 0; - // rules - if ($join == 'any') { - $this->form['tests'][0]['test'] = 'true'; - } - else { - foreach ($headers as $idx => $header) { - $header = $this->strip_value($header); - $target = $this->strip_value($targets[$idx], true); - $operator = $this->strip_value($ops[$idx]); - $comparator = $this->strip_value($comparators[$idx]); - - if ($header == 'size') { - $sizeop = $this->strip_value($sizeops[$idx]); - $sizeitem = $this->strip_value($items[$idx]); - $sizetarget = $this->strip_value($sizetargets[$idx]); - - $this->form['tests'][$i]['test'] = 'size'; - $this->form['tests'][$i]['type'] = $sizeop; - $this->form['tests'][$i]['arg'] = $sizetarget; - - if ($sizetarget == '') - $this->errors['tests'][$i]['sizetarget'] = $this->gettext('cannotbeempty'); - else if (!preg_match('/^[0-9]+(K|M|G)?$/i', $sizetarget.$sizeitem, $m)) { - $this->errors['tests'][$i]['sizetarget'] = $this->gettext('forbiddenchars'); - $this->form['tests'][$i]['item'] = $sizeitem; - } - else - $this->form['tests'][$i]['arg'] .= $m[1]; - } - else if ($header == 'body') { - $trans = $this->strip_value($body_trans[$idx]); - $trans_type = $this->strip_value($body_types[$idx], true); - - if (preg_match('/^not/', $operator)) - $this->form['tests'][$i]['not'] = true; - $type = preg_replace('/^not/', '', $operator); - - if ($type == 'exists') { - $this->errors['tests'][$i]['op'] = true; - } - - $this->form['tests'][$i]['test'] = 'body'; - $this->form['tests'][$i]['type'] = $type; - $this->form['tests'][$i]['arg'] = $target; - - if ($target == '' && $type != 'exists') - $this->errors['tests'][$i]['target'] = $this->gettext('cannotbeempty'); - else if (preg_match('/^(value|count)-/', $type) && !preg_match('/[0-9]+/', $target)) - $this->errors['tests'][$i]['target'] = $this->gettext('forbiddenchars'); - - $this->form['tests'][$i]['part'] = $trans; - if ($trans == 'content') { - $this->form['tests'][$i]['content'] = $trans_type; - } - } - else { - $cust_header = $headers = $this->strip_value($cust_headers[$idx]); - $mod = $this->strip_value($mods[$idx]); - $mod_type = $this->strip_value($mod_types[$idx]); - - if (preg_match('/^not/', $operator)) - $this->form['tests'][$i]['not'] = true; - $type = preg_replace('/^not/', '', $operator); - - if ($header == '...') { - $headers = preg_split('/[\s,]+/', $cust_header, -1, PREG_SPLIT_NO_EMPTY); - - if (!count($headers)) - $this->errors['tests'][$i]['header'] = $this->gettext('cannotbeempty'); - else { - foreach ($headers as $hr) { - // RFC2822: printable ASCII except colon - if (!preg_match('/^[\x21-\x39\x41-\x7E]+$/i', $hr)) { - $this->errors['tests'][$i]['header'] = $this->gettext('forbiddenchars'); - } - } - } - - if (empty($this->errors['tests'][$i]['header'])) - $cust_header = (is_array($headers) && count($headers) == 1) ? $headers[0] : $headers; - } - - if ($type == 'exists') { - $this->form['tests'][$i]['test'] = 'exists'; - $this->form['tests'][$i]['arg'] = $header == '...' ? $cust_header : $header; - } - else { - $test = 'header'; - $header = $header == '...' ? $cust_header : $header; - - if ($mod == 'address' || $mod == 'envelope') { - $found = false; - if (empty($this->errors['tests'][$i]['header'])) { - foreach ((array)$header as $hdr) { - if (!in_array(strtolower(trim($hdr)), $this->addr_headers)) - $found = true; - } - } - if (!$found) - $test = $mod; - } - - $this->form['tests'][$i]['type'] = $type; - $this->form['tests'][$i]['test'] = $test; - $this->form['tests'][$i]['arg1'] = $header; - $this->form['tests'][$i]['arg2'] = $target; - - if ($target == '') - $this->errors['tests'][$i]['target'] = $this->gettext('cannotbeempty'); - else if (preg_match('/^(value|count)-/', $type) && !preg_match('/[0-9]+/', $target)) - $this->errors['tests'][$i]['target'] = $this->gettext('forbiddenchars'); - - if ($mod) { - $this->form['tests'][$i]['part'] = $mod_type; - } - } - } - - if ($header != 'size' && $comparator) { - if (preg_match('/^(value|count)/', $this->form['tests'][$i]['type'])) - $comparator = 'i;ascii-numeric'; - - $this->form['tests'][$i]['comparator'] = $comparator; - } - - $i++; - } - } - - $i = 0; - // actions - foreach($act_types as $idx => $type) { - $type = $this->strip_value($type); - $target = $this->strip_value($act_targets[$idx]); - - switch ($type) { - - case 'fileinto': - case 'fileinto_copy': - $mailbox = $this->strip_value($mailboxes[$idx], false, false); - $this->form['actions'][$i]['target'] = $this->mod_mailbox($mailbox, 'in'); - if ($type == 'fileinto_copy') { - $type = 'fileinto'; - $this->form['actions'][$i]['copy'] = true; - } - break; - - case 'reject': - case 'ereject': - $target = $this->strip_value($area_targets[$idx]); - $this->form['actions'][$i]['target'] = str_replace("\r\n", "\n", $target); - - // if ($target == '') -// $this->errors['actions'][$i]['targetarea'] = $this->gettext('cannotbeempty'); - break; - - case 'redirect': - case 'redirect_copy': - $this->form['actions'][$i]['target'] = $target; - - if ($this->form['actions'][$i]['target'] == '') - $this->errors['actions'][$i]['target'] = $this->gettext('cannotbeempty'); - else if (!rcube_utils::check_email($this->form['actions'][$i]['target'])) - $this->errors['actions'][$i]['target'] = $this->gettext('noemailwarning'); - - if ($type == 'redirect_copy') { - $type = 'redirect'; - $this->form['actions'][$i]['copy'] = true; - } - break; - - case 'addflag': - case 'setflag': - case 'removeflag': - $_target = array(); - if (empty($flags[$idx])) { - $this->errors['actions'][$i]['target'] = $this->gettext('noflagset'); - } - else { - foreach ($flags[$idx] as $flag) { - $_target[] = $this->strip_value($flag); - } - } - $this->form['actions'][$i]['target'] = $_target; - break; - - case 'vacation': - $reason = $this->strip_value($reasons[$idx]); - $interval_type = $interval_types[$idx] == 'seconds' ? 'seconds' : 'days'; - $this->form['actions'][$i]['reason'] = str_replace("\r\n", "\n", $reason); - $this->form['actions'][$i]['subject'] = $subject[$idx]; - $this->form['actions'][$i]['addresses'] = explode(',', $addresses[$idx]); - $this->form['actions'][$i][$interval_type] = $intervals[$idx]; -// @TODO: vacation :mime, :from, :handle - - if ($this->form['actions'][$i]['addresses']) { - foreach($this->form['actions'][$i]['addresses'] as $aidx => $address) { - $address = trim($address); - if (!$address) - unset($this->form['actions'][$i]['addresses'][$aidx]); - else if(!rcube_utils::check_email($address)) { - $this->errors['actions'][$i]['addresses'] = $this->gettext('noemailwarning'); - break; - } else - $this->form['actions'][$i]['addresses'][$aidx] = $address; - } - } - - if ($this->form['actions'][$i]['reason'] == '') - $this->errors['actions'][$i]['reason'] = $this->gettext('cannotbeempty'); - if ($this->form['actions'][$i][$interval_type] && !preg_match('/^[0-9]+$/', $this->form['actions'][$i][$interval_type])) - $this->errors['actions'][$i]['interval'] = $this->gettext('forbiddenchars'); - break; - - case 'set': - $this->form['actions'][$i]['name'] = $varnames[$idx]; - $this->form['actions'][$i]['value'] = $varvalues[$idx]; - foreach ((array)$varmods[$idx] as $v_m) { - $this->form['actions'][$i][$v_m] = true; - } - - if (empty($varnames[$idx])) { - $this->errors['actions'][$i]['name'] = $this->gettext('cannotbeempty'); - } - else if (!preg_match('/^[0-9a-z_]+$/i', $varnames[$idx])) { - $this->errors['actions'][$i]['name'] = $this->gettext('forbiddenchars'); - } - - if (!isset($varvalues[$idx]) || $varvalues[$idx] === '') { - $this->errors['actions'][$i]['value'] = $this->gettext('cannotbeempty'); - } - break; - - case 'notify': - if (empty($notifyaddrs[$idx])) { - $this->errors['actions'][$i]['address'] = $this->gettext('cannotbeempty'); - } - else if (!rcube_utils::check_email($notifyaddrs[$idx])) { - $this->errors['actions'][$i]['address'] = $this->gettext('noemailwarning'); - } - if (!empty($notifyfrom[$idx]) && !rcube_utils::check_email($notifyfrom[$idx])) { - $this->errors['actions'][$i]['from'] = $this->gettext('noemailwarning'); - } - $this->form['actions'][$i]['address'] = $notifyaddrs[$idx]; - $this->form['actions'][$i]['body'] = $notifybodies[$idx]; - $this->form['actions'][$i]['message'] = $notifymessages[$idx]; - $this->form['actions'][$i]['from'] = $notifyfrom[$idx]; - $this->form['actions'][$i]['importance'] = $notifyimp[$idx]; - break; - } - - $this->form['actions'][$i]['type'] = $type; - $i++; - } - - if (!$this->errors && !$error) { - // zapis skryptu - if (!isset($this->script[$fid])) { - $fid = $this->sieve->script->add_rule($this->form); - $new = true; - } else - $fid = $this->sieve->script->update_rule($fid, $this->form); - - if ($fid !== false) - $save = $this->save_script(); - - if ($save && $fid !== false) { - $this->rc->output->show_message('managesieve.filtersaved', 'confirmation'); - if ($this->rc->task != 'mail') { - $this->rc->output->command('parent.managesieve_updatelist', - isset($new) ? 'add' : 'update', - array( - 'name' => rcube::Q($this->form['name']), - 'id' => $fid, - 'disabled' => $this->form['disabled'] - )); - } - else { - $this->rc->output->command('managesieve_dialog_close'); - $this->rc->output->send('iframe'); - } - } - else { - $this->rc->output->show_message('managesieve.filtersaveerror', 'error'); -// $this->rc->output->send(); - } - } - } - - $this->managesieve_send(); - } - - private function managesieve_send() - { - // Handle form action - if (isset($_GET['_framed']) || isset($_POST['_framed'])) { - if (isset($_GET['_newset']) || isset($_POST['_newset'])) { - $this->rc->output->send('managesieve.setedit'); - } - else { - $this->rc->output->send('managesieve.filteredit'); - } - } else { - $this->rc->output->set_pagetitle($this->gettext('filters')); - $this->rc->output->send('managesieve.managesieve'); - } - } - - // return the filters list as HTML table - function filters_list($attrib) - { - // add id to message list table if not specified - if (!strlen($attrib['id'])) - $attrib['id'] = 'rcmfilterslist'; - - // define list of cols to be displayed - $a_show_cols = array('name'); - - $result = $this->list_rules(); - - // create XHTML table - $out = $this->rc->table_output($attrib, $result, $a_show_cols, 'id'); - - // set client env - $this->rc->output->add_gui_object('filterslist', $attrib['id']); - $this->rc->output->include_script('list.js'); - - // add some labels to client - $this->rc->output->add_label('managesieve.filterdeleteconfirm'); - - return $out; - } - - // return the filters list as <SELECT> - function filtersets_list($attrib, $no_env = false) - { - // add id to message list table if not specified - if (!strlen($attrib['id'])) - $attrib['id'] = 'rcmfiltersetslist'; - - $list = $this->list_scripts(); - - if ($list) { - asort($list, SORT_LOCALE_STRING); - } - - if (!empty($attrib['type']) && $attrib['type'] == 'list') { - // define list of cols to be displayed - $a_show_cols = array('name'); - - if ($list) { - foreach ($list as $idx => $set) { - $scripts['S'.$idx] = $set; - $result[] = array( - 'name' => rcube::Q($set), - 'id' => 'S'.$idx, - 'class' => !in_array($set, $this->active) ? 'disabled' : '', - ); - } - } - - // create XHTML table - $out = $this->rc->table_output($attrib, $result, $a_show_cols, 'id'); - - $this->rc->output->set_env('filtersets', $scripts); - $this->rc->output->include_script('list.js'); - } - else { - $select = new html_select(array('name' => '_set', 'id' => $attrib['id'], - 'onchange' => $this->rc->task != 'mail' ? 'rcmail.managesieve_set()' : '')); - - if ($list) { - foreach ($list as $set) - $select->add($set, $set); - } - - $out = $select->show($this->sieve->current); - } - - // set client env - if (!$no_env) { - $this->rc->output->add_gui_object('filtersetslist', $attrib['id']); - $this->rc->output->add_label('managesieve.setdeleteconfirm'); - } - - return $out; - } - - function filter_frame($attrib) - { - if (!$attrib['id']) - $attrib['id'] = 'rcmfilterframe'; - - $attrib['name'] = $attrib['id']; - - $this->rc->output->set_env('contentframe', $attrib['name']); - $this->rc->output->set_env('blankpage', $attrib['src'] ? - $this->rc->output->abs_url($attrib['src']) : 'program/resources/blank.gif'); - - return $this->rc->output->frame($attrib); - } - - function filterset_form($attrib) - { - if (!$attrib['id']) - $attrib['id'] = 'rcmfiltersetform'; - - $out = '<form name="filtersetform" action="./" method="post" enctype="multipart/form-data">'."\n"; - - $hiddenfields = new html_hiddenfield(array('name' => '_task', 'value' => $this->rc->task)); - $hiddenfields->add(array('name' => '_action', 'value' => 'plugin.managesieve-save')); - $hiddenfields->add(array('name' => '_framed', 'value' => ($_POST['_framed'] || $_GET['_framed'] ? 1 : 0))); - $hiddenfields->add(array('name' => '_newset', 'value' => 1)); - - $out .= $hiddenfields->show(); - - $name = rcube_utils::get_input_value('_name', rcube_utils::INPUT_POST); - $copy = rcube_utils::get_input_value('_copy', rcube_utils::INPUT_POST); - $selected = rcube_utils::get_input_value('_from', rcube_utils::INPUT_POST); - - // filter set name input - $input_name = new html_inputfield(array('name' => '_name', 'id' => '_name', 'size' => 30, - 'class' => ($this->errors['name'] ? 'error' : ''))); - - $out .= sprintf('<label for="%s"><b>%s:</b></label> %s<br /><br />', - '_name', rcube::Q($this->gettext('filtersetname')), $input_name->show($name)); - - $out .="\n<fieldset class=\"itemlist\"><legend>" . $this->gettext('filters') . ":</legend>\n"; - $out .= '<input type="radio" id="from_none" name="_from" value="none"' - .(!$selected || $selected=='none' ? ' checked="checked"' : '').'></input>'; - $out .= sprintf('<label for="%s">%s</label> ', 'from_none', rcube::Q($this->gettext('none'))); - - // filters set list - $list = $this->list_scripts(); - $select = new html_select(array('name' => '_copy', 'id' => '_copy')); - - if (is_array($list)) { - asort($list, SORT_LOCALE_STRING); - - if (!$copy) - $copy = $_SESSION['managesieve_current']; - - foreach ($list as $set) { - $select->add($set, $set); - } - - $out .= '<br /><input type="radio" id="from_set" name="_from" value="set"' - .($selected=='set' ? ' checked="checked"' : '').'></input>'; - $out .= sprintf('<label for="%s">%s:</label> ', 'from_set', rcube::Q($this->gettext('fromset'))); - $out .= $select->show($copy); - } - - // script upload box - $upload = new html_inputfield(array('name' => '_file', 'id' => '_file', 'size' => 30, - 'type' => 'file', 'class' => ($this->errors['file'] ? 'error' : ''))); - - $out .= '<br /><input type="radio" id="from_file" name="_from" value="file"' - .($selected=='file' ? ' checked="checked"' : '').'></input>'; - $out .= sprintf('<label for="%s">%s:</label> ', 'from_file', rcube::Q($this->gettext('fromfile'))); - $out .= $upload->show(); - $out .= '</fieldset>'; - - $this->rc->output->add_gui_object('sieveform', 'filtersetform'); - - if ($this->errors['name']) - $this->add_tip('_name', $this->errors['name'], true); - if ($this->errors['file']) - $this->add_tip('_file', $this->errors['file'], true); - - $this->print_tips(); - - return $out; - } - - - function filter_form($attrib) - { - if (!$attrib['id']) - $attrib['id'] = 'rcmfilterform'; - - $fid = rcube_utils::get_input_value('_fid', rcube_utils::INPUT_GPC); - $scr = isset($this->form) ? $this->form : $this->script[$fid]; - - $hiddenfields = new html_hiddenfield(array('name' => '_task', 'value' => $this->rc->task)); - $hiddenfields->add(array('name' => '_action', 'value' => 'plugin.managesieve-save')); - $hiddenfields->add(array('name' => '_framed', 'value' => ($_POST['_framed'] || $_GET['_framed'] ? 1 : 0))); - $hiddenfields->add(array('name' => '_fid', 'value' => $fid)); - - $out = '<form name="filterform" action="./" method="post">'."\n"; - $out .= $hiddenfields->show(); - - // 'any' flag - if (sizeof($scr['tests']) == 1 && $scr['tests'][0]['test'] == 'true' && !$scr['tests'][0]['not']) - $any = true; - - // filter name input - $field_id = '_name'; - $input_name = new html_inputfield(array('name' => '_name', 'id' => $field_id, 'size' => 30, - 'class' => ($this->errors['name'] ? 'error' : ''))); - - if ($this->errors['name']) - $this->add_tip($field_id, $this->errors['name'], true); - - if (isset($scr)) - $input_name = $input_name->show($scr['name']); - else - $input_name = $input_name->show(); - - $out .= sprintf("\n<label for=\"%s\"><b>%s:</b></label> %s\n", - $field_id, rcube::Q($this->gettext('filtername')), $input_name); - - // filter set selector - if ($this->rc->task == 'mail') { - $out .= sprintf("\n <label for=\"%s\"><b>%s:</b></label> %s\n", - $field_id, rcube::Q($this->gettext('filterset')), - $this->filtersets_list(array('id' => 'sievescriptname'), true)); - } - - $out .= '<br /><br /><fieldset><legend>' . rcube::Q($this->gettext('messagesrules')) . "</legend>\n"; - - // any, allof, anyof radio buttons - $field_id = '_allof'; - $input_join = new html_radiobutton(array('name' => '_join', 'id' => $field_id, 'value' => 'allof', - 'onclick' => 'rule_join_radio(\'allof\')', 'class' => 'radio')); - - if (isset($scr) && !$any) - $input_join = $input_join->show($scr['join'] ? 'allof' : ''); - else - $input_join = $input_join->show(); - - $out .= sprintf("%s<label for=\"%s\">%s</label> \n", - $input_join, $field_id, rcube::Q($this->gettext('filterallof'))); - - $field_id = '_anyof'; - $input_join = new html_radiobutton(array('name' => '_join', 'id' => $field_id, 'value' => 'anyof', - 'onclick' => 'rule_join_radio(\'anyof\')', 'class' => 'radio')); - - if (isset($scr) && !$any) - $input_join = $input_join->show($scr['join'] ? '' : 'anyof'); - else - $input_join = $input_join->show('anyof'); // default - - $out .= sprintf("%s<label for=\"%s\">%s</label>\n", - $input_join, $field_id, rcube::Q($this->gettext('filteranyof'))); - - $field_id = '_any'; - $input_join = new html_radiobutton(array('name' => '_join', 'id' => $field_id, 'value' => 'any', - 'onclick' => 'rule_join_radio(\'any\')', 'class' => 'radio')); - - $input_join = $input_join->show($any ? 'any' : ''); - - $out .= sprintf("%s<label for=\"%s\">%s</label>\n", - $input_join, $field_id, rcube::Q($this->gettext('filterany'))); - - $rows_num = isset($scr) ? sizeof($scr['tests']) : 1; - - $out .= '<div id="rules"'.($any ? ' style="display: none"' : '').'>'; - for ($x=0; $x<$rows_num; $x++) - $out .= $this->rule_div($fid, $x); - $out .= "</div>\n"; - - $out .= "</fieldset>\n"; - - // actions - $out .= '<fieldset><legend>' . rcube::Q($this->gettext('messagesactions')) . "</legend>\n"; - - $rows_num = isset($scr) ? sizeof($scr['actions']) : 1; - - $out .= '<div id="actions">'; - for ($x=0; $x<$rows_num; $x++) - $out .= $this->action_div($fid, $x); - $out .= "</div>\n"; - - $out .= "</fieldset>\n"; - - $this->print_tips(); - - if ($scr['disabled']) { - $this->rc->output->set_env('rule_disabled', true); - } - $this->rc->output->add_label( - 'managesieve.ruledeleteconfirm', - 'managesieve.actiondeleteconfirm' - ); - $this->rc->output->add_gui_object('sieveform', 'filterform'); - - return $out; - } - - function rule_div($fid, $id, $div=true) - { - $rule = isset($this->form) ? $this->form['tests'][$id] : $this->script[$fid]['tests'][$id]; - $rows_num = isset($this->form) ? sizeof($this->form['tests']) : sizeof($this->script[$fid]['tests']); - - // headers select - $select_header = new html_select(array('name' => "_header[]", 'id' => 'header'.$id, - 'onchange' => 'rule_header_select(' .$id .')')); - foreach($this->headers as $name => $val) - $select_header->add(rcube::Q($this->gettext($name)), Q($val)); - if (in_array('body', $this->exts)) - $select_header->add(rcube::Q($this->gettext('body')), 'body'); - $select_header->add(rcube::Q($this->gettext('size')), 'size'); - $select_header->add(rcube::Q($this->gettext('...')), '...'); - - // TODO: list arguments - $aout = ''; - - if ((isset($rule['test']) && in_array($rule['test'], array('header', 'address', 'envelope'))) - && !is_array($rule['arg1']) && in_array($rule['arg1'], $this->headers) - ) { - $aout .= $select_header->show($rule['arg1']); - } - else if ((isset($rule['test']) && $rule['test'] == 'exists') - && !is_array($rule['arg']) && in_array($rule['arg'], $this->headers) - ) { - $aout .= $select_header->show($rule['arg']); - } - else if (isset($rule['test']) && $rule['test'] == 'size') - $aout .= $select_header->show('size'); - else if (isset($rule['test']) && $rule['test'] == 'body') - $aout .= $select_header->show('body'); - else if (isset($rule['test']) && $rule['test'] != 'true') - $aout .= $select_header->show('...'); - else - $aout .= $select_header->show(); - - if (isset($rule['test']) && in_array($rule['test'], array('header', 'address', 'envelope'))) { - if (is_array($rule['arg1'])) - $custom = implode(', ', $rule['arg1']); - else if (!in_array($rule['arg1'], $this->headers)) - $custom = $rule['arg1']; - } - else if (isset($rule['test']) && $rule['test'] == 'exists') { - if (is_array($rule['arg'])) - $custom = implode(', ', $rule['arg']); - else if (!in_array($rule['arg'], $this->headers)) - $custom = $rule['arg']; - } - - $tout = '<div id="custom_header' .$id. '" style="display:' .(isset($custom) ? 'inline' : 'none'). '"> - <input type="text" name="_custom_header[]" id="custom_header_i'.$id.'" ' - . $this->error_class($id, 'test', 'header', 'custom_header_i') - .' value="' .rcube::Q($custom). '" size="15" /> </div>' . "\n"; - - // matching type select (operator) - $select_op = new html_select(array('name' => "_rule_op[]", 'id' => 'rule_op'.$id, - 'style' => 'display:' .($rule['test']!='size' ? 'inline' : 'none'), - 'class' => 'operator_selector', - 'onchange' => 'rule_op_select('.$id.')')); - $select_op->add(rcube::Q($this->gettext('filtercontains')), 'contains'); - $select_op->add(rcube::Q($this->gettext('filternotcontains')), 'notcontains'); - $select_op->add(rcube::Q($this->gettext('filteris')), 'is'); - $select_op->add(rcube::Q($this->gettext('filterisnot')), 'notis'); - $select_op->add(rcube::Q($this->gettext('filterexists')), 'exists'); - $select_op->add(rcube::Q($this->gettext('filternotexists')), 'notexists'); - $select_op->add(rcube::Q($this->gettext('filtermatches')), 'matches'); - $select_op->add(rcube::Q($this->gettext('filternotmatches')), 'notmatches'); - if (in_array('regex', $this->exts)) { - $select_op->add(rcube::Q($this->gettext('filterregex')), 'regex'); - $select_op->add(rcube::Q($this->gettext('filternotregex')), 'notregex'); - } - if (in_array('relational', $this->exts)) { - $select_op->add(rcube::Q($this->gettext('countisgreaterthan')), 'count-gt'); - $select_op->add(rcube::Q($this->gettext('countisgreaterthanequal')), 'count-ge'); - $select_op->add(rcube::Q($this->gettext('countislessthan')), 'count-lt'); - $select_op->add(rcube::Q($this->gettext('countislessthanequal')), 'count-le'); - $select_op->add(rcube::Q($this->gettext('countequals')), 'count-eq'); - $select_op->add(rcube::Q($this->gettext('countnotequals')), 'count-ne'); - $select_op->add(rcube::Q($this->gettext('valueisgreaterthan')), 'value-gt'); - $select_op->add(rcube::Q($this->gettext('valueisgreaterthanequal')), 'value-ge'); - $select_op->add(rcube::Q($this->gettext('valueislessthan')), 'value-lt'); - $select_op->add(rcube::Q($this->gettext('valueislessthanequal')), 'value-le'); - $select_op->add(rcube::Q($this->gettext('valueequals')), 'value-eq'); - $select_op->add(rcube::Q($this->gettext('valuenotequals')), 'value-ne'); - } - - // target input (TODO: lists) - - if (in_array($rule['test'], array('header', 'address', 'envelope'))) { - $test = ($rule['not'] ? 'not' : '').($rule['type'] ? $rule['type'] : 'is'); - $target = $rule['arg2']; - } - else if ($rule['test'] == 'body') { - $test = ($rule['not'] ? 'not' : '').($rule['type'] ? $rule['type'] : 'is'); - $target = $rule['arg']; - } - else if ($rule['test'] == 'size') { - $test = ''; - $target = ''; - if (preg_match('/^([0-9]+)(K|M|G)?$/', $rule['arg'], $matches)) { - $sizetarget = $matches[1]; - $sizeitem = $matches[2]; - } - else { - $sizetarget = $rule['arg']; - $sizeitem = $rule['item']; - } - } - else { - $test = ($rule['not'] ? 'not' : '').$rule['test']; - $target = ''; - } - - $tout .= $select_op->show($test); - $tout .= '<input type="text" name="_rule_target[]" id="rule_target' .$id. '" - value="' .rcube::Q($target). '" size="20" ' . $this->error_class($id, 'test', 'target', 'rule_target') - . ' style="display:' . ($rule['test']!='size' && $rule['test'] != 'exists' ? 'inline' : 'none') . '" />'."\n"; - - $select_size_op = new html_select(array('name' => "_rule_size_op[]", 'id' => 'rule_size_op'.$id)); - $select_size_op->add(rcube::Q($this->gettext('filterover')), 'over'); - $select_size_op->add(rcube::Q($this->gettext('filterunder')), 'under'); - - $tout .= '<div id="rule_size' .$id. '" style="display:' . ($rule['test']=='size' ? 'inline' : 'none') .'">'; - $tout .= $select_size_op->show($rule['test']=='size' ? $rule['type'] : ''); - $tout .= '<input type="text" name="_rule_size_target[]" id="rule_size_i'.$id.'" value="'.$sizetarget.'" size="10" ' - . $this->error_class($id, 'test', 'sizetarget', 'rule_size_i') .' /> - <label><input type="radio" name="_rule_size_item['.$id.']" value=""' - . (!$sizeitem ? ' checked="checked"' : '') .' class="radio" />'.$this->rc->gettext('B').'</label> - <label><input type="radio" name="_rule_size_item['.$id.']" value="K"' - . ($sizeitem=='K' ? ' checked="checked"' : '') .' class="radio" />'.$this->rc->gettext('KB').'</label> - <label><input type="radio" name="_rule_size_item['.$id.']" value="M"' - . ($sizeitem=='M' ? ' checked="checked"' : '') .' class="radio" />'.$this->rc->gettext('MB').'</label> - <label><input type="radio" name="_rule_size_item['.$id.']" value="G"' - . ($sizeitem=='G' ? ' checked="checked"' : '') .' class="radio" />'.$this->rc->gettext('GB').'</label>'; - $tout .= '</div>'; - - // Advanced modifiers (address, envelope) - $select_mod = new html_select(array('name' => "_rule_mod[]", 'id' => 'rule_mod_op'.$id, - 'onchange' => 'rule_mod_select(' .$id .')')); - $select_mod->add(rcube::Q($this->gettext('none')), ''); - $select_mod->add(rcube::Q($this->gettext('address')), 'address'); - if (in_array('envelope', $this->exts)) - $select_mod->add(rcube::Q($this->gettext('envelope')), 'envelope'); - - $select_type = new html_select(array('name' => "_rule_mod_type[]", 'id' => 'rule_mod_type'.$id)); - $select_type->add(rcube::Q($this->gettext('allparts')), 'all'); - $select_type->add(rcube::Q($this->gettext('domain')), 'domain'); - $select_type->add(rcube::Q($this->gettext('localpart')), 'localpart'); - if (in_array('subaddress', $this->exts)) { - $select_type->add(rcube::Q($this->gettext('user')), 'user'); - $select_type->add(rcube::Q($this->gettext('detail')), 'detail'); - } - - $need_mod = $rule['test'] != 'size' && $rule['test'] != 'body'; - $mout = '<div id="rule_mod' .$id. '" class="adv" style="display:' . ($need_mod ? 'block' : 'none') .'">'; - $mout .= ' <span>'; - $mout .= rcube::Q($this->gettext('modifier')) . ' '; - $mout .= $select_mod->show($rule['test']); - $mout .= '</span>'; - $mout .= ' <span id="rule_mod_type' . $id . '"'; - $mout .= ' style="display:' . (in_array($rule['test'], array('address', 'envelope')) ? 'inline' : 'none') .'">'; - $mout .= rcube::Q($this->gettext('modtype')) . ' '; - $mout .= $select_type->show($rule['part']); - $mout .= '</span>'; - $mout .= '</div>'; - - // Advanced modifiers (body transformations) - $select_mod = new html_select(array('name' => "_rule_trans[]", 'id' => 'rule_trans_op'.$id, - 'onchange' => 'rule_trans_select(' .$id .')')); - $select_mod->add(rcube::Q($this->gettext('text')), 'text'); - $select_mod->add(rcube::Q($this->gettext('undecoded')), 'raw'); - $select_mod->add(rcube::Q($this->gettext('contenttype')), 'content'); - - $mout .= '<div id="rule_trans' .$id. '" class="adv" style="display:' . ($rule['test'] == 'body' ? 'block' : 'none') .'">'; - $mout .= ' <span>'; - $mout .= rcube::Q($this->gettext('modifier')) . ' '; - $mout .= $select_mod->show($rule['part']); - $mout .= '<input type="text" name="_rule_trans_type[]" id="rule_trans_type'.$id - . '" value="'.(is_array($rule['content']) ? implode(',', $rule['content']) : $rule['content']) - .'" size="20" style="display:' . ($rule['part'] == 'content' ? 'inline' : 'none') .'"' - . $this->error_class($id, 'test', 'part', 'rule_trans_type') .' />'; - $mout .= '</span>'; - $mout .= '</div>'; - - // Advanced modifiers (body transformations) - $select_comp = new html_select(array('name' => "_rule_comp[]", 'id' => 'rule_comp_op'.$id)); - $select_comp->add(rcube::Q($this->gettext('default')), ''); - $select_comp->add(rcube::Q($this->gettext('octet')), 'i;octet'); - $select_comp->add(rcube::Q($this->gettext('asciicasemap')), 'i;ascii-casemap'); - if (in_array('comparator-i;ascii-numeric', $this->exts)) { - $select_comp->add(rcube::Q($this->gettext('asciinumeric')), 'i;ascii-numeric'); - } - - $mout .= '<div id="rule_comp' .$id. '" class="adv" style="display:' . ($rule['test'] != 'size' ? 'block' : 'none') .'">'; - $mout .= ' <span>'; - $mout .= rcube::Q($this->gettext('comparator')) . ' '; - $mout .= $select_comp->show($rule['comparator']); - $mout .= '</span>'; - $mout .= '</div>'; - - // Build output table - $out = $div ? '<div class="rulerow" id="rulerow' .$id .'">'."\n" : ''; - $out .= '<table><tr>'; - $out .= '<td class="advbutton">'; - $out .= '<a href="#" id="ruleadv' . $id .'" title="'. rcube::Q($this->gettext('advancedopts')). '" - onclick="rule_adv_switch(' . $id .', this)" class="show"> </a>'; - $out .= '</td>'; - $out .= '<td class="rowactions">' . $aout . '</td>'; - $out .= '<td class="rowtargets">' . $tout . "\n"; - $out .= '<div id="rule_advanced' .$id. '" style="display:none">' . $mout . '</div>'; - $out .= '</td>'; - - // add/del buttons - $out .= '<td class="rowbuttons">'; - $out .= '<a href="#" id="ruleadd' . $id .'" title="'. rcube::Q($this->gettext('add')). '" - onclick="rcmail.managesieve_ruleadd(' . $id .')" class="button add"></a>'; - $out .= '<a href="#" id="ruledel' . $id .'" title="'. rcube::Q($this->gettext('del')). '" - onclick="rcmail.managesieve_ruledel(' . $id .')" class="button del' . ($rows_num<2 ? ' disabled' : '') .'"></a>'; - $out .= '</td>'; - $out .= '</tr></table>'; - - $out .= $div ? "</div>\n" : ''; - - return $out; - } - - function action_div($fid, $id, $div=true) - { - $action = isset($this->form) ? $this->form['actions'][$id] : $this->script[$fid]['actions'][$id]; - $rows_num = isset($this->form) ? sizeof($this->form['actions']) : sizeof($this->script[$fid]['actions']); - - $out = $div ? '<div class="actionrow" id="actionrow' .$id .'">'."\n" : ''; - - $out .= '<table><tr><td class="rowactions">'; - - // action select - $select_action = new html_select(array('name' => "_action_type[$id]", 'id' => 'action_type'.$id, - 'onchange' => 'action_type_select(' .$id .')')); - if (in_array('fileinto', $this->exts)) - $select_action->add(rcube::Q($this->gettext('messagemoveto')), 'fileinto'); - if (in_array('fileinto', $this->exts) && in_array('copy', $this->exts)) - $select_action->add(rcube::Q($this->gettext('messagecopyto')), 'fileinto_copy'); - $select_action->add(rcube::Q($this->gettext('messageredirect')), 'redirect'); - if (in_array('copy', $this->exts)) - $select_action->add(rcube::Q($this->gettext('messagesendcopy')), 'redirect_copy'); - if (in_array('reject', $this->exts)) - $select_action->add(rcube::Q($this->gettext('messagediscard')), 'reject'); - else if (in_array('ereject', $this->exts)) - $select_action->add(rcube::Q($this->gettext('messagediscard')), 'ereject'); - if (in_array('vacation', $this->exts)) - $select_action->add(rcube::Q($this->gettext('messagereply')), 'vacation'); - $select_action->add(rcube::Q($this->gettext('messagedelete')), 'discard'); - if (in_array('imapflags', $this->exts) || in_array('imap4flags', $this->exts)) { - $select_action->add(rcube::Q($this->gettext('setflags')), 'setflag'); - $select_action->add(rcube::Q($this->gettext('addflags')), 'addflag'); - $select_action->add(rcube::Q($this->gettext('removeflags')), 'removeflag'); - } - if (in_array('variables', $this->exts)) { - $select_action->add(rcube::Q($this->gettext('setvariable')), 'set'); - } - if (in_array('enotify', $this->exts) || in_array('notify', $this->exts)) { - $select_action->add(rcube::Q($this->gettext('notify')), 'notify'); - } - $select_action->add(rcube::Q($this->gettext('rulestop')), 'stop'); - - $select_type = $action['type']; - if (in_array($action['type'], array('fileinto', 'redirect')) && $action['copy']) { - $select_type .= '_copy'; - } - - $out .= $select_action->show($select_type); - $out .= '</td>'; - - // actions target inputs - $out .= '<td class="rowtargets">'; - // shared targets - $out .= '<input type="text" name="_action_target['.$id.']" id="action_target' .$id. '" ' - .'value="' .($action['type']=='redirect' ? rcube::Q($action['target'], 'strict', false) : ''). '" size="35" ' - .'style="display:' .($action['type']=='redirect' ? 'inline' : 'none') .'" ' - . $this->error_class($id, 'action', 'target', 'action_target') .' />'; - $out .= '<textarea name="_action_target_area['.$id.']" id="action_target_area' .$id. '" ' - .'rows="3" cols="35" '. $this->error_class($id, 'action', 'targetarea', 'action_target_area') - .'style="display:' .(in_array($action['type'], array('reject', 'ereject')) ? 'inline' : 'none') .'">' - . (in_array($action['type'], array('reject', 'ereject')) ? rcube::Q($action['target'], 'strict', false) : '') - . "</textarea>\n"; - - // vacation - $vsec = in_array('vacation-seconds', $this->exts); - $out .= '<div id="action_vacation' .$id.'" style="display:' .($action['type']=='vacation' ? 'inline' : 'none') .'">'; - $out .= '<span class="label">'. rcube::Q($this->gettext('vacationreason')) .'</span><br />' - .'<textarea name="_action_reason['.$id.']" id="action_reason' .$id. '" ' - .'rows="3" cols="35" '. $this->error_class($id, 'action', 'reason', 'action_reason') . '>' - . Q($action['reason'], 'strict', false) . "</textarea>\n"; - $out .= '<br /><span class="label">' .rcube::Q($this->gettext('vacationsubject')) . '</span><br />' - .'<input type="text" name="_action_subject['.$id.']" id="action_subject'.$id.'" ' - .'value="' . (is_array($action['subject']) ? rcube::Q(implode(', ', $action['subject']), 'strict', false) : $action['subject']) . '" size="35" ' - . $this->error_class($id, 'action', 'subject', 'action_subject') .' />'; - $out .= '<br /><span class="label">' .rcube::Q($this->gettext('vacationaddresses')) . '</span><br />' - .'<input type="text" name="_action_addresses['.$id.']" id="action_addr'.$id.'" ' - .'value="' . (is_array($action['addresses']) ? rcube::Q(implode(', ', $action['addresses']), 'strict', false) : $action['addresses']) . '" size="35" ' - . $this->error_class($id, 'action', 'addresses', 'action_addr') .' />'; - $out .= '<br /><span class="label">' . rcube::Q($this->gettext($vsec ? 'vacationinterval' : 'vacationdays')) . '</span><br />' - .'<input type="text" name="_action_interval['.$id.']" id="action_interval'.$id.'" ' - .'value="' .rcube::Q(isset($action['seconds']) ? $action['seconds'] : $action['days'], 'strict', false) . '" size="2" ' - . $this->error_class($id, 'action', 'interval', 'action_interval') .' />'; - if ($vsec) { - $out .= ' <label><input type="radio" name="_action_interval_type['.$id.']" value="days"' - . (!isset($action['seconds']) ? ' checked="checked"' : '') .' class="radio" />'.$this->gettext('days').'</label>' - . ' <label><input type="radio" name="_action_interval_type['.$id.']" value="seconds"' - . (isset($action['seconds']) ? ' checked="checked"' : '') .' class="radio" />'.$this->gettext('seconds').'</label>'; - } - $out .= '</div>'; - - // flags - $flags = array( - 'read' => '\\Seen', - 'answered' => '\\Answered', - 'flagged' => '\\Flagged', - 'deleted' => '\\Deleted', - 'draft' => '\\Draft', - ); - $flags_target = (array)$action['target']; - - $out .= '<div id="action_flags' .$id.'" style="display:' - . (preg_match('/^(set|add|remove)flag$/', $action['type']) ? 'inline' : 'none') . '"' - . $this->error_class($id, 'action', 'flags', 'action_flags') . '>'; - foreach ($flags as $fidx => $flag) { - $out .= '<input type="checkbox" name="_action_flags[' .$id .'][]" value="' . $flag . '"' - . (in_array_nocase($flag, $flags_target) ? 'checked="checked"' : '') . ' />' - . rcube::Q($this->gettext('flag'.$fidx)) .'<br>'; - } - $out .= '</div>'; - - // set variable - $set_modifiers = array( - 'lower', - 'upper', - 'lowerfirst', - 'upperfirst', - 'quotewildcard', - 'length' - ); - - $out .= '<div id="action_set' .$id.'" style="display:' .($action['type']=='set' ? 'inline' : 'none') .'">'; - $out .= '<span class="label">' .rcube::Q($this->gettext('setvarname')) . '</span><br />' - .'<input type="text" name="_action_varname['.$id.']" id="action_varname'.$id.'" ' - .'value="' . rcube::Q($action['name']) . '" size="35" ' - . $this->error_class($id, 'action', 'name', 'action_varname') .' />'; - $out .= '<br /><span class="label">' .rcube::Q($this->gettext('setvarvalue')) . '</span><br />' - .'<input type="text" name="_action_varvalue['.$id.']" id="action_varvalue'.$id.'" ' - .'value="' . rcube::Q($action['value']) . '" size="35" ' - . $this->error_class($id, 'action', 'value', 'action_varvalue') .' />'; - $out .= '<br /><span class="label">' .rcube::Q($this->gettext('setvarmodifiers')) . '</span><br />'; - foreach ($set_modifiers as $j => $s_m) { - $s_m_id = 'action_varmods' . $id . $s_m; - $out .= sprintf('<input type="checkbox" name="_action_varmods[%s][]" value="%s" id="%s"%s />%s<br>', - $id, $s_m, $s_m_id, - (array_key_exists($s_m, (array)$action) && $action[$s_m] ? ' checked="checked"' : ''), - rcube::Q($this->gettext('var' . $s_m))); - } - $out .= '</div>'; - - // notify - // skip :options tag - not used by the mailto method - $out .= '<div id="action_notify' .$id.'" style="display:' .($action['type']=='notify' ? 'inline' : 'none') .'">'; - $out .= '<span class="label">' .rcube::Q($this->gettext('notifyaddress')) . '</span><br />' - .'<input type="text" name="_action_notifyaddress['.$id.']" id="action_notifyaddress'.$id.'" ' - .'value="' . rcube::Q($action['address']) . '" size="35" ' - . $this->error_class($id, 'action', 'address', 'action_notifyaddress') .' />'; - $out .= '<br /><span class="label">'. rcube::Q($this->gettext('notifybody')) .'</span><br />' - .'<textarea name="_action_notifybody['.$id.']" id="action_notifybody' .$id. '" ' - .'rows="3" cols="35" '. $this->error_class($id, 'action', 'method', 'action_notifybody') . '>' - . rcube::Q($action['body'], 'strict', false) . "</textarea>\n"; - $out .= '<br /><span class="label">' .rcube::Q($this->gettext('notifysubject')) . '</span><br />' - .'<input type="text" name="_action_notifymessage['.$id.']" id="action_notifymessage'.$id.'" ' - .'value="' . rcube::Q($action['message']) . '" size="35" ' - . $this->error_class($id, 'action', 'message', 'action_notifymessage') .' />'; - $out .= '<br /><span class="label">' .rcube::Q($this->gettext('notifyfrom')) . '</span><br />' - .'<input type="text" name="_action_notifyfrom['.$id.']" id="action_notifyfrom'.$id.'" ' - .'value="' . rcube::Q($action['from']) . '" size="35" ' - . $this->error_class($id, 'action', 'from', 'action_notifyfrom') .' />'; - $importance_options = array( - 3 => 'notifyimportancelow', - 2 => 'notifyimportancenormal', - 1 => 'notifyimportancehigh' - ); - $select_importance = new html_select(array( - 'name' => '_action_notifyimportance[' . $id . ']', - 'id' => '_action_notifyimportance' . $id, - 'class' => $this->error_class($id, 'action', 'importance', 'action_notifyimportance'))); - foreach ($importance_options as $io_v => $io_n) { - $select_importance->add(rcube::Q($this->gettext($io_n)), $io_v); - } - $out .= '<br /><span class="label">' . rcube::Q($this->gettext('notifyimportance')) . '</span><br />'; - $out .= $select_importance->show($action['importance'] ? $action['importance'] : 2); - $out .= '</div>'; - - // mailbox select - if ($action['type'] == 'fileinto') - $mailbox = $this->mod_mailbox($action['target'], 'out'); - else - $mailbox = ''; - - $select = $this->rc->folder_selector(array( - 'realnames' => false, - 'maxlength' => 100, - 'id' => 'action_mailbox' . $id, - 'name' => "_action_mailbox[$id]", - 'style' => 'display:'.(!isset($action) || $action['type']=='fileinto' ? 'inline' : 'none') - )); - $out .= $select->show($mailbox); - $out .= '</td>'; - - // add/del buttons - $out .= '<td class="rowbuttons">'; - $out .= '<a href="#" id="actionadd' . $id .'" title="'. rcube::Q($this->gettext('add')). '" - onclick="rcmail.managesieve_actionadd(' . $id .')" class="button add"></a>'; - $out .= '<a href="#" id="actiondel' . $id .'" title="'. rcube::Q($this->gettext('del')). '" - onclick="rcmail.managesieve_actiondel(' . $id .')" class="button del' . ($rows_num<2 ? ' disabled' : '') .'"></a>'; - $out .= '</td>'; - - $out .= '</tr></table>'; - - $out .= $div ? "</div>\n" : ''; - - return $out; - } - - private function genid() - { - return preg_replace('/[^0-9]/', '', microtime(true)); - } - - private function strip_value($str, $allow_html = false, $trim = true) - { - if (!$allow_html) { - $str = strip_tags($str); - } - - return $trim ? trim($str) : $str; - } - - private function error_class($id, $type, $target, $elem_prefix='') - { - // TODO: tooltips - if (($type == 'test' && ($str = $this->errors['tests'][$id][$target])) || - ($type == 'action' && ($str = $this->errors['actions'][$id][$target])) - ) { - $this->add_tip($elem_prefix.$id, $str, true); - return ' class="error"'; - } - - return ''; - } - - private function add_tip($id, $str, $error=false) - { - if ($error) - $str = html::span('sieve error', $str); - - $this->tips[] = array($id, $str); - } - - private function print_tips() - { - if (empty($this->tips)) - return; - - $script = rcmail_output::JS_OBJECT_NAME.'.managesieve_tip_register('.json_encode($this->tips).');'; - $this->rc->output->add_script($script, 'foot'); - } - - /** - * Converts mailbox name from/to UTF7-IMAP from/to internal Sieve encoding - * with delimiter replacement. - * - * @param string $mailbox Mailbox name - * @param string $mode Conversion direction ('in'|'out') - * - * @return string Mailbox name - */ - private function mod_mailbox($mailbox, $mode = 'out') - { - $delimiter = $_SESSION['imap_delimiter']; - $replace_delimiter = $this->rc->config->get('managesieve_replace_delimiter'); - $mbox_encoding = $this->rc->config->get('managesieve_mbox_encoding', 'UTF7-IMAP'); - - if ($mode == 'out') { - $mailbox = rcube_charset::convert($mailbox, $mbox_encoding, 'UTF7-IMAP'); - if ($replace_delimiter && $replace_delimiter != $delimiter) - $mailbox = str_replace($replace_delimiter, $delimiter, $mailbox); - } - else { - $mailbox = rcube_charset::convert($mailbox, 'UTF7-IMAP', $mbox_encoding); - if ($replace_delimiter && $replace_delimiter != $delimiter) - $mailbox = str_replace($delimiter, $replace_delimiter, $mailbox); - } - - return $mailbox; - } - - /** - * List sieve scripts - * - * @return array Scripts list - */ - public function list_scripts() - { - if ($this->list !== null) { - return $this->list; - } - - $this->list = $this->sieve->get_scripts(); - - // Handle active script(s) and list of scripts according to Kolab's KEP:14 - if ($this->rc->config->get('managesieve_kolab_master')) { - - // Skip protected names - foreach ((array)$this->list as $idx => $name) { - $_name = strtoupper($name); - if ($_name == 'MASTER') - $master_script = $name; - else if ($_name == 'MANAGEMENT') - $management_script = $name; - else if($_name == 'USER') - $user_script = $name; - else - continue; - - unset($this->list[$idx]); - } - - // get active script(s), read USER script - if ($user_script) { - $extension = $this->rc->config->get('managesieve_filename_extension', '.sieve'); - $filename_regex = '/'.preg_quote($extension, '/').'$/'; - $_SESSION['managesieve_user_script'] = $user_script; - - $this->sieve->load($user_script); - - foreach ($this->sieve->script->as_array() as $rules) { - foreach ($rules['actions'] as $action) { - if ($action['type'] == 'include' && empty($action['global'])) { - $name = preg_replace($filename_regex, '', $action['target']); - $this->active[] = $name; - } - } - } - } - // create USER script if it doesn't exist - else { - $content = "# USER Management Script\n" - ."#\n" - ."# This script includes the various active sieve scripts\n" - ."# it is AUTOMATICALLY GENERATED. DO NOT EDIT MANUALLY!\n" - ."#\n" - ."# For more information, see http://wiki.kolab.org/KEP:14#USER\n" - ."#\n"; - if ($this->sieve->save_script('USER', $content)) { - $_SESSION['managesieve_user_script'] = 'USER'; - if (empty($this->master_file)) - $this->sieve->activate('USER'); - } - } - } - else if (!empty($this->list)) { - // Get active script name - if ($active = $this->sieve->get_active()) { - $this->active = array($active); - } - - // Hide scripts from config - $exceptions = $this->rc->config->get('managesieve_filename_exceptions'); - if (!empty($exceptions)) { - $this->list = array_diff($this->list, (array)$exceptions); - } - } - - return $this->list; - } - - /** - * Removes sieve script - * - * @param string $name Script name - * - * @return bool True on success, False on failure - */ - public function remove_script($name) - { - $result = $this->sieve->remove($name); - - // Kolab's KEP:14 - if ($result && $this->rc->config->get('managesieve_kolab_master')) { - $this->deactivate_script($name); - } - - return $result; + $engine = $this->get_engine(); + $engine->save(); } /** - * Activates sieve script - * - * @param string $name Script name - * - * @return bool True on success, False on failure + * Initializes engine object */ - public function activate_script($name) + private function get_engine() { - // Kolab's KEP:14 - if ($this->rc->config->get('managesieve_kolab_master')) { - $extension = $this->rc->config->get('managesieve_filename_extension', '.sieve'); - $user_script = $_SESSION['managesieve_user_script']; - - // if the script is not active... - if ($user_script && ($key = array_search($name, $this->active)) === false) { - // ...rewrite USER file adding appropriate include command - if ($this->sieve->load($user_script)) { - $script = $this->sieve->script->as_array(); - $list = array(); - $regexp = '/' . preg_quote($extension, '/') . '$/'; - - // Create new include entry - $rule = array( - 'actions' => array( - 0 => array( - 'target' => $name.$extension, - 'type' => 'include', - 'personal' => true, - ))); + if (!$this->engine) { + $this->load_config(); - // get all active scripts for sorting - foreach ($script as $rid => $rules) { - foreach ($rules['actions'] as $aid => $action) { - if ($action['type'] == 'include' && empty($action['global'])) { - $target = $extension ? preg_replace($regexp, '', $action['target']) : $action['target']; - $list[] = $target; - } - } - } - $list[] = $name; - - // Sort and find current script position - asort($list, SORT_LOCALE_STRING); - $list = array_values($list); - $index = array_search($name, $list); - - // add rule at the end of the script - if ($index === false || $index == count($list)-1) { - $this->sieve->script->add_rule($rule); - } - // add rule at index position - else { - $script2 = array(); - foreach ($script as $rid => $rules) { - if ($rid == $index) { - $script2[] = $rule; - } - $script2[] = $rules; - } - $this->sieve->script->content = $script2; - } - - $result = $this->sieve->save(); - if ($result) { - $this->active[] = $name; - } - } - } - } - else { - $result = $this->sieve->activate($name); - if ($result) - $this->active = array($name); - } + // Add include path for internal classes + $include_path = $this->home . '/lib' . PATH_SEPARATOR; + $include_path .= ini_get('include_path'); + set_include_path($include_path); - return $result; - } - - /** - * Deactivates sieve script - * - * @param string $name Script name - * - * @return bool True on success, False on failure - */ - public function deactivate_script($name) - { - // Kolab's KEP:14 - if ($this->rc->config->get('managesieve_kolab_master')) { - $extension = $this->rc->config->get('managesieve_filename_extension', '.sieve'); - $user_script = $_SESSION['managesieve_user_script']; - - // if the script is active... - if ($user_script && ($key = array_search($name, $this->active)) !== false) { - // ...rewrite USER file removing appropriate include command - if ($this->sieve->load($user_script)) { - $script = $this->sieve->script->as_array(); - $name = $name.$extension; - - foreach ($script as $rid => $rules) { - foreach ($rules['actions'] as $aid => $action) { - if ($action['type'] == 'include' && empty($action['global']) - && $action['target'] == $name - ) { - break 2; - } - } - } - - // Entry found - if ($rid < count($script)) { - $this->sieve->script->delete_rule($rid); - $result = $this->sieve->save(); - if ($result) { - unset($this->active[$key]); - } - } - } - } - } - else { - $result = $this->sieve->deactivate(); - if ($result) - $this->active = array(); - } - - return $result; - } - - /** - * Saves current script (adding some variables) - */ - public function save_script($name = null) - { - // Kolab's KEP:14 - if ($this->rc->config->get('managesieve_kolab_master')) { - $this->sieve->script->set_var('EDITOR', self::PROGNAME); - $this->sieve->script->set_var('EDITOR_VERSION', self::VERSION); - } - - return $this->sieve->save($name); - } - - /** - * Returns list of rules from the current script - * - * @return array List of rules - */ - public function list_rules() - { - $result = array(); - $i = 1; - - foreach ($this->script as $idx => $filter) { - if ($filter['type'] != 'if') { - continue; - } - $fname = $filter['name'] ? $filter['name'] : "#$i"; - $result[] = array( - 'id' => $idx, - 'name' => rcube::Q($fname), - 'class' => $filter['disabled'] ? 'disabled' : '', - ); - $i++; + $this->engine = new rcube_sieve_engine($this); } - return $result; + return $this->engine; } } diff --git a/plugins/managesieve/package.xml b/plugins/managesieve/package.xml index a0c38b82d..9c02957a5 100644 --- a/plugins/managesieve/package.xml +++ b/plugins/managesieve/package.xml @@ -26,7 +26,7 @@ <release>stable</release> <api>stable</api> </stability> - <license uri="http://www.gnu.org/licenses/gpl-2.0.html">GNU GPLv2</license> + <license uri="http://www.gnu.org/licenses/gpl.html">GNU GPLv3+</license> <notes>-</notes> <contents> <dir baseinstalldir="/" name="/"> @@ -93,6 +93,7 @@ <file name="skins/classic/images/add.png" role="data"></file> <file name="skins/classic/images/del.png" role="data"></file> <file name="skins/classic/images/down_small.gif" role="data"></file> + <file name="skins/classic/images/erase.png" role="data"></file> <file name="skins/classic/images/filter.png" role="data"></file> <file name="skins/classic/images/up_small.gif" role="data"></file> <file name="skins/larry/managesieve.css" role="data"></file> @@ -103,10 +104,11 @@ <file name="skins/larry/images/add.png" role="data"></file> <file name="skins/larry/images/del.png" role="data"></file> <file name="skins/larry/images/down_small.gif" role="data"></file> + <file name="skins/larry/images/erase.png" role="data"></file> <file name="skins/larry/images/up_small.gif" role="data"></file> - <file name="managesieve.php" role="php"></file> - <file name="lib/rcube_sieve.php" role="php"></file> - <file name="lib/rcube_sieve_script.php" role="php"></file> + <file name="lib/Roundcube/rcube_sieve.php" role="php"></file> + <file name="lib/Roundcube/rcube_sieve_engine.php" role="php"></file> + <file name="lib/Roundcube/rcube_sieve_script.php" role="php"></file> <file name="lib/Net/Sieve.php" role="php"></file> <file name="config.inc.php.dist" role="data"></file> </dir> diff --git a/plugins/managesieve/skins/classic/images/erase.png b/plugins/managesieve/skins/classic/images/erase.png Binary files differnew file mode 100644 index 000000000..ddd3a9782 --- /dev/null +++ b/plugins/managesieve/skins/classic/images/erase.png diff --git a/plugins/managesieve/skins/classic/managesieve.css b/plugins/managesieve/skins/classic/managesieve.css index 86a0d197d..59d88cb46 100644 --- a/plugins/managesieve/skins/classic/managesieve.css +++ b/plugins/managesieve/skins/classic/managesieve.css @@ -201,11 +201,30 @@ td.rowtargets padding-top: 2px; } +td.rowtargets > div +{ + vertical-align: top; + margin-top: 2px; +} + td.rowtargets div.adv { padding-top: 3px; } +td.rowtargets div.adv span.label +{ + display: inline-block; + padding-right: 10px; + min-width: 65px; +} + +html.mozilla #filter-form select +{ + padding-top: 3px; + padding-bottom: 3px; +} + input.disabled, input.disabled:hover { color: #999999; @@ -226,6 +245,7 @@ input.radio select.operator_selector { width: 200px; + vertical-align: top; } td.rowtargets span, @@ -306,8 +326,78 @@ a.button.disabled #filter-form textarea { font-size: 11px; + vertical-align: middle; +} + +/* smart multi-row input field */ +.listarea +{ + border: 1px solid #666; + margin: 0; + padding: 1px; + display: inline-block; + max-height: 67px; + overflow-y: auto; +} + +td.rowtargets > span.listarea +{ + vertical-align: top; + margin-top: 2px; +} + +.listelement +{ + display: block; + white-space: nowrap; + background-color: #fff; + border-top: 1px solid #e2e2e2; + height: 16px; + padding: 0; + margin: 0; + overflow: hidden; + line-height: 16px; } +.listarea.error .listelement +{ + background-color: #FFFFC4; +} + +.listelement:first-child +{ + border-top: none; +} + +#filter-form .listelement input +{ + border: none; + border-radius: 0; + box-shadow: none; + outline: none; + vertical-align: top; + height: 16px; + padding-top: 0; + padding-bottom: 0; + line-height: 16px; + background-color: transparent; +} + +.listelement input:focus +{ + box-shadow: none; +} + +.listelement .reset +{ + display: inline-block; + width: 16px; + height: 16px; + background: url(images/erase.png) -1px 0 no-repeat #eee; + cursor: pointer; +} + + /* fixes for popup window */ body.iframe.mail diff --git a/plugins/managesieve/skins/classic/templates/managesieve.html b/plugins/managesieve/skins/classic/templates/managesieve.html index 71eebe105..869e3ac36 100644 --- a/plugins/managesieve/skins/classic/templates/managesieve.html +++ b/plugins/managesieve/skins/classic/templates/managesieve.html @@ -19,7 +19,7 @@ </style> </head> -<body onload="rcube_init_mail_ui()"> +<body> <roundcube:include file="/includes/taskbar.html" /> <roundcube:include file="/includes/header.html" /> @@ -83,5 +83,9 @@ </ul> </div> +<script type="text/javascript"> +rcube_init_mail_ui(); +</script> + </body> </html> diff --git a/plugins/managesieve/skins/larry/images/erase.png b/plugins/managesieve/skins/larry/images/erase.png Binary files differnew file mode 100644 index 000000000..ddd3a9782 --- /dev/null +++ b/plugins/managesieve/skins/larry/images/erase.png diff --git a/plugins/managesieve/skins/larry/managesieve.css b/plugins/managesieve/skins/larry/managesieve.css index 099f05f0d..2144fe13f 100644 --- a/plugins/managesieve/skins/larry/managesieve.css +++ b/plugins/managesieve/skins/larry/managesieve.css @@ -43,7 +43,7 @@ #filtersetslist { width: 100%; - table-layout: fixed; + table-layout: fixed; } #filterslist tbody td, @@ -175,9 +175,23 @@ td.rowtargets padding-top: 2px; } +td.rowtargets > div +{ + vertical-align: top; + margin-top: 2px; +} + td.rowtargets div.adv { padding-top: 3px; + font-size: 10px; +} + +td.rowtargets div.adv span.label +{ + display: inline-block; + padding-right: 5px; + min-width: 70px; } input.disabled, input.disabled:hover @@ -205,6 +219,7 @@ input.radio select.operator_selector { width: 200px; + vertical-align: top; } td.rowtargets span, @@ -290,6 +305,13 @@ a.button.disabled { font-size: 11px; padding: 1px; + vertical-align: middle; +} + +html.mozilla #filter-form select +{ + padding-top: 3px; + padding-bottom: 3px; } /* revert larry style button */ @@ -306,6 +328,80 @@ fieldset border-radius: 4px; } +/* smart multi-row input field */ +.listarea +{ + border: 1px solid #B2B2B2; + border-radius: 4px; + box-shadow: inset 0 0 2px 1px rgba(0,0,0, 0.1); + -moz-box-shadow: inset 0 0 2px 1px rgba(0,0,0, 0.1); + -webkit-box-shadow: inset 0 0 2px 1px rgba(0,0,0, 0.1); + -o-box-shadow: inset 0 0 2px 1px rgba(0,0,0, 0.1); + margin: 0; + padding: 2px; + display: inline-block; + max-height: 59px; + overflow-y: auto; +} + +td.rowtargets > span.listarea +{ + vertical-align: top; + margin-top: 2px; +} + +.listelement +{ + display: block; + white-space: nowrap; + background-color: #fff; + border-top: 1px solid #e2e2e2; + height: 14px; + padding: 0; + margin: 0; + overflow: hidden; + line-height: 14px; +} + +.listarea.error .listelement +{ + background-color: #FFFFC4; +} + +.listelement:first-child +{ + border-top: none; +} + +#filter-form .listelement input +{ + border: none; + border-radius: 0; + box-shadow: none; + outline: none; + vertical-align: top; + height: 14px; + padding-top: 0; + padding-bottom: 0; + line-height: 14px; + background-color: transparent; +} + +.listelement input:focus +{ + box-shadow: none; +} + +.listelement .reset +{ + display: inline-block; + width: 16px; + height: 16px; + background: url(images/erase.png) -1px -1px no-repeat #eee; + cursor: pointer; +} + + /* fixes for popup window */ body.iframe.mail diff --git a/plugins/managesieve/tests/src/parser.out b/plugins/managesieve/tests/src/parser.out index 385c8890d..366515b06 100644 --- a/plugins/managesieve/tests/src/parser.out +++ b/plugins/managesieve/tests/src/parser.out @@ -1,4 +1,4 @@ -require ["fileinto","reject","envelope"]; +require ["envelope","fileinto","reject"]; # rule:[spam] if header :contains "X-DSPAM-Result" "Spam" { diff --git a/plugins/managesieve/tests/src/parser_date b/plugins/managesieve/tests/src/parser_date new file mode 100644 index 000000000..06b00333f --- /dev/null +++ b/plugins/managesieve/tests/src/parser_date @@ -0,0 +1,21 @@ +require ["comparator-i;ascii-numeric","date","fileinto","relational"]; +# rule:[date] +if allof (date :originalzone :value "ge" :comparator "i;ascii-numeric" "date" "hour" "09") +{ + fileinto "urgent"; +} +# rule:[date-weekday] +if date :is "received" "weekday" "0" +{ + fileinto "weekend"; +} +# rule:[date-zone] +if date :zone "-0500" :value "gt" :comparator "i;ascii-numeric" "received" "iso8601" "2007-02-26T09:00:00-05:00" +{ + stop; +} +# rule:[currentdate] +if anyof (currentdate :is "weekday" "0", currentdate :value "lt" :comparator "i;ascii-numeric" "hour" "09", currentdate :value "ge" :comparator "i;ascii-numeric" "date" "2007-06-30") +{ + stop; +} diff --git a/plugins/managesieve/tests/src/parser_enotify_b b/plugins/managesieve/tests/src/parser_enotify_b index 8854658f4..9a17eaf0c 100644 --- a/plugins/managesieve/tests/src/parser_enotify_b +++ b/plugins/managesieve/tests/src/parser_enotify_b @@ -1,4 +1,4 @@ -require ["envelope","variables","enotify"]; +require ["enotify","envelope","variables"]; # rule:[from] if envelope :all :matches "from" "*" { diff --git a/plugins/managesieve/tests/src/parser_index b/plugins/managesieve/tests/src/parser_index new file mode 100644 index 000000000..78aba9a55 --- /dev/null +++ b/plugins/managesieve/tests/src/parser_index @@ -0,0 +1,24 @@ +require ["comparator-i;ascii-numeric","date","fileinto","index","relational"]; +# rule:[index-header1] +if header :index 1 :last :contains "X-DSPAM-Result" "Spam" +{ + fileinto "Spam"; + stop; +} +# rule:[index-header2] +if header :index 2 :contains ["From","To"] "test@domain.tld" +{ + discard; + stop; +} +# rule:[index-address] +if address :index 1 :all :is "From" "nagios@domain.tld" +{ + fileinto "domain.tld"; + stop; +} +# rule:[index-date] +if date :index 1 :last :zone "-0500" :value "gt" :comparator "i;ascii-numeric" "received" "iso8601" "2007-02-26T09:00:00-05:00" +{ + stop; +} diff --git a/plugins/managesieve/tests/src/parser_notify_b b/plugins/managesieve/tests/src/parser_notify_b index cf80a9701..9a3ca803c 100644 --- a/plugins/managesieve/tests/src/parser_notify_b +++ b/plugins/managesieve/tests/src/parser_notify_b @@ -1,4 +1,4 @@ -require ["envelope","variables","notify"]; +require ["envelope","notify","variables"]; # rule:[from] if envelope :all :matches "from" "*" { diff --git a/plugins/managesieve/tests/src/parser_relational b/plugins/managesieve/tests/src/parser_relational index 0a92fde54..92c5e1a8e 100644 --- a/plugins/managesieve/tests/src/parser_relational +++ b/plugins/managesieve/tests/src/parser_relational @@ -1,4 +1,4 @@ -require ["relational","comparator-i;ascii-numeric"]; +require ["comparator-i;ascii-numeric","relational"]; # rule:[redirect] if header :value "ge" :comparator "i;ascii-numeric" "X-Spam-score" "14" { diff --git a/plugins/managesieve/tests/src/parser_subaddress b/plugins/managesieve/tests/src/parser_subaddress index f106b796e..e44555096 100644 --- a/plugins/managesieve/tests/src/parser_subaddress +++ b/plugins/managesieve/tests/src/parser_subaddress @@ -1,4 +1,4 @@ -require ["envelope","subaddress","fileinto"]; +require ["envelope","fileinto","subaddress"]; if envelope :user "To" "postmaster" { fileinto "postmaster"; diff --git a/plugins/markasjunk/localization/el_GR.inc b/plugins/markasjunk/localization/el_GR.inc index 78cfaf060..fb16a29ce 100644 --- a/plugins/markasjunk/localization/el_GR.inc +++ b/plugins/markasjunk/localization/el_GR.inc @@ -17,7 +17,7 @@ */ $labels = array(); -$labels['buttontext'] = 'Junk'; +$labels['buttontext'] = 'Ανεπιθύμητα'; $labels['buttontitle'] = 'Σήμανση ως Ανεπιθύμητου'; $labels['reportedasjunk'] = 'Αναφέρθηκε ως Ανεπιθήμητο'; diff --git a/plugins/markasjunk/localization/gl_ES.inc b/plugins/markasjunk/localization/gl_ES.inc index dd0c0ad40..d2a9e98b7 100644 --- a/plugins/markasjunk/localization/gl_ES.inc +++ b/plugins/markasjunk/localization/gl_ES.inc @@ -17,7 +17,7 @@ */ $labels = array(); -$labels['buttontext'] = 'Junk'; +$labels['buttontext'] = 'Correo lixo'; $labels['buttontitle'] = 'Marcar como correo lixo'; $labels['reportedasjunk'] = 'Mensaxe marcada como correo lixo'; diff --git a/plugins/markasjunk/localization/lb_LU.inc b/plugins/markasjunk/localization/lb_LU.inc new file mode 100644 index 000000000..eb211d66c --- /dev/null +++ b/plugins/markasjunk/localization/lb_LU.inc @@ -0,0 +1,24 @@ +<?php + +/* + +-----------------------------------------------------------------------+ + | plugins/markasjunk/localization/<lang>.inc | + | | + | Localization file of the Roundcube Webmail Mark-As-Junk plugin | + | Copyright (C) 2012-2013, The Roundcube Dev Team | + | | + | Licensed under the GNU General Public License version 3 or | + | any later version with exceptions for skins & plugins. | + | See the README file for a full license statement. | + | | + +-----------------------------------------------------------------------+ + + For translation see https://www.transifex.com/projects/p/roundcube-webmail/resource/plugin-markasjunk/ +*/ + +$labels = array(); +$labels['buttontext'] = 'Spam'; +$labels['buttontitle'] = 'Als Spam markéieren'; +$labels['reportedasjunk'] = 'Erfollegräich als Spam gemellt'; + +?>
\ No newline at end of file diff --git a/plugins/markasjunk/localization/lv_LV.inc b/plugins/markasjunk/localization/lv_LV.inc index f0ea921ba..5389ae399 100644 --- a/plugins/markasjunk/localization/lv_LV.inc +++ b/plugins/markasjunk/localization/lv_LV.inc @@ -17,8 +17,8 @@ */ $labels = array(); -$labels['buttontext'] = 'Junk'; -$labels['buttontitle'] = 'Iezīmēt kā mēstuli'; -$labels['reportedasjunk'] = 'Sekmīgi iezīmēta kā mēstule'; +$labels['buttontext'] = 'Mēstules'; +$labels['buttontitle'] = 'Atzīmēt kā mēstuli'; +$labels['reportedasjunk'] = 'Sekmīgi iatzīmēta kā mēstule'; ?>
\ No newline at end of file diff --git a/plugins/new_user_dialog/localization/ko_KR.inc b/plugins/new_user_dialog/localization/ko_KR.inc index 82240f37d..d9b519475 100644 --- a/plugins/new_user_dialog/localization/ko_KR.inc +++ b/plugins/new_user_dialog/localization/ko_KR.inc @@ -17,7 +17,7 @@ */ $labels = array(); -$labels['identitydialogtitle'] = '수신자의 신원을 채우기 바랍니다.'; -$labels['identitydialoghint'] = '이 박스는 최초로 로그인할 때만 나타납니다.'; +$labels['identitydialogtitle'] = '수신인의 신원을 완성하시기 바랍니다.'; +$labels['identitydialoghint'] = '이 상자는 최초로 로그인할 때만 나타납니다.'; ?>
\ No newline at end of file diff --git a/plugins/new_user_dialog/localization/lb_LU.inc b/plugins/new_user_dialog/localization/lb_LU.inc new file mode 100644 index 000000000..36da96e5e --- /dev/null +++ b/plugins/new_user_dialog/localization/lb_LU.inc @@ -0,0 +1,23 @@ +<?php + +/* + +-----------------------------------------------------------------------+ + | plugins/new_user_dialog/localization/<lang>.inc | + | | + | Localization file of the Roundcube Webmail New User Dialog plugin | + | Copyright (C) 2012-2013, The Roundcube Dev Team | + | | + | Licensed under the GNU General Public License version 3 or | + | any later version with exceptions for skins & plugins. | + | See the README file for a full license statement. | + | | + +-----------------------------------------------------------------------+ + + For translation see https://www.transifex.com/projects/p/roundcube-webmail/resource/plugin-new_user_dialog/ +*/ + +$labels = array(); +$labels['identitydialogtitle'] = 'Vervollstänneg w.e.gl deng Sender-Identitéit'; +$labels['identitydialoghint'] = 'Dës Këscht erschéngt just beim éischte Login.'; + +?>
\ No newline at end of file diff --git a/plugins/new_user_dialog/localization/lv_LV.inc b/plugins/new_user_dialog/localization/lv_LV.inc index 2e3642330..0447d995a 100644 --- a/plugins/new_user_dialog/localization/lv_LV.inc +++ b/plugins/new_user_dialog/localization/lv_LV.inc @@ -17,7 +17,7 @@ */ $labels = array(); -$labels['identitydialogtitle'] = 'Lūdzu, aizpildiet nosūtītāja identifikācijas informāciju'; -$labels['identitydialoghint'] = 'Šis logs parādīsies tikai pirmajā pieteikšanās reizē'; +$labels['identitydialogtitle'] = 'Lūdzu aizpildiet Jūsu, kā sūtītāja, identitātes informāciju'; +$labels['identitydialoghint'] = 'Šis logs parādīsies tikai pirmajā autorizācijas reizē.'; ?>
\ No newline at end of file diff --git a/plugins/new_user_dialog/localization/nl_NL.inc b/plugins/new_user_dialog/localization/nl_NL.inc index 4d5d41185..c5d392f98 100644 --- a/plugins/new_user_dialog/localization/nl_NL.inc +++ b/plugins/new_user_dialog/localization/nl_NL.inc @@ -17,7 +17,7 @@ */ $labels = array(); -$labels['identitydialogtitle'] = 'Vul uw correcte identiteitgegevens in a.u.b.'; -$labels['identitydialoghint'] = 'Dit scherm verschijnt enkel bij uw eerste login.'; +$labels['identitydialogtitle'] = 'Vul alstublieft uw afzendergegevens in.'; +$labels['identitydialoghint'] = 'Dit scherm verschijnt eenmalig bij uw eerste aanmelding.'; ?>
\ No newline at end of file diff --git a/plugins/new_user_dialog/localization/zh_CN.inc b/plugins/new_user_dialog/localization/zh_CN.inc index 99b2de701..ca40173af 100644 --- a/plugins/new_user_dialog/localization/zh_CN.inc +++ b/plugins/new_user_dialog/localization/zh_CN.inc @@ -17,7 +17,7 @@ */ $labels = array(); -$labels['identitydialogtitle'] = '请填写发送者标识'; +$labels['identitydialogtitle'] = '请填写发送人身份'; $labels['identitydialoghint'] = '本提示仅在第一次登录时显示。'; ?>
\ No newline at end of file diff --git a/plugins/new_user_dialog/new_user_dialog.php b/plugins/new_user_dialog/new_user_dialog.php index 871384e47..39a707638 100644 --- a/plugins/new_user_dialog/new_user_dialog.php +++ b/plugins/new_user_dialog/new_user_dialog.php @@ -10,10 +10,12 @@ * @version @package_version@ * @license GNU GPLv3+ * @author Thomas Bruederli + * @author Aleksander Machniak */ class new_user_dialog extends rcube_plugin { public $task = 'login|mail'; + public $noframe = true; function init() { @@ -32,8 +34,9 @@ class new_user_dialog extends rcube_plugin function create_identity($p) { // set session flag when a new user was created and the default identity seems to be incomplete - if ($p['login'] && !$p['complete']) + if ($p['login'] && !$p['complete']) { $_SESSION['plugin.newuserdialog'] = true; + } } /** @@ -86,7 +89,6 @@ class new_user_dialog extends rcube_plugin 'id' => 'newuserdialog', 'action' => $rcmail->url('plugin.newusersave'), 'method' => 'post'), - html::tag('h3', null, rcube::Q($this->gettext('identitydialogtitle'))) . html::p('hint', rcube::Q($this->gettext('identitydialoghint'))) . $table->show() . html::p(array('class' => 'formbuttons'), @@ -94,12 +96,23 @@ class new_user_dialog extends rcube_plugin 'class' => 'button mainaction', 'value' => $this->gettext('save')))) )); + $title = rcube::JQ($this->gettext('identitydialogtitle')); + // disable keyboard events for messages list (#1486726) - $rcmail->output->add_script( - "rcmail.message_list.key_press = function(){}; - rcmail.message_list.key_down = function(){}; - $('#newuserdialog').show().dialog({ modal:true, resizable:false, closeOnEscape:false, width:420 }); - $('input[name=_name]').focus(); + $rcmail->output->add_script(" + $('#newuserdialog').show() + .dialog({modal:true, resizable:false, closeOnEscape:false, width:450, title:'$title'}) + .submit(function() { + var i, request = {}, form = $(this).serializeArray(); + + for (i in form) + request[form[i].name] = form[i].value; + + rcmail.http_post('plugin.newusersave', request, true); + return false; + }); + $('input[name=_name]').focus(); + rcube_webmail.prototype.new_user_dialog_close = function() { $('#newuserdialog').dialog('close'); } ", 'docready'); $this->include_stylesheet('newuserdialog.css'); @@ -107,16 +120,16 @@ class new_user_dialog extends rcube_plugin } /** - * Handler for submitted form + * Handler for submitted form (ajax request) * * Check fields and save to default identity if valid. * Afterwards the session flag is removed and we're done. */ function save_data() { - $rcmail = rcmail::get_instance(); - $identity = $rcmail->user->get_identity(); - $identities_level = intval($rcmail->config->get('identities_level', 0)); + $rcmail = rcmail::get_instance(); + $identity = $rcmail->user->get_identity(); + $ident_level = intval($rcmail->config->get('identities_level', 0)); $save_data = array( 'name' => rcube_utils::get_input_value('_name', rcube_utils::INPUT_POST), @@ -126,20 +139,26 @@ class new_user_dialog extends rcube_plugin ); // don't let the user alter the e-mail address if disabled by config - if ($identities_level == 1 || $identities_level == 3) + if (in_array($ident_level, array(1,3,4))) { $save_data['email'] = $identity['email']; - else - $save_data['email'] = rcube_utils::idn_to_ascii($save_data['email']); + } - // save data if not empty - if (!empty($save_data['name']) && !empty($save_data['email'])) { + if (empty($save_data['name']) || empty($save_data['email'])) { + $rcmail->output->show_message('formincomplete', 'error'); + } + else if (!rcube_utils::check_email($save_data['email'] = rcube_utils::idn_to_ascii($save_data['email']))) { + $rcmail->output->show_message('emailformaterror', 'error', array('email' => $save_data['email'])); + } + else { + // save data $rcmail->user->update_identity($identity['identity_id'], $save_data); $rcmail->session->remove('plugin.newuserdialog'); + // hide dialog + $rcmail->output->command('new_user_dialog_close'); + $rcmail->output->show_message('successfullysaved', 'confirmation'); } - $rcmail->output->redirect(''); + $rcmail->output->send(); } } - -?> diff --git a/plugins/new_user_dialog/package.xml b/plugins/new_user_dialog/package.xml index 0bca1d9d4..68a929931 100644 --- a/plugins/new_user_dialog/package.xml +++ b/plugins/new_user_dialog/package.xml @@ -13,21 +13,16 @@ <email>roundcube@gmail.com</email> <active>yes</active> </lead> - <date>2012-01-16</date> - <time>17:00</time> + <date>2013-05-09</date> <version> - <release>1.5</release> - <api>1.0</api> + <release>2.0</release> + <api>2.0</api> </version> <stability> <release>stable</release> <api>stable</api> </stability> <license uri="http://www.gnu.org/licenses/gpl.html">GNU GPLv3+</license> - <notes> -- Use jquery UI to render the dialog -- Fixed IDNA encoding/decoding of e-mail addresses (#1487909) - </notes> <contents> <dir baseinstalldir="/" name="/"> <file name="new_user_dialog.php" role="php"> @@ -71,84 +66,4 @@ </required> </dependencies> <phprelease/> - <changelog> - <release> - <date>2010-03-29</date> - <time>13:20:00</time> - <version> - <release>1.0</release> - <api>1.0</api> - </version> - <stability> - <release>stable</release> - <api>stable</api> - </stability> - <license uri="http://www.gnu.org/licenses/gpl-2.0.html">GNU GPLv2</license> - <notes></notes> - </release> - <release> - <date>2010-05-13</date> - <time>19:35:00</time> - <version> - <release>1.1</release> - <api>1.0</api> - </version> - <stability> - <release>stable</release> - <api>stable</api> - </stability> - <license uri="http://www.gnu.org/licenses/gpl-2.0.html">GNU GPLv2</license> - <notes> -- Fix space bar and backspace buttons not working (#1486726) - </notes> - </release> - <release> - <date>2010-05-27</date> - <time>12:00:00</time> - <version> - <release>1.2</release> - <api>1.0</api> - </version> - <stability> - <release>stable</release> - <api>stable</api> - </stability> - <license uri="http://www.gnu.org/licenses/gpl-2.0.html">GNU GPLv2</license> - <notes> -- Add overlay box only to mail task main template -- Fix possible error on form submission (#1486103) - </notes> - </release> - <release> - <date>2010-12-02</date> - <time>12:00:00</time> - <version> - <release>1.3</release> - <api>1.0</api> - </version> - <stability> - <release>stable</release> - <api>stable</api> - </stability> - <license uri="http://www.gnu.org/licenses/gpl-2.0.html">GNU GPLv2</license> - <notes> -- Added setting of focus on name input -- Added gl_ES translation - </notes> - </release> - <release> - <date>2012-01-16</date> - <time>17:00:00</time> - <version> - <release>1.5</release> - <api>1.0</api> - </version> - <stability> - <release>stable</release> - <api>stable</api> - </stability> - <license uri="http://www.gnu.org/licenses/gpl-2.0.html">GNU GPLv2</license> - <notes>- Use jquery UI to render the dialog</notes> - </release> - </changelog> </package> diff --git a/plugins/new_user_identity/new_user_identity.php b/plugins/new_user_identity/new_user_identity.php index f98145b6c..bb0821a53 100644 --- a/plugins/new_user_identity/new_user_identity.php +++ b/plugins/new_user_identity/new_user_identity.php @@ -8,6 +8,7 @@ * * @version @package_version@ * @author Kris Steinhoff + * @license GNU GPLv3+ * * Example configuration: * @@ -33,8 +34,6 @@ class new_user_identity extends rcube_plugin function lookup_user_name($args) { - $rcmail = rcmail::get_instance(); - if ($this->init_ldap($args['host'])) { $results = $this->ldap->search('*', $args['user'], true); if (count($results->records) == 1) { diff --git a/plugins/new_user_identity/package.xml b/plugins/new_user_identity/package.xml index e50cd9255..45a3c4c8d 100644 --- a/plugins/new_user_identity/package.xml +++ b/plugins/new_user_identity/package.xml @@ -24,7 +24,7 @@ <release>stable</release> <api>stable</api> </stability> - <license uri="http://www.gnu.org/licenses/gpl-2.0.html">GNU GPLv2</license> + <license uri="http://www.gnu.org/licenses/gpl.html">GNU GPLv3+</license> <notes>-</notes> <contents> <dir baseinstalldir="/" name="/"> diff --git a/plugins/newmail_notifier/localization/gl_ES.inc b/plugins/newmail_notifier/localization/gl_ES.inc index 6c1129b31..8d105531e 100644 --- a/plugins/newmail_notifier/localization/gl_ES.inc +++ b/plugins/newmail_notifier/localization/gl_ES.inc @@ -16,14 +16,14 @@ For translation see https://www.transifex.com/projects/p/roundcube-webmail/resource/plugin-newmail_notifier/ */ -$labels['basic'] = 'Display browser notifications on new message'; -$labels['desktop'] = 'Display desktop notifications on new message'; -$labels['sound'] = 'Play the sound on new message'; +$labels['basic'] = 'Amosar notificacións no navegador cando entre unha mensaxe nova'; +$labels['desktop'] = 'Amosar notificacións no escritorio cando chegue unha mensaxe nova'; +$labels['sound'] = 'Tocar un son cando chegue unha mensaxe nova'; $labels['test'] = 'Proba'; $labels['title'] = 'Novo Correo!'; -$labels['body'] = 'You\'ve received a new message.'; -$labels['testbody'] = 'This is a test notification.'; -$labels['desktopdisabled'] = 'Desktop notifications are disabled in your browser.'; +$labels['body'] = 'Recibiu unha mensaxe nova'; +$labels['testbody'] = 'Esta é unha notificación de proba'; +$labels['desktopdisabled'] = 'As notificacións de escritorio están desactivadas no seu navegador'; $labels['desktopunsupported'] = 'O teu navegador non soporta notificacións de escritorio.'; ?> diff --git a/plugins/newmail_notifier/localization/lb_LU.inc b/plugins/newmail_notifier/localization/lb_LU.inc new file mode 100644 index 000000000..c4b014819 --- /dev/null +++ b/plugins/newmail_notifier/localization/lb_LU.inc @@ -0,0 +1,29 @@ +<?php + +/* + +-----------------------------------------------------------------------+ + | plugins/newmail_notifier/localization/<lang>.inc | + | | + | Localization file of the Roundcube Webmail New Mail Notifier plugin | + | Copyright (C) 2012-2013, The Roundcube Dev Team | + | | + | Licensed under the GNU General Public License version 3 or | + | any later version with exceptions for skins & plugins. | + | See the README file for a full license statement. | + | | + +-----------------------------------------------------------------------+ + + For translation see https://www.transifex.com/projects/p/roundcube-webmail/resource/plugin-newmail_notifier/ +*/ + +$labels['basic'] = 'Browser-Notifikatioun bei neiem Message uweisen'; +$labels['desktop'] = 'Desktop-Notifikatioun bei neiem Message uweisen'; +$labels['sound'] = 'Dësen Toun bei neiem Message spillen'; +$labels['test'] = 'Test'; +$labels['title'] = 'Nei E-Mail!'; +$labels['body'] = 'Du hues en neie Message kritt.'; +$labels['testbody'] = 'Dëst ass eng Test-Benoorichtegung.'; +$labels['desktopdisabled'] = 'Desktop-Notifikatioune sinn an dengem Browser ausgeschalt.'; +$labels['desktopunsupported'] = 'Däi Browser ënnerstëtzt keng Desktop-Notifikatiounen.'; + +?> diff --git a/plugins/newmail_notifier/localization/lv_LV.inc b/plugins/newmail_notifier/localization/lv_LV.inc index 9df738b25..da9603cd5 100644 --- a/plugins/newmail_notifier/localization/lv_LV.inc +++ b/plugins/newmail_notifier/localization/lv_LV.inc @@ -16,14 +16,14 @@ For translation see https://www.transifex.com/projects/p/roundcube-webmail/resource/plugin-newmail_notifier/ */ -$labels['basic'] = 'Attēlot paziņojumu pie jaunas vēstules saņemšanas'; -$labels['desktop'] = 'Attēlot darbvirsmas paziņojumu pie jaunas vēstules saņemšanas'; -$labels['sound'] = 'Atskaņot skaņas signālu pie jaunas vēstules saņemšanas'; -$labels['test'] = 'Test'; -$labels['title'] = 'Jauns E-pasts!'; -$labels['body'] = 'Jūs esat saņēmis jaunu e-pastu.'; +$labels['basic'] = 'Saņemot jaunu vēstuli, parādīt paziņojumu'; +$labels['desktop'] = 'Saņemot jaunu vēstuli, parādīt darbavirsmas paziņojumu'; +$labels['sound'] = 'Saņemot jaunu vēstuli, atskaņot skaņas signālu'; +$labels['test'] = 'Pārbaudīt'; +$labels['title'] = 'Jauns e-pasts!'; +$labels['body'] = 'Jūs esat saņēmis jaunu vēstuli.'; $labels['testbody'] = 'Šis ir testa paziņojums.'; -$labels['desktopdisabled'] = 'Darbvirsmas paziņojumi ir atslēgti Jūsu pārlūkprogrammā.'; -$labels['desktopunsupported'] = 'Jūsu pārlūkprogramma neatbalsta darbvirsmas paziņojumus.'; +$labels['desktopdisabled'] = 'Darbavirsmas paziņojumi Jūsu pārlūkprogrammā ir atslēgti.'; +$labels['desktopunsupported'] = 'Jūsu pārlūkprogramma neatbalsta darbavirsmas paziņojumus.'; ?> diff --git a/plugins/newmail_notifier/localization/nl_NL.inc b/plugins/newmail_notifier/localization/nl_NL.inc index e18a6ff2d..01f97e4ce 100644 --- a/plugins/newmail_notifier/localization/nl_NL.inc +++ b/plugins/newmail_notifier/localization/nl_NL.inc @@ -16,14 +16,14 @@ For translation see https://www.transifex.com/projects/p/roundcube-webmail/resource/plugin-newmail_notifier/ */ -$labels['basic'] = 'Toon browsermelding bij nieuw bericht'; -$labels['desktop'] = 'Toon desktopmelding bij nieuw bericht'; -$labels['sound'] = 'Speel geluid bij nieuw bericht'; +$labels['basic'] = 'Toon melding in browser bij nieuw bericht'; +$labels['desktop'] = 'Toon melding op bureaublad bij nieuw bericht'; +$labels['sound'] = 'Geluid afspelen bij nieuw bericht'; $labels['test'] = 'Test'; $labels['title'] = 'Nieuwe e-mail!'; $labels['body'] = 'U heeft een nieuw bericht ontvangen.'; $labels['testbody'] = 'Dit is een testmelding.'; -$labels['desktopdisabled'] = 'Desktopmeldingen zijn uitgeschakeld in uw browser.'; -$labels['desktopunsupported'] = 'Uw browser ondersteunt geen desktopmeldingen.'; +$labels['desktopdisabled'] = 'Bureaubladmeldingen zijn uitgeschakeld in uw browser.'; +$labels['desktopunsupported'] = 'Uw browser ondersteunt geen bureaubladmeldingen.'; ?> diff --git a/plugins/newmail_notifier/newmail_notifier.js b/plugins/newmail_notifier/newmail_notifier.js index 7c9b55ded..c398424b6 100644 --- a/plugins/newmail_notifier/newmail_notifier.js +++ b/plugins/newmail_notifier/newmail_notifier.js @@ -34,6 +34,13 @@ function newmail_notifier_stop(prop) $('<link rel="shortcut icon" href="'+rcmail.env.favicon_href+'"/>').replaceAll('link[rel="shortcut icon"]'); rcmail.env.favicon_href = null; } + + // Remove IE icon overlay if we're pinned to Taskbar + try { + if(window.external.msIsSiteMode()) { + window.external.msSiteModeClearIconOverlay(); + } + } catch(e) {} } // Basic notification: window.focus and favicon change @@ -49,6 +56,13 @@ function newmail_notifier_basic() rcmail.env.favicon_href = oldlink.attr('href'); link.replaceAll(oldlink); + + // Add IE icon overlay if we're pinned to Taskbar + try { + if (window.external.msIsSiteMode()) { + window.external.msSiteModeSetIconOverlay('plugins/newmail_notifier/overlay.ico', rcmail.gettext('title', 'newmail_notifier')); + } + } catch(e) {} } // Sound notification @@ -69,44 +83,79 @@ function newmail_notifier_sound() } } -// Desktop notification (need Chrome or Firefox with a plugin) +// Desktop notification +// - Require Chrome or Firefox latest version (22+) / 21.0 or older with a plugin function newmail_notifier_desktop(body) { - var dn = window.webkitNotifications; - - if (dn && !dn.checkPermission()) { - if (rcmail.newmail_popup) - rcmail.newmail_popup.cancel(); - var popup = window.webkitNotifications.createNotification('plugins/newmail_notifier/mail.png', - rcmail.gettext('title', 'newmail_notifier'), body); - popup.onclick = function() { - this.cancel(); + +/** + * Fix: As of 17 June 2013, Chrome/Chromium does not implement Notification.permission correctly that + * it gives 'undefined' until an object has been created: + * https://code.google.com/p/chromium/issues/detail?id=163226 + * + */ + try { + if (Notification.permission == 'granted' || Notification.permission == undefined) { + var popup = new Notification(rcmail.gettext('title', 'newmail_notifier'), { + dir: "auto", + lang: "", + body: body, + tag: "newmail_notifier", + icon: "plugins/newmail_notifier/mail.png", + }); + popup.onclick = function() { + this.close(); + } + setTimeout(function() { popup.close(); }, 10000); // close after 10 seconds + if (popup.permission == 'granted') return true; + } + } + catch (e) { + var dn = window.webkitNotifications; + + if (dn && !dn.checkPermission()) { + if (rcmail.newmail_popup) + rcmail.newmail_popup.cancel(); + var popup = window.webkitNotifications.createNotification('plugins/newmail_notifier/mail.png', + rcmail.gettext('title', 'newmail_notifier'), body); + popup.onclick = function() { + this.cancel(); + } + popup.show(); + setTimeout(function() { popup.cancel(); }, 10000); // close after 10 seconds + rcmail.newmail_popup = popup; + return true; } - popup.show(); - setTimeout(function() { popup.cancel(); }, 10000); // close after 10 seconds - rcmail.newmail_popup = popup; - return true; } - return false; } function newmail_notifier_test_desktop() { - var dn = window.webkitNotifications, - txt = rcmail.gettext('testbody', 'newmail_notifier'); + var txt = rcmail.gettext('testbody', 'newmail_notifier'); - if (dn) { - if (!dn.checkPermission()) - newmail_notifier_desktop(txt); + // W3C draft implementation (with fix for Chrome/Chromium) + try { + var testNotification = new window.Notification(txt, {tag: "newmail_notifier"}); // Try to show a test message + if (Notification.permission !== 'granted' || (testNotification.permission && testNotification.permission !== 'granted')) + newmail_notifier_desktop_authorize(); + } + // webkit implementation + catch (e) { + var dn = window.webkitNotifications; + if (dn) { + if (!dn.checkPermission()) + newmail_notifier_desktop(txt); + else + dn.requestPermission(function() { + if (!newmail_notifier_desktop(txt)) + rcmail.display_message(rcmail.gettext('desktopdisabled', 'newmail_notifier'), 'error'); + }); + } else - dn.requestPermission(function() { - if (!newmail_notifier_desktop(txt)) - rcmail.display_message(rcmail.gettext('desktopdisabled', 'newmail_notifier'), 'error'); - }); + // Everything fails, means the browser has no support + rcmail.display_message(rcmail.gettext('desktopunsupported', 'newmail_notifier'), 'error'); } - else - rcmail.display_message(rcmail.gettext('desktopunsupported', 'newmail_notifier'), 'error'); } function newmail_notifier_test_basic() @@ -118,3 +167,12 @@ function newmail_notifier_test_sound() { newmail_notifier_sound(); } + +function newmail_notifier_desktop_authorize() { + Notification.requestPermission(function(perm) { + if (perm == 'denied') + rcmail.display_message(rcmail.gettext('desktopdisabled', 'newmail_notifier'), 'error'); + if (perm == 'granted') + newmail_notifier_test_desktop(); // Test again, which should show test message + }); +} diff --git a/plugins/newmail_notifier/newmail_notifier.php b/plugins/newmail_notifier/newmail_notifier.php index 61f7bdbaa..ca1c2ff67 100644 --- a/plugins/newmail_notifier/newmail_notifier.php +++ b/plugins/newmail_notifier/newmail_notifier.php @@ -15,18 +15,18 @@ * * Copyright (C) 2011, Kolab Systems AG * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 - * as published by the Free Software Foundation. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see http://www.gnu.org/licenses/. */ class newmail_notifier extends rcube_plugin diff --git a/plugins/newmail_notifier/overlay.ico b/plugins/newmail_notifier/overlay.ico Binary files differnew file mode 100644 index 000000000..17eb61a05 --- /dev/null +++ b/plugins/newmail_notifier/overlay.ico diff --git a/plugins/newmail_notifier/package.xml b/plugins/newmail_notifier/package.xml index ea0fcd9c1..b8ef34933 100644 --- a/plugins/newmail_notifier/package.xml +++ b/plugins/newmail_notifier/package.xml @@ -28,7 +28,7 @@ <release>stable</release> <api>stable</api> </stability> - <license uri="http://www.gnu.org/licenses/gpl-2.0.html">GNU GPLv2</license> + <license uri="http://www.gnu.org/licenses/gpl.html">GNU GPLv3+</license> <notes>-</notes> <contents> <dir baseinstalldir="/" name="/"> diff --git a/plugins/password/README b/plugins/password/README index 25af8cbcd..af70156a6 100644 --- a/plugins/password/README +++ b/plugins/password/README @@ -1,31 +1,29 @@ ----------------------------------------------------------------------- Password Plugin for Roundcube ----------------------------------------------------------------------- - Plugin that adds a possibility to change user password using many methods (drivers) via Settings/Password tab. - ----------------------------------------------------------------------- - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License version 2 - as published by the Free Software Foundation. + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + You should have received a copy of the GNU General Public License + along with this program. If not, see http://www.gnu.org/licenses/. @version @package_version@ - @author Aleksander 'A.L.E.C' Machniak <alec@alec.pl> + @author Aleksander Machniak <alec@alec.pl> @author <see driver files for driver authors> ----------------------------------------------------------------------- - 1. Configuration - 2. Drivers + 1. Configuration + 2. Drivers 2.1. Database (sql) 2.2. Cyrus/SASL (sasl) 2.3. Poppassd/Courierpassd (poppassd) @@ -44,7 +42,7 @@ 2.16. DBMail (dbmail) 2.17. Expect (expect) 2.18. Samba (smb) - 3. Driver API + 3. Driver API 1. Configuration @@ -65,40 +63,40 @@ ------------------- You can specify which database to connect by 'password_db_dsn' option and - what SQL query to execute by 'password_query'. See main.inc.php.dist file for + what SQL query to execute by 'password_query'. See config.inc.php.dist file for more info. Example implementations of an update_passwd function: - This is for use with LMS (http://lms.org.pl) database and postgres: - CREATE OR REPLACE FUNCTION update_passwd(hash text, account text) RETURNS integer AS $$ - DECLARE - res integer; - BEGIN - UPDATE passwd SET password = hash - WHERE login = split_part(account, '@', 1) - AND domainid = (SELECT id FROM domains WHERE name = split_part(account, '@', 2)) - RETURNING id INTO res; - RETURN res; - END; - $$ LANGUAGE plpgsql SECURITY DEFINER; + CREATE OR REPLACE FUNCTION update_passwd(hash text, account text) RETURNS integer AS $$ + DECLARE + res integer; + BEGIN + UPDATE passwd SET password = hash + WHERE login = split_part(account, '@', 1) + AND domainid = (SELECT id FROM domains WHERE name = split_part(account, '@', 2)) + RETURNING id INTO res; + RETURN res; + END; + $$ LANGUAGE plpgsql SECURITY DEFINER; - This is for use with a SELECT update_passwd(%o,%c,%u) query - Updates the password only when the old password matches the MD5 password - in the database - - CREATE FUNCTION update_password (oldpass text, cryptpass text, user text) RETURNS text - MODIFIES SQL DATA - BEGIN - DECLARE currentsalt varchar(20); - DECLARE error text; - SET error = 'incorrect current password'; - SELECT substring_index(substr(user.password,4),_latin1'$',1) INTO currentsalt FROM users WHERE username=user; - SELECT '' INTO error FROM users WHERE username=user AND password=ENCRYPT(oldpass,currentsalt); - UPDATE users SET password=cryptpass WHERE username=user AND password=ENCRYPT(oldpass,currentsalt); - RETURN error; - END + Updates the password only when the old password matches the MD5 password + in the database + + CREATE FUNCTION update_password (oldpass text, cryptpass text, user text) RETURNS text + MODIFIES SQL DATA + BEGIN + DECLARE currentsalt varchar(20); + DECLARE error text; + SET error = 'incorrect current password'; + SELECT substring_index(substr(user.password,4),_latin1'$',1) INTO currentsalt FROM users WHERE username=user; + SELECT '' INTO error FROM users WHERE username=user AND password=ENCRYPT(oldpass,currentsalt); + UPDATE users SET password=cryptpass WHERE username=user AND password=ENCRYPT(oldpass,currentsalt); + RETURN error; + END Example SQL UPDATEs: @@ -142,7 +140,7 @@ documented within it. Compile the wrapper program: - gcc -o chgsaslpasswd chgsaslpasswd.c + gcc -o chgsaslpasswd chgsaslpasswd.c Chown the compiled chgsaslpasswd binary to the cyrus user and group that your browser runs as, then chmod them to 4550. @@ -150,13 +148,13 @@ For example, if your cyrus user is 'cyrus' and the apache server group is 'nobody' (I've been told Redhat runs Apache as user 'apache'): - chown cyrus:nobody chgsaslpasswd - chmod 4550 chgsaslpasswd + chown cyrus:nobody chgsaslpasswd + chmod 4550 chgsaslpasswd Stephen Carr has suggested users should try to run the scripts on a test account as the cyrus user eg; - su cyrus -c "./chgsaslpasswd -p test_account" + su cyrus -c "./chgsaslpasswd -p test_account" This will allow you to make sure that the script will work for your setup. Should the script not work, make sure that: @@ -192,8 +190,12 @@ 2.6. cPanel (cpanel) -------------------- - You can specify parameters for HTTP connection to cPanel's admin - interface. See config.inc.php.dist file for more info. + Install cPanel XMLAPI Client Class into Roundcube program/lib directory + or any other place in PHP include path. You can get the class from + https://raw.github.com/CpanelInc/xmlapi-php/master/xmlapi.php + + You can configure parameters for connection to cPanel's API interface. + See config.inc.php.dist file for more info. 2.7. XIMSS/Communigate (ximms) diff --git a/plugins/password/config.inc.php.dist b/plugins/password/config.inc.php.dist index 16e3737d6..9256829aa 100644 --- a/plugins/password/config.inc.php.dist +++ b/plugins/password/config.inc.php.dist @@ -31,6 +31,10 @@ $rcmail_config['password_login_exceptions'] = null; //$rcmail_config['password_hosts'] = array('mail.example.com', 'mail2.example.org'); $rcmail_config['password_hosts'] = null; +// Enables saving the new password even if it matches the old password. Useful +// for upgrading the stored passwords after the encryption scheme has changed. +$rcmail_config['password_force_save'] = false; + // SQL Driver options // ------------------ @@ -265,13 +269,7 @@ $rcmail_config['password_cpanel_username'] = 'username'; $rcmail_config['password_cpanel_password'] = 'password'; // The cPanel port to use -$rcmail_config['password_cpanel_port'] = 2082; - -// Using ssl for cPanel connections? -$rcmail_config['password_cpanel_ssl'] = true; - -// The cPanel theme in use -$rcmail_config['password_cpanel_theme'] = 'x'; +$rcmail_config['password_cpanel_port'] = 2087; // XIMSS (Communigate server) Driver options diff --git a/plugins/password/drivers/cpanel.php b/plugins/password/drivers/cpanel.php index 79887109b..b71c33ec1 100644 --- a/plugins/password/drivers/cpanel.php +++ b/plugins/password/drivers/cpanel.php @@ -4,95 +4,43 @@ * cPanel Password Driver * * Driver that adds functionality to change the users cPanel password. - * The cPanel PHP API code has been taken from: http://www.phpclasses.org/browse/package/3534.html + * Originally written by Fulvio Venturelli <fulvio@venturelli.org> * - * This driver has been tested with Hostmonster hosting and seems to work fine. + * Completely rewritten using the cPanel API2 call Email::passwdpop + * as opposed to the original coding against the UI, which is a fragile method that + * makes the driver to always return a failure message for any language other than English + * see http://trac.roundcube.net/ticket/1487015 * - * @version 2.0 - * @author Fulvio Venturelli <fulvio@venturelli.org> + * This driver has been tested with o2switch hosting and seems to work fine. + * + * @version 3.0 + * @author Christian Chech <christian@chech.fr> */ class rcube_cpanel_password { public function save($curpas, $newpass) { + require_once 'xmlapi.php'; + $rcmail = rcmail::get_instance(); - // Create a cPanel email object - $cPanel = new emailAccount($rcmail->config->get('password_cpanel_host'), - $rcmail->config->get('password_cpanel_username'), - $rcmail->config->get('password_cpanel_password'), - $rcmail->config->get('password_cpanel_port'), - $rcmail->config->get('password_cpanel_ssl'), - $rcmail->config->get('password_cpanel_theme'), - $_SESSION['username'] ); + $this->cuser = $rcmail->config->get('password_cpanel_username'); + + // Setup the xmlapi connection + $this->xmlapi = new xmlapi($rcmail->config->get('password_cpanel_host')); + $this->xmlapi->set_port($rcmail->config->get('password_cpanel_port')); + $this->xmlapi->password_auth($this->cuser, $rcmail->config->get('password_cpanel_password')); + $this->xmlapi->set_output('json'); + $this->xmlapi->set_debug(0); - if ($cPanel->setPassword($newpass)) { + if ($this->setPassword($_SESSION['username'], $newpass)) { return PASSWORD_SUCCESS; } else { return PASSWORD_ERROR; } } -} - - -class HTTP -{ - function HTTP($host, $username, $password, $port, $ssl, $theme) - { - $this->ssl = $ssl ? 'ssl://' : ''; - $this->username = $username; - $this->password = $password; - $this->theme = $theme; - $this->auth = base64_encode($username . ':' . $password); - $this->port = $port; - $this->host = $host; - $this->path = '/frontend/' . $theme . '/'; - } - - function getData($url, $data = '') - { - $url = $this->path . $url; - if (is_array($data)) { - $url = $url . '?'; - foreach ($data as $key => $value) { - $url .= urlencode($key) . '=' . urlencode($value) . '&'; - } - $url = substr($url, 0, -1); - } - - $response = ''; - $fp = fsockopen($this->ssl . $this->host, $this->port); - if (!$fp) { - return false; - } - - $out = 'GET ' . $url . ' HTTP/1.0' . "\r\n"; - $out .= 'Authorization: Basic ' . $this->auth . "\r\n"; - $out .= 'Connection: Close' . "\r\n\r\n"; - fwrite($fp, $out); - while (!feof($fp)) { - $response .= @fgets($fp); - } - fclose($fp); - return $response; - } -} - - -class emailAccount -{ - function emailAccount($host, $username, $password, $port, $ssl, $theme, $address) - { - $this->HTTP = new HTTP($host, $username, $password, $port, $ssl, $theme); - if (strpos($address, '@')) { - list($this->email, $this->domain) = explode('@', $address); - } - else { - list($this->email, $this->domain) = array($address, ''); - } - } /** * Change email account password @@ -101,16 +49,24 @@ class emailAccount * @param string $password email account password * @return bool */ - function setPassword($password) + function setPassword($address, $password) { - $data['email'] = $this->email; - $data['domain'] = $this->domain; + if (strpos($address, '@')) { + list($data['email'], $data['domain']) = explode('@', $address); + } + else { + list($data['email'], $data['domain']) = array($address, ''); + } + $data['password'] = $password; - $response = $this->HTTP->getData('mail/dopasswdpop.html', $data); - if (strpos($response, 'success') && !strpos($response, 'failure')) { + $query = $this->xmlapi->api2_query($this->cuser, 'Email', 'passwdpop', $data); + $query = json_decode($query, true); + + if ($query['cpanelresult']['data'][0]['result'] == 1) { return true; } + return false; } } diff --git a/plugins/password/drivers/directadmin.php b/plugins/password/drivers/directadmin.php index 8bf0dc613..44ecea406 100644 --- a/plugins/password/drivers/directadmin.php +++ b/plugins/password/drivers/directadmin.php @@ -297,7 +297,6 @@ class HTTPSocket { $status = socket_get_status($socket); $startTime = time(); $length = 0; - $prevSecond = 0; while ( !feof($socket) && !$status['timed_out'] ) { $chunk = fgets($socket,1024); diff --git a/plugins/password/drivers/pam.php b/plugins/password/drivers/pam.php index 8cd94c737..4d0ba1656 100644 --- a/plugins/password/drivers/pam.php +++ b/plugins/password/drivers/pam.php @@ -11,7 +11,8 @@ class rcube_pam_password { function save($currpass, $newpass) { - $user = $_SESSION['username']; + $user = $_SESSION['username']; + $error = ''; if (extension_loaded('pam') || extension_loaded('pam_auth')) { if (pam_auth($user, $currpass, $error, false)) { diff --git a/plugins/password/drivers/sql.php b/plugins/password/drivers/sql.php index e02bff146..7a51dfe44 100644 --- a/plugins/password/drivers/sql.php +++ b/plugins/password/drivers/sql.php @@ -34,8 +34,9 @@ class rcube_sql_password $db = $rcmail->get_dbh(); } - if ($err = $db->is_error()) + if ($db->is_error()) { return PASSWORD_ERROR; + } // crypted password if (strpos($sql, '%c') !== FALSE) { @@ -183,8 +184,8 @@ class rcube_sql_password $res = $db->query($sql, $sql_vars); if (!$db->is_error()) { - if (strtolower(substr(trim($query),0,6))=='select') { - if ($result = $db->fetch_array($res)) + if (strtolower(substr(trim($sql),0,6)) == 'select') { + if ($db->fetch_array($res)) return PASSWORD_SUCCESS; } else { // This is the good case: 1 row updated diff --git a/plugins/password/drivers/xmail.php b/plugins/password/drivers/xmail.php index 37abc3001..59e467c5b 100644 --- a/plugins/password/drivers/xmail.php +++ b/plugins/password/drivers/xmail.php @@ -67,7 +67,7 @@ class XMail { function send($msg) { socket_write($this->socket,$msg); - if (substr($in = socket_read($this->socket, 512, PHP_BINARY_READ),0,1) != "+") { + if (substr(socket_read($this->socket, 512, PHP_BINARY_READ),0,1) != "+") { return false; } return true; @@ -85,7 +85,7 @@ class XMail { return false; } - if (substr($in = socket_read($this->socket, 512, PHP_BINARY_READ),0,1) != "+") { + if (substr(socket_read($this->socket, 512, PHP_BINARY_READ),0,1) != "+") { socket_close($this->socket); return false; } diff --git a/plugins/password/localization/gl_ES.inc b/plugins/password/localization/gl_ES.inc index 245d1c634..93c505a6a 100644 --- a/plugins/password/localization/gl_ES.inc +++ b/plugins/password/localization/gl_ES.inc @@ -26,7 +26,7 @@ $messages = array(); $messages['nopassword'] = 'Por favor, introduza un contrasinal novo.'; $messages['nocurpassword'] = 'Por favor, introduza o contrasinal actual.'; $messages['passwordincorrect'] = 'O contrasinal actual é incorrecto.'; -$messages['passwordinconsistency'] = 'Os contrasinals non coinciden. Por favor, inténteo de novo.'; +$messages['passwordinconsistency'] = 'Os contrasinais non cadran. Por favor, inténteo outra vez.'; $messages['crypterror'] = 'Non foi posible gardar o contrasinal novo. Falta a función de cifrado.'; $messages['connecterror'] = 'Non foi posible gardar o contrasinal novo. Erro de conexión'; $messages['internalerror'] = 'Non foi posible gardar o contrasinal novo.'; diff --git a/plugins/password/localization/lb_LU.inc b/plugins/password/localization/lb_LU.inc new file mode 100644 index 000000000..9962aed28 --- /dev/null +++ b/plugins/password/localization/lb_LU.inc @@ -0,0 +1,37 @@ +<?php + +/* + +-----------------------------------------------------------------------+ + | plugins/password/localization/<lang>.inc | + | | + | Localization file of the Roundcube Webmail Password plugin | + | Copyright (C) 2012-2013, The Roundcube Dev Team | + | | + | Licensed under the GNU General Public License version 3 or | + | any later version with exceptions for skins & plugins. | + | See the README file for a full license statement. | + | | + +-----------------------------------------------------------------------+ + + For translation see https://www.transifex.com/projects/p/roundcube-webmail/resource/plugin-password/ +*/ + +$labels = array(); +$labels['changepasswd'] = 'Passwuert änneren'; +$labels['curpasswd'] = 'Aktuellt Passwuert:'; +$labels['newpasswd'] = 'Neit Passwuert:'; +$labels['confpasswd'] = 'Neit Passwuert bestätegen:'; + +$messages = array(); +$messages['nopassword'] = 'Gëff wann ech gelift en neit Passwuert an.'; +$messages['nocurpassword'] = 'Gëff wann ech gelift dat aktuellt Passwuert an.'; +$messages['passwordincorrect'] = 'Aktuellt Passwuert net korrekt.'; +$messages['passwordinconsistency'] = 'D\'Passwierder passen net, probéier wann ech gelift nach eng Kéier.'; +$messages['crypterror'] = 'Passwuert konnt net gespäichert ginn. Verschlësselungs-Funktioun feelt.'; +$messages['connecterror'] = 'Passwuert konnt net gespäichert ginn. Connectiouns-Feeler.'; +$messages['internalerror'] = 'Neit Passwuert konnt net gespäichert ginn.'; +$messages['passwordshort'] = 'D\'Passwuert muss mindestens $length Zeeche laang sinn.'; +$messages['passwordweak'] = 'D\'Passwuert muss mindestens eng Zuel an ee Sazzeechen enthalen.'; +$messages['passwordforbidden'] = 'D\'Passwuert enthält verbueden Zeechen.'; + +?> diff --git a/plugins/password/localization/lv_LV.inc b/plugins/password/localization/lv_LV.inc index 650d31b2c..ac0e5da79 100644 --- a/plugins/password/localization/lv_LV.inc +++ b/plugins/password/localization/lv_LV.inc @@ -20,18 +20,18 @@ $labels = array(); $labels['changepasswd'] = 'Nomainīt paroli'; $labels['curpasswd'] = 'Pašreizējā parole:'; $labels['newpasswd'] = 'Jaunā parole:'; -$labels['confpasswd'] = 'Vēlreiz jauno paroli:'; +$labels['confpasswd'] = 'Apstiprināt jauno paroli:'; $messages = array(); -$messages['nopassword'] = 'Lūdzu, ievadiet jauno paroli.'; -$messages['nocurpassword'] = 'Lūdzu, ievadiet pašreizējo paroli.'; -$messages['passwordincorrect'] = 'Pašreizējā parole nepareiza.'; +$messages['nopassword'] = 'Lūdzu ievadiet jauno paroli.'; +$messages['nocurpassword'] = 'Lūdzu ievadiet pašreizējo paroli.'; +$messages['passwordincorrect'] = 'Pašreizējā parole nav pareiza.'; $messages['passwordinconsistency'] = 'Paroles nesakrīt. Lūdzu, ievadiet vēlreiz.'; -$messages['crypterror'] = 'Nevarēja saglabāt jauno paroli. Trūkst kriptēšanas funkcija.'; +$messages['crypterror'] = 'Nevarēja saglabāt jauno paroli. Trūkst kriptēšanas funkcijas.'; $messages['connecterror'] = 'Nevarēja saglabāt jauno paroli. Savienojuma kļūda.'; $messages['internalerror'] = 'Nevarēja saglabāt jauno paroli.'; -$messages['passwordshort'] = 'Jaunajai parolei jābūt vismaz $length simbola garai.'; -$messages['passwordweak'] = 'Jaunajai parolei jāsatur vismaz viens cipars un punktuācijas simbols.'; -$messages['passwordforbidden'] = 'Password contains forbidden characters.'; +$messages['passwordshort'] = 'Jaunajai parolei jābūt vismaz $length simbolu garai.'; +$messages['passwordweak'] = 'Jaunajai parolei jāsatur vismaz viens cipars un speciālais simbols.'; +$messages['passwordforbidden'] = 'Parole satur neatļautus simbolus.'; ?> diff --git a/plugins/password/localization/nl_NL.inc b/plugins/password/localization/nl_NL.inc index c2c4599bc..e5b634602 100644 --- a/plugins/password/localization/nl_NL.inc +++ b/plugins/password/localization/nl_NL.inc @@ -17,21 +17,21 @@ */ $labels = array(); -$labels['changepasswd'] = 'Wijzig Wachtwoord'; -$labels['curpasswd'] = 'Huidig Wachtwoord:'; -$labels['newpasswd'] = 'Nieuw Wachtwoord:'; -$labels['confpasswd'] = 'Bevestig Nieuw Wachtwoord:'; +$labels['changepasswd'] = 'Wachtwoord wijzigen'; +$labels['curpasswd'] = 'Huidig wachtwoord:'; +$labels['newpasswd'] = 'Nieuw wachtwoord:'; +$labels['confpasswd'] = 'Bevestig nieuw wachtwoord:'; $messages = array(); -$messages['nopassword'] = 'Vul een wachtwoord in.'; -$messages['nocurpassword'] = 'vul het huidige wachtwoord in.'; +$messages['nopassword'] = 'Vul uw nieuwe wachtwoord in.'; +$messages['nocurpassword'] = 'Vul uw huidige wachtwoord in.'; $messages['passwordincorrect'] = 'Huidig wachtwoord is onjuist.'; $messages['passwordinconsistency'] = 'Wachtwoorden komen niet overeen, probeer het opnieuw.'; -$messages['crypterror'] = 'De server mist een functie om uw wachtwoord et beveiligen.'; -$messages['connecterror'] = 'Kan het nieuwe wachtwoord niet opslaan. Verbindingsfout.'; -$messages['internalerror'] = 'Uw wachtwoord kan niet worden opgeslagen.'; +$messages['crypterror'] = 'Nieuwe wachtwoord kan niet opgeslagen worden; de server mist een versleutelfunctie.'; +$messages['connecterror'] = 'Nieuwe wachtwoord kan niet opgeslagen worden; verbindingsfout.'; +$messages['internalerror'] = 'Uw nieuwe wachtwoord kan niet worden opgeslagen.'; $messages['passwordshort'] = 'Het wachtwoord moet minimaal $length tekens lang zijn.'; -$messages['passwordweak'] = 'Het wachtwoord moet minimaal één nummer en één leesteken bevatten.'; +$messages['passwordweak'] = 'Het wachtwoord moet minimaal één cijfer en één leesteken bevatten.'; $messages['passwordforbidden'] = 'Het wachtwoord bevat tekens die niet toegestaan zijn.'; ?> diff --git a/plugins/password/localization/zh_CN.inc b/plugins/password/localization/zh_CN.inc index 5a15635e7..5d14926f2 100644 --- a/plugins/password/localization/zh_CN.inc +++ b/plugins/password/localization/zh_CN.inc @@ -24,13 +24,13 @@ $labels['confpasswd'] = '确认新密码:'; $messages = array(); $messages['nopassword'] = '请输入新密码。'; -$messages['nocurpassword'] = '请输入正确的密码。'; +$messages['nocurpassword'] = '请输入当前的密码。'; $messages['passwordincorrect'] = '当前密码不正确。'; $messages['passwordinconsistency'] = '两次输入的密码不一致,请重试。'; -$messages['crypterror'] = '无法保存新密码,因为加密功能不可用。'; -$messages['connecterror'] = '无法保存新密码,因为连接出错。'; +$messages['crypterror'] = '无法保存新密码,缺少加密功能。'; +$messages['connecterror'] = '无法保存新密码,连接出错。'; $messages['internalerror'] = '无法保存新密码。'; -$messages['passwordshort'] = '密码必须至少为 $length 位。'; +$messages['passwordshort'] = '密码至少为 $length 位。'; $messages['passwordweak'] = '密码必须至少包含一个数字和一个标点符号。'; $messages['passwordforbidden'] = '密码包含禁止使用的字符。'; diff --git a/plugins/password/package.xml b/plugins/password/package.xml index 9a056dec6..16eda1ad0 100644 --- a/plugins/password/package.xml +++ b/plugins/password/package.xml @@ -15,19 +15,18 @@ <email>alec@alec.pl</email> <active>yes</active> </lead> - <date>2012-11-15</date> + <date>2013-04-28</date> <version> - <release>3.2</release> + <release>3.4</release> <api>2.0</api> </version> <stability> <release>stable</release> <api>stable</api> </stability> - <license uri="http://www.gnu.org/licenses/gpl-2.0.html">GNU GPLv2</license> + <license uri="http://www.gnu.org/licenses/gpl.html">GNU GPLv3+</license> <notes> -- Fix wrong (non-specific) error message on crypt or connection error (#1488808) -- Added option to define IMAP hosts that support password changes - password_hosts +Added password_force_save option </notes> <contents> <dir baseinstalldir="/" name="/"> @@ -347,5 +346,36 @@ - Added Samba password (#1488364) </notes> </release> + <release> + <date>2012-11-15</date> + <version> + <release>3.2</release> + <api>2.0</api> + </version> + <stability> + <release>stable</release> + <api>stable</api> + </stability> + <license uri="http://www.gnu.org/licenses/gpl-2.0.html">GNU GPLv2</license> + <notes> +- Fix wrong (non-specific) error message on crypt or connection error (#1488808) +- Added option to define IMAP hosts that support password changes - password_hosts + </notes> + </release> + <release> + <date>2013-03-30</date> + <version> + <release>3.3</release> + <api>2.0</api> + </version> + <stability> + <release>stable</release> + <api>stable</api> + </stability> + <license uri="http://www.gnu.org/licenses/gpl-2.0.html">GNU GPLv2</license> + <notes> +Added new cPanel driver - fixes localization related issues (#1487015) + </notes> + </release> </changelog> </package> diff --git a/plugins/password/password.php b/plugins/password/password.php index 39020a0bf..f1a3e17b9 100644 --- a/plugins/password/password.php +++ b/plugins/password/password.php @@ -1,32 +1,26 @@ <?php -/* - +-------------------------------------------------------------------------+ - | Password Plugin for Roundcube | - | @version @package_version@ | - | | - | Copyright (C) 2009-2010, Roundcube Dev. | - | | - | This program is free software; you can redistribute it and/or modify | - | it under the terms of the GNU General Public License version 2 | - | as published by the Free Software Foundation. | - | | - | This program is distributed in the hope that it will be useful, | - | but WITHOUT ANY WARRANTY; without even the implied warranty of | - | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | - | GNU General Public License for more details. | - | | - | You should have received a copy of the GNU General Public License along | - | with this program; if not, write to the Free Software Foundation, Inc., | - | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | - | | - +-------------------------------------------------------------------------+ - | Author: Aleksander Machniak <alec@alec.pl> | - +-------------------------------------------------------------------------+ - - $Id: index.php 2645 2009-06-15 07:01:36Z alec $ - -*/ +/** + * Password Plugin for Roundcube + * + * @version @package_version@ + * @author Aleksander Machniak <alec@alec.pl> + * + * Copyright (C) 2005-2013, The Roundcube Dev Team + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see http://www.gnu.org/licenses/. + */ define('PASSWORD_CRYPT_ERROR', 1); define('PASSWORD_ERROR', 2); @@ -147,7 +141,7 @@ class password extends rcube_plugin $rcmail->output->command('display_message', $this->gettext('passwordweak'), 'error'); } // password is the same as the old one, do nothing, return success - else if ($sespwd == $newpwd) { + else if ($sespwd == $newpwd && !$rcmail->config->get('password_force_save')) { $rcmail->output->command('display_message', $this->gettext('successfullysaved'), 'confirmation'); } // try to save the password diff --git a/plugins/redundant_attachments/config.inc.php.dist b/plugins/redundant_attachments/config.inc.php.dist index 6c317ead1..a0be3755e 100644 --- a/plugins/redundant_attachments/config.inc.php.dist +++ b/plugins/redundant_attachments/config.inc.php.dist @@ -6,8 +6,8 @@ // to use memcache as a fallback when write-master is unavailable. $rcmail_config['redundant_attachments_memcache'] = false; -// When memcache is used, attachment data expires after -// specied TTL time in seconds (max.2592000). Default is 12 hours. -$rcmail_config['redundant_attachments_memcache_ttl'] = 12 * 60 * 60; +// Attachment data expires after specied TTL time in seconds (max.2592000). +// Default is 12 hours. +$rcmail_config['redundant_attachments_cache_ttl'] = 12 * 60 * 60; ?> diff --git a/plugins/redundant_attachments/redundant_attachments.php b/plugins/redundant_attachments/redundant_attachments.php index 4ebc8dad7..c0affad3c 100644 --- a/plugins/redundant_attachments/redundant_attachments.php +++ b/plugins/redundant_attachments/redundant_attachments.php @@ -68,13 +68,14 @@ class redundant_attachments extends filesystem_attachments // load configuration $this->load_config(); + $ttl = 12 * 60 * 60; // 12 hours + $ttl = $rcmail->config->get('redundant_attachments_cache_ttl', $ttl); + // Init SQL cache (disable cache data serialization) - $this->cache = $rcmail->get_cache($this->prefix, 'db', 0, false); + $this->cache = $rcmail->get_cache($this->prefix, 'db', $ttl, false); // Init memcache (fallback) cache if ($rcmail->config->get('redundant_attachments_memcache')) { - $ttl = 12 * 60 * 60; // 12 hours - $ttl = (int) $rcmail->config->get('redundant_attachments_memcache_ttl', $ttl); $this->mem_cache = $rcmail->get_cache($this->prefix, 'memcache', $ttl, false); } diff --git a/plugins/show_additional_headers/package.xml b/plugins/show_additional_headers/package.xml index 7297916c3..9ca60baa9 100644 --- a/plugins/show_additional_headers/package.xml +++ b/plugins/show_additional_headers/package.xml @@ -24,7 +24,7 @@ <release>stable</release> <api>stable</api> </stability> - <license uri="http://www.gnu.org/licenses/gpl-2.0.html">GNU GPLv2</license> + <license uri="http://www.gnu.org/licenses/gpl.html">GNU GPLv3+</license> <notes>-</notes> <contents> <dir baseinstalldir="/" name="/"> diff --git a/plugins/show_additional_headers/show_additional_headers.php b/plugins/show_additional_headers/show_additional_headers.php index 1375348c2..c2b0ca1d3 100644 --- a/plugins/show_additional_headers/show_additional_headers.php +++ b/plugins/show_additional_headers/show_additional_headers.php @@ -6,12 +6,12 @@ * Proof-of-concept plugin which will fetch additional headers * and display them in the message view. * - * Enable the plugin in config/main.inc.php and add your desired headers: + * Enable the plugin in config.inc.php and add your desired headers: * $rcmail_config['show_additional_headers'] = array('User-Agent'); * * @version @package_version@ * @author Thomas Bruederli - * @website http://roundcube.net + * @license GNU GPLv3+ */ class show_additional_headers extends rcube_plugin { diff --git a/plugins/squirrelmail_usercopy/squirrelmail_usercopy.php b/plugins/squirrelmail_usercopy/squirrelmail_usercopy.php index d5d0d47ec..e882a2f37 100644 --- a/plugins/squirrelmail_usercopy/squirrelmail_usercopy.php +++ b/plugins/squirrelmail_usercopy/squirrelmail_usercopy.php @@ -63,7 +63,7 @@ class squirrelmail_usercopy extends rcube_plugin if ($this->prefs['___sig'.$i.'___']) $ident_data['signature'] = $this->prefs['___sig'.$i.'___']; // insert identity - $identid = $rcmail->user->insert_identity($ident_data); + $rcmail->user->insert_identity($ident_data); } } diff --git a/plugins/subscriptions_option/localization/gl_ES.inc b/plugins/subscriptions_option/localization/gl_ES.inc index bbff10c3b..a273777da 100644 --- a/plugins/subscriptions_option/localization/gl_ES.inc +++ b/plugins/subscriptions_option/localization/gl_ES.inc @@ -17,6 +17,6 @@ */ $labels = array(); -$labels['useimapsubscriptions'] = 'Usar suscripcións IMAP'; +$labels['useimapsubscriptions'] = 'Usar subscricións IMAP'; ?> diff --git a/plugins/subscriptions_option/localization/lb_LU.inc b/plugins/subscriptions_option/localization/lb_LU.inc new file mode 100644 index 000000000..d9432634b --- /dev/null +++ b/plugins/subscriptions_option/localization/lb_LU.inc @@ -0,0 +1,22 @@ +<?php + +/* + +-----------------------------------------------------------------------+ + | plugins/subscriptions_option/localization/<lang>.inc | + | | + | Localization file of the Roundcube Webmail Subscriptions plugin | + | Copyright (C) 2012-2013, The Roundcube Dev Team | + | | + | Licensed under the GNU General Public License version 3 or | + | any later version with exceptions for skins & plugins. | + | See the README file for a full license statement. | + | | + +-----------------------------------------------------------------------+ + + For translation see https://www.transifex.com/projects/p/roundcube-webmail/resource/plugin-subscriptions_option/ +*/ + +$labels = array(); +$labels['useimapsubscriptions'] = 'IMAP-Abonnementer benotzen'; + +?> diff --git a/plugins/subscriptions_option/package.xml b/plugins/subscriptions_option/package.xml index 79d44f8c2..04f2c1b3c 100644 --- a/plugins/subscriptions_option/package.xml +++ b/plugins/subscriptions_option/package.xml @@ -32,7 +32,7 @@ <release>stable</release> <api>stable</api> </stability> - <license uri="http://www.gnu.org/licenses/gpl-2.0.html">GNU GPLv2</license> + <license uri="http://www.gnu.org/licenses/gpl.html">GNU GPLv3+</license> <notes>-</notes> <contents> <dir baseinstalldir="/" name="/"> diff --git a/plugins/subscriptions_option/subscriptions_option.php b/plugins/subscriptions_option/subscriptions_option.php index 7678d8e94..284c048df 100644 --- a/plugins/subscriptions_option/subscriptions_option.php +++ b/plugins/subscriptions_option/subscriptions_option.php @@ -7,7 +7,7 @@ * It includes a toggle on the settings page under "Server Settings". * The preference can also be locked * - * Add it to the plugins list in config/main.inc.php to enable the user option + * Add it to the plugins list in config.inc.php to enable the user option * The user option can be hidden and set globally by adding 'use_subscriptions' * to the 'dont_override' configure line: * $rcmail_config['dont_override'] = array('use_subscriptions'); @@ -21,6 +21,7 @@ * * @version @package_version@ * @author Ziba Scott + * @license GNU GPLv3+ */ class subscriptions_option extends rcube_plugin { diff --git a/plugins/userinfo/localization/lb_LU.inc b/plugins/userinfo/localization/lb_LU.inc new file mode 100644 index 000000000..d8394f6d8 --- /dev/null +++ b/plugins/userinfo/localization/lb_LU.inc @@ -0,0 +1,25 @@ +<?php + +/* + +-----------------------------------------------------------------------+ + | plugins/userinfo/localization/<lang>.inc | + | | + | Localization file of the Roundcube Webmail Userinfo plugin | + | Copyright (C) 2012-2013, The Roundcube Dev Team | + | | + | Licensed under the GNU General Public License version 3 or | + | any later version with exceptions for skins & plugins. | + | See the README file for a full license statement. | + | | + +-----------------------------------------------------------------------+ + + For translation see https://www.transifex.com/projects/p/roundcube-webmail/resource/plugin-userinfo/ +*/ + +$labels = array(); +$labels['userinfo'] = 'Benotzer-Info'; +$labels['created'] = 'Erstallt'; +$labels['lastlogin'] = 'Leschte Login'; +$labels['defaultidentity'] = 'Standard-Identitéit'; + +?>
\ No newline at end of file diff --git a/plugins/userinfo/localization/nl_NL.inc b/plugins/userinfo/localization/nl_NL.inc index 8c636e700..8c46ca6c4 100644 --- a/plugins/userinfo/localization/nl_NL.inc +++ b/plugins/userinfo/localization/nl_NL.inc @@ -19,7 +19,7 @@ $labels = array(); $labels['userinfo'] = 'Gebruikersinformatie'; $labels['created'] = 'Aangemaakt'; -$labels['lastlogin'] = 'Laatste login'; +$labels['lastlogin'] = 'Laatste aanmelding'; $labels['defaultidentity'] = 'Standaardidentiteit'; ?>
\ No newline at end of file diff --git a/plugins/userinfo/localization/zh_CN.inc b/plugins/userinfo/localization/zh_CN.inc index 265c0704a..2b06ab218 100644 --- a/plugins/userinfo/localization/zh_CN.inc +++ b/plugins/userinfo/localization/zh_CN.inc @@ -18,8 +18,8 @@ $labels = array(); $labels['userinfo'] = '用户信息'; -$labels['created'] = '创建'; -$labels['lastlogin'] = '最后登录'; +$labels['created'] = '创建于'; +$labels['lastlogin'] = '最近登录'; $labels['defaultidentity'] = '默认身份'; ?>
\ No newline at end of file diff --git a/plugins/vcard_attachments/localization/gl_ES.inc b/plugins/vcard_attachments/localization/gl_ES.inc index b502c85c7..806f6bb7d 100644 --- a/plugins/vcard_attachments/localization/gl_ES.inc +++ b/plugins/vcard_attachments/localization/gl_ES.inc @@ -17,7 +17,7 @@ */ $labels = array(); -$labels['addvcardmsg'] = 'Engadir a tarxeta ao caderno de enderezos'; -$labels['vcardsavefailed'] = 'Non foi posible gardar a tarxeta'; +$labels['addvcardmsg'] = 'Engadir vCard ao caderno de enderezos'; +$labels['vcardsavefailed'] = 'Non foi posible gardar a vCard'; ?>
\ No newline at end of file diff --git a/plugins/vcard_attachments/localization/lb_LU.inc b/plugins/vcard_attachments/localization/lb_LU.inc new file mode 100644 index 000000000..b9d23eaa5 --- /dev/null +++ b/plugins/vcard_attachments/localization/lb_LU.inc @@ -0,0 +1,23 @@ +<?php + +/* + +-----------------------------------------------------------------------+ + | plugins/vcard_attachments/localization/<lang>.inc | + | | + | Localization file of the Roundcube Webmail Vcard Attachments plugin | + | Copyright (C) 2012-2013, The Roundcube Dev Team | + | | + | Licensed under the GNU General Public License version 3 or | + | any later version with exceptions for skins & plugins. | + | See the README file for a full license statement. | + | | + +-----------------------------------------------------------------------+ + + For translation see https://www.transifex.com/projects/p/roundcube-webmail/resource/plugin-vcard_attachments/ +*/ + +$labels = array(); +$labels['addvcardmsg'] = 'vCard an d\'Adressbuch setzen'; +$labels['vcardsavefailed'] = 'vCard kann net gespäichert ginn'; + +?>
\ No newline at end of file diff --git a/plugins/vcard_attachments/localization/zh_CN.inc b/plugins/vcard_attachments/localization/zh_CN.inc index 6deb21da4..5ff81a806 100644 --- a/plugins/vcard_attachments/localization/zh_CN.inc +++ b/plugins/vcard_attachments/localization/zh_CN.inc @@ -17,7 +17,7 @@ */ $labels = array(); -$labels['addvcardmsg'] = '添加 vCard 到地址簿中'; +$labels['addvcardmsg'] = '添加 vCard 至地址簿中'; $labels['vcardsavefailed'] = '无法保存 vCard'; ?>
\ No newline at end of file diff --git a/plugins/vcard_attachments/vcard_attachments.php b/plugins/vcard_attachments/vcard_attachments.php index 4905b373e..cf7e22d3a 100644 --- a/plugins/vcard_attachments/vcard_attachments.php +++ b/plugins/vcard_attachments/vcard_attachments.php @@ -45,7 +45,7 @@ class vcard_attachments extends rcube_plugin } } // the same with message bodies - foreach ((array)$this->message->parts as $idx => $part) { + foreach ((array)$this->message->parts as $part) { if ($this->is_vcard($part)) { $this->vcard_parts[] = $part->mime_id; $this->vcard_bodies[] = $part->mime_id; @@ -63,7 +63,6 @@ class vcard_attachments extends rcube_plugin function html_output($p) { $attach_script = false; - $icon = 'plugins/vcard_attachments/' .$this->local_skin_path(). '/vcard_add_contact.png'; foreach ($this->vcard_parts as $part) { $vcards = rcube_vcard::import($this->message->get_part_content($part, null, true)); diff --git a/plugins/virtuser_file/virtuser_file.php b/plugins/virtuser_file/virtuser_file.php index 2c705b2d0..ed0eba189 100644 --- a/plugins/virtuser_file/virtuser_file.php +++ b/plugins/virtuser_file/virtuser_file.php @@ -3,7 +3,7 @@ /** * File based User-to-Email and Email-to-User lookup * - * Add it to the plugins list in config/main.inc.php and set + * Add it to the plugins list in config.inc.php and set * path to a virtuser table file to resolve user names and e-mail * addresses * $rcmail_config['virtuser_file'] = ''; @@ -19,13 +19,13 @@ class virtuser_file extends rcube_plugin function init() { - $this->app = rcmail::get_instance(); - $this->file = $this->app->config->get('virtuser_file'); + $this->app = rcmail::get_instance(); + $this->file = $this->app->config->get('virtuser_file'); - if ($this->file) { - $this->add_hook('user2email', array($this, 'user2email')); - $this->add_hook('email2user', array($this, 'email2user')); - } + if ($this->file) { + $this->add_hook('user2email', array($this, 'user2email')); + $this->add_hook('email2user', array($this, 'email2user')); + } } /** @@ -34,25 +34,24 @@ class virtuser_file extends rcube_plugin function user2email($p) { $r = $this->findinvirtual('/\s' . preg_quote($p['user'], '/') . '\s*$/'); - $result = array(); + $result = array(); - for ($i=0; $i<count($r); $i++) - { - $arr = preg_split('/\s+/', $r[$i]); + for ($i=0; $i<count($r); $i++) { + $arr = preg_split('/\s+/', $r[$i]); - if (count($arr) > 0 && strpos($arr[0], '@')) { - $result[] = rcube_utils::idn_to_ascii(trim(str_replace('\\@', '@', $arr[0]))); + if (count($arr) > 0 && strpos($arr[0], '@')) { + $result[] = rcube_utils::idn_to_ascii(trim(str_replace('\\@', '@', $arr[0]))); - if ($p['first']) { - $p['email'] = $result[0]; - break; - } - } - } + if ($p['first']) { + $p['email'] = $result[0]; + break; + } + } + } - $p['email'] = empty($result) ? NULL : $result; + $p['email'] = empty($result) ? NULL : $result; - return $p; + return $p; } /** @@ -60,18 +59,18 @@ class virtuser_file extends rcube_plugin */ function email2user($p) { - $r = $this->findinvirtual('/^' . preg_quote($p['email'], '/') . '\s/'); + $r = $this->findinvirtual('/^' . preg_quote($p['email'], '/') . '\s/'); - for ($i=0; $i<count($r); $i++) { - $arr = preg_split('/\s+/', trim($r[$i])); + for ($i=0; $i<count($r); $i++) { + $arr = preg_split('/\s+/', trim($r[$i])); - if (count($arr) > 0) { - $p['user'] = trim($arr[count($arr)-1]); - break; - } - } + if (count($arr) > 0) { + $p['user'] = trim($arr[count($arr)-1]); + break; + } + } - return $p; + return $p; } /** @@ -82,26 +81,25 @@ class virtuser_file extends rcube_plugin */ private function findinvirtual($pattern) { - $result = array(); - $virtual = null; + $result = array(); + $virtual = null; - if ($this->file) - $virtual = file($this->file); + if ($this->file) + $virtual = file($this->file); - if (empty($virtual)) - return $result; + if (empty($virtual)) + return $result; - // check each line for matches - foreach ($virtual as $line) { - $line = trim($line); - if (empty($line) || $line[0]=='#') - continue; + // check each line for matches + foreach ($virtual as $line) { + $line = trim($line); + if (empty($line) || $line[0]=='#') + continue; - if (preg_match($pattern, $line)) - $result[] = $line; - } + if (preg_match($pattern, $line)) + $result[] = $line; + } - return $result; + return $result; } - } diff --git a/plugins/virtuser_query/package.xml b/plugins/virtuser_query/package.xml index b7ea565d8..9430bf69d 100644 --- a/plugins/virtuser_query/package.xml +++ b/plugins/virtuser_query/package.xml @@ -22,7 +22,7 @@ <release>stable</release> <api>stable</api> </stability> - <license uri="http://www.gnu.org/licenses/gpl-2.0.html">GNU GPLv2</license> + <license uri="http://www.gnu.org/licenses/gpl.html">GNU GPLv3+</license> <notes>-</notes> <contents> <dir baseinstalldir="/" name="/"> diff --git a/plugins/virtuser_query/virtuser_query.php b/plugins/virtuser_query/virtuser_query.php index 675eb7c1b..3181cda94 100644 --- a/plugins/virtuser_query/virtuser_query.php +++ b/plugins/virtuser_query/virtuser_query.php @@ -3,7 +3,7 @@ /** * DB based User-to-Email and Email-to-User lookup * - * Add it to the plugins list in config/main.inc.php and set + * Add it to the plugins list in config.inc.php and set * SQL queries to resolve usernames, e-mail addresses and hostnames from the database * %u will be replaced with the current username for login. * %m will be replaced with the current e-mail address for login. @@ -12,7 +12,7 @@ * The email query could optionally select identity data columns in specified order: * name, organization, reply-to, bcc, signature, html_signature * - * $rcmail_config['virtuser_query'] = array('email' => '', 'user' => '', 'host' => ''); + * $rcmail_config['virtuser_query'] = array('email' => '', 'user' => '', 'host' => '', 'alias' => ''); * * The email query can return more than one record to create more identities. * This requires identities_level option to be set to value less than 2. @@ -23,6 +23,8 @@ * @version @package_version@ * @author Aleksander Machniak <alec@alec.pl> * @author Steffen Vogel + * @author Tim Gerundt + * @license GNU GPLv3+ */ class virtuser_query extends rcube_plugin { @@ -49,6 +51,9 @@ class virtuser_query extends rcube_plugin if ($this->config['host']) { $this->add_hook('authenticate', array($this, 'user2host')); } + if ($this->config['alias']) { + $this->add_hook('authenticate', array($this, 'alias2user')); + } } } @@ -59,7 +64,7 @@ class virtuser_query extends rcube_plugin { $dbh = $this->get_dbh(); - $sql_result = $dbh->query(preg_replace('/%u/', $dbh->escapeSimple($p['user']), $this->config['email'])); + $sql_result = $dbh->query(preg_replace('/%u/', $dbh->escape($p['user']), $this->config['email'])); while ($sql_arr = $dbh->fetch_array($sql_result)) { if (strpos($sql_arr[0], '@')) { @@ -78,8 +83,9 @@ class virtuser_query extends rcube_plugin $result[] = $sql_arr[0]; } - if ($p['first']) + if ($p['first']) { break; + } } } @@ -95,7 +101,7 @@ class virtuser_query extends rcube_plugin { $dbh = $this->get_dbh(); - $sql_result = $dbh->query(preg_replace('/%m/', $dbh->escapeSimple($p['email']), $this->config['user'])); + $sql_result = $dbh->query(preg_replace('/%m/', $dbh->escape($p['email']), $this->config['user'])); if ($sql_arr = $dbh->fetch_array($sql_result)) { $p['user'] = $sql_arr[0]; @@ -111,7 +117,7 @@ class virtuser_query extends rcube_plugin { $dbh = $this->get_dbh(); - $sql_result = $dbh->query(preg_replace('/%u/', $dbh->escapeSimple($p['user']), $this->config['host'])); + $sql_result = $dbh->query(preg_replace('/%u/', $dbh->escape($p['user']), $this->config['host'])); if ($sql_arr = $dbh->fetch_array($sql_result)) { $p['host'] = $sql_arr[0]; @@ -121,6 +127,22 @@ class virtuser_query extends rcube_plugin } /** + * Alias > User + */ + function alias2user($p) + { + $dbh = $this->get_dbh(); + + $sql_result = $dbh->query(preg_replace('/%u/', $dbh->escape($p['user']), $this->config['alias'])); + + if ($sql_arr = $dbh->fetch_array($sql_result)) { + $p['user'] = $sql_arr[0]; + } + + return $p; + } + + /** * Initialize database handler */ function get_dbh() @@ -141,4 +163,3 @@ class virtuser_query extends rcube_plugin } } - diff --git a/plugins/zipdownload/localization/lb_LU.inc b/plugins/zipdownload/localization/lb_LU.inc new file mode 100644 index 000000000..6721c51cb --- /dev/null +++ b/plugins/zipdownload/localization/lb_LU.inc @@ -0,0 +1,23 @@ +<?php + +/* + +-----------------------------------------------------------------------+ + | plugins/zipdownload/localization/<lang>.inc | + | | + | Localization file of the Roundcube Webmail Zipdownload plugin | + | Copyright (C) 2012-2013, The Roundcube Dev Team | + | | + | Licensed under the GNU General Public License version 3 or | + | any later version with exceptions for skins & plugins. | + | See the README file for a full license statement. | + | | + +-----------------------------------------------------------------------+ + + For translation see https://www.transifex.com/projects/p/roundcube-webmail/resource/plugin-zipdownload/ +*/ + +$labels = array(); +$labels['downloadall'] = 'All d\'Unhäng eroflueden'; +$labels['downloadfolder'] = 'Dossier eroflueden'; + +?>
\ No newline at end of file diff --git a/plugins/zipdownload/zipdownload.php b/plugins/zipdownload/zipdownload.php index 7e132bfbb..59431267d 100644 --- a/plugins/zipdownload/zipdownload.php +++ b/plugins/zipdownload/zipdownload.php @@ -108,7 +108,7 @@ class zipdownload extends rcube_plugin foreach ($message->attachments as $part) { $pid = $part->mime_id; $part = $message->mime_parts[$pid]; - $disp_name = $this->_convert_filename($part->filename, $part->charset); + $disp_name = $this->_convert_filename($part->filename); if ($part->body) { $orig_message_raw = $part->body; @@ -169,7 +169,7 @@ class zipdownload extends rcube_plugin for ($i = 0; ($i * $imap->get_pagesize()) <= $count; $i++) { $a_headers = $imap->list_messages($mbox_name, ($i + 1)); - foreach ($a_headers as $n => $header) { + foreach ($a_headers as $header) { if (empty($header)) continue; @@ -199,7 +199,7 @@ class zipdownload extends rcube_plugin $zip = new ZipArchive(); $zip->open($tmpfname, ZIPARCHIVE::OVERWRITE); - foreach ($uids as $key => $uid){ + foreach ($uids as $uid){ $headers = $imap->get_message_headers($uid); $subject = rcube_mime::decode_mime_string((string)$headers->subject); $subject = $this->_convert_filename($subject); @@ -263,9 +263,9 @@ class zipdownload extends rcube_plugin /** * Helper function to convert filenames to the configured charset */ - private function _convert_filename($str, $from = RCUBE_CHARSET) + private function _convert_filename($str) { - $str = rcube_charset::convert($str, $from == '' ? RCUBE_CHARSET : $from, $this->charset); + $str = rcube_charset::convert($str, RCUBE_CHARSET, $this->charset); return strtr($str, array(':'=>'', '/'=>'-')); } |