Dotclear

Changeset 459 for plugins/blocNotes


Ignore:
Timestamp:
06/27/08 10:30:18 (15 years ago)
Author:
sacha
Message:

Ajout des vérifications pour éviter l'exécution des plugins en dehors de Dotclear

Location:
plugins/blocNotes
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • plugins/blocNotes/_admin.php

    r455 r459  
    2121# 
    2222# ***** END LICENSE BLOCK ***** 
     23if (!defined('DC_CONTEXT_ADMIN')) { return; } 
    2324 
    24      require_once(dirname(__FILE__).'/lib.blocNotes.php'); 
     25require_once(dirname(__FILE__).'/lib.blocNotes.php'); 
    2526 
    26      # dashboard 
    27      if ($core->auth->check('usage,contentadmin',$core->blog->id)) 
    28      { 
    29           # <= 2.0-beta7 
    30           if (isset($__dashboard_icons)) { 
    31                $__dashboard_icons[] = array(__('Notebook'),'plugin.php?p=blocNotes','index.php?pf=blocNotes/icon-big.png'); 
    32           } 
    33           # > 2.0-beta7 
    34           $core->addBehavior('adminDashboardIcons',array('blocNotes','adminDashboardIcons')); 
     27# dashboard 
     28if ($core->auth->check('usage,contentadmin',$core->blog->id)) 
     29{ 
     30     # <= 2.0-beta7 
     31     if (isset($__dashboard_icons)) { 
     32          $__dashboard_icons[] = array(__('Notebook'),'plugin.php?p=blocNotes','index.php?pf=blocNotes/icon-big.png'); 
    3533     } 
     34     # > 2.0-beta7 
     35     $core->addBehavior('adminDashboardIcons',array('blocNotes','adminDashboardIcons')); 
     36} 
    3637 
    37      # post 
    38      $core->addBehavior('adminPostForm',array('blocNotes','form')); 
    39      $core->addBehavior('adminAfterPostCreate',array('blocNotes','putSettings')); 
    40      $core->addBehavior('adminAfterPostUpdate',array('blocNotes','putSettings')); 
    41      $core->addBehavior('adminPostHeaders',array('blocNotes','adminPostHeaders')); 
     38# post 
     39$core->addBehavior('adminPostForm',array('blocNotes','form')); 
     40$core->addBehavior('adminAfterPostCreate',array('blocNotes','putSettings')); 
     41$core->addBehavior('adminAfterPostUpdate',array('blocNotes','putSettings')); 
     42$core->addBehavior('adminPostHeaders',array('blocNotes','adminPostHeaders')); 
    4243 
    43      $_menu['Plugins']->addItem(__('Notebook'), 
    44      'plugin.php?p=blocNotes', 
    45      'index.php?pf=blocNotes/icon.png', 
    46      preg_match('/plugin.php\?p=blocNotes(&.*)?$/',$_SERVER['REQUEST_URI']), 
    47      $core->auth->check('usage,contentadmin',$core->blog->id)); 
     44$_menu['Plugins']->addItem(__('Notebook'), 
     45'plugin.php?p=blocNotes', 
     46'index.php?pf=blocNotes/icon.png', 
     47preg_match('/plugin.php\?p=blocNotes(&.*)?$/',$_SERVER['REQUEST_URI']), 
     48$core->auth->check('usage,contentadmin',$core->blog->id)); 
    4849?> 
  • plugins/blocNotes/_define.php

    r455 r459  
    2121# 
    2222# ***** END LICENSE BLOCK ***** 
     23if (!defined('DC_RC_PATH')) { return; } 
    2324 
    2425$this->registerModule( 
  • plugins/blocNotes/index.php

    r455 r459  
    2121# 
    2222# ***** END LICENSE BLOCK ***** 
    23  
    24      if (!defined('DC_CONTEXT_ADMIN')) { exit; } 
     23if (!defined('DC_CONTEXT_ADMIN')) { return; } 
    2524 
    2625     try 
Note: See TracChangeset for help on using the changeset viewer.

Sites map