Dotclear


Ignore:
Timestamp:
09/22/13 02:49:48 (12 years ago)
Author:
Denis Jean-Chirstian <contact@…>
Branch:
default
Message:

Revamp plugin maintenance, step 5, now open to admin user and various fixes, addresses #999

File:
1 edited

Legend:

Unmodified
Added
Removed
  • plugins/maintenance/inc/class.dc.maintenance.task.php

    r1984 r1989  
    2929     protected $ajax = false; 
    3030     protected $blog = false; 
     31     protected $perm = null; 
    3132 
    3233     protected $id; 
     
    5556          $this->init(); 
    5657 
     58          if ($this->perm() === null && !$this->core->auth->isSuperAdmin() 
     59          || !$this->core->auth->check($this->perm(), $this->core->blog->id)) { 
     60               return null; 
     61          } 
     62 
    5763          $this->p_url = $p_url; 
    5864          $this->id = get_class($this); 
     
    7278 
    7379          $this->ts = abs((integer) $ts); 
     80 
     81          return true; 
    7482     } 
    7583 
     
    8391     { 
    8492          return null; 
     93     } 
     94 
     95     /** 
     96      * Get task permission. 
     97      * 
     98      * Return user permission required to run this task  
     99      * or null for super admin. 
     100      * 
     101      * @return <b>mixed</b> Permission. 
     102      */ 
     103     public function perm() 
     104     { 
     105          return $this->perm; 
     106     } 
     107 
     108     /** 
     109      * Get task scope. 
     110      *. 
     111      * Is task limited to current blog. 
     112      * 
     113      * @return <b>boolean</b> Limit to blog 
     114      */ 
     115     public function blog() 
     116     { 
     117          return $this->blog; 
    85118     } 
    86119 
Note: See TracChangeset for help on using the changeset viewer.

Sites map