Changeset 9368


Ignore:
Timestamp:
Feb 24, 2011, 3:08:11 PM (9 years ago)
Author:
plg
Message:

bug 2202 fixed: invalidate_user_cache() must be called before any redirect in included files

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/admin.php

    r9358 r9368  
    2222// +-----------------------------------------------------------------------+
    2323
    24 //----------------------------------------------------------- include
     24// +-----------------------------------------------------------------------+
     25// | Basic constants and includes                                          |
     26// +-----------------------------------------------------------------------+
     27
    2528define('PHPWG_ROOT_PATH','./');
    2629define('IN_ADMIN', true);
    27 include_once( PHPWG_ROOT_PATH.'include/common.inc.php' );
    28 
     30
     31include_once(PHPWG_ROOT_PATH.'include/common.inc.php');
    2932include_once(PHPWG_ROOT_PATH.'admin/include/functions.php');
    3033include_once(PHPWG_ROOT_PATH.'admin/include/functions_plugins.inc.php');
     
    3538// | Check Access and exit when user status is not ok                      |
    3639// +-----------------------------------------------------------------------+
     40
    3741check_status(ACCESS_ADMINISTRATOR);
     42
     43// +-----------------------------------------------------------------------+
     44// | Direct actions                                                        |
     45// +-----------------------------------------------------------------------+
    3846
    3947// tags
     
    6876
    6977// +-----------------------------------------------------------------------+
    70 // |                    synchronize user informations                      |
    71 // +-----------------------------------------------------------------------+
     78// | Synchronize user informations                                         |
     79// +-----------------------------------------------------------------------+
     80
    7281if (mt_rand(0,9)==0)
    7382{
     
    7685
    7786// +-----------------------------------------------------------------------+
    78 // |                            variables init                             |
     87// | Variables init                                                        |
    7988// +-----------------------------------------------------------------------+
    8089
     
    114123$link_start = PHPWG_ROOT_PATH.'admin.php?page=';
    115124$conf_link = $link_start.'configuration&section=';
    116 //----------------------------------------------------- template initialization
     125
     126// +-----------------------------------------------------------------------+
     127// | Template init                                                         |
     128// +-----------------------------------------------------------------------+
     129
    117130$title = l10n('Piwigo Administration'); // for include/page_header.php
    118131$page['page_banner'] = '<h1>'.l10n('Piwigo Administration').'</h1>';
     
    159172  );
    160173
    161 //---------------------------------------------------------------- plugin menus
     174// +-----------------------------------------------------------------------+
     175// | Plugin menu                                                           |
     176// +-----------------------------------------------------------------------+
     177
    162178$plugin_menu_links = trigger_event('get_admin_plugin_menu_links', array() );
    163179
     
    169185$template->assign('plugin_menu_items', $plugin_menu_links);
    170186
    171 include(PHPWG_ROOT_PATH.'admin/'.$page['page'].'.php');
    172 
    173 //------------------------------------------------------------- content display
    174 
    175 // +-----------------------------------------------------------------------+
    176 // |                            errors & infos                             |
    177 // +-----------------------------------------------------------------------+
    178 
    179 $template->assign('ACTIVE_MENU', get_active_menu($page['page']));
    180 
    181 if (count($page['errors']) != 0)
    182 {
    183   $template->assign('errors', $page['errors']);
    184 }
    185 
    186 if (count($page['infos']) != 0)
    187 {
    188   $template->assign('infos', $page['infos']);
    189 }
    190 
    191 if (count($page['warnings']) != 0)
    192 {
    193   $template->assign('warnings', $page['warnings']);
    194 }
    195 
    196 // Add the Piwigo Official menu
    197   $template->assign( 'pwgmenu', pwg_URL() );
    198 
    199 include(PHPWG_ROOT_PATH.'include/page_header.php');
    200 
    201 trigger_action('loc_end_admin');
    202 
    203 $template->pparse('admin');
    204 
    205 // +-----------------------------------------------------------------------+
    206 // |                     order permission refreshment                      |
    207 // +-----------------------------------------------------------------------+
     187// +-----------------------------------------------------------------------+
     188// | Refresh permissions                                                   |
     189// +-----------------------------------------------------------------------+
     190
    208191// Only for pages witch change permissions
    209192if (
     
    235218}
    236219
     220// +-----------------------------------------------------------------------+
     221// | Include specific page                                                 |
     222// +-----------------------------------------------------------------------+
     223
     224include(PHPWG_ROOT_PATH.'admin/'.$page['page'].'.php');
     225
     226// +-----------------------------------------------------------------------+
     227// | Errors, Infos & Warnings                                              |
     228// +-----------------------------------------------------------------------+
     229
     230$template->assign('ACTIVE_MENU', get_active_menu($page['page']));
     231
     232if (count($page['errors']) != 0)
     233{
     234  $template->assign('errors', $page['errors']);
     235}
     236
     237if (count($page['infos']) != 0)
     238{
     239  $template->assign('infos', $page['infos']);
     240}
     241
     242if (count($page['warnings']) != 0)
     243{
     244  $template->assign('warnings', $page['warnings']);
     245}
     246
     247// +-----------------------------------------------------------------------+
     248// | Sending html code                                                     |
     249// +-----------------------------------------------------------------------+
     250
     251// Add the Piwigo Official menu
     252$template->assign( 'pwgmenu', pwg_URL() );
     253
     254include(PHPWG_ROOT_PATH.'include/page_header.php');
     255
     256trigger_action('loc_end_admin');
     257
     258$template->pparse('admin');
     259
    237260include(PHPWG_ROOT_PATH.'include/page_tail.php');
    238261?>
Note: See TracChangeset for help on using the changeset viewer.