Dotclear

Changeset 4006:4de7ea99ccac


Ignore:
Timestamp:
07/09/19 13:10:33 (6 years ago)
Author:
franck <carnet.franck.paul@…>
Branch:
default
Message:

If context cannot be conserved when switching blog, test dashboard access permission before killing the session

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • admin/index.php

    r3947 r4006  
    2929} 
    3030 
    31 dcPage::check('usage,contentadmin'); 
     31dcPage::check('usage,contentadmin', true); 
    3232 
    3333if ($core->plugins->disableDepModules($core->adminurl->get('admin.home', []))) { 
  • inc/admin/lib.dc.page.php

    r4002 r4006  
    2424 
    2525    # Auth check 
    26     public static function check($permissions) 
     26    public static function check($permissions, $home = false) 
    2727    { 
    2828        $core = self::getCore(); 
     
    3232        } 
    3333 
     34        // Check if dashboard is not the current page et if it is granted for the user 
     35        if (!$home && $core->blog && $core->auth->check('usage,contentadmin', $core->blog->id)) { 
     36            // Go back to the dashboard 
     37            http::redirect(DC_ADMIN_URL); 
     38        } 
     39 
    3440        if (session_id()) { 
    3541            $core->session->destroy(); 
     
    3945 
    4046    # Check super admin 
    41     public static function checkSuper() 
     47    public static function checkSuper($home = false) 
    4248    { 
    4349        $core = self::getCore(); 
    4450 
    4551        if (!$core->auth->isSuperAdmin()) { 
     52            // Check if dashboard is not the current page et if it is granted for the user 
     53            if (!$home && $core->blog && $core->auth->check('usage,contentadmin', $core->blog->id)) { 
     54                // Go back to the dashboard 
     55                http::redirect(DC_ADMIN_URL); 
     56            } 
     57 
    4658            if (session_id()) { 
    4759                $core->session->destroy(); 
Note: See TracChangeset for help on using the changeset viewer.

Sites map