Dotclear

Changeset 2797:4a5f0d16acd2


Ignore:
Timestamp:
11/17/14 10:30:07 (11 years ago)
Author:
franck <carnet.franck.paul@…>
Branch:
default
Message:

Add an optional setting (blog pref) to prevent blog from Clickjacking

Files:
3 edited

Legend:

Unmodified
Added
Removed
  • admin/blog_pref.php

    r2776 r2797  
    234234          $blog_settings->system->put('enable_xmlrpc',!empty($_POST['enable_xmlrpc'])); 
    235235          $blog_settings->system->put('note_title_tag',$_POST['note_title_tag']); 
    236  
    237236          $blog_settings->system->put('nb_post_for_home',$nb_post_for_home); 
    238237          $blog_settings->system->put('nb_post_per_page',$nb_post_per_page); 
     
    250249          $blog_settings->system->put('nb_comment_per_feed',$nb_comment_per_feed); 
    251250          $blog_settings->system->put('short_feed_items',!empty($_POST['short_feed_items'])); 
    252  
    253251          if (isset($_POST['robots_policy'])) { 
    254252               $blog_settings->system->put('robots_policy',$_POST['robots_policy']); 
    255253          } 
     254          $blog_settings->system->put('prevents_clickjacking',!empty($_POST['prevents_clickjacking'])); 
    256255 
    257256          # --BEHAVIOR-- adminBeforeBlogSettingsUpdate 
     
    606605     echo '</div>'; 
    607606 
     607     echo 
     608     '<div class="fieldset"><h4>'.__('Blog security').'</h4>'. 
     609     '<p><label for="prevents_clickjacking" class="classic">'. 
     610     form::checkbox('prevents_clickjacking','1',$blog_settings->system->prevents_clickjacking). 
     611     __('Protect the blog from Clickjacking (see <a href="https://en.wikipedia.org/wiki/Clickjacking">Wikipedia</a>)').'</label></p>'. 
     612     '<br class="clear" />'. //Opera sucks 
     613     '</div>'; 
    608614 
    609615     # --BEHAVIOR-- adminBlogPreferencesForm 
  • inc/public/lib.urlhandlers.php

    r2770 r2797  
    110110 
    111111          header('Content-Type: '.$_ctx->content_type.'; charset=UTF-8'); 
     112 
     113          if ($core->blog->settings->system->prevents_clickjacking) { 
     114               // Prevents Clickjacking as far as possible 
     115               header('X-Frame-Options: SAMEORIGIN'); // FF 3.6.9+ Chrome 4.1+ IE 8+ Safari 4+ Opera 10.5+ 
     116          } 
     117 
    112118          $result['content'] = $core->tpl->getData($_ctx->current_tpl); 
    113119          $result['content_type'] = $_ctx->content_type; 
  • locales/fr/main.po

    r2789 r2797  
    36763676msgstr "Choisir une date" 
    36773677 
     3678msgid "Blog security" 
     3679msgstr "Sécurité du blog" 
     3680 
     3681msgid "Protect the blog from Clickjacking (see <a href=\"https://en.wikipedia.org/wiki/Clickjacking\">Wikipedia</a>)" 
     3682msgstr "Protéger le blog des détournements de clic ou Clickjacking (voir <a href=\"https://fr.wikipedia.org/wiki/Clickjacking\">Wikipedia</a>)" 
     3683 
    36783684#~ msgid "You don't have permissions to deactivate this plugin." 
    36793685#~ msgstr "Vous n'avez pas les permissions pour désactiver ce plugin." 
Note: See TracChangeset for help on using the changeset viewer.

Sites map