diff --git a/htdocs/admin/modules.php b/htdocs/admin/modules.php index 113d12570cb..1456b95b45f 100644 --- a/htdocs/admin/modules.php +++ b/htdocs/admin/modules.php @@ -79,6 +79,11 @@ if ($action == 'set' && $user->admin) { $result=activateModule($value); if ($result) setEventMessages($result, null, 'errors'); + else + { + $msg = $langs->trans('ModuleEnabledAdminMustCheckRights'); + setEventMessages($msg, null, 'warnings'); + } header("Location: modules.php?mode=".$mode.$param.($page_y?'&page_y='.$page_y:'')); exit; } @@ -605,7 +610,7 @@ if ($mode != 'marketplace') else $text.=$langs->trans("No"); $text.='
'.$langs->trans("AddMenus").': '; - if (isset($objMod->menu) && is_array($objMod->menu) && ! empty($objMod->menu)) + if (isset($objMod->menu) && ! empty($objMod->menu)) // objMod can be an array or just an int 1 { $text.=$langs->trans("Yes"); } diff --git a/htdocs/core/lib/usergroups.lib.php b/htdocs/core/lib/usergroups.lib.php index 26a7455bf62..2e9a9d582bd 100644 --- a/htdocs/core/lib/usergroups.lib.php +++ b/htdocs/core/lib/usergroups.lib.php @@ -62,7 +62,7 @@ function user_prepare_head($object) if ($canreadperms) { $head[$h][0] = DOL_URL_ROOT.'/user/perms.php?id='.$object->id; - $head[$h][1] = $langs->trans("UserRights"); + $head[$h][1] = $langs->trans("UserRights"). ' '.($object->nb_rights).''; $head[$h][2] = 'rights'; $h++; } diff --git a/htdocs/core/modules/modAccounting.class.php b/htdocs/core/modules/modAccounting.class.php index 60d99438f4f..af081130db4 100644 --- a/htdocs/core/modules/modAccounting.class.php +++ b/htdocs/core/modules/modAccounting.class.php @@ -284,8 +284,10 @@ class modAccounting extends DolibarrModules $this->rights[$r][5] = ''; $r++; - // Main menu entries - $this->menus = array(); - $r = 0; + + // Menus + //------- + $this->menu = 1; // This module add menu entries. They are coded into menu manager. + } } diff --git a/htdocs/core/modules/modAdherent.class.php b/htdocs/core/modules/modAdherent.class.php index bcf7c32b74e..6b52490d350 100644 --- a/htdocs/core/modules/modAdherent.class.php +++ b/htdocs/core/modules/modAdherent.class.php @@ -209,7 +209,7 @@ class modAdherent extends DolibarrModules $this->rights[$r][0] = 71; $this->rights[$r][1] = 'Read members\' card'; $this->rights[$r][2] = 'r'; - $this->rights[$r][3] = 1; + $this->rights[$r][3] = 0; $this->rights[$r][4] = 'lire'; $r++; @@ -244,7 +244,7 @@ class modAdherent extends DolibarrModules $this->rights[$r][0] = 78; $this->rights[$r][1] = 'Read subscriptions'; $this->rights[$r][2] = 'r'; - $this->rights[$r][3] = 1; + $this->rights[$r][3] = 0; $this->rights[$r][4] = 'cotisation'; $this->rights[$r][5] = 'lire'; @@ -256,6 +256,12 @@ class modAdherent extends DolibarrModules $this->rights[$r][4] = 'cotisation'; $this->rights[$r][5] = 'creer'; + + // Menus + //------- + $this->menu = 1; // This module add menu entries. They are coded into menu manager. + + // Exports //-------- $r=0; diff --git a/htdocs/core/modules/modAgenda.class.php b/htdocs/core/modules/modAgenda.class.php index a8775fd9b2d..47e6fb43d5c 100644 --- a/htdocs/core/modules/modAgenda.class.php +++ b/htdocs/core/modules/modAgenda.class.php @@ -118,7 +118,7 @@ class modAgenda extends DolibarrModules $this->rights[$r][0] = 2401; $this->rights[$r][1] = 'Read actions/tasks linked to his account'; $this->rights[$r][2] = 'r'; - $this->rights[$r][3] = 1; + $this->rights[$r][3] = 0; $this->rights[$r][4] = 'myactions'; $this->rights[$r][5] = 'read'; $r++; diff --git a/htdocs/core/modules/modApi.class.php b/htdocs/core/modules/modApi.class.php index 8008590cce7..fc1821fde53 100644 --- a/htdocs/core/modules/modApi.class.php +++ b/htdocs/core/modules/modApi.class.php @@ -155,7 +155,7 @@ class modApi extends DolibarrModules // Example: // $this->rights[$r][0] = $this->numero + $r; // Permission id (must not be already used) // $this->rights[$r][1] = 'Permision label'; // Permission label - // $this->rights[$r][3] = 1; // Permission by default for new user (0/1) + // $this->rights[$r][3] = 0; // Permission by default for new user (0/1) // $this->rights[$r][4] = 'level1'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2) // $this->rights[$r][5] = 'level2'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2) // $r++; diff --git a/htdocs/core/modules/modBanque.class.php b/htdocs/core/modules/modBanque.class.php index 86c772fe4c8..33ca523d00b 100644 --- a/htdocs/core/modules/modBanque.class.php +++ b/htdocs/core/modules/modBanque.class.php @@ -89,7 +89,7 @@ class modBanque extends DolibarrModules $this->rights[$r][0] = 111; // id de la permission $this->rights[$r][1] = 'Lire les comptes bancaires'; // libelle de la permission $this->rights[$r][2] = 'r'; - $this->rights[$r][3] = 1; + $this->rights[$r][3] = 0; $this->rights[$r][4] = 'lire'; $r++; @@ -135,7 +135,11 @@ class modBanque extends DolibarrModules $this->rights[$r][4] = 'cheque'; - + // Menus + //------- + $this->menu = 1; // This module add menu entries. They are coded into menu manager. + + // Exports //-------- $r=0; diff --git a/htdocs/core/modules/modBookmark.class.php b/htdocs/core/modules/modBookmark.class.php index 5614ceb53ab..8924be16ba4 100644 --- a/htdocs/core/modules/modBookmark.class.php +++ b/htdocs/core/modules/modBookmark.class.php @@ -81,22 +81,27 @@ class modBookmark extends DolibarrModules $this->rights[$r][0] = 331; // id de la permission $this->rights[$r][1] = 'Lire les bookmarks'; // libelle de la permission $this->rights[$r][2] = 'r'; // type de la permission (deprecie a ce jour) - $this->rights[$r][3] = 1; // La permission est-elle une permission par defaut + $this->rights[$r][3] = 0; // La permission est-elle une permission par defaut $this->rights[$r][4] = 'lire'; $r++; $this->rights[$r][0] = 332; // id de la permission $this->rights[$r][1] = 'Creer/modifier les bookmarks'; // libelle de la permission $this->rights[$r][2] = 'r'; // type de la permission (deprecie a ce jour) - $this->rights[$r][3] = 1; // La permission est-elle une permission par defaut + $this->rights[$r][3] = 0; // La permission est-elle une permission par defaut $this->rights[$r][4] = 'creer'; $r++; $this->rights[$r][0] = 333; // id de la permission $this->rights[$r][1] = 'Supprimer les bookmarks'; // libelle de la permission $this->rights[$r][2] = 'r'; // type de la permission (d�pr�ci� � ce jour) - $this->rights[$r][3] = 1; // La permission est-elle une permission par d�faut + $this->rights[$r][3] = 0; // La permission est-elle une permission par d�faut $this->rights[$r][4] = 'supprimer'; + + // Menus + //------- + $this->menu = 1; // This module add menu entries. They are coded into menu manager. + } } diff --git a/htdocs/core/modules/modCashDesk.class.php b/htdocs/core/modules/modCashDesk.class.php index 93c0f3016ed..ec8764c9017 100644 --- a/htdocs/core/modules/modCashDesk.class.php +++ b/htdocs/core/modules/modCashDesk.class.php @@ -86,7 +86,7 @@ class modCashDesk extends DolibarrModules $this->rights[$r][0] = 50101; $this->rights[$r][1] = 'Use point of sale'; $this->rights[$r][2] = 'a'; - $this->rights[$r][3] = 1; + $this->rights[$r][3] = 0; $this->rights[$r][4] = 'use'; // Main menu entries diff --git a/htdocs/core/modules/modCategorie.class.php b/htdocs/core/modules/modCategorie.class.php index 75260ef0a5a..edda1043d71 100644 --- a/htdocs/core/modules/modCategorie.class.php +++ b/htdocs/core/modules/modCategorie.class.php @@ -89,7 +89,7 @@ class modCategorie extends DolibarrModules $this->rights[$r][0] = 241; // id de la permission $this->rights[$r][1] = 'Lire les categories'; // libelle de la permission $this->rights[$r][2] = 'r'; // type de la permission (deprecated) - $this->rights[$r][3] = 1; // La permission est-elle une permission par defaut + $this->rights[$r][3] = 0; // La permission est-elle une permission par defaut $this->rights[$r][4] = 'lire'; $r++; @@ -107,6 +107,12 @@ class modCategorie extends DolibarrModules $this->rights[$r][4] = 'supprimer'; $r++; + + // Menus + //------- + $this->menu = 1; // This module add menu entries. They are coded into menu manager. + + // Exports //-------- $r=0; diff --git a/htdocs/core/modules/modCommande.class.php b/htdocs/core/modules/modCommande.class.php index 2d3080f892a..ce792b683fe 100644 --- a/htdocs/core/modules/modCommande.class.php +++ b/htdocs/core/modules/modCommande.class.php @@ -114,7 +114,7 @@ class modCommande extends DolibarrModules $this->rights[$r][0] = 81; $this->rights[$r][1] = 'Lire les commandes clients'; $this->rights[$r][2] = 'r'; - $this->rights[$r][3] = 1; + $this->rights[$r][3] = 0; $this->rights[$r][4] = 'lire'; $r++; @@ -170,6 +170,12 @@ class modCommande extends DolibarrModules $this->rights[$r][4] = 'commande'; $this->rights[$r][5] = 'export'; + + // Menus + //------- + $this->menu = 1; // This module add menu entries. They are coded into menu manager. + + // Exports //-------- $r=0; diff --git a/htdocs/core/modules/modComptabilite.class.php b/htdocs/core/modules/modComptabilite.class.php index ca49ab12f7d..c07318fb36b 100644 --- a/htdocs/core/modules/modComptabilite.class.php +++ b/htdocs/core/modules/modComptabilite.class.php @@ -91,9 +91,15 @@ class modComptabilite extends DolibarrModules $this->rights[$r][0] = 95; $this->rights[$r][1] = 'Lire CA, bilans, resultats'; $this->rights[$r][2] = 'r'; - $this->rights[$r][3] = 1; + $this->rights[$r][3] = 0; $this->rights[$r][4] = 'resultat'; $this->rights[$r][5] = 'lire'; + + + // Menus + //------- + $this->menu = 1; // This module add menu entries. They are coded into menu manager. + } diff --git a/htdocs/core/modules/modContrat.class.php b/htdocs/core/modules/modContrat.class.php index d298c5aa182..c4c8cd500fb 100644 --- a/htdocs/core/modules/modContrat.class.php +++ b/htdocs/core/modules/modContrat.class.php @@ -91,7 +91,7 @@ class modContrat extends DolibarrModules $this->rights[$r][0] = 161; $this->rights[$r][1] = 'Lire les contrats'; $this->rights[$r][2] = 'r'; - $this->rights[$r][3] = 1; + $this->rights[$r][3] = 0; $this->rights[$r][4] = 'lire'; $r++; @@ -130,6 +130,11 @@ class modContrat extends DolibarrModules $this->rights[$r][4] = 'export'; + // Menus + //------- + $this->menu = 1; // This module add menu entries. They are coded into menu manager. + + // Exports //-------- $langs->load("contracts"); diff --git a/htdocs/core/modules/modCron.class.php b/htdocs/core/modules/modCron.class.php index 49a857b3562..282b835be66 100644 --- a/htdocs/core/modules/modCron.class.php +++ b/htdocs/core/modules/modCron.class.php @@ -108,7 +108,7 @@ class modCron extends DolibarrModules $this->rights[$r][0] = 23001; $this->rights[$r][1] = 'Read cron jobs'; - $this->rights[$r][3] = 1; + $this->rights[$r][3] = 0; $this->rights[$r][4] = 'read'; $r++; diff --git a/htdocs/core/modules/modDeplacement.class.php b/htdocs/core/modules/modDeplacement.class.php index 7a0760a603d..ab4e7a0095f 100644 --- a/htdocs/core/modules/modDeplacement.class.php +++ b/htdocs/core/modules/modDeplacement.class.php @@ -108,6 +108,12 @@ class modDeplacement extends DolibarrModules $this->rights[5][3] = 0; $this->rights[5][4] = 'export'; + + // Menus + //------- + $this->menu = 1; // This module add menu entries. They are coded into menu manager. + + // Exports $r=0; diff --git a/htdocs/core/modules/modDocumentGeneration.class.php b/htdocs/core/modules/modDocumentGeneration.class.php index 909f1d5f5e8..ec40c8b6dc5 100644 --- a/htdocs/core/modules/modDocumentGeneration.class.php +++ b/htdocs/core/modules/modDocumentGeneration.class.php @@ -84,7 +84,7 @@ class modDocumentGeneration extends DolibarrModules $this->rights[$r][0] = 1521; $this->rights[$r][1] = 'Lire les documents'; $this->rights[$r][2] = 'r'; - $this->rights[$r][3] = 1; + $this->rights[$r][3] = 0; $this->rights[$r][4] = 'lire'; $r++; diff --git a/htdocs/core/modules/modDon.class.php b/htdocs/core/modules/modDon.class.php index c62b46db06b..063c3b75b55 100644 --- a/htdocs/core/modules/modDon.class.php +++ b/htdocs/core/modules/modDon.class.php @@ -135,7 +135,12 @@ class modDon extends DolibarrModules $this->rights[3][2] = 'd'; $this->rights[3][3] = 0; $this->rights[3][4] = 'supprimer'; - + + + // Menus + //------- + $this->menu = 1; // This module add menu entries. They are coded into menu manager. + } diff --git a/htdocs/core/modules/modDynamicPrices.class.php b/htdocs/core/modules/modDynamicPrices.class.php index 4e5cd3a3f62..cb6544f4d29 100644 --- a/htdocs/core/modules/modDynamicPrices.class.php +++ b/htdocs/core/modules/modDynamicPrices.class.php @@ -83,5 +83,6 @@ class modDynamicPrices extends DolibarrModules $this->rights = array(); $this->rights_class = 'dynamicprices'; $r=0; + } } diff --git a/htdocs/core/modules/modECM.class.php b/htdocs/core/modules/modECM.class.php index 1aa5008032d..b263b16e29e 100644 --- a/htdocs/core/modules/modECM.class.php +++ b/htdocs/core/modules/modECM.class.php @@ -101,21 +101,21 @@ class modECM extends DolibarrModules $this->rights[$r][0] = 2501; $this->rights[$r][1] = 'Consulter/Télécharger les documents'; $this->rights[$r][2] = 'r'; - $this->rights[$r][3] = 1; + $this->rights[$r][3] = 0; $this->rights[$r][4] = 'read'; $r++; $this->rights[$r][0] = 2503; $this->rights[$r][1] = 'Soumettre ou supprimer des documents'; $this->rights[$r][2] = 'w'; - $this->rights[$r][3] = 1; + $this->rights[$r][3] = 0; $this->rights[$r][4] = 'upload'; $r++; $this->rights[$r][0] = 2515; $this->rights[$r][1] = 'Administrer les rubriques de documents'; $this->rights[$r][2] = 'w'; - $this->rights[$r][3] = 1; + $this->rights[$r][3] = 0; $this->rights[$r][4] = 'setup'; diff --git a/htdocs/core/modules/modExpedition.class.php b/htdocs/core/modules/modExpedition.class.php index 8116186219d..d408d5e4375 100644 --- a/htdocs/core/modules/modExpedition.class.php +++ b/htdocs/core/modules/modExpedition.class.php @@ -145,7 +145,7 @@ class modExpedition extends DolibarrModules $this->rights[$r][0] = 101; $this->rights[$r][1] = 'Lire les expeditions'; $this->rights[$r][2] = 'r'; - $this->rights[$r][3] = 1; + $this->rights[$r][3] = 0; $this->rights[$r][4] = 'lire'; $r++; @@ -190,7 +190,7 @@ class modExpedition extends DolibarrModules $this->rights[$r][0] = 1101; $this->rights[$r][1] = 'Lire les bons de livraison'; $this->rights[$r][2] = 'r'; - $this->rights[$r][3] = 1; + $this->rights[$r][3] = 0; $this->rights[$r][4] = 'livraison'; $this->rights[$r][5] = 'lire'; @@ -218,6 +218,12 @@ class modExpedition extends DolibarrModules $this->rights[$r][4] = 'livraison'; $this->rights[$r][5] = 'supprimer'; + + // Menus + //------- + $this->menu = 1; // This module add menu entries. They are coded into menu manager. + + // Exports //-------- $r=0; diff --git a/htdocs/core/modules/modExpenseReport.class.php b/htdocs/core/modules/modExpenseReport.class.php index 01110a66bf3..36c921fc0d6 100644 --- a/htdocs/core/modules/modExpenseReport.class.php +++ b/htdocs/core/modules/modExpenseReport.class.php @@ -193,6 +193,12 @@ class modExpenseReport extends DolibarrModules $this->rights[5][3] = 0; $this->rights[5][4] = 'export'; + + // Menus + //------- + $this->menu = 1; // This module add menu entries. They are coded into menu manager. + + // Exports $r=0; diff --git a/htdocs/core/modules/modExport.class.php b/htdocs/core/modules/modExport.class.php index e8a6baa8509..cc0090c2fc8 100644 --- a/htdocs/core/modules/modExport.class.php +++ b/htdocs/core/modules/modExport.class.php @@ -81,7 +81,7 @@ class modExport extends DolibarrModules $this->rights[$r][0] = 1201; $this->rights[$r][1] = 'Lire les exports'; $this->rights[$r][2] = 'r'; - $this->rights[$r][3] = 1; + $this->rights[$r][3] = 0; $this->rights[$r][4] = 'lire'; $r++; @@ -90,5 +90,11 @@ class modExport extends DolibarrModules $this->rights[$r][2] = 'w'; $this->rights[$r][3] = 0; $this->rights[$r][4] = 'creer'; + + + // Menus + //------- + $this->menu = 1; // This module add menu entries. They are coded into menu manager. + } } diff --git a/htdocs/core/modules/modFTP.class.php b/htdocs/core/modules/modFTP.class.php index e7388faaedf..2c50d3daaf1 100644 --- a/htdocs/core/modules/modFTP.class.php +++ b/htdocs/core/modules/modFTP.class.php @@ -97,7 +97,7 @@ class modFTP extends DolibarrModules $this->rights[$r][0] = 2801; $this->rights[$r][1] = 'Use FTP client in read mode (browse and download only)'; $this->rights[$r][2] = 'r'; - $this->rights[$r][3] = 1; + $this->rights[$r][3] = 0; $this->rights[$r][4] = 'read'; $r++; @@ -107,10 +107,11 @@ class modFTP extends DolibarrModules $this->rights[$r][3] = 0; $this->rights[$r][4] = 'write'; + // Menus - //------ - $this->menus = array(); // List of menus to add - $r=0; + //------- + $this->menu = 1; // This module add menu entries. They are coded into menu manager. + // Top menu $this->menu[$r]=array('fk_menu'=>0, diff --git a/htdocs/core/modules/modFacture.class.php b/htdocs/core/modules/modFacture.class.php index d15215a4f99..d1a90fbad17 100644 --- a/htdocs/core/modules/modFacture.class.php +++ b/htdocs/core/modules/modFacture.class.php @@ -126,7 +126,7 @@ class modFacture extends DolibarrModules $this->rights[$r][0] = 11; $this->rights[$r][1] = 'Lire les factures'; $this->rights[$r][2] = 'a'; - $this->rights[$r][3] = 1; + $this->rights[$r][3] = 0; $this->rights[$r][4] = 'lire'; $r++; @@ -184,6 +184,11 @@ class modFacture extends DolibarrModules $this->rights[$r][5] = 'export'; + // Menus + //------- + $this->menu = 1; // This module add menu entries. They are coded into menu manager. + + // Exports //-------- $r=1; diff --git a/htdocs/core/modules/modFicheinter.class.php b/htdocs/core/modules/modFicheinter.class.php index 4c4fcbcc6d8..6a844159230 100644 --- a/htdocs/core/modules/modFicheinter.class.php +++ b/htdocs/core/modules/modFicheinter.class.php @@ -99,7 +99,7 @@ class modFicheinter extends DolibarrModules $this->rights[$r][0] = 61; $this->rights[$r][1] = 'Lire les fiches d\'intervention'; $this->rights[$r][2] = 'r'; - $this->rights[$r][3] = 1; + $this->rights[$r][3] = 0; $this->rights[$r][4] = 'lire'; $r++; @@ -147,6 +147,12 @@ class modFicheinter extends DolibarrModules $this->rights[$r][4] = 'ficheinter_advance'; // Visible if option MAIN_USE_ADVANCED_PERMS is on $this->rights[$r][5] = 'unvalidate'; + + // Menus + //------- + $this->menu = 1; // This module add menu entries. They are coded into menu manager. + + //Exports //-------- $r=1; diff --git a/htdocs/core/modules/modFournisseur.class.php b/htdocs/core/modules/modFournisseur.class.php index 7d5d6752281..29378667b63 100644 --- a/htdocs/core/modules/modFournisseur.class.php +++ b/htdocs/core/modules/modFournisseur.class.php @@ -129,14 +129,14 @@ class modFournisseur extends DolibarrModules $this->rights[$r][0] = 1181; $this->rights[$r][1] = 'Consulter les fournisseurs'; $this->rights[$r][2] = 'r'; - $this->rights[$r][3] = 1; + $this->rights[$r][3] = 0; $this->rights[$r][4] = 'lire'; $r++; $this->rights[$r][0] = 1182; $this->rights[$r][1] = 'Consulter les commandes fournisseur'; $this->rights[$r][2] = 'r'; - $this->rights[$r][3] = 1; + $this->rights[$r][3] = 0; $this->rights[$r][4] = 'commande'; $this->rights[$r][5] = 'lire'; @@ -209,7 +209,7 @@ class modFournisseur extends DolibarrModules $this->rights[$r][0] = 1231; $this->rights[$r][1] = 'Consulter les factures fournisseur'; $this->rights[$r][2] = 'r'; - $this->rights[$r][3] = 1; + $this->rights[$r][3] = 0; $this->rights[$r][4] = 'facture'; $this->rights[$r][5] = 'lire'; @@ -272,7 +272,12 @@ class modFournisseur extends DolibarrModules $this->rights[$r][5] = 'approve2'; } - + + // Menus + //------- + $this->menu = 1; // This module add menu entries. They are coded into menu manager. + + // Exports //-------- $r=0; diff --git a/htdocs/core/modules/modGravatar.class.php b/htdocs/core/modules/modGravatar.class.php index 241cca18dbb..237778309c2 100644 --- a/htdocs/core/modules/modGravatar.class.php +++ b/htdocs/core/modules/modGravatar.class.php @@ -114,7 +114,7 @@ class modGravatar extends DolibarrModules // Example: // $this->rights[$r][0] = 2000; // Permission id (must not be already used) // $this->rights[$r][1] = 'Permision label'; // Permission label - // $this->rights[$r][3] = 1; // Permission by default for new user (0/1) + // $this->rights[$r][3] = 0; // Permission by default for new user (0/1) // $this->rights[$r][4] = 'level1'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2) // $this->rights[$r][5] = 'level2'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2) // $r++; diff --git a/htdocs/core/modules/modHRM.class.php b/htdocs/core/modules/modHRM.class.php index f370c78b25e..5cbb282424a 100644 --- a/htdocs/core/modules/modHRM.class.php +++ b/htdocs/core/modules/modHRM.class.php @@ -99,21 +99,21 @@ class modHRM extends DolibarrModules $this->rights[$r][0] = 4001; $this->rights[$r][1] = 'See employees'; - $this->rights[$r][3] = 1; + $this->rights[$r][3] = 0; $this->rights[$r][4] = 'employee'; $this->rights[$r][5] = 'read'; $r ++; $this->rights[$r][0] = 4002; $this->rights[$r][1] = 'Create employees'; - $this->rights[$r][3] = 1; + $this->rights[$r][3] = 0; $this->rights[$r][4] = 'employee'; $this->rights[$r][5] = 'write'; $r ++; $this->rights[$r][0] = 4003; $this->rights[$r][1] = 'Delete employees'; - $this->rights[$r][3] = 1; + $this->rights[$r][3] = 0; $this->rights[$r][4] = 'employee'; $this->rights[$r][5] = 'delete'; $r ++; @@ -125,9 +125,11 @@ class modHRM extends DolibarrModules $this->rights[$r][5] = 'export'; $r ++; - // Main menu entries - $this->menus = array (); // List of menus to add - $r = 0; + + // Menus + //------- + $this->menu = 1; // This module add menu entries. They are coded into menu manager. + } /** diff --git a/htdocs/core/modules/modHoliday.class.php b/htdocs/core/modules/modHoliday.class.php index 73b316ec164..0dc44a36e22 100644 --- a/htdocs/core/modules/modHoliday.class.php +++ b/htdocs/core/modules/modHoliday.class.php @@ -133,14 +133,14 @@ class modHoliday extends DolibarrModules $this->rights[$r][0] = 20001; // Permission id (must not be already used) $this->rights[$r][1] = 'Read your own holidays'; // Permission label - $this->rights[$r][3] = 1; // Permission by default for new user (0/1) + $this->rights[$r][3] = 0; // Permission by default for new user (0/1) $this->rights[$r][4] = 'read'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2) $this->rights[$r][5] = ''; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2) $r++; $this->rights[$r][0] = 20002; // Permission id (must not be already used) $this->rights[$r][1] = 'Create/modify your own holidays'; // Permission label - $this->rights[$r][3] = 1; // Permission by default for new user (0/1) + $this->rights[$r][3] = 0; // Permission by default for new user (0/1) $this->rights[$r][4] = 'write'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2) $this->rights[$r][5] = ''; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2) $r++; @@ -173,10 +173,11 @@ class modHoliday extends DolibarrModules $this->rights[$r][5] = ''; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2) $r++; - // Main menu entries - $this->menus = array(); // List of menus to add - $r=0; - + + // Menus + //------- + $this->menu = 1; // This module add menu entries. They are coded into menu manager. + // Exports $r=1; diff --git a/htdocs/core/modules/modImport.class.php b/htdocs/core/modules/modImport.class.php index 8f3faad9bd1..2efebb58d80 100644 --- a/htdocs/core/modules/modImport.class.php +++ b/htdocs/core/modules/modImport.class.php @@ -85,5 +85,11 @@ class modImport extends DolibarrModules $this->rights[$r][2] = 'r'; $this->rights[$r][3] = 0; $this->rights[$r][4] = 'run'; + + + // Menus + //------- + $this->menu = 1; // This module add menu entries. They are coded into menu manager. + } } diff --git a/htdocs/core/modules/modLoan.class.php b/htdocs/core/modules/modLoan.class.php index b7e7f822bbc..7e445a3dbce 100644 --- a/htdocs/core/modules/modLoan.class.php +++ b/htdocs/core/modules/modLoan.class.php @@ -99,7 +99,7 @@ class modLoan extends DolibarrModules $this->rights[$r][0] = 520; $this->rights[$r][1] = 'Read loans'; $this->rights[$r][2] = 'r'; - $this->rights[$r][3] = 1; + $this->rights[$r][3] = 0; $this->rights[$r][4] = 'read'; $this->rights[$r][5] = ''; @@ -135,7 +135,12 @@ class modLoan extends DolibarrModules $this->rights[$r][4] = 'export'; $this->rights[$r][5] = ''; - + + // Menus + //------- + $this->menu = 1; // This module add menu entries. They are coded into menu manager. + + // Exports //-------- $r=0; diff --git a/htdocs/core/modules/modMailing.class.php b/htdocs/core/modules/modMailing.class.php index 00ece509285..45d2685abe4 100644 --- a/htdocs/core/modules/modMailing.class.php +++ b/htdocs/core/modules/modMailing.class.php @@ -79,7 +79,7 @@ class modMailing extends DolibarrModules $this->rights[$r][0] = 221; // id de la permission $this->rights[$r][1] = 'Consulter les mailings'; // libelle de la permission $this->rights[$r][2] = 'r'; // type de la permission (deprecie a ce jour) - $this->rights[$r][3] = 1; // La permission est-elle une permission par defaut + $this->rights[$r][3] = 0; // La permission est-elle une permission par defaut $this->rights[$r][4] = 'lire'; $r++; @@ -127,6 +127,10 @@ class modMailing extends DolibarrModules $this->rights[$r][4] = 'mailing_advance'; // Visible if option MAIN_USE_ADVANCED_PERMS is on $this->rights[$r][5] = 'delete'; + // Menus + //------- + $this->menu = 1; // This module add menu entries. They are coded into menu manager. + } diff --git a/htdocs/core/modules/modMailmanSpip.class.php b/htdocs/core/modules/modMailmanSpip.class.php index 2ebff38ef08..3900c0549b9 100644 --- a/htdocs/core/modules/modMailmanSpip.class.php +++ b/htdocs/core/modules/modMailmanSpip.class.php @@ -76,5 +76,10 @@ class modMailmanSpip extends DolibarrModules // Permissions $this->rights = array(); $this->rights_class = 'clicktodial'; + + // Menus + //------- + $this->menu = 1; // This module add menu entries. They are coded into menu manager. + } } diff --git a/htdocs/core/modules/modMargin.class.php b/htdocs/core/modules/modMargin.class.php index 300911c7877..a04c9ac567a 100644 --- a/htdocs/core/modules/modMargin.class.php +++ b/htdocs/core/modules/modMargin.class.php @@ -126,7 +126,7 @@ class modMargin extends DolibarrModules $this->rights[$r][0] = 59001; // id de la permission $this->rights[$r][1] = 'Visualiser les marges'; // libelle de la permission $this->rights[$r][2] = 'r'; // type de la permission (deprecie a ce jour) - $this->rights[$r][3] = 1; // La permission est-elle une permission par defaut + $this->rights[$r][3] = 0; // La permission est-elle une permission par defaut $this->rights[$r][4] = 'liretous'; $r++; diff --git a/htdocs/core/modules/modMultiCurrency.class.php b/htdocs/core/modules/modMultiCurrency.class.php index 7ae613edd49..a4875dc16e2 100644 --- a/htdocs/core/modules/modMultiCurrency.class.php +++ b/htdocs/core/modules/modMultiCurrency.class.php @@ -189,7 +189,7 @@ class modMultiCurrency extends DolibarrModules // Example: // $this->rights[$r][0] = $this->numero + $r; // Permission id (must not be already used) // $this->rights[$r][1] = 'Permision label'; // Permission label - // $this->rights[$r][3] = 1; // Permission by default for new user (0/1) + // $this->rights[$r][3] = 0; // Permission by default for new user (0/1) // $this->rights[$r][4] = 'level1'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2) // $this->rights[$r][5] = 'level2'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2) // $r++; diff --git a/htdocs/core/modules/modOauth.class.php b/htdocs/core/modules/modOauth.class.php index fe444960b53..4be01e561fe 100644 --- a/htdocs/core/modules/modOauth.class.php +++ b/htdocs/core/modules/modOauth.class.php @@ -97,7 +97,7 @@ class modOauth extends DolibarrModules $this->rights[$r][0] = 66000; $this->rights[$r][1] = 'OauthAccess'; $this->rights[$r][2] = 'r'; - $this->rights[$r][3] = 1; + $this->rights[$r][3] = 0; $this->rights[$r][4] = 'read';*/ // Main menu entries diff --git a/htdocs/core/modules/modOpenSurvey.class.php b/htdocs/core/modules/modOpenSurvey.class.php index 02cf9138a1f..7cbfeb1e268 100644 --- a/htdocs/core/modules/modOpenSurvey.class.php +++ b/htdocs/core/modules/modOpenSurvey.class.php @@ -119,9 +119,9 @@ class modOpenSurvey extends DolibarrModules $r++; - // Main menu entries - $this->menus = array(); // List of menus to add - $r=0; + // Menus + //------- + $this->menu = 1; // This module add menu entries. They are coded into menu manager. /* $this->menu[$r]=array( 'fk_menu'=>0, // Use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode 'type'=>'top', diff --git a/htdocs/core/modules/modPaybox.class.php b/htdocs/core/modules/modPaybox.class.php index d77d2dfc3f4..6cbdd5e2127 100644 --- a/htdocs/core/modules/modPaybox.class.php +++ b/htdocs/core/modules/modPaybox.class.php @@ -106,7 +106,7 @@ class modPayBox extends DolibarrModules // Example: // $this->rights[$r][0] = 2000; // Permission id (must not be already used) // $this->rights[$r][1] = 'Permision label'; // Permission label - // $this->rights[$r][3] = 1; // Permission by default for new user (0/1) + // $this->rights[$r][3] = 0; // Permission by default for new user (0/1) // $this->rights[$r][4] = 'level1'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2) // $this->rights[$r][5] = 'level2'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2) // $r++; diff --git a/htdocs/core/modules/modPrelevement.class.php b/htdocs/core/modules/modPrelevement.class.php index 75e8410e19e..982cb95d208 100644 --- a/htdocs/core/modules/modPrelevement.class.php +++ b/htdocs/core/modules/modPrelevement.class.php @@ -94,7 +94,7 @@ class modPrelevement extends DolibarrModules $this->rights[$r][0] = 151; $this->rights[$r][1] = 'Read withdrawals'; $this->rights[$r][2] = 'r'; - $this->rights[$r][3] = 1; + $this->rights[$r][3] = 0; $this->rights[$r][4] = 'bons'; $this->rights[$r][5] = 'lire'; @@ -129,6 +129,11 @@ class modPrelevement extends DolibarrModules $this->rights[2][4] = 'bons'; $this->rights[2][5] = 'configurer'; */ + + // Menus + //------- + $this->menu = 1; // This module add menu entries. They are coded into menu manager. + } diff --git a/htdocs/core/modules/modPrinting.class.php b/htdocs/core/modules/modPrinting.class.php index 4a228488947..2ea807781b1 100644 --- a/htdocs/core/modules/modPrinting.class.php +++ b/htdocs/core/modules/modPrinting.class.php @@ -97,7 +97,7 @@ class modPrinting extends DolibarrModules $this->rights[$r][0] = 64001; $this->rights[$r][1] = 'DirectPrint'; $this->rights[$r][2] = 'r'; - $this->rights[$r][3] = 1; + $this->rights[$r][3] = 0; $this->rights[$r][4] = 'read'; // Main menu entries diff --git a/htdocs/core/modules/modProduct.class.php b/htdocs/core/modules/modProduct.class.php index 154639f848d..4ff68ae8d6b 100644 --- a/htdocs/core/modules/modProduct.class.php +++ b/htdocs/core/modules/modProduct.class.php @@ -99,7 +99,7 @@ class modProduct extends DolibarrModules $this->rights[$r][0] = 31; // id de la permission $this->rights[$r][1] = 'Lire les produits'; // libelle de la permission $this->rights[$r][2] = 'r'; // type de la permission (deprecie a ce jour) - $this->rights[$r][3] = 1; // La permission est-elle une permission par defaut + $this->rights[$r][3] = 0; // La permission est-elle une permission par defaut $this->rights[$r][4] = 'lire'; $r++; @@ -124,6 +124,10 @@ class modProduct extends DolibarrModules $this->rights[$r][4] = 'export'; $r++; + // Menus + //------- + + $this->menu = 1; // This module add menu entries. They are coded into menu manager. /* We can't enable this here because it must be enabled in both product and service module and this create duplicate insert $r=0; $this->menu[$r]=array( 'fk_menu'=>'fk_mainmenu=home,fk_leftmenu=admintools', // Use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode diff --git a/htdocs/core/modules/modProductBatch.class.php b/htdocs/core/modules/modProductBatch.class.php index ca0e2829819..9dbc8eb0212 100644 --- a/htdocs/core/modules/modProductBatch.class.php +++ b/htdocs/core/modules/modProductBatch.class.php @@ -95,10 +95,12 @@ class modProductBatch extends DolibarrModules $this->rights = array(); // Permission array used by this module $r=0; - // Main menu entries - $this->menu = array(); // List of menus to add - $r=0; - + + // Menus + //------- + $this->menu = 1; // This module add menu entries. They are coded into menu manager. + + // Exports $r=0; diff --git a/htdocs/core/modules/modProjet.class.php b/htdocs/core/modules/modProjet.class.php index 2d71eaba5a1..f26265c33fa 100644 --- a/htdocs/core/modules/modProjet.class.php +++ b/htdocs/core/modules/modProjet.class.php @@ -154,7 +154,7 @@ class modProjet extends DolibarrModules $this->rights[$r][0] = 41; // id de la permission $this->rights[$r][1] = "Read projects and tasks (shared projects or projects I am contact for). Can also enter time consumed on assigned tasks (timesheet)"; // libelle de la permission $this->rights[$r][2] = 'r'; // type de la permission (deprecie a ce jour) - $this->rights[$r][3] = 1; // La permission est-elle une permission par defaut + $this->rights[$r][3] = 0; // La permission est-elle une permission par defaut $this->rights[$r][4] = 'lire'; $r++; @@ -203,6 +203,11 @@ class modProjet extends DolibarrModules $this->rights[$r][5] = 'supprimer'; + // Menus + //------- + $this->menu = 1; // This module add menu entries. They are coded into menu manager. + + //Exports //-------- $r=1; diff --git a/htdocs/core/modules/modPropale.class.php b/htdocs/core/modules/modPropale.class.php index e9fe448baf7..2ecf7d6960c 100644 --- a/htdocs/core/modules/modPropale.class.php +++ b/htdocs/core/modules/modPropale.class.php @@ -116,7 +116,7 @@ class modPropale extends DolibarrModules $this->rights[$r][0] = 21; // id de la permission $this->rights[$r][1] = 'Lire les propositions commerciales'; // libelle de la permission $this->rights[$r][2] = 'r'; // type de la permission (deprecie a ce jour) - $this->rights[$r][3] = 1; // La permission est-elle une permission par defaut + $this->rights[$r][3] = 0; // La permission est-elle une permission par defaut $this->rights[$r][4] = 'lire'; $r++; @@ -163,6 +163,12 @@ class modPropale extends DolibarrModules $this->rights[$r][3] = 0; // La permission est-elle une permission par defaut $this->rights[$r][4] = 'export'; + + // Menus + //------- + $this->menu = 1; // This module add menu entries. They are coded into menu manager. + + // Exports //-------- $r=0; diff --git a/htdocs/core/modules/modReceiptPrinter.class.php b/htdocs/core/modules/modReceiptPrinter.class.php index 121722125f2..f1520cf698f 100644 --- a/htdocs/core/modules/modReceiptPrinter.class.php +++ b/htdocs/core/modules/modReceiptPrinter.class.php @@ -97,7 +97,7 @@ class modReceiptPrinter extends DolibarrModules $this->rights[$r][0] = 67000; $this->rights[$r][1] = 'ReceiptPrinter'; $this->rights[$r][2] = 'r'; - $this->rights[$r][3] = 1; + $this->rights[$r][3] = 0; $this->rights[$r][4] = 'read'; // Main menu entries diff --git a/htdocs/core/modules/modResource.class.php b/htdocs/core/modules/modResource.class.php index 83476270bc5..ee6162569b1 100644 --- a/htdocs/core/modules/modResource.class.php +++ b/htdocs/core/modules/modResource.class.php @@ -196,6 +196,11 @@ class modResource extends DolibarrModules $r++; + // Menus + //------- + $this->menu = 1; // This module add menu entries. They are coded into menu manager. + + // Add here list of permission defined by // an id, a label, a boolean and two constant strings. // Example: @@ -204,7 +209,7 @@ class modResource extends DolibarrModules //// Permission label //$this->rights[$r][1] = 'Permision label'; //// Permission by default for new user (0/1) - //$this->rights[$r][3] = 1; + //$this->rights[$r][3] = 0; //// In php code, permission will be checked by test //// if ($user->rights->permkey->level1->level2) //$this->rights[$r][4] = 'level1'; diff --git a/htdocs/core/modules/modSalaries.class.php b/htdocs/core/modules/modSalaries.class.php index 43742280465..a1f4753b12d 100644 --- a/htdocs/core/modules/modSalaries.class.php +++ b/htdocs/core/modules/modSalaries.class.php @@ -137,6 +137,11 @@ class modSalaries extends DolibarrModules $this->rights[$r][5] = ''; + // Menus + //------- + $this->menu = 1; // This module add menu entries. They are coded into menu manager. + + // Exports //-------- $r=0; diff --git a/htdocs/core/modules/modService.class.php b/htdocs/core/modules/modService.class.php index 5ea2cfde964..7a5db7fcffd 100644 --- a/htdocs/core/modules/modService.class.php +++ b/htdocs/core/modules/modService.class.php @@ -88,7 +88,7 @@ class modService extends DolibarrModules $this->rights[$r][0] = 531; // id de la permission $this->rights[$r][1] = 'Lire les services'; // libelle de la permission $this->rights[$r][2] = 'r'; // type de la permission (deprecie a ce jour) - $this->rights[$r][3] = 1; // La permission est-elle une permission par defaut + $this->rights[$r][3] = 0; // La permission est-elle une permission par defaut $this->rights[$r][4] = 'lire'; $r++; @@ -130,7 +130,12 @@ class modService extends DolibarrModules */ - // Exports + // Menus + //------- + $this->menu = 1; // This module add menu entries. They are coded into menu manager. + + + // Exports //-------- $r=0; diff --git a/htdocs/core/modules/modSociete.class.php b/htdocs/core/modules/modSociete.class.php index 4eac3c84c8a..33e59acf4a2 100644 --- a/htdocs/core/modules/modSociete.class.php +++ b/htdocs/core/modules/modSociete.class.php @@ -143,7 +143,7 @@ class modSociete extends DolibarrModules $this->rights[$r][0] = 121; // id de la permission $this->rights[$r][1] = 'Lire les societes'; // libelle de la permission $this->rights[$r][2] = 'r'; // type de la permission (deprecie a ce jour) - $this->rights[$r][3] = 1; // La permission est-elle une permission par defaut + $this->rights[$r][3] = 0; // La permission est-elle une permission par defaut $this->rights[$r][4] = 'lire'; /* $r++; @@ -206,7 +206,7 @@ class modSociete extends DolibarrModules $this->rights[$r][0] = 262; $this->rights[$r][1] = 'Consulter tous les tiers par utilisateurs internes (sinon uniquement si contact commercial). Non effectif pour utilisateurs externes (tjs limités à eux-meme).'; $this->rights[$r][2] = 'r'; - $this->rights[$r][3] = 1; + $this->rights[$r][3] = 0; $this->rights[$r][4] = 'client'; $this->rights[$r][5] = 'voir'; @@ -214,7 +214,7 @@ class modSociete extends DolibarrModules $this->rights[$r][0] = 281; // id de la permission $this->rights[$r][1] = 'Lire les contacts'; // libelle de la permission $this->rights[$r][2] = 'r'; // type de la permission (deprecie a ce jour) - $this->rights[$r][3] = 1; // La permission est-elle une permission par defaut + $this->rights[$r][3] = 0; // La permission est-elle une permission par defaut $this->rights[$r][4] = 'contact'; $this->rights[$r][5] = 'lire'; @@ -242,7 +242,12 @@ class modSociete extends DolibarrModules $this->rights[$r][4] = 'contact'; $this->rights[$r][5] = 'export'; - + + // Menus + //------- + $this->menu = 1; // This module add menu entries. They are coded into menu manager. + + // Exports //-------- $r=0; diff --git a/htdocs/core/modules/modStock.class.php b/htdocs/core/modules/modStock.class.php index 778eb39e827..b2c2f806bd7 100644 --- a/htdocs/core/modules/modStock.class.php +++ b/htdocs/core/modules/modStock.class.php @@ -117,6 +117,12 @@ class modStock extends DolibarrModules $this->rights[4][4] = 'mouvement'; $this->rights[4][5] = 'creer'; + + // Menus + //------- + $this->menu = 1; // This module add menu entries. They are coded into menu manager. + + // Exports //-------- $r=0; diff --git a/htdocs/core/modules/modSupplierProposal.class.php b/htdocs/core/modules/modSupplierProposal.class.php index 842146597a3..f17b27415da 100644 --- a/htdocs/core/modules/modSupplierProposal.class.php +++ b/htdocs/core/modules/modSupplierProposal.class.php @@ -102,13 +102,13 @@ class modSupplierProposal extends DolibarrModules $r++; $this->rights[$r][0] = $this->numero + $r; // id de la permission $this->rights[$r][1] = 'Read supplier proposals'; // libelle de la permission - $this->rights[$r][3] = 1; // La permission est-elle une permission par defaut + $this->rights[$r][3] = 0; // La permission est-elle une permission par defaut $this->rights[$r][4] = 'lire'; $r++; $this->rights[$r][0] = $this->numero + $r; // id de la permission $this->rights[$r][1] = 'Create/modify supplier proposals'; // libelle de la permission - $this->rights[$r][3] = 1; // La permission est-elle une permission par defaut + $this->rights[$r][3] = 0; // La permission est-elle une permission par defaut $this->rights[$r][4] = 'creer'; $r++; diff --git a/htdocs/core/modules/modTax.class.php b/htdocs/core/modules/modTax.class.php index 293384b49a8..bb8f31e466d 100644 --- a/htdocs/core/modules/modTax.class.php +++ b/htdocs/core/modules/modTax.class.php @@ -88,7 +88,7 @@ class modTax extends DolibarrModules $this->rights[$r][0] = 91; $this->rights[$r][1] = 'Lire les charges'; $this->rights[$r][2] = 'r'; - $this->rights[$r][3] = 1; + $this->rights[$r][3] = 0; $this->rights[$r][4] = 'charges'; $this->rights[$r][5] = 'lire'; @@ -117,6 +117,12 @@ class modTax extends DolibarrModules $this->rights[$r][5] = 'export'; + // Menus + //------- + + $this->menu = 1; // This module add menu entries. They are coded into menu manager. + + // Exports //-------- $r=0; diff --git a/htdocs/core/modules/modUser.class.php b/htdocs/core/modules/modUser.class.php index 759b68555b7..f481cdffb8e 100644 --- a/htdocs/core/modules/modUser.class.php +++ b/htdocs/core/modules/modUser.class.php @@ -134,7 +134,7 @@ class modUser extends DolibarrModules $this->rights[$r][0] = 341; $this->rights[$r][1] = 'Consulter ses propres permissions'; $this->rights[$r][2] = 'r'; - $this->rights[$r][3] = 1; + $this->rights[$r][3] = 0; $this->rights[$r][4] = 'self_advance'; // Visible if option MAIN_USE_ADVANCED_PERMS is on $this->rights[$r][5] = 'readperms'; @@ -142,7 +142,7 @@ class modUser extends DolibarrModules $this->rights[$r][0] = 342; $this->rights[$r][1] = 'Creer/modifier ses propres infos utilisateur'; $this->rights[$r][2] = 'w'; - $this->rights[$r][3] = 1; + $this->rights[$r][3] = 0; $this->rights[$r][4] = 'self'; $this->rights[$r][5] = 'creer'; @@ -150,7 +150,7 @@ class modUser extends DolibarrModules $this->rights[$r][0] = 343; $this->rights[$r][1] = 'Modifier son propre mot de passe'; $this->rights[$r][2] = 'w'; - $this->rights[$r][3] = 1; + $this->rights[$r][3] = 0; $this->rights[$r][4] = 'self'; $this->rights[$r][5] = 'password'; @@ -158,7 +158,7 @@ class modUser extends DolibarrModules $this->rights[$r][0] = 344; $this->rights[$r][1] = 'Modifier ses propres permissions'; $this->rights[$r][2] = 'w'; - $this->rights[$r][3] = 1; + $this->rights[$r][3] = 0; $this->rights[$r][4] = 'self_advance'; // Visible if option MAIN_USE_ADVANCED_PERMS is on $this->rights[$r][5] = 'writeperms'; @@ -202,6 +202,13 @@ class modUser extends DolibarrModules $this->rights[$r][4] = 'user'; $this->rights[$r][5] = 'export'; + + // Menus + //------- + + $this->menu = 1; // This module add menu entries. They are coded into menu manager. + + // Exports //-------- $r=0; diff --git a/htdocs/core/modules/modWebsites.class.php b/htdocs/core/modules/modWebsites.class.php index a510e569b60..97dfbd6dd12 100644 --- a/htdocs/core/modules/modWebsites.class.php +++ b/htdocs/core/modules/modWebsites.class.php @@ -92,7 +92,7 @@ class modWebsites extends DolibarrModules $this->rights[$r][0] = 10001; $this->rights[$r][1] = 'Read website content'; - $this->rights[$r][3] = 1; + $this->rights[$r][3] = 0; $this->rights[$r][4] = 'read'; $r++; diff --git a/htdocs/core/modules/modWorkflow.class.php b/htdocs/core/modules/modWorkflow.class.php index e793d21e03c..5c348cdf77f 100644 --- a/htdocs/core/modules/modWorkflow.class.php +++ b/htdocs/core/modules/modWorkflow.class.php @@ -94,7 +94,7 @@ class modWorkflow extends DolibarrModules $this->rights[$r][0] = 6001; // id de la permission $this->rights[$r][1] = "Lire les workflow"; // libelle de la permission $this->rights[$r][2] = 'r'; // type de la permission (deprecie a ce jour) - $this->rights[$r][3] = 1; // La permission est-elle une permission par defaut + $this->rights[$r][3] = 0; // La permission est-elle une permission par defaut $this->rights[$r][4] = 'read'; */ diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 46fe32e605e..dcd2764c7dc 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -1625,3 +1625,5 @@ activateModuleDependNotSatisfied=Module "%s" depends on module "%s" that is miss CommandIsNotInsideAllowedCommands=The command you try to run is not inside list of allowed commands defined into parameter $dolibarr_main_restrict_os_commands into conf.php file. LandingPage=Landing page SamePriceAlsoForSharedCompanies=If you use the multicompany module, with the choice "Single price", price will be also the same for all companies if products are shared between environments +ModuleEnabledAdminMustCheckRights=Module has been activated. All permissions were given to admin users only. +UserHasNoPermissions=This user has no permission defined diff --git a/htdocs/user/card.php b/htdocs/user/card.php index d900e5506eb..fb3ad2fe3f0 100644 --- a/htdocs/user/card.php +++ b/htdocs/user/card.php @@ -1139,6 +1139,10 @@ else $object->fetch($id); if ($res < 0) { dol_print_error($db,$object->error); exit; } $res=$object->fetch_optionals($object->id,$extralabels); + + // Check if user has rights + $object->getrights(); + if(empty($object->nb_rights)) setEventMessages($langs->trans('UserHasNoPermissions'), null, 'warnings'); // Connexion ldap // pour recuperer passDoNotExpire et userChangePassNextLogon diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index 9e736de6f96..37832f20ea6 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -107,6 +107,7 @@ class User extends CommonObject var $rights; // Array of permissions user->rights->permx var $all_permissions_are_loaded; /**< \private all_permissions_are_loaded */ private $_tab_loaded=array(); // Array of cache of already loaded permissions + var $nb_rights; // Number of rights granted to the user var $conf; // To store personal config var $oldcopy; // To contains a clone of this when we need to save old properties of object @@ -142,6 +143,7 @@ class User extends CommonObject // For cache usage $this->all_permissions_are_loaded = 0; + $this->nb_rights = 0; // Force some default values $this->admin = 0; @@ -635,10 +637,12 @@ class User extends CommonObject if ($subperms) { if (! isset($this->rights->$module->$perms) || ! is_object($this->rights->$module->$perms)) $this->rights->$module->$perms = new stdClass(); + if(empty($this->rights->$module->$perms->$subperms)) $this->nb_rights++; $this->rights->$module->$perms->$subperms = 1; } else { + if(empty($this->rights->$module->$perms)) $this->nb_rights++; $this->rights->$module->$perms = 1; } @@ -685,10 +689,12 @@ class User extends CommonObject if ($subperms) { if (! isset($this->rights->$module->$perms) || ! is_object($this->rights->$module->$perms)) $this->rights->$module->$perms = new stdClass(); + if(empty($this->rights->$module->$perms->$subperms)) $this->nb_rights++; $this->rights->$module->$perms->$subperms = 1; } else { + if(empty($this->rights->$module->$perms)) $this->nb_rights++; $this->rights->$module->$perms = 1; }