camaleon_cms 2.9.1 → 2.9.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (111) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +12 -5
  3. data/app/apps/plugins/front_cache/admin_controller.rb +1 -0
  4. data/app/apps/plugins/front_cache/front_cache_helper.rb +23 -14
  5. data/app/apps/plugins/visibility_post/visibility_post_helper.rb +1 -1
  6. data/app/apps/themes/default/views/category.html.erb +1 -1
  7. data/app/apps/themes/default/views/post_tag.html.erb +1 -1
  8. data/app/apps/themes/default/views/post_type.html.erb +1 -1
  9. data/app/apps/themes/default/views/search.html.erb +1 -1
  10. data/app/apps/themes/new/views/category.html.erb +1 -1
  11. data/app/apps/themes/new/views/post_tag.html.erb +1 -1
  12. data/app/apps/themes/new/views/post_type.html.erb +1 -1
  13. data/app/apps/themes/new/views/search.html.erb +1 -1
  14. data/app/controllers/camaleon_cms/admin/appearances/nav_menus_controller.rb +22 -5
  15. data/app/controllers/camaleon_cms/admin/appearances/widgets/assign_controller.rb +4 -2
  16. data/app/controllers/camaleon_cms/admin/appearances/widgets/main_controller.rb +3 -3
  17. data/app/controllers/camaleon_cms/admin/appearances/widgets/sidebar_controller.rb +2 -2
  18. data/app/controllers/camaleon_cms/admin/categories_controller.rb +9 -5
  19. data/app/controllers/camaleon_cms/admin/media_controller.rb +18 -5
  20. data/app/controllers/camaleon_cms/admin/post_tags_controller.rb +7 -4
  21. data/app/controllers/camaleon_cms/admin/posts/drafts_controller.rb +1 -1
  22. data/app/controllers/camaleon_cms/admin/posts_controller.rb +6 -3
  23. data/app/controllers/camaleon_cms/admin/sessions_controller.rb +2 -2
  24. data/app/controllers/camaleon_cms/admin/settings/custom_fields_controller.rb +33 -11
  25. data/app/controllers/camaleon_cms/admin/settings/post_types_controller.rb +13 -4
  26. data/app/controllers/camaleon_cms/admin/settings/sites_controller.rb +7 -4
  27. data/app/controllers/camaleon_cms/admin/settings_controller.rb +7 -4
  28. data/app/controllers/camaleon_cms/admin/user_roles_controller.rb +2 -2
  29. data/app/controllers/camaleon_cms/admin/users_controller.rb +16 -12
  30. data/app/controllers/camaleon_cms/admin_controller.rb +8 -0
  31. data/app/controllers/camaleon_cms/apps/plugins_admin_controller.rb +5 -0
  32. data/app/controllers/concerns/camaleon_cms/admin/custom_fields_concern.rb +29 -0
  33. data/app/decorators/camaleon_cms/post_decorator.rb +1 -1
  34. data/app/decorators/camaleon_cms/user_decorator.rb +1 -1
  35. data/app/helpers/camaleon_cms/admin/application_helper.rb +17 -17
  36. data/app/helpers/camaleon_cms/admin/post_type_helper.rb +25 -22
  37. data/app/helpers/camaleon_cms/comment_helper.rb +74 -40
  38. data/app/helpers/camaleon_cms/frontend/content_select_helper.rb +1 -1
  39. data/app/helpers/camaleon_cms/frontend/nav_menu_helper.rb +1 -1
  40. data/app/helpers/camaleon_cms/html_helper.rb +15 -1
  41. data/app/helpers/camaleon_cms/session_helper.rb +13 -1
  42. data/app/helpers/camaleon_cms/site_helper.rb +16 -3
  43. data/app/helpers/camaleon_cms/uploader_helper.rb +102 -51
  44. data/app/models/camaleon_cms/ability.rb +54 -102
  45. data/app/models/camaleon_cms/category.rb +2 -0
  46. data/app/models/camaleon_cms/custom_field.rb +14 -0
  47. data/app/models/camaleon_cms/custom_field_group.rb +38 -1
  48. data/app/models/camaleon_cms/custom_fields_relationship.rb +1 -1
  49. data/app/models/camaleon_cms/nav_menu.rb +2 -0
  50. data/app/models/camaleon_cms/nav_menu_item.rb +2 -0
  51. data/app/models/camaleon_cms/plugin.rb +2 -0
  52. data/app/models/camaleon_cms/post_tag.rb +2 -0
  53. data/app/models/camaleon_cms/post_type.rb +2 -0
  54. data/app/models/camaleon_cms/site.rb +2 -0
  55. data/app/models/camaleon_cms/term_taxonomy.rb +0 -2
  56. data/app/models/camaleon_cms/theme.rb +2 -0
  57. data/app/models/camaleon_cms/user_role.rb +13 -0
  58. data/app/models/camaleon_cms/widget/main.rb +2 -0
  59. data/app/models/camaleon_cms/widget/sidebar.rb +2 -0
  60. data/app/models/camaleon_record.rb +34 -0
  61. data/app/models/concerns/camaleon_cms/custom_fields_read.rb +4 -4
  62. data/app/models/concerns/camaleon_cms/metas.rb +1 -1
  63. data/app/models/current_request.rb +16 -0
  64. data/app/uploaders/camaleon_cms_aws_uploader.rb +8 -1
  65. data/app/validators/camaleon_cms/post_uniq_validator.rb +16 -4
  66. data/app/views/camaleon_cms/admin/appearances/nav_menus/_left_menu_items.html.erb +2 -2
  67. data/app/views/camaleon_cms/admin/appearances/widgets/main/form.html.erb +1 -1
  68. data/app/views/camaleon_cms/admin/categories/index.html.erb +1 -1
  69. data/app/views/camaleon_cms/admin/comments/index.html.erb +2 -2
  70. data/app/views/camaleon_cms/admin/comments/list.html.erb +1 -1
  71. data/app/views/camaleon_cms/admin/post_tags/index.html.erb +1 -1
  72. data/app/views/camaleon_cms/admin/posts/_sidebar.html.erb +1 -1
  73. data/app/views/camaleon_cms/admin/posts/index.html.erb +3 -3
  74. data/app/views/camaleon_cms/admin/search.html.erb +1 -1
  75. data/app/views/camaleon_cms/admin/settings/custom_fields/_render.html.erb +23 -2
  76. data/app/views/camaleon_cms/admin/settings/custom_fields/fields/_select_eval.html.erb +1 -1
  77. data/app/views/camaleon_cms/admin/settings/custom_fields/form.html.erb +1 -1
  78. data/app/views/camaleon_cms/admin/settings/custom_fields/index.html.erb +1 -1
  79. data/app/views/camaleon_cms/admin/settings/post_types/index.html.erb +1 -1
  80. data/app/views/camaleon_cms/admin/settings/sites/index.html.erb +1 -1
  81. data/app/views/camaleon_cms/admin/user_roles/form.html.erb +79 -5
  82. data/app/views/camaleon_cms/admin/user_roles/index.html.erb +1 -1
  83. data/app/views/camaleon_cms/admin/users/index.html.erb +1 -1
  84. data/app/views/layouts/camaleon_cms/admin/_flash_messages.html.erb +2 -2
  85. data/config/initializers/custom_initializers.rb +2 -2
  86. data/config/locales/camaleon_cms/admin/ar.yml +6 -2
  87. data/config/locales/camaleon_cms/admin/de.yml +6 -2
  88. data/config/locales/camaleon_cms/admin/en.yml +6 -2
  89. data/config/locales/camaleon_cms/admin/es.yml +6 -2
  90. data/config/locales/camaleon_cms/admin/fr.yml +6 -2
  91. data/config/locales/camaleon_cms/admin/it.yml +6 -2
  92. data/config/locales/camaleon_cms/admin/nl.yml +7 -2
  93. data/config/locales/camaleon_cms/admin/pt-BR.yml +6 -2
  94. data/config/locales/camaleon_cms/admin/pt.yml +6 -2
  95. data/config/locales/camaleon_cms/admin/ru.yml +6 -2
  96. data/config/locales/camaleon_cms/admin/uk.yml +6 -2
  97. data/config/locales/camaleon_cms/admin/zh-CH.yml +6 -2
  98. data/db/migrate/20150611161134_post_table_into_utf8.rb +14 -14
  99. data/db/migrate/20150926095310_rename_column_posts.rb +3 -3
  100. data/db/migrate/20151212095328_add_confirm_token_to_users.rb +3 -3
  101. data/db/migrate/20160504155652_add_feature_to_posts.rb +1 -1
  102. data/db/migrate/20160504155653_move_first_name_of_users.rb +2 -2
  103. data/db/migrate/20160609121449_add_group_to_custom_field_values.rb +1 -1
  104. data/db/migrate/20161215202255_drop_user_relationship_table.rb +1 -1
  105. data/db/migrate/20180124132318_create_media.rb +1 -1
  106. data/db/migrate/20180704211100_adjust_field_length.rb +1 -1
  107. data/lib/camaleon_cms/version.rb +1 -1
  108. data/lib/ext/string.rb +3 -3
  109. data/lib/plugin_routes.rb +3 -3
  110. data/lib/tasks/custom_fields_roles.rake +56 -0
  111. metadata +64 -5
@@ -587,7 +587,10 @@ ar:
587
587
  requires_different_email: 'Requires different email'
588
588
  created_pending_validate_email: "The user has been created, please confirm your email"
589
589
  new_photo: 'New Photo'
590
- others_permissions: 'Others permissions'
590
+ other_permissions: 'Others permissions'
591
+ select_eval_modal:
592
+ title: 'صلاحية خطيرة'
593
+ description: 'صلاحية select_eval تسمح بتنفيذ كود ديناميكي من خيارات الحقول المخصصة. تفعيلها قد يؤدي الى تنفيذ كود عشوائي، كشف البيانات، والسيطرة الكاملة على الموقع عند تقييم محتوى غير موثوق.'
591
594
  profile: 'Profile'
592
595
  slogan: 'Slogan'
593
596
  type_contents: 'Type of Contents'
@@ -613,7 +616,7 @@ ar:
613
616
  media: 'Permission to the midsection'
614
617
  publish: 'You need permits Create or Edit, Edit Other, Edit, Publish, to enable this permission'
615
618
  themes: 'Themes permission to section'
616
- widgets: 'Widgets permission to section'
619
+ widgets: 'Allow editing widgets, including saving unsanitized code.'
617
620
  menus: 'Permission to the Menu section'
618
621
  plugins: 'Permission to the Plugins section'
619
622
  users: 'Permission to create, edit, delete Users'
@@ -664,6 +667,7 @@ ar:
664
667
  error_created: "No created sidebar."
665
668
  error_updated: "No Update sidebar."
666
669
  error_deleted: "Sidebar deleted."
670
+ warning: "Warning: Widgets can store unsanitized HTML and Javascript. Only enter code that you understand and trust."
667
671
  intro:
668
672
  profile: "In this place you can see your profile options."
669
673
  content: "This block contains all content groups of your site. Each content can have different structure configured in settings => Content Groups"
@@ -586,7 +586,10 @@ de:
586
586
  requires_different_email: 'Erfordert eine andere Email'
587
587
  created_pending_validate_email: 'Der Benutzer wurde erstellt, bitte bestätige deine Email.'
588
588
  new_photo: 'Neues Bild'
589
- others_permissions: 'Rechte Anderer'
589
+ other_permissions: 'Rechte Anderer'
590
+ select_eval_modal:
591
+ title: 'Gefahrliche Berechtigung'
592
+ description: 'Die Berechtigung select_eval erlaubt die Ausfuhrung von dynamischem Code aus Optionen benutzerdefinierter Felder. Das Aktivieren kann zu beliebiger Codeausfuhrung, Datenoffenlegung und einer vollstandigen Kompromittierung der Website fuhren, wenn nicht vertrauenswurdige Inhalte ausgewertet werden.'
590
593
  profile: 'Profil'
591
594
  slogan: 'Slogan'
592
595
  type_contents: 'Art der Inhalte'
@@ -612,7 +615,7 @@ de:
612
615
  media: 'Rechte für den Mittelbereich'
613
616
  publish: 'Du benötigst die Rechte Erstellen oder Verarbeiten, Andere Bearbeiten, Bearbeiten, Veröffentlichen, um dieses Recht zu aktivieren'
614
617
  themes: 'Recht für den Themes-Bereich'
615
- widgets: 'Widgets-Recht für den Bereich'
618
+ widgets: 'Ermöglichen Sie die Bearbeitung von Widgets, einschließlich des Speicherns von nicht bereinigtem Code.'
616
619
  menus: 'Recht für den Menübereich'
617
620
  plugins: 'Recht für den Plugin-Bereich'
618
621
  users: 'Recht zum Erstellen, Bearbeiten und Löschen von Benutzern'
@@ -663,6 +666,7 @@ de:
663
666
  error_created: 'Fehler beim Erstellen der Sidebar.'
664
667
  error_updated: 'Fehler beim Aktualisieren der Sidebar.'
665
668
  error_deleted: 'Fehler beim Löschen der Sidebar.'
669
+ warning: "Warnung: Widgets können nicht bereinigtes HTML und Javascript speichern. Geben Sie nur Code ein, den Sie verstehen und dem Sie vertrauen."
666
670
  intro:
667
671
  profile: 'Hier kannst du Einstellungen für dein Profil vornehmen.'
668
672
  content: 'Dieser Block enthält die Inhaltsgruppen deiner Seite. Jeder Inhalt kann auf verschiedene Weise konfiguriert werden. Siehe Einstellungen => Inhaltsgruppen'
@@ -640,7 +640,10 @@ en:
640
640
  role_can_not_be_deleted: Role can not be deleted
641
641
  user_can_not_delete_own_account: You cannot delete your own account
642
642
  new_photo: 'New Photo'
643
- others_permissions: 'Others permissions'
643
+ other_permissions: 'Other permissions'
644
+ select_eval_modal:
645
+ title: 'Dangerous Permission'
646
+ description: 'The select_eval permission allows execution of dynamic code from custom field options. Enabling it can lead to arbitrary code execution, data exposure, and full site compromise if untrusted content is evaluated.'
644
647
  profile: 'Profile'
645
648
  slogan: 'Slogan'
646
649
  type_contents: 'Type of Contents'
@@ -666,7 +669,7 @@ en:
666
669
  media: 'Permission to the midsection'
667
670
  publish: 'You need permits Create or Edit, Edit Other, Edit, Publish, to enable this permission'
668
671
  themes: 'Themes permission to section'
669
- widgets: 'Widgets permission to section'
672
+ widgets: 'Allow editing widgets, including saving unsanitized code.'
670
673
  menus: 'Permission to the Menu section'
671
674
  plugins: 'Permission to the Plugins section'
672
675
  users: 'Permission to create, edit, delete Users'
@@ -728,6 +731,7 @@ en:
728
731
  error_created: "No created sidebar."
729
732
  error_updated: "No Update sidebar."
730
733
  error_deleted: "Sidebar deleted."
734
+ warning: "Warning: Widgets can store unsanitized HTML and Javascript. Only enter code that you understand and trust."
731
735
  intro:
732
736
  profile: "In this place you can see your profile options."
733
737
  content: "This block contains all content groups of your site. Each content can have different structure configured in settings => Content Groups"
@@ -561,7 +561,10 @@ es:
561
561
  requires_different_email: 'Requiere diferente correo electrónico'
562
562
  created_pending_validate_email: 'El usuario ha sido creado, por favor confirma tu email'
563
563
  new_photo: 'Nueva Fotografía'
564
- others_permissions: 'Otros permisos'
564
+ other_permissions: 'Otros permisos'
565
+ select_eval_modal:
566
+ title: 'Permiso peligroso'
567
+ description: 'El permiso select_eval permite ejecutar codigo dinamico desde opciones de campos personalizados. Al habilitarlo, puede provocar ejecucion arbitraria de codigo, exposicion de datos y compromiso total del sitio si se evalua contenido no confiable.'
565
568
  profile: 'Perfil'
566
569
  slogan: 'Eslogan'
567
570
  type_contents: 'Tipo de Contenidos'
@@ -587,7 +590,7 @@ es:
587
590
  media: 'Permiso a la seccion Media'
588
591
  publish: 'Necesitas tener los permisos de Crear o Editar, Editar Otros, Editar Publicar, para habilitar este permiso'
589
592
  themes: 'Permiso a la seccion Plantillas'
590
- widgets: 'Permiso a la seccion Widgets'
593
+ widgets: 'Permitir la edición de widgets, incluido el almacenamiento de código sin desinfectar.'
591
594
  menus: 'Permiso a la seccion Menu'
592
595
  plugins: 'Permiso a la seccion Plugins'
593
596
  users: 'Permiso para crear, editar, eliminar Usuarios'
@@ -629,6 +632,7 @@ es:
629
632
  error_created: 'No se ha creado el Widget.'
630
633
  error_updated: 'No se ha actualizado el Widget.'
631
634
  not_registered_widgets: 'No existen widgets registrados'
635
+ warning: "Advertencia: Los widgets pueden almacenar HTML y Javascript sin desinfectar. Ingrese solo el código que comprenda y en el que confíe."
632
636
  appearances:
633
637
  nav_menus:
634
638
  menu_items:
@@ -567,7 +567,10 @@ fr:
567
567
  requires_different_email: 'Un email différent est requis'
568
568
  created_pending_validate_email: "L'utilisateur a été créé, veuillez confirmer votre email"
569
569
  new_photo: 'Nouvelle photo'
570
- others_permissions: 'Autres permissions'
570
+ other_permissions: 'Autres permissions'
571
+ select_eval_modal:
572
+ title: 'Permission dangereuse'
573
+ description: 'La permission select_eval autorise l execution de code dynamique depuis les options des champs personnalises. Son activation peut entrainer l execution de code arbitraire, l exposition de donnees et la compromission complete du site si du contenu non fiable est evalue.'
571
574
  profile: 'Profil'
572
575
  slogan: 'Slogan'
573
576
  type_contents: 'Type de contenus'
@@ -593,7 +596,7 @@ fr:
593
596
  media: 'Permission pour la section média'
594
597
  publish: 'Permissions Créer ou Editer, Editer autre, Editer, Publier, requises pour activer cette permission'
595
598
  themes: 'Permission pour la section thèmes'
596
- widgets: 'Permission pour la section widgets'
599
+ widgets: "Autoriser la modification des widgets, y compris l'enregistrement de code non nettoyé."
597
600
  menus: 'Permission pour la section menus'
598
601
  plugins: 'Permission pour la section plugins'
599
602
  users: 'Permission de créer, éditer et supprimer des utilisateurs'
@@ -644,6 +647,7 @@ fr:
644
647
  error_created: "Sidebar non créée."
645
648
  error_updated: "Sidebar non mise à jour."
646
649
  error_deleted: "Sidebar supprimée."
650
+ warning: "Attention : les widgets peuvent stocker du HTML et du Javascript non nettoyés. Entrez uniquement du code que vous comprenez et auquel vous faites confiance."
647
651
  intro:
648
652
  profile: "Ici vous pouvez voir les options de votre profil."
649
653
  content: "Ce bloc contient tout les groupes de contenu de votre site. Chaque contenu peut avoir une structure différente configurable via Paramètres => Groupes de contenu"
@@ -565,7 +565,10 @@ it:
565
565
  requires_different_username: 'Inserisci uno username diverso'
566
566
  requires_different_email: 'Inserisci una email diversa'
567
567
  new_photo: 'Nuova foto'
568
- others_permissions: 'Altri permessi'
568
+ other_permissions: 'Altri permessi'
569
+ select_eval_modal:
570
+ title: 'Permesso pericoloso'
571
+ description: 'Il permesso select_eval consente l esecuzione di codice dinamico dalle opzioni dei campi personalizzati. Se abilitato, puo causare esecuzione arbitraria di codice, esposizione dei dati e compromissione completa del sito quando viene valutato contenuto non attendibile.'
569
572
  profile: 'Profilo'
570
573
  slogan: 'Slogan'
571
574
  type_contents: 'Tipi di contenuti'
@@ -591,7 +594,7 @@ it:
591
594
  media: 'Permesso per la midsection'
592
595
  publish: 'Devi abilitare Crea o Modifica, Modifica Altro, Modifica, Pubblica, per abilitare questi permessi'
593
596
  themes: 'Permessi per la sezione temi'
594
- widgets: 'Permessi per la sezione widget'
597
+ widgets: 'Consenti la modifica dei widget, incluso il salvataggio di codice non disinfettato.'
595
598
  menus: 'Permessi per la sezione menù'
596
599
  plugins: 'Permessi per la sezione plugin'
597
600
  users: 'Permesso di creare, modificare e cancellare utenti'
@@ -633,3 +636,4 @@ it:
633
636
  error_created: 'Widget non creato.'
634
637
  error_updated: 'Widget non aggiornato.'
635
638
  not_registered_widgets: 'Non ci sono widget registrati'
639
+ warning: "Attenzione: i widget possono memorizzare HTML e Javascript non sanificati. Inserisci solo il codice che comprendi e di cui ti fidi."
@@ -563,7 +563,10 @@ nl:
563
563
  requires_different_email: 'Andere e-mail verplicht'
564
564
  created_pending_validate_email: "Gebruiker is aangemaakt, bevestig uw e-mail"
565
565
  new_photo: 'Nieuwe foto'
566
- others_permissions: 'Andere rechten'
566
+ other_permissions: 'Andere rechten'
567
+ select_eval_modal:
568
+ title: 'Gevaarlijke toestemming'
569
+ description: 'De toestemming select_eval staat het uitvoeren van dynamische code toe vanuit opties van aangepaste velden. Inschakelen kan leiden tot willekeurige code-uitvoering, blootstelling van gegevens en volledige compromittering van de site als niet-vertrouwde inhoud wordt ge-evalueerd.'
567
570
  profile: 'Profiel'
568
571
  slogan: 'Slogan'
569
572
  type_contents: 'Type inhoud'
@@ -589,7 +592,7 @@ nl:
589
592
  media: 'Toegang tot media'
590
593
  publish: 'Je hebt de volgende rechten toevoegen en bewerken, bewerk andere, bewerk gepubliceerd nodig om dit aan te passen'
591
594
  themes: "Toegang tot thema's"
592
- widgets: 'Toegang tot widgets'
595
+ widgets: 'Sta het bewerken van widgets toe, inclusief het opslaan van niet-opgeschoonde code.'
593
596
  menus: "Toegang tot menu's"
594
597
  plugins: 'Toegang tot plugins'
595
598
  users: 'Rechten om gebruikers aan te maken, te bewerken of te verwijderen'
@@ -640,6 +643,8 @@ nl:
640
643
  error_created: "FOUT! Sidebar is niet aangemaakt."
641
644
  error_updated: "FOUT! Sidebar is niet bijgewerkt."
642
645
  error_deleted: "Sidebar verwijderd."
646
+ warning: "Waarschuwing: Widgets kunnen niet-opgeschoonde HTML en Javascript opslaan. Voer alleen code in die u begrijpt en vertrouwt."
647
+
643
648
  intro:
644
649
  profile: "Hier kun je profiel opties bekijken."
645
650
  content: "Dit blok bevat alle inhoud types van uw site. Elk inhoud type kan in een andere structuur geconfigureerd worden in instellingen => Inhoud type's hebben"
@@ -555,7 +555,10 @@ pt-BR:
555
555
  requires_different_username: 'Requer usuário diferente'
556
556
  requires_different_email: 'Requer email diferente'
557
557
  new_photo: 'Nova foto'
558
- others_permissions: 'Outras permissões'
558
+ other_permissions: 'Outras permissões'
559
+ select_eval_modal:
560
+ title: 'Permissao perigosa'
561
+ description: 'A permissao select_eval permite executar codigo dinamico a partir das opcoes de campos personalizados. Ao habilitar, pode causar execucao arbitraria de codigo, exposicao de dados e comprometimento total do site caso conteudo nao confiavel seja avaliado.'
559
562
  profile: 'Perfil'
560
563
  slogan: 'Slogan'
561
564
  type_contents: 'TIpo de conteúdos'
@@ -581,7 +584,7 @@ pt-BR:
581
584
  media: 'Permissão para o meio'
582
585
  publish: 'Você precisa permitir Criar ou Editar, Editar Outro, Editar, Publicar , para habilitar esta permissão'
583
586
  themes: 'Permissão para a seção Temas'
584
- widgets: 'Permissão para a seção Widgets'
587
+ widgets: 'Permitir a edição de widgets, incluindo salvar código não higienizado.'
585
588
  menus: 'Permissão para a seção Menu'
586
589
  plugins: 'Permissão para a seção Plugins'
587
590
  users: 'Permissão to criar, editar, excluir Usuários'
@@ -623,6 +626,7 @@ pt-BR:
623
626
  error_created: 'Nenhum Widget criado.'
624
627
  error_updated: 'Nenhum Widget atualizado.'
625
628
  not_registered_widgets: 'Não há widgets registrados'
629
+ warning: "Aviso: Os widgets podem armazenar HTML e Javascript não higienizados. Insira apenas o código que você entende e confia."
626
630
  intro:
627
631
  profile: "Neste lugar você pode ver suas opções de perfis."
628
632
  content: "Este bloco contém todo o grupo de conteúdo de seu site. Cada conteúdo pode ter uma estrutura diferente configurada em Configurações => Grupos de conteúdo"
@@ -553,7 +553,10 @@ pt:
553
553
  requires_different_username: 'Requer utilizador diferente'
554
554
  requires_different_email: 'Requer email diferente'
555
555
  new_photo: 'Nova foto'
556
- others_permissions: 'Outras permissões'
556
+ other_permissions: 'Outras permissões'
557
+ select_eval_modal:
558
+ title: 'Permissao perigosa'
559
+ description: 'A permissao select_eval permite executar codigo dinamico a partir das opcoes dos campos personalizados. Ao ativar, pode causar execucao arbitraria de codigo, exposicao de dados e comprometimento total do site se conteudo nao confiavel for avaliado.'
557
560
  profile: 'Perfil'
558
561
  slogan: 'Slogan'
559
562
  type_contents: 'TIpo de conteúdos'
@@ -579,7 +582,7 @@ pt:
579
582
  media: 'Permissão para o meio'
580
583
  publish: 'Permissão para Criar ou Editar, Editar Outro, Editar, Publicar, para habilitar esta permissão'
581
584
  themes: 'Permissão para a secção Temas'
582
- widgets: 'Permissão para a secção Widgets'
585
+ widgets: 'Permite a edição de widgets, incluindo salvar código não higienizado.'
583
586
  menus: 'Permissão para a secção Menu'
584
587
  plugins: 'Permissão para a secção Plugins'
585
588
  users: 'Permissão para criar, editar, apagar utilizadores'
@@ -621,6 +624,7 @@ pt:
621
624
  error_created: 'Nenhum Widget criado.'
622
625
  error_updated: 'Nenhum Widget atualizado.'
623
626
  not_registered_widgets: 'Não há widgets registados'
627
+ warning: "Aviso: Os widgets podem armazenar HTML e Javascript não higienizados. Introduza apenas o código que compreende e em que confia."
624
628
  intro:
625
629
  profile: "Neste lugar pode ver suas opções de perfis."
626
630
  content: "Este bloco contém todo o grupo de conteúdo de seu site. Cada conteúdo pode ter uma estrutura diferente configurada em Configurações => Grupos de conteúdo"
@@ -574,7 +574,10 @@ ru:
574
574
  requires_different_email: 'Требуется другая эл. почта'
575
575
  created_pending_validate_email: "Пользователь был создан, пожалуйста, подтвердите вашу электронную почту"
576
576
  new_photo: 'Новая фотография'
577
- others_permissions: 'Другие разрешения'
577
+ other_permissions: 'Другие разрешения'
578
+ select_eval_modal:
579
+ title: 'Опасное право доступа'
580
+ description: 'Поле типа select_eval позволяет выполнять динамический код из параметров, введённых пользователем. Это может привести к произвольному выполнению кода, утечке данных (в том числе паролей и ключей авторизации) и полной компрометации сайта. Включайте это правл доступа только для доверенных пользователей!'
578
581
  profile: 'Профиль'
579
582
  slogan: 'Слоган'
580
583
  type_contents: 'Тип контента'
@@ -600,7 +603,7 @@ ru:
600
603
  media: 'Permission to the midsection'
601
604
  publish: 'Вам требуется разрешение на Создание, Редактирование, Редактирование других или Опубликовать чтобы включить это разрешение'
602
605
  themes: 'Разрешение тем на раздел'
603
- widgets: 'Разрешение виджетов на раздел'
606
+ widgets: 'Разрешите редактирование виджетов, в том числе сохранение неочищенного кода.'
604
607
  menus: 'Разрешение на раздел Меню'
605
608
  plugins: 'Разрешение на раздел Плагинов'
606
609
  users: 'Разрешение на создание, редактирование и удаление Пользователей'
@@ -651,6 +654,7 @@ ru:
651
654
  error_created: "Боковая панель не создана."
652
655
  error_updated: "Боковая панель не обновлена."
653
656
  error_deleted: "Боковая панель удалена."
657
+ warning: "Предупреждение: Виджеты могут хранить неочищенный HTML и Javascript. Вводите только тот код, который вы понимаете и которому доверяете."
654
658
  intro:
655
659
  profile: "Здесь вы можете увидеть настройки вашего профиля."
656
660
  content: "Этот блок содержит все группы контента вашего сайта. Каждый контент может иметь различную структуру, их можно настроить в Настройки => Группа контентов"
@@ -574,7 +574,10 @@ uk:
574
574
  requires_different_email: 'Потрібні інші ел. пошта '
575
575
  created_pending_validate_email: "Користувач був створений, будь ласка, підтвердіть вашу електронну пошту"
576
576
  new_photo: 'Нова фотографія'
577
- others_permissions: 'Інші роздільності'
577
+ other_permissions: 'Інші роздільності'
578
+ select_eval_modal:
579
+ title: 'Небезпечний дозвіл'
580
+ description: 'Дозвіл select_eval дозволяє виконувати динамічний код з параметрів користувацьких полів. Увімкнення може призвести до довільного виконання коду, витоку даних і повної компрометації сайту, якщо обробляється недовірений вміст.'
578
581
  profile: 'Профіль'
579
582
  slogan: 'Слоган'
580
583
  type_contents: 'Тип Контенту'
@@ -600,7 +603,7 @@ uk:
600
603
  media: 'Permission to the midsection'
601
604
  publish: 'Вам потрібен дозвіл на Створення, редагування, Редагування інших або Опублікувати щоб включити цей дозвіл'
602
605
  themes: 'Дозвіл тим на розділ'
603
- widgets: 'Дозвіл віджетів на розділ'
606
+ widgets: 'Уможливлено редагування віджетів, зокрема збереження непродезінфікованого коду.'
604
607
  menus: 'Дозвіл на розділ Меню'
605
608
  plugins: 'Дозвіл на розділ Плагінів'
606
609
  users: 'Дозвіл на створення, редагування і видалення користувачів'
@@ -651,6 +654,7 @@ uk:
651
654
  error_created: "Бічна панель не створена."
652
655
  error_updated: "Бічна панель не оновлена."
653
656
  error_deleted: "Бічна панель видалена."
657
+ warning: "Попередження: Віджети можуть зберігати непродезінфіковані HTML та Javascript. Вводьте лише той код, який ви розумієте та якому довіряєте."
654
658
  intro:
655
659
  profile: "Тут ви можете побачити налаштування вашого профілю."
656
660
  content: "Цей блок містить всі групи контенту вашого сайту. Кожен контент може мати різну структуру, яких можна налаштувати в Налаштування => Група контентів"
@@ -607,7 +607,10 @@ zh-CN:
607
607
  role_can_not_be_deleted: '无法删除此角色'
608
608
  user_can_not_delete_own_account: '用户不能删除自己的帐户'
609
609
  new_photo: '新建照片'
610
- others_permissions: '其他权限'
610
+ other_permissions: '其他权限'
611
+ select_eval_modal:
612
+ title: '危险权限'
613
+ description: 'select_eval 权限允许从自定义字段选项中执行动态代码。启用后,如果评估不受信任的内容,可能导致任意代码执行、数据泄露以及站点被完全攻陷。'
611
614
  profile: '资料'
612
615
  slogan: '标语'
613
616
  type_contents: '内容的类型'
@@ -633,7 +636,7 @@ zh-CN:
633
636
  media: '媒体资源部分'
634
637
  publish: '开启该权限,允许创建,编辑, 或公开'
635
638
  themes: '主题部分'
636
- widgets: '插件部分'
639
+ widgets: '允许编辑小部件,包括保存未经清理的代码。'
637
640
  menus: '菜单部分'
638
641
  plugins: '插件部分'
639
642
  users: '创建,编辑,删除用户'
@@ -684,6 +687,7 @@ zh-CN:
684
687
  error_created: '侧边栏创建失败'
685
688
  error_updated: '侧边栏更新失败'
686
689
  error_deleted: "侧边栏已删除."
690
+ warning: "警告:小组件可以存储未经清理的 HTML 和 Javascript。仅输入您理解和信任的代码。"
687
691
  intro:
688
692
  profile: "在这个地方,您可以看到您的个人资料选项."
689
693
  content: "此块包含您网站的所有内容组。 每个内容可以具有在 设置 => 内容组"
@@ -1,12 +1,12 @@
1
1
  class PostTableIntoUtf8 < CamaManager.migration_class
2
2
  def change
3
3
  if table_exists? CamaleonCms::User.table_name
4
- add_column(CamaleonCms::User.table_name, :email, :string) unless column_exists?(CamaleonCms::User.table_name, :email)
5
- add_column(CamaleonCms::User.table_name, :username, :string) unless column_exists?(CamaleonCms::User.table_name, :username)
6
- add_column(CamaleonCms::User.table_name, :role, :string, default: 'client', index: true) unless column_exists?(CamaleonCms::User.table_name, :role)
7
- add_column(CamaleonCms::User.table_name, :parent_id, :integer) unless column_exists?(CamaleonCms::User.table_name, :parent_id)
8
- add_column(CamaleonCms::User.table_name, :site_id, :integer, index: true, default: -1) unless column_exists?(CamaleonCms::User.table_name, :site_id)
9
- add_column(CamaleonCms::User.table_name, :auth_token, :string) unless column_exists?(CamaleonCms::User.table_name, :auth_token)
4
+ add_column(CamaleonCms::User.table_name, :email, :string, if_not_exists: true)
5
+ add_column(CamaleonCms::User.table_name, :username, :string, if_not_exists: true)
6
+ add_column(CamaleonCms::User.table_name, :role, :string, default: 'client', index: true, if_not_exists: true)
7
+ add_column(CamaleonCms::User.table_name, :parent_id, :integer, if_not_exists: true)
8
+ add_column(CamaleonCms::User.table_name, :site_id, :integer, index: true, default: -1, if_not_exists: true)
9
+ add_column(CamaleonCms::User.table_name, :auth_token, :string, if_not_exists: true)
10
10
  else
11
11
  create_table CamaleonCms::User.table_name do |t|
12
12
  t.string "username", index: true
@@ -26,7 +26,7 @@ class PostTableIntoUtf8 < CamaManager.migration_class
26
26
  end
27
27
  end
28
28
 
29
- create_table "#{PluginRoutes.static_system_info["db_prefix"]}term_taxonomy" do |t|
29
+ create_table "#{PluginRoutes.static_system_info["db_prefix"]}term_taxonomy", if_not_exists: true do |t|
30
30
  t.string "taxonomy", index: true
31
31
  t.text "description", limit: 1073741823
32
32
  t.integer "parent_id", index: true
@@ -41,7 +41,7 @@ class PostTableIntoUtf8 < CamaManager.migration_class
41
41
  t.belongs_to :user, index: true#, foreign_key: true
42
42
  end
43
43
 
44
- create_table "#{PluginRoutes.static_system_info["db_prefix"]}posts" do |t|
44
+ create_table "#{PluginRoutes.static_system_info["db_prefix"]}posts", if_not_exists: true do |t|
45
45
  t.string "title"
46
46
  t.string "slug", index: true
47
47
  t.text "content", limit: 1073741823
@@ -58,13 +58,13 @@ class PostTableIntoUtf8 < CamaManager.migration_class
58
58
  t.belongs_to :user, index: true#, foreign_key: true
59
59
  end
60
60
 
61
- create_table "#{PluginRoutes.static_system_info["db_prefix"]}term_relationships" do |t|
61
+ create_table "#{PluginRoutes.static_system_info["db_prefix"]}term_relationships", if_not_exists: true do |t|
62
62
  t.integer "objectid", index: true
63
63
  t.integer "term_order", index: true
64
64
  t.belongs_to :term_taxonomy, index: true
65
65
  end
66
66
 
67
- create_table "#{PluginRoutes.static_system_info["db_prefix"]}user_relationships" do |t|
67
+ create_table "#{PluginRoutes.static_system_info["db_prefix"]}user_relationships", if_not_exists: true do |t|
68
68
  t.integer "term_order"
69
69
  t.integer "active", default: 1
70
70
 
@@ -72,7 +72,7 @@ class PostTableIntoUtf8 < CamaManager.migration_class
72
72
  t.belongs_to :user, index: true
73
73
  end
74
74
 
75
- create_table "#{PluginRoutes.static_system_info["db_prefix"]}comments" do |t|
75
+ create_table "#{PluginRoutes.static_system_info["db_prefix"]}comments", if_not_exists: true do |t|
76
76
  t.string "author"
77
77
  t.string "author_email"
78
78
  t.string "author_url"
@@ -87,7 +87,7 @@ class PostTableIntoUtf8 < CamaManager.migration_class
87
87
  t.timestamps null: false
88
88
  end
89
89
 
90
- create_table "#{PluginRoutes.static_system_info["db_prefix"]}custom_fields" do |t|
90
+ create_table "#{PluginRoutes.static_system_info["db_prefix"]}custom_fields", if_not_exists: true do |t|
91
91
  t.string "object_class", index: true
92
92
  t.string "name"
93
93
  t.string "slug", index: true
@@ -100,7 +100,7 @@ class PostTableIntoUtf8 < CamaManager.migration_class
100
100
  t.string "status"
101
101
  end
102
102
 
103
- create_table "#{PluginRoutes.static_system_info["db_prefix"]}custom_fields_relationships" do |t|
103
+ create_table "#{PluginRoutes.static_system_info["db_prefix"]}custom_fields_relationships", if_not_exists: true do |t|
104
104
  t.integer "objectid", index: true
105
105
  t.integer "custom_field_id", index: true
106
106
  t.integer "term_order"
@@ -109,7 +109,7 @@ class PostTableIntoUtf8 < CamaManager.migration_class
109
109
  t.string "custom_field_slug", index: true
110
110
  end
111
111
 
112
- create_table "#{PluginRoutes.static_system_info["db_prefix"]}metas" do |t|
112
+ create_table "#{PluginRoutes.static_system_info["db_prefix"]}metas", if_not_exists: true do |t|
113
113
  t.string "key", index: true
114
114
  t.text "value", limit: 1073741823
115
115
  t.integer "objectid", index: true
@@ -1,9 +1,9 @@
1
1
  # change post structure to optimize query speed
2
2
  class RenameColumnPosts < CamaManager.migration_class
3
3
  def change
4
- remove_column "#{PluginRoutes.static_system_info["db_prefix"]}posts", :comment_count
5
- add_column "#{PluginRoutes.static_system_info["db_prefix"]}posts", :post_order, :integer, default: 0
6
- add_column "#{PluginRoutes.static_system_info["db_prefix"]}posts", :taxonomy_id, :integer, default: nil, index: true
4
+ remove_column "#{PluginRoutes.static_system_info["db_prefix"]}posts", :comment_count, if_exists: true
5
+ add_column "#{PluginRoutes.static_system_info["db_prefix"]}posts", :post_order, :integer, default: 0, if_not_exists: true
6
+ add_column "#{PluginRoutes.static_system_info["db_prefix"]}posts", :taxonomy_id, :integer, default: nil, index: true, if_not_exists: true
7
7
  CamaleonCms::Post.all.each do |post|
8
8
  begin
9
9
  post_id = post.get_post_type_depre.id
@@ -1,7 +1,7 @@
1
1
  class AddConfirmTokenToUsers < CamaManager.migration_class
2
2
  def change
3
- add_column CamaleonCms::User.table_name, :confirm_email_token, :string, default: nil
4
- add_column CamaleonCms::User.table_name, :confirm_email_sent_at, :datetime, default: nil
5
- add_column CamaleonCms::User.table_name, :is_valid_email, :boolean, default: true
3
+ add_column CamaleonCms::User.table_name, :confirm_email_token, :string, default: nil, if_not_exists: true
4
+ add_column CamaleonCms::User.table_name, :confirm_email_sent_at, :datetime, default: nil, if_not_exists: true
5
+ add_column CamaleonCms::User.table_name, :is_valid_email, :boolean, default: true, if_not_exists: true
6
6
  end
7
7
  end
@@ -1,5 +1,5 @@
1
1
  class AddFeatureToPosts < CamaManager.migration_class
2
2
  def change
3
- add_column "#{PluginRoutes.static_system_info["db_prefix"]}posts", :is_feature, :boolean, default: false
3
+ add_column "#{PluginRoutes.static_system_info["db_prefix"]}posts", :is_feature, :boolean, default: false, if_not_exists: true
4
4
  end
5
5
  end
@@ -1,7 +1,7 @@
1
1
  class MoveFirstNameOfUsers < CamaManager.migration_class
2
2
  def change
3
- add_column CamaleonCms::User.table_name, :first_name, :string unless column_exists?(CamaleonCms::User.table_name, :first_name)
4
- add_column CamaleonCms::User.table_name, :last_name, :string unless column_exists?(CamaleonCms::User.table_name, :last_name)
3
+ add_column CamaleonCms::User.table_name, :first_name, :string, if_not_exists: true
4
+ add_column CamaleonCms::User.table_name, :last_name, :string, if_not_exists: true
5
5
  CamaleonCms::User.all.each do |u|
6
6
  u.update_columns(first_name: u.get_meta('first_name'), last_name: u.get_meta('last_name')) if u.get_meta('first_name').present?
7
7
  end
@@ -1,5 +1,5 @@
1
1
  class AddGroupToCustomFieldValues < CamaManager.migration_class
2
2
  def change
3
- add_column "#{PluginRoutes.static_system_info["db_prefix"]}custom_fields_relationships", :group_number, :integer, default: 0
3
+ add_column "#{PluginRoutes.static_system_info["db_prefix"]}custom_fields_relationships", :group_number, :integer, default: 0, if_not_exists: true
4
4
  end
5
5
  end
@@ -1,5 +1,5 @@
1
1
  class DropUserRelationshipTable < CamaManager.migration_class
2
2
  def change
3
- drop_table "#{PluginRoutes.static_system_info["db_prefix"]}user_relationships"
3
+ drop_table "#{PluginRoutes.static_system_info["db_prefix"]}user_relationships", if_exists: true
4
4
  end
5
5
  end
@@ -1,6 +1,6 @@
1
1
  class CreateMedia < CamaManager.migration_class
2
2
  def change
3
- create_table "#{PluginRoutes.static_system_info["db_prefix"]}media" do |t|
3
+ create_table "#{PluginRoutes.static_system_info["db_prefix"]}media", if_not_exists: true do |t|
4
4
  t.references :site, index: true
5
5
  t.string :name, index: true
6
6
  t.boolean :is_folder, index: true, default: false
@@ -2,7 +2,7 @@ class AdjustFieldLength < CamaManager.migration_class
2
2
  def change
3
3
  post_table = CamaleonCms::Post.table_name
4
4
  change_column post_table, :title, :text
5
- remove_index(post_table, :slug) if index_exists?(post_table, :slug)
5
+ remove_index(post_table, :slug, if_exists: true)
6
6
  change_column post_table, :slug, :text
7
7
  add_index post_table, :slug, length: 255
8
8
  change_column "#{PluginRoutes.static_system_info["db_prefix"]}term_taxonomy", :name, :text
@@ -1,3 +1,3 @@
1
1
  module CamaleonCms
2
- VERSION = '2.9.1'.freeze
2
+ VERSION = '2.9.2'.freeze
3
3
  end
data/lib/ext/string.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  class String
2
2
  def to_bool
3
- return true if self == true || self =~ (/(true|t|yes|y|1)$/i)
4
- return false if self == false || blank? || self =~ (/(false|f|no|n|0)$/i)
3
+ return true if self == true || self =~ /(true|t|yes|y|1)$/i
4
+ return false if self == false || blank? || self =~ /(false|f|no|n|0)$/i
5
5
 
6
6
  raise ArgumentError, "invalid value for Boolean: \"#{self}\""
7
7
  end
@@ -111,7 +111,7 @@ class String
111
111
  name = name.gsub(sanitize_regexp, '_')
112
112
  name = "_#{name}" if name =~ /\A\.+\z/
113
113
  name = 'unnamed' if name.empty?
114
- name.mb_chars.to_s
114
+ name
115
115
  end
116
116
 
117
117
  # return cleaned model class name
data/lib/plugin_routes.rb CHANGED
@@ -174,12 +174,12 @@ class PluginRoutes
174
174
  @@all_sites = nil
175
175
  @@_vars.each { |v| class_variable_set("@@cache_#{v}", nil) }
176
176
  Rails.application.reload_routes!
177
- @@_after_reload.uniq.each { |r| eval(r) }
177
+ @@_after_reload.uniq.each(&:call)
178
178
  end
179
179
 
180
- # permit to add extra actions for reload routes
180
+ # Add a callable (Proc/Lambda) to run after routes reload; strings are not supported.
181
181
  def self.add_after_reload_routes(command)
182
- @@_after_reload << command
182
+ @@_after_reload << (command.is_a?(String) ? raise(ArgumentError, 'Expected a callable (Proc/Lambda), not a String') : command)
183
183
  end
184
184
 
185
185
  # return all enabled plugins []
@@ -0,0 +1,56 @@
1
+ namespace :camaleon_cms do
2
+ desc 'Backfill user roles to include custom_fields manager permission'
3
+ task backfill_custom_fields_permission: :environment do
4
+ Rails.logger.info 'Backfilling custom_fields manager permission for existing user roles...'
5
+ CamaleonCms::UserRole.find_each do |role|
6
+ key = "_manager_#{role.parent_id}"
7
+ begin
8
+ current_role = role.get_meta(key)
9
+ # if the role already has settings/managers, skip; otherwise add custom_fields => 1
10
+ if current_role.blank? || (!current_role.is_a?(Hash) || current_role['custom_fields'].blank?)
11
+ current_role = (current_role.is_a?(Hash) ? current_role : {}).merge!('custom_fields' => 1)
12
+ role.set_meta(key, current_role)
13
+ Rails.logger.info "Updated role=#{role.slug} site_id=#{role.parent_id}"
14
+ else
15
+ Rails.logger.info "Skipped role=#{role.slug} site_id=#{role.parent_id} (already has custom_fields)"
16
+ end
17
+ rescue StandardError => e
18
+ Rails.logger.info "Failed to update role=#{role.slug}: #{e.message}"
19
+ end
20
+ end
21
+ Rails.logger.info 'Done.'
22
+ end
23
+
24
+ desc 'Backfill admin user roles to include select_eval permission'
25
+ task backfill_select_eval_permission: :environment do
26
+ Rails.logger.info 'Backfilling select_eval permission for admin roles...'
27
+ updated_count = 0
28
+ skipped_count = 0
29
+
30
+ CamaleonCms::UserRole.where(slug: 'admin', term_group: -1).find_each do |role|
31
+ site_id = role.parent_id
32
+ key = "_manager_#{site_id}"
33
+ begin
34
+ current_meta = role.get_meta(key, {})
35
+
36
+ # Only update if role doesn't already have select_eval
37
+ if !current_meta[:select_eval]
38
+ updated_meta = current_meta.merge(select_eval: 1)
39
+ role.set_meta(key, updated_meta)
40
+ Rails.logger.info "✓ Updated admin role site_id=#{site_id}"
41
+ updated_count += 1
42
+ else
43
+ Rails.logger.info " Skipped admin role site_id=#{site_id} (already has select_eval)"
44
+ skipped_count += 1
45
+ end
46
+ rescue StandardError => e
47
+ Rails.logger.info "✗ Failed to update admin role site_id=#{site_id}: #{e.message}"
48
+ end
49
+ end
50
+
51
+ Rails.logger.info "\nSummary:"
52
+ Rails.logger.info " Updated: #{updated_count} admin roles"
53
+ Rails.logger.info " Skipped: #{skipped_count} admin roles"
54
+ Rails.logger.info "\nDone! All admin roles now have select_eval permission."
55
+ end
56
+ end