Ignore:
Timestamp:
Jan 18, 2007, 3:09:31 AM (18 years ago)
Author:
rvelices
Message:

plugin simplification: adding admin links does not require the plugin_id anymore...

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/admin/plugin.php

    r1705 r1731  
    3434check_status(ACCESS_ADMINISTRATOR);
    3535
    36 $section = explode('~', $_GET['section'] );
    37 if (count($section)!=2)
     36$sections = explode('/', $_GET['section'] );
     37for ($i=0; $i<count($sections); $i++)
     38{
     39  if (empty($sections[$i]) or $sections[$i]=='..')
     40  {
     41    unset($sections[$i]);
     42    $i--;
     43  }
     44}
     45
     46if (count($sections)<2)
    3847{
    3948  die('Invalid plugin URL');
    4049}
    4150
    42 $plugin_id = $section[0];
     51$plugin_id = $sections[0];
    4352$check_db_plugin = get_db_plugins('active', $plugin_id );
    4453if (empty($check_db_plugin))
     
    4655  die('Invalid URL - plugin '.$plugin_id.' not active');
    4756}
    48 $section[1]=str_replace('./', '', $section[1]); // no up in dir structure
    4957
    50 $filename = PHPWG_PLUGINS_PATH.$plugin_id.'/'.$section[1].'.php';
     58$filename = PHPWG_PLUGINS_PATH.implode('/', $sections);
    5159if (is_file($filename))
    5260{
     
    5563else
    5664{
    57   die('Missing '.$filename);
     65  die('Missing file '.$filename);
    5866}
    5967?>
Note: See TracChangeset for help on using the changeset viewer.