Changeset 2776


Ignore:
Timestamp:
Oct 19, 2008, 5:37:43 PM (16 years ago)
Author:
vdigital
Message:

Jump to category icon is removed on user forbidden categories (previously check_restrictions was leading administrators to the access denied page).

Location:
branches/2.0/admin
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/2.0/admin/cat_modify.php

    r2653 r2776  
    236236  array(
    237237    'CATEGORIES_NAV'     => $navigation,
     238    'CAT_ID'             => $category['id'],
    238239    'CAT_NAME'           => @htmlspecialchars($category['name']),
    239240    'CAT_COMMENT'        => @htmlspecialchars($category['comment']),
  • branches/2.0/admin/include/functions.php

    r2678 r2776  
    19001900  }
    19011901}
     1902
     1903/**
     1904 * Is the category accessible to the (Admin) user ?
     1905 *
     1906 * Note : if the user is not authorized to see this category, category jump
     1907 * will be replaced by admin cat_modify page
     1908 *
     1909 * @param int category id to verify
     1910 * @return bool
     1911 */
     1912function cat_admin_access($category_id)
     1913{
     1914  global $user;
     1915
     1916  // $filter['visible_categories'] and $filter['visible_images']
     1917  // are not used because it's not necessary (filter <> restriction)
     1918  if (in_array($category_id, explode(',', $user['forbidden_categories'])))
     1919  {
     1920    return false;
     1921  }
     1922  return true;
     1923}
     1924
    19021925?>
  • branches/2.0/admin/template/goto/cat_list.tpl

    r2573 r2776  
    4949      <!-- category {$category.ID} -->
    5050      <ul class="categoryActions">
     51        {if cat_admin_access($category.ID)}
    5152        <li><a href="{$category.U_JUMPTO}" title="{'jump to category'|@translate}"><img src="{$themeconf.admin_icon_dir}/category_jump-to.png" class="button" alt="{'jump to category'|@translate}" /></a></li>
     53        {/if}
    5254        <li><a href="{$category.U_EDIT}" title="{'edit category informations'|@translate}"><img src="{$themeconf.admin_icon_dir}/category_edit.png" class="button" alt="{'edit'|@translate}"/></a></li>
    5355        {if isset($category.U_MANAGE_ELEMENTS) }
  • branches/2.0/admin/template/goto/cat_modify.tpl

    r2760 r2776  
    1111
    1212<ul class="categoryActions">
     13  {if cat_admin_access($CAT_ID)}
    1314  <li><a href="{$U_JUMPTO}" title="{'jump to category'|@translate}"><img src="{$themeconf.admin_icon_dir}/category_jump-to.png" class="button" alt="{'jump to category'|@translate}" /></a></li>
     15  {/if}
    1416  {if isset($U_MANAGE_ELEMENTS) }
    1517  <li><a href="{$U_MANAGE_ELEMENTS}" title="{'manage category elements'|@translate}"><img src="{$ROOT_URL}{$themeconf.admin_icon_dir}/category_elements.png" class="button" alt="{'elements'|@translate}" /></a></li>
Note: See TracChangeset for help on using the changeset viewer.