diff --git a/htdocs/adherents/note.php b/htdocs/adherents/note.php index 752f9465484..65360e09c51 100644 --- a/htdocs/adherents/note.php +++ b/htdocs/adherents/note.php @@ -94,9 +94,11 @@ $hookmanager->initHooks(array('membernote')); // Security check $result = restrictedArea($user, 'adherent', $object->id, '', '', 'socid', 'rowid', 0); + /* * Actions */ + $parameters = array(); $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) { diff --git a/htdocs/adherents/partnership.php b/htdocs/adherents/partnership.php index b2080b86470..11a94d5657f 100644 --- a/htdocs/adherents/partnership.php +++ b/htdocs/adherents/partnership.php @@ -113,7 +113,7 @@ if (($action == 'update' || $action == 'edit') && $object->status != $object::ST // Security check -$result = restrictedArea($user, 'adherent', $id, '', '', 'socid', 'rowid', 0); +restrictedArea($user, 'adherent', $id, '', '', 'socid', 'rowid', 0); /* diff --git a/htdocs/adherents/stats/byproperties.php b/htdocs/adherents/stats/byproperties.php index d92d9ee274a..4c0aa51da52 100644 --- a/htdocs/adherents/stats/byproperties.php +++ b/htdocs/adherents/stats/byproperties.php @@ -49,7 +49,7 @@ if ($user->socid > 0) { $action = ''; $socid = $user->socid; } -$result = restrictedArea($user, 'adherent', '', '', 'cotisation'); +restrictedArea($user, 'adherent', '', '', 'cotisation'); $year = (int) dol_print_date(dol_now('gmt'), "%Y", 'gmt'); $startyear = $year - (!getDolGlobalString('MAIN_STATS_GRAPHS_SHOW_N_YEARS') ? 2 : max(1, min(10, getDolGlobalString('MAIN_STATS_GRAPHS_SHOW_N_YEARS')))); diff --git a/htdocs/adherents/stats/geo.php b/htdocs/adherents/stats/geo.php index 99aea16bd6b..56736ffd687 100644 --- a/htdocs/adherents/stats/geo.php +++ b/htdocs/adherents/stats/geo.php @@ -51,7 +51,7 @@ if ($user->socid > 0) { $action = ''; $socid = $user->socid; } -$result = restrictedArea($user, 'adherent', '', '', 'cotisation'); +restrictedArea($user, 'adherent', '', '', 'cotisation'); $year = (int) dol_print_date(dol_now('gmt'), "%Y", 'gmt'); $startyear = $year - (!getDolGlobalString('MAIN_STATS_GRAPHS_SHOW_N_YEARS') ? 2 : max(1, min(10, getDolGlobalString('MAIN_STATS_GRAPHS_SHOW_N_YEARS')))); diff --git a/htdocs/adherents/stats/index.php b/htdocs/adherents/stats/index.php index d2840c1c303..432069604fc 100644 --- a/htdocs/adherents/stats/index.php +++ b/htdocs/adherents/stats/index.php @@ -57,7 +57,7 @@ if ($user->socid > 0) { $action = ''; $socid = $user->socid; } -$result = restrictedArea($user, 'adherent', '', '', 'cotisation'); +restrictedArea($user, 'adherent', '', '', 'cotisation'); $year = (int) dol_print_date(dol_now('gmt'), "%Y", 'gmt'); $startyear = $year - (!getDolGlobalInt('MAIN_STATS_GRAPHS_SHOW_N_YEARS') ? 2 : max(1, min(10, getDolGlobalInt('MAIN_STATS_GRAPHS_SHOW_N_YEARS')))); diff --git a/htdocs/adherents/subscription/list.php b/htdocs/adherents/subscription/list.php index 603a32c8455..039a7e31af4 100644 --- a/htdocs/adherents/subscription/list.php +++ b/htdocs/adherents/subscription/list.php @@ -120,7 +120,7 @@ $arrayfields = array( ); // Security check -$result = restrictedArea($user, 'adherent', '', '', 'cotisation'); +restrictedArea($user, 'adherent', '', '', 'cotisation'); $permissiontodelete = $user->hasRight('adherent', 'cotisation', 'creer'); diff --git a/htdocs/adherents/type_ldap.php b/htdocs/adherents/type_ldap.php index d268da302bc..731cd6de8b7 100644 --- a/htdocs/adherents/type_ldap.php +++ b/htdocs/adherents/type_ldap.php @@ -25,12 +25,6 @@ // Load Dolibarr environment require '../main.inc.php'; -require_once DOL_DOCUMENT_ROOT.'/core/lib/member.lib.php'; -require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; -require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent_type.class.php'; -require_once DOL_DOCUMENT_ROOT.'/core/class/ldap.class.php'; -require_once DOL_DOCUMENT_ROOT.'/core/lib/ldap.lib.php'; - /** * @var Conf $conf * @var DoliDB $db @@ -38,6 +32,11 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/ldap.lib.php'; * @var Translate $langs * @var User $user */ +require_once DOL_DOCUMENT_ROOT.'/core/lib/member.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; +require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent_type.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/ldap.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/ldap.lib.php'; // Load translation files required by the page $langs->loadLangs(array("admin", "members", "ldap")); @@ -54,11 +53,11 @@ $result = restrictedArea($user, 'adherent', $id, 'adherent_type'); $object = new AdherentType($db); $object->fetch($id); + /* * Actions */ - $parameters = array(); $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) { diff --git a/htdocs/admin/emailcollector_card.php b/htdocs/admin/emailcollector_card.php index ee86296678a..ac3aea7c570 100644 --- a/htdocs/admin/emailcollector_card.php +++ b/htdocs/admin/emailcollector_card.php @@ -107,7 +107,7 @@ include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be 'inclu //if ($user->socid > 0) accessforbidden(); //if ($user->socid > 0) $socid = $user->socid; //$isdraft = (($object->statut == MyObject::STATUS_DRAFT) ? 1 : 0); -//$result = restrictedArea($user, 'mymodule', $object->id, '', '', 'fk_soc', 'rowid', $isdraft); +//restrictedArea($user, 'mymodule', $object->id, '', '', 'fk_soc', 'rowid', $isdraft); $permissionnote = $user->admin; // Used by the include of actions_setnotes.inc.php $permissiondellink = $user->admin; // Used by the include of actions_dellink.inc.php diff --git a/htdocs/admin/emailcollector_list.php b/htdocs/admin/emailcollector_list.php index 0c62f292d2d..9011309da56 100644 --- a/htdocs/admin/emailcollector_list.php +++ b/htdocs/admin/emailcollector_list.php @@ -101,7 +101,7 @@ if ($user->socid > 0) { // Protection if external user //$socid = $user->socid; accessforbidden(); } -//$result = restrictedArea($user, 'emailcollector', $id, ''); +//restrictedArea($user, 'emailcollector', $id, ''); // Initialize array of search criteria $search_all = trim(GETPOST('search_all', 'alphanohtml')); diff --git a/htdocs/blockedlog/ajax/block-add.php b/htdocs/blockedlog/ajax/block-add.php index fb76a26cf73..f72f1885ef2 100644 --- a/htdocs/blockedlog/ajax/block-add.php +++ b/htdocs/blockedlog/ajax/block-add.php @@ -51,7 +51,7 @@ $element = GETPOST('element', 'alpha'); $action = GETPOST('action', 'aZ09'); if ($element === 'facture') { - $result = restrictedArea($user, 'facture', $id, '', '', 'fk_soc', 'rowid', 0); + restrictedArea($user, 'facture', $id, '', '', 'fk_soc', 'rowid', 0); } else { accessforbidden('Bad value for element'); } diff --git a/htdocs/bom/bom_document.php b/htdocs/bom/bom_document.php index 301bb7c6330..292e78c70b3 100644 --- a/htdocs/bom/bom_document.php +++ b/htdocs/bom/bom_document.php @@ -52,7 +52,7 @@ $ref = GETPOST('ref', 'alpha'); // Security check - Protection if external user // if ($user->socid > 0) accessforbidden(); // if ($user->socid > 0) $socid = $user->socid; -// $result = restrictedArea($user, 'bom', $id); +// restrictedArea($user, 'bom', $id); // Load variables for pagination $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; diff --git a/htdocs/bom/bom_net_needs.php b/htdocs/bom/bom_net_needs.php index c721e4156b0..5fbf5747f96 100644 --- a/htdocs/bom/bom_net_needs.php +++ b/htdocs/bom/bom_net_needs.php @@ -91,7 +91,7 @@ if ($object->id > 0) { //if ($user->socid > 0) accessforbidden(); //if ($user->socid > 0) $socid = $user->socid; $isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0); -$result = restrictedArea($user, 'bom', $object->id, $object->table_element, '', '', 'rowid', $isdraft); +restrictedArea($user, 'bom', $object->id, $object->table_element, '', '', 'rowid', $isdraft); // Permissions $permissionnote = $user->hasRight('bom', 'write'); // Used by the include of actions_setnotes.inc.php diff --git a/htdocs/bom/bom_note.php b/htdocs/bom/bom_note.php index 705d743a1cf..689d73454fe 100644 --- a/htdocs/bom/bom_note.php +++ b/htdocs/bom/bom_note.php @@ -61,7 +61,7 @@ $extrafields->fetch_name_optionals_label($object->table_element); // Security check - Protection if external user //if ($user->socid > 0) accessforbidden(); //if ($user->socid > 0) $socid = $user->socid; -//$result = restrictedArea($user, 'bom', $id); +//restrictedArea($user, 'bom', $id); // Load object include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once'. Include fetch and fetch_thirdparty but not fetch_optionals diff --git a/htdocs/comm/action/rapport/index.php b/htdocs/comm/action/rapport/index.php index fc1e95b3bc7..7ad6a501c4f 100644 --- a/htdocs/comm/action/rapport/index.php +++ b/htdocs/comm/action/rapport/index.php @@ -65,7 +65,7 @@ if (!$sortfield) { } // Security check -//$result = restrictedArea($user, 'agenda', 0, '', 'myactions'); +//restrictedArea($user, 'agenda', 0, '', 'myactions'); if (!$user->hasRight("agenda", "allactions", "read")) { accessforbidden(); } diff --git a/htdocs/comm/mailing/info.php b/htdocs/comm/mailing/info.php index ef17e9c0e80..14e9c7f9e58 100644 --- a/htdocs/comm/mailing/info.php +++ b/htdocs/comm/mailing/info.php @@ -46,7 +46,7 @@ $langs->load("mails"); if (!$user->hasRight('mailing', 'lire') || (!getDolGlobalString('EXTERNAL_USERS_ARE_AUTHORIZED') && $user->socid > 0)) { accessforbidden(); } -//$result = restrictedArea($user, 'mailing'); +//restrictedArea($user, 'mailing'); diff --git a/htdocs/comm/mailing/list.php b/htdocs/comm/mailing/list.php index ba02e8b01ca..196afe61966 100644 --- a/htdocs/comm/mailing/list.php +++ b/htdocs/comm/mailing/list.php @@ -102,7 +102,7 @@ $permissiontodelete = $user->hasRight('mailing', 'delete'); if (!$user->hasRight('mailing', 'lire') || (!getDolGlobalString('EXTERNAL_USERS_ARE_AUTHORIZED') && $user->socid > 0)) { accessforbidden(); } -//$result = restrictedArea($user, 'mailing'); +//restrictedArea($user, 'mailing'); /* diff --git a/htdocs/compta/payment_vat/card.php b/htdocs/compta/payment_vat/card.php index 8096aa9fb7e..4d2b0747a16 100644 --- a/htdocs/compta/payment_vat/card.php +++ b/htdocs/compta/payment_vat/card.php @@ -57,7 +57,7 @@ if ($user->socid) { $socid = $user->socid; } // TODO ajouter regle pour restreindre access paiement -//$result = restrictedArea($user, 'facture', $id,''); +//restrictedArea($user, 'facture', $id,''); $object = new PaymentVAT($db); if ($id > 0) { diff --git a/htdocs/compta/tva/payments.php b/htdocs/compta/tva/payments.php index db96fcbe9d6..bb3bf856571 100644 --- a/htdocs/compta/tva/payments.php +++ b/htdocs/compta/tva/payments.php @@ -80,7 +80,7 @@ $object = new Tva($db); if ($user->socid) { $socid = $user->socid; } -//$result = restrictedArea($user, 'tax|salaries', '', '', 'charges|'); +//restrictedArea($user, 'tax|salaries', '', '', 'charges|'); $result = restrictedArea($user, 'tax', '', 'tva', 'charges'); diff --git a/htdocs/contact/project.php b/htdocs/contact/project.php index 29f5d89eb19..9ced6d21a10 100644 --- a/htdocs/contact/project.php +++ b/htdocs/contact/project.php @@ -25,9 +25,6 @@ // Load Dolibarr environment require '../main.inc.php'; -require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; -require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; - /** * @var Conf $conf * @var DoliDB $db @@ -35,16 +32,24 @@ require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; * @var Translate $langs * @var User $user */ +require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; +require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/contact.lib.php'; $langs->loadLangs(array("contacts", "companies", "projects")); +$action = GETPOST('action', 'aZ09'); + // Security check $id = GETPOSTINT('id'); // Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context $hookmanager->initHooks(array('projectcontact')); -$result = restrictedArea($user, 'contact', $id, 'socpeople&societe'); +$object = new Project($db); + +restrictedArea($user, 'contact', $id, 'socpeople&societe'); + /* * Actions @@ -56,6 +61,7 @@ if ($reshook < 0) { setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); } + /* * View */ @@ -63,9 +69,6 @@ if ($reshook < 0) { $form = new Form($db); if ($id) { - require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; - require_once DOL_DOCUMENT_ROOT.'/core/lib/contact.lib.php'; - $object = new Contact($db); $result = $object->fetch($id); diff --git a/htdocs/don/payment/card.php b/htdocs/don/payment/card.php index b2ba19b8983..1cba1d5c19b 100644 --- a/htdocs/don/payment/card.php +++ b/htdocs/don/payment/card.php @@ -53,7 +53,7 @@ if ($user->socid) { $socid = $user->socid; } // TODO Add rule to restrict access payment -//$result = restrictedArea($user, 'facture', $id,''); +//restrictedArea($user, 'facture', $id,''); $object = new PaymentDonation($db); if ($id > 0) { diff --git a/htdocs/eventorganization/conferenceorboothattendee_note.php b/htdocs/eventorganization/conferenceorboothattendee_note.php index 230f9375c36..699d7b5a124 100644 --- a/htdocs/eventorganization/conferenceorboothattendee_note.php +++ b/htdocs/eventorganization/conferenceorboothattendee_note.php @@ -59,7 +59,7 @@ $extrafields->fetch_name_optionals_label($object->table_element); // Security check - Protection if external user //if ($user->socid > 0) accessforbidden(); //if ($user->socid > 0) $socid = $user->socid; -//$result = restrictedArea($user, 'eventorganization', $id); +//restrictedArea($user, 'eventorganization', $id); // Load object include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once'. Include fetch and fetch_thirdparty but not fetch_optionals diff --git a/htdocs/expensereport/payment/card.php b/htdocs/expensereport/payment/card.php index 91880ea6342..e8a6609cf4b 100644 --- a/htdocs/expensereport/payment/card.php +++ b/htdocs/expensereport/payment/card.php @@ -53,7 +53,7 @@ if ($user->socid) { $socid = $user->socid; } // TODO Add rule to restrict access payment -//$result = restrictedArea($user, 'facture', $id,''); +//restrictedArea($user, 'facture', $id,''); $object = new PaymentExpenseReport($db); diff --git a/htdocs/loan/payment/card.php b/htdocs/loan/payment/card.php index 90da60e10c9..3e15653a5f1 100644 --- a/htdocs/loan/payment/card.php +++ b/htdocs/loan/payment/card.php @@ -50,7 +50,7 @@ if ($user->socid) { $socid = $user->socid; } // TODO ajouter regle pour restreindre access paiement -//$result = restrictedArea($user, 'facture', $id,''); +//restrictedArea($user, 'facture', $id,''); $payment = new PaymentLoan($db); if ($id > 0) { diff --git a/htdocs/partnership/partnership_agenda.php b/htdocs/partnership/partnership_agenda.php index faa7460feef..9375d37991c 100644 --- a/htdocs/partnership/partnership_agenda.php +++ b/htdocs/partnership/partnership_agenda.php @@ -101,7 +101,7 @@ $managedfor = getDolGlobalString('PARTNERSHIP_IS_MANAGED_FOR', 'thirdparty'); // Security check - Protection if external user //if ($user->socid > 0) accessforbidden(); //if ($user->socid > 0) $socid = $user->socid; -//$result = restrictedArea($user, 'partnership', $object->id); +//restrictedArea($user, 'partnership', $object->id); if (empty($conf->partnership->enabled)) { accessforbidden(); } diff --git a/htdocs/partnership/partnership_contact.php b/htdocs/partnership/partnership_contact.php index 2880e555890..897237fb648 100644 --- a/htdocs/partnership/partnership_contact.php +++ b/htdocs/partnership/partnership_contact.php @@ -68,7 +68,7 @@ $managedfor = getDolGlobalString('PARTNERSHIP_IS_MANAGED_FOR', 'thirdparty'); // Security check - Protection if external user //if ($user->socid > 0) accessforbidden(); //if ($user->socid > 0) $socid = $user->socid; -//$result = restrictedArea($user, 'partnership', $object->id); +//restrictedArea($user, 'partnership', $object->id); if (empty($conf->partnership->enabled)) { accessforbidden(); } diff --git a/htdocs/partnership/partnership_document.php b/htdocs/partnership/partnership_document.php index 12e84a13214..a0ce4f9e0d9 100644 --- a/htdocs/partnership/partnership_document.php +++ b/htdocs/partnership/partnership_document.php @@ -89,7 +89,7 @@ $managedfor = getDolGlobalString('PARTNERSHIP_IS_MANAGED_FOR', 'thirdparty'); // Security check - Protection if external user //if ($user->socid > 0) accessforbidden(); //if ($user->socid > 0) $socid = $user->socid; -//$result = restrictedArea($user, 'partnership', $object->id); +//restrictedArea($user, 'partnership', $object->id); if (empty($conf->partnership->enabled)) { accessforbidden(); } diff --git a/htdocs/partnership/partnership_list.php b/htdocs/partnership/partnership_list.php index f0a20503fa2..894399c61db 100644 --- a/htdocs/partnership/partnership_list.php +++ b/htdocs/partnership/partnership_list.php @@ -174,7 +174,7 @@ $permissiontodelete = $user->hasRight('partnership', 'delete'); // Security check - Protection if external user //if ($user->socid > 0) accessforbidden(); //if ($user->socid > 0) $socid = $user->socid; -//$result = restrictedArea($user, 'partnership', $object->id); +//restrictedArea($user, 'partnership', $object->id); if (empty($conf->partnership->enabled)) { accessforbidden(); } diff --git a/htdocs/partnership/partnership_note.php b/htdocs/partnership/partnership_note.php index 478f5304527..7ddb8c89566 100644 --- a/htdocs/partnership/partnership_note.php +++ b/htdocs/partnership/partnership_note.php @@ -58,7 +58,7 @@ $extrafields->fetch_name_optionals_label($object->table_element); // Security check - Protection if external user //if ($user->socid > 0) accessforbidden(); //if ($user->socid > 0) $socid = $user->socid; -//$result = restrictedArea($user, 'partnership', $id); +//restrictedArea($user, 'partnership', $id); // Load object include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once'. Include fetch and fetch_thirdparty but not fetch_optionals @@ -74,7 +74,7 @@ $managedfor = getDolGlobalString('PARTNERSHIP_IS_MANAGED_FOR', 'thirdparty'); // Security check - Protection if external user //if ($user->socid > 0) accessforbidden(); //if ($user->socid > 0) $socid = $user->socid; -//$result = restrictedArea($user, 'partnership', $object->id); +//restrictedArea($user, 'partnership', $object->id); if (empty($conf->partnership->enabled)) { accessforbidden(); } diff --git a/htdocs/product/inventory/card.php b/htdocs/product/inventory/card.php index 69631bcdc86..8ccc335278c 100644 --- a/htdocs/product/inventory/card.php +++ b/htdocs/product/inventory/card.php @@ -92,7 +92,7 @@ include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be 'inclu // Security check - Protection if external user //if ($user->socid > 0) accessforbidden(); //if ($user->socid > 0) $socid = $user->socid; -//$result = restrictedArea($user, 'mymodule', $id); +//restrictedArea($user, 'mymodule', $id); if (!getDolGlobalString('MAIN_USE_ADVANCED_PERMS')) { $permissiontoread = $user->hasRight('stock', 'lire'); diff --git a/htdocs/product/inventory/inventory.php b/htdocs/product/inventory/inventory.php index a0835b81ffb..47ff37da2ce 100644 --- a/htdocs/product/inventory/inventory.php +++ b/htdocs/product/inventory/inventory.php @@ -114,7 +114,7 @@ include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be 'inclu // Security check - Protection if external user //if ($user->socid > 0) accessforbidden(); //if ($user->socid > 0) $socid = $user->socid; -//$result = restrictedArea($user, 'mymodule', $id); +//restrictedArea($user, 'mymodule', $id); //Parameters Page $paramwithsearch = '&sortfield=' . urlencode($sortfield); diff --git a/htdocs/product/stock/productlot_card.php b/htdocs/product/stock/productlot_card.php index f0c660f63fc..3155aa02ef6 100644 --- a/htdocs/product/stock/productlot_card.php +++ b/htdocs/product/stock/productlot_card.php @@ -137,7 +137,7 @@ if ($user->socid > 0) { // Protection if external user //$socid = $user->socid; accessforbidden(); } -//$result = restrictedArea($user, 'productbatch'); +//restrictedArea($user, 'productbatch'); if (!$permissiontoread) { accessforbidden(); } diff --git a/htdocs/product/stock/productlot_document.php b/htdocs/product/stock/productlot_document.php index 4122ab756a6..535d08f6cd4 100644 --- a/htdocs/product/stock/productlot_document.php +++ b/htdocs/product/stock/productlot_document.php @@ -126,7 +126,7 @@ if ($user->socid > 0) { // Protection if external user //$socid = $user->socid; accessforbidden(); } -//$result = restrictedArea($user, 'productbatch'); +//restrictedArea($user, 'productbatch'); if (!$permissiontoread) { accessforbidden(); } diff --git a/htdocs/product/stock/productlot_list.php b/htdocs/product/stock/productlot_list.php index 4d414a692a6..d885eea6098 100644 --- a/htdocs/product/stock/productlot_list.php +++ b/htdocs/product/stock/productlot_list.php @@ -156,7 +156,7 @@ if ($user->socid > 0) { // Protection if external user //$socid = $user->socid; accessforbidden(); } -//$result = restrictedArea($user, 'productbatch'); +//restrictedArea($user, 'productbatch'); if (!$permissiontoread) { accessforbidden(); } diff --git a/htdocs/product/stock/stocktransfer/stocktransfer_agenda.php b/htdocs/product/stock/stocktransfer/stocktransfer_agenda.php index a5d73bab604..b9334955d53 100644 --- a/htdocs/product/stock/stocktransfer/stocktransfer_agenda.php +++ b/htdocs/product/stock/stocktransfer/stocktransfer_agenda.php @@ -104,8 +104,8 @@ $upload_dir = $conf->stocktransfer->multidir_output[isset($object->entity) ? $ob //if ($user->socid > 0) accessforbidden(); //if ($user->socid > 0) $socid = $user->socid; //$isdraft = (($object->statut == $object::STATUS_DRAFT) ? 1 : 0); -//$result = restrictedArea($user, 'stocktransfer', $object->id, '', '', 'fk_soc', 'rowid', $isdraft); -//$result = restrictedArea($user, 'stocktransfer', $object->id, '', 'stocktransfer'); +//restrictedArea($user, 'stocktransfer', $object->id, '', '', 'fk_soc', 'rowid', $isdraft); +//restrictedArea($user, 'stocktransfer', $object->id, '', 'stocktransfer'); if (!$permissiontoread || ($action === 'create' && !$permissiontoadd)) { accessforbidden(); diff --git a/htdocs/product/stock/stocktransfer/stocktransfer_card.php b/htdocs/product/stock/stocktransfer/stocktransfer_card.php index af2727778d6..fb91e6d716e 100644 --- a/htdocs/product/stock/stocktransfer/stocktransfer_card.php +++ b/htdocs/product/stock/stocktransfer/stocktransfer_card.php @@ -111,7 +111,7 @@ $upload_dir = $conf->stocktransfer->multidir_output[isset($object->entity) ? $ob //if ($user->socid > 0) accessforbidden(); //if ($user->socid > 0) $socid = $user->socid; //$isdraft = (($object->statut == $object::STATUS_DRAFT) ? 1 : 0); -//$result = restrictedArea($user, 'stocktransfer', $object->id, '', '', 'fk_soc', 'rowid', $isdraft); +//restrictedArea($user, 'stocktransfer', $object->id, '', '', 'fk_soc', 'rowid', $isdraft); if (!$permissiontoread || ($action === 'create' && !$permissiontoadd)) { accessforbidden(); diff --git a/htdocs/product/stock/stocktransfer/stocktransfer_contact.php b/htdocs/product/stock/stocktransfer/stocktransfer_contact.php index dfae3f2f121..0d32ee58337 100644 --- a/htdocs/product/stock/stocktransfer/stocktransfer_contact.php +++ b/htdocs/product/stock/stocktransfer/stocktransfer_contact.php @@ -93,8 +93,8 @@ $upload_dir = $conf->stocktransfer->multidir_output[isset($object->entity) ? $ob //if ($user->socid > 0) accessforbidden(); //if ($user->socid > 0) $socid = $user->socid; //$isdraft = (($object->statut == $object::STATUS_DRAFT) ? 1 : 0); -//$result = restrictedArea($user, 'stocktransfer', $object->id, '', '', 'fk_soc', 'rowid', $isdraft); -//$result = restrictedArea($user, 'stocktransfer', $object->id, '', 'stocktransfer'); +//restrictedArea($user, 'stocktransfer', $object->id, '', '', 'fk_soc', 'rowid', $isdraft); +//restrictedArea($user, 'stocktransfer', $object->id, '', 'stocktransfer'); if (!$permissiontoread || ($action === 'create' && !$permissiontoadd)) { accessforbidden(); diff --git a/htdocs/product/stock/stocktransfer/stocktransfer_document.php b/htdocs/product/stock/stocktransfer/stocktransfer_document.php index bb41dda4b3b..10816dcab3b 100644 --- a/htdocs/product/stock/stocktransfer/stocktransfer_document.php +++ b/htdocs/product/stock/stocktransfer/stocktransfer_document.php @@ -87,7 +87,7 @@ if ($id > 0 || !empty($ref)) { // Security check - Protection if external user //if ($user->socid > 0) accessforbidden(); //if ($user->socid > 0) $socid = $user->socid; -//$result = restrictedArea($user, 'stocktransfer', $object->id); +//restrictedArea($user, 'stocktransfer', $object->id); $permissiontoadd = $user->hasRight('stocktransfer', 'stocktransfer', 'write'); // Used by the include of actions_addupdatedelete.inc.php diff --git a/htdocs/product/stock/stocktransfer/stocktransfer_list.php b/htdocs/product/stock/stocktransfer/stocktransfer_list.php index 57d6eba521b..86dc220044c 100644 --- a/htdocs/product/stock/stocktransfer/stocktransfer_list.php +++ b/htdocs/product/stock/stocktransfer/stocktransfer_list.php @@ -146,7 +146,7 @@ if (empty($conf->stocktransfer->enabled)) { if ($user->socid > 0) { accessforbidden(); } -//$result = restrictedArea($user, 'stocktransfer', $id, ''); +//restrictedArea($user, 'stocktransfer', $id, ''); if (!$permissiontoread) { accessforbidden(); } diff --git a/htdocs/product/stock/stocktransfer/stocktransfer_note.php b/htdocs/product/stock/stocktransfer/stocktransfer_note.php index 0680ec657c2..fa641f8c124 100644 --- a/htdocs/product/stock/stocktransfer/stocktransfer_note.php +++ b/htdocs/product/stock/stocktransfer/stocktransfer_note.php @@ -57,7 +57,7 @@ $extrafields->fetch_name_optionals_label($object->table_element); // Security check - Protection if external user //if ($user->socid > 0) accessforbidden(); //if ($user->socid > 0) $socid = $user->socid; -//$result = restrictedArea($user, 'stocktransfer', $id); +//restrictedArea($user, 'stocktransfer', $id); // Load object include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once'. Include fetch and fetch_thirdparty but not fetch_optionals diff --git a/htdocs/projet/activity/index.php b/htdocs/projet/activity/index.php index 09bf99d4060..73dce094058 100644 --- a/htdocs/projet/activity/index.php +++ b/htdocs/projet/activity/index.php @@ -62,7 +62,7 @@ $socid = 0; if ($user->socid > 0) { $socid = $user->socid; } -//$result = restrictedArea($user, 'projet', $projectid); +//restrictedArea($user, 'projet', $projectid); if (!$user->hasRight('projet', 'lire')) { accessforbidden(); } diff --git a/htdocs/projet/tasks/note.php b/htdocs/projet/tasks/note.php index e473a7f0458..0028cdb39ed 100644 --- a/htdocs/projet/tasks/note.php +++ b/htdocs/projet/tasks/note.php @@ -98,7 +98,7 @@ if ($id > 0 || $ref) { $object->fetch($id, $ref); } -//$result = restrictedArea($user, 'projet', $id, '', 'task'); // TODO ameliorer la verification +//restrictedArea($user, 'projet', $id, '', 'task'); // TODO ameliorer la verification restrictedArea($user, 'projet', $object->fk_project, 'projet&project'); $permissionnote = ($user->hasRight('projet', 'creer') || $user->hasRight('projet', 'all', 'creer')); diff --git a/htdocs/recruitment/recruitmentjobposition_note.php b/htdocs/recruitment/recruitmentjobposition_note.php index 2f6867e9253..6a6299e265f 100644 --- a/htdocs/recruitment/recruitmentjobposition_note.php +++ b/htdocs/recruitment/recruitmentjobposition_note.php @@ -57,7 +57,7 @@ $extrafields->fetch_name_optionals_label($object->table_element); // Security check - Protection if external user //if ($user->socid > 0) accessforbidden(); //if ($user->socid > 0) $socid = $user->socid; -//$result = restrictedArea($user, 'recruitment', $id); +//restrictedArea($user, 'recruitment', $id); // Load object include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once'. Include fetch and fetch_thirdparty but not fetch_optionals diff --git a/htdocs/stripe/charge.php b/htdocs/stripe/charge.php index eb3d89f2c47..076088dc2f2 100644 --- a/htdocs/stripe/charge.php +++ b/htdocs/stripe/charge.php @@ -48,7 +48,7 @@ $socid = GETPOSTINT("socid"); if ($user->socid) { $socid = $user->socid; } -//$result = restrictedArea($user, 'salaries', '', '', ''); +//restrictedArea($user, 'salaries', '', '', ''); $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $rowid = GETPOST("rowid", 'alpha'); diff --git a/htdocs/stripe/payout.php b/htdocs/stripe/payout.php index f2db4f3e50f..a21765a209d 100644 --- a/htdocs/stripe/payout.php +++ b/htdocs/stripe/payout.php @@ -48,7 +48,7 @@ $socid = GETPOSTINT("socid"); if ($user->socid) { $socid = $user->socid; } -//$result = restrictedArea($user, 'salaries', '', '', ''); +//restrictedArea($user, 'salaries', '', '', ''); $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $rowid = GETPOST("rowid", 'alpha'); diff --git a/htdocs/stripe/transaction.php b/htdocs/stripe/transaction.php index 0b99642ecd9..13d18eb2227 100644 --- a/htdocs/stripe/transaction.php +++ b/htdocs/stripe/transaction.php @@ -48,7 +48,7 @@ $socid = GETPOSTINT("socid"); if ($user->socid) { $socid = $user->socid; } -//$result = restrictedArea($user, 'salaries', '', '', ''); +//restrictedArea($user, 'salaries', '', '', ''); $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $rowid = GETPOST("rowid", 'alpha'); diff --git a/htdocs/ticket/index.php b/htdocs/ticket/index.php index 11593041abb..723c09add61 100644 --- a/htdocs/ticket/index.php +++ b/htdocs/ticket/index.php @@ -72,7 +72,7 @@ $endyear = $year; $object = new Ticket($db); // Security check -//$result = restrictedArea($user, 'ticket|knowledgemanagement', 0, '', '', '', ''); +//restrictedArea($user, 'ticket|knowledgemanagement', 0, '', '', '', ''); if (!$user->hasRight('ticket', 'read') && !$user->hasRight('knowledgemanagement', 'knowledgerecord', 'read')) { accessforbidden('Not enough permissions'); } diff --git a/htdocs/user/bank.php b/htdocs/user/bank.php index 66d34c04b99..439aa1d7008 100644 --- a/htdocs/user/bank.php +++ b/htdocs/user/bank.php @@ -115,7 +115,7 @@ $permissiontosimpleedit = ($selfpermission || $usercanadd); $childids = $user->getAllChildIds(1); // Ok if user->hasRight('salaries', 'readall') or user->hasRight('hrm', 'read') -//$result = restrictedArea($user, 'salaries|hrm', $object->id, 'user&user', $feature2); +//restrictedArea($user, 'salaries|hrm', $object->id, 'user&user', $feature2); $ok = false; if ($user->id == $id) { $ok = true; // A user can always read its own card diff --git a/htdocs/user/group/perms.php b/htdocs/user/group/perms.php index 8e525db9d3d..eb7002cdb69 100644 --- a/htdocs/user/group/perms.php +++ b/htdocs/user/group/perms.php @@ -78,7 +78,7 @@ $socid = 0; if (!empty($user->socid) && $user->socid > 0) { $socid = $user->socid; } -//$result = restrictedArea($user, 'user', $id, 'usergroup', ''); +//restrictedArea($user, 'user', $id, 'usergroup', ''); if (!$permissiontoread) { accessforbidden(); } diff --git a/htdocs/website/websiteaccount_card.php b/htdocs/website/websiteaccount_card.php index 7d158ef5a72..4fe65e3257d 100644 --- a/htdocs/website/websiteaccount_card.php +++ b/htdocs/website/websiteaccount_card.php @@ -80,7 +80,7 @@ include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be 'inclu // Security check //if ($user->socid > 0) accessforbidden(); //if ($user->socid > 0) $socid = $user->socid; -//$result = restrictedArea($user, 'website', $id); +//restrictedArea($user, 'website', $id); $permissiontoaccess = (isModEnabled('website') && $user->hasRight('website', 'read')) || isModEnabled('webportal'); if (!$permissiontoaccess) { accessforbidden('NotAllowed');