git-svn-id: https://forge.glpi-project.org/svn/example/trunk@113 349b9182-4a13-0410-896f-e5e9767dd1b3
This commit is contained in:
remicollet
2009-12-12 07:17:01 +00:00
parent f33753092c
commit 89d7d18237
3 changed files with 36 additions and 36 deletions

View File

@ -61,7 +61,7 @@ function plugin_init_example() {
'searchpage' => 'front/dropdown.php'));
// Display a menu entry ?
if (plugin_example_haveTypeRight('PluginExampleExample','r')) { // Right set in change_profile hook
if (isset($_SESSION["glpi_plugin_example_profile"])) { // Right set in change_profile hook
$PLUGIN_HOOKS['menu_entry']['example'] = 'front/example.php';
$PLUGIN_HOOKS['submenu_entry']['example']['options']['optionname']['title']="Search";
@ -176,19 +176,5 @@ function plugin_example_check_config($verbose=false){
return false;
}
// Define rights for the plugin types
function plugin_example_haveTypeRight($type,$right){
if (!isset($_SESSION["glpi_plugin_example_profile"])) {
// No right
return false;
}
switch ($type){
case 'PluginExampleExample' :
// Evaluate the right from data saved in session by change_profile hook
return ($right=='r' || $_SESSION["glpi_plugin_example_profile"]=='w');
}
}
?>