mirror of
https://github.com/pluginsGLPI/example.git
synced 2025-06-28 06:58:43 +02:00
Clean
git-svn-id: https://forge.glpi-project.org/svn/example/trunk@113 349b9182-4a13-0410-896f-e5e9767dd1b3
This commit is contained in:
16
setup.php
16
setup.php
@ -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');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
|
Reference in New Issue
Block a user