diff --git a/htdocs/api/class/api_access.class.php b/htdocs/api/class/api_access.class.php
index fb074a8b32d..1355261d0ef 100644
--- a/htdocs/api/class/api_access.class.php
+++ b/htdocs/api/class/api_access.class.php
@@ -200,7 +200,7 @@ class DolibarrApiAccess implements iAuthenticate
}
// User seems valid
- $fuser->getrights();
+ $fuser->loadRights();
// Set the property $user to the $user of API
static::$user = $fuser;
diff --git a/htdocs/api/class/api_login.class.php b/htdocs/api/class/api_login.class.php
index 77f337743fc..810c0829952 100644
--- a/htdocs/api/class/api_login.class.php
+++ b/htdocs/api/class/api_login.class.php
@@ -144,7 +144,7 @@ class Login
// Renew the hash
if (empty($tmpuser->api_key) || $reset) {
- $tmpuser->getrights();
+ $tmpuser->loadRights();
if (!$tmpuser->hasRight('user', 'self', 'creer')) {
if (empty($tmpuser->api_key)) {
throw new RestException(403, 'No API token set for this user and user need write permission on itself to reset its API token');
diff --git a/htdocs/core/lib/ws.lib.php b/htdocs/core/lib/ws.lib.php
index f2f39b2eddf..2efffff73af 100644
--- a/htdocs/core/lib/ws.lib.php
+++ b/htdocs/core/lib/ws.lib.php
@@ -72,7 +72,7 @@ function check_authentication($authentication, &$error, &$errorcode, &$errorlabe
// Validation of login
if (!$error) {
- $fuser->getrights(); // Load permission of user
+ $fuser->loadRights(); // Load permission of user
// Authentication mode
if (empty($dolibarr_main_authentication)) {
diff --git a/htdocs/core/modules/DolibarrModules.class.php b/htdocs/core/modules/DolibarrModules.class.php
index 88232c594f0..8bc05ad4a54 100644
--- a/htdocs/core/modules/DolibarrModules.class.php
+++ b/htdocs/core/modules/DolibarrModules.class.php
@@ -2019,7 +2019,7 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it
if (!empty($reinitadminperms) && !empty($user->admin)) { // Reload permission for current user if defined
// We reload permissions
$user->clearrights();
- $user->getrights();
+ $user->loadRights();
}
}
$this->db->free($resql);
diff --git a/htdocs/dav/fileserver.php b/htdocs/dav/fileserver.php
index 6911838834e..756639438f6 100644
--- a/htdocs/dav/fileserver.php
+++ b/htdocs/dav/fileserver.php
@@ -58,7 +58,7 @@ require_once DOL_DOCUMENT_ROOT.'/includes/sabre/autoload.php';
$user = new User($db);
if (isset($_SERVER['PHP_AUTH_USER']) && $_SERVER['PHP_AUTH_USER'] != '') {
$user->fetch(0, $_SERVER['PHP_AUTH_USER']);
- $user->getrights();
+ $user->loadRights();
}
// Load translation files required by the page
diff --git a/htdocs/ecm/search.php b/htdocs/ecm/search.php
index 202ea14afb7..2910d7a4184 100644
--- a/htdocs/ecm/search.php
+++ b/htdocs/ecm/search.php
@@ -40,7 +40,7 @@ if ($user->socid) {
$result = restrictedArea($user, 'ecm', '');
// Load permissions
-$user->getrights('ecm');
+$user->loadRights('ecm');
// Get parameters
$socid = GETPOSTINT('socid');
diff --git a/htdocs/expensereport/class/expensereport.class.php b/htdocs/expensereport/class/expensereport.class.php
index 57b80393617..8cec82fcb6d 100644
--- a/htdocs/expensereport/class/expensereport.class.php
+++ b/htdocs/expensereport/class/expensereport.class.php
@@ -2743,7 +2743,7 @@ class ExpenseReport extends CommonObject
$currentUser = new User($db);
$currentUser->fetch($this->fk_user);
- $currentUser->getrights('expensereport');
+ $currentUser->loadRights('expensereport');
//Clean
$qty = (float) price2num($qty);
diff --git a/htdocs/expensereport/list.php b/htdocs/expensereport/list.php
index a66ee7c4b16..3e5ca842ec8 100644
--- a/htdocs/expensereport/list.php
+++ b/htdocs/expensereport/list.php
@@ -271,7 +271,7 @@ $user_id = $user->id;
if ($id > 0) {
// Charge utilisateur edite
$fuser->fetch($id, '', '', 1);
- $fuser->getrights();
+ $fuser->loadRights();
$user_id = $fuser->id;
$search_user = $user_id;
diff --git a/htdocs/fourn/commande/index.php b/htdocs/fourn/commande/index.php
index ee6ca36224a..91d50316771 100644
--- a/htdocs/fourn/commande/index.php
+++ b/htdocs/fourn/commande/index.php
@@ -256,7 +256,7 @@ if ($resql) {
$userstatic = new User($db);
$userstatic->id = $obj->rowid;
- $userstatic->getrights('fournisseur');
+ $userstatic->loadRights('fournisseur');
if ($userstatic->hasRight('fournisseur', 'commande', 'approuver')) {
print '
';
diff --git a/htdocs/holiday/list.php b/htdocs/holiday/list.php
index 6baf24ccb24..16aad58d970 100644
--- a/htdocs/holiday/list.php
+++ b/htdocs/holiday/list.php
@@ -253,7 +253,7 @@ $user_id = $user->id;
if ($id > 0) {
// Charge utilisateur edite
$fuser->fetch($id, '', '', 1);
- $fuser->getrights();
+ $fuser->loadRights();
$user_id = $fuser->id;
$search_employee = $user_id;
diff --git a/htdocs/imports/emptyexample.php b/htdocs/imports/emptyexample.php
index ec84e98e714..7f72904e13d 100644
--- a/htdocs/imports/emptyexample.php
+++ b/htdocs/imports/emptyexample.php
@@ -79,7 +79,7 @@ $langs->load("exports");
// Check exportkey
if (empty($datatoimport)) {
- $user->getrights();
+ $user->loadRights();
llxHeader();
print 'Bad value for datatoimport.
';
diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php
index 399cb9030f1..a26222d051c 100644
--- a/htdocs/main.inc.php
+++ b/htdocs/main.inc.php
@@ -1471,7 +1471,7 @@ if (!defined('NOLOGIN')) {
}
// Load permissions
- $user->getrights();
+ $user->loadRights();
}
dol_syslog("--- Access to ".(empty($_SERVER["REQUEST_METHOD"]) ? '' : $_SERVER["REQUEST_METHOD"].' ').$_SERVER["PHP_SELF"].' - action='.GETPOST('action', 'aZ09').', massaction='.GETPOST('massaction', 'aZ09').(defined('NOTOKENRENEWAL') ? ' NOTOKENRENEWAL='.constant('NOTOKENRENEWAL') : ''), LOG_NOTICE);
diff --git a/htdocs/modulebuilder/template/css/mymodule.css.php b/htdocs/modulebuilder/template/css/mymodule.css.php
index d805158c114..f243960ecee 100644
--- a/htdocs/modulebuilder/template/css/mymodule.css.php
+++ b/htdocs/modulebuilder/template/css/mymodule.css.php
@@ -81,7 +81,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
// Load user to have $user->conf loaded (not done by default here because of NOLOGIN constant defined) and load permission if we need to use them in CSS
/*if (empty($user->id) && !empty($_SESSION['dol_login'])) {
$user->fetch('',$_SESSION['dol_login']);
- $user->getrights();
+ $user->loadRights();
}*/
@@ -107,5 +107,3 @@ div.mainmenu.mymodule {
.myclasscss {
/* ... */
}
-
-
diff --git a/htdocs/modulebuilder/template/scripts/mymodule.php b/htdocs/modulebuilder/template/scripts/mymodule.php
index 9bb5d54cfa5..1f59f3a602c 100644
--- a/htdocs/modulebuilder/template/scripts/mymodule.php
+++ b/htdocs/modulebuilder/template/scripts/mymodule.php
@@ -105,7 +105,7 @@ if (!($result > 0)) {
dol_print_error(null, $user->error);
exit;
}
-$user->getrights();
+$user->loadRights();
$hookmanager->initHooks(array('cli'));
diff --git a/htdocs/modulebuilder/template/test/phpunit/MyObjectTest.php b/htdocs/modulebuilder/template/test/phpunit/MyObjectTest.php
index 89b2e3db554..97861ddf147 100644
--- a/htdocs/modulebuilder/template/test/phpunit/MyObjectTest.php
+++ b/htdocs/modulebuilder/template/test/phpunit/MyObjectTest.php
@@ -34,7 +34,7 @@ require_once dirname(__FILE__).'/../../htdocs/mymodule/class/myobject.class.php'
if (empty($user->id)) {
print "Load permissions for admin user nb 1\n";
$user->fetch(1);
- $user->getrights();
+ $user->loadRights();
}
$conf->global->MAIN_DISABLE_ALL_MAILS = 1;
diff --git a/htdocs/public/agenda/agendaexport.php b/htdocs/public/agenda/agendaexport.php
index 284dfd6091e..718c97e03ed 100644
--- a/htdocs/public/agenda/agendaexport.php
+++ b/htdocs/public/agenda/agendaexport.php
@@ -162,7 +162,7 @@ if (!isModEnabled('agenda')) {
// Check config
if (!getDolGlobalString('MAIN_AGENDA_XCAL_EXPORTKEY')) {
- $user->getrights();
+ $user->loadRights();
top_httphead();
@@ -189,7 +189,7 @@ if ($reshook < 0) {
} elseif (empty($reshook)) {
// Check exportkey
if (!GETPOST("exportkey") || getDolGlobalString('MAIN_AGENDA_XCAL_EXPORTKEY') != GETPOST("exportkey")) {
- $user->getrights();
+ $user->loadRights();
top_httphead();
diff --git a/htdocs/public/cron/cron_run_jobs_by_url.php b/htdocs/public/cron/cron_run_jobs_by_url.php
index 3185f7bfa55..86c0cc76299 100644
--- a/htdocs/public/cron/cron_run_jobs_by_url.php
+++ b/htdocs/public/cron/cron_run_jobs_by_url.php
@@ -118,7 +118,7 @@ if ($result < 0) {
exit;
}
}
-$user->getrights();
+$user->loadRights();
$id = GETPOST('id', 'alpha'); // We accept non numeric id. We will filter later.
@@ -180,7 +180,7 @@ if (is_array($object->lines) && (count($object->lines) > 0)) {
exit(-1);
}
}
- $user->getrights();
+ $user->loadRights();
}
}
diff --git a/htdocs/public/stripe/ipn.php b/htdocs/public/stripe/ipn.php
index 787a1474904..b7cec54d44c 100644
--- a/htdocs/public/stripe/ipn.php
+++ b/htdocs/public/stripe/ipn.php
@@ -93,7 +93,7 @@ if (getDolGlobalString('STRIPE_USER_ACCOUNT_FOR_ACTIONS')) {
// We set the user to use for all ipn actions in Dolibarr
$user = new User($db);
$user->fetch(getDolGlobalString('STRIPE_USER_ACCOUNT_FOR_ACTIONS'));
- $user->getrights();
+ $user->loadRights();
} else {
httponly_accessforbidden('Error: Setup of module Stripe not complete for mode '.dol_escape_htmltag($service).'. The STRIPE_USER_ACCOUNT_FOR_ACTIONS is not defined.', 400, 1);
}
diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php
index 33266aeaad8..7b65ab171b6 100644
--- a/htdocs/theme/eldy/style.css.php
+++ b/htdocs/theme/eldy/style.css.php
@@ -69,7 +69,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
// and permission, so we can later calculate number of top menu ($nbtopmenuentries) according to user profile.
if (empty($user->id) && !empty($_SESSION['dol_login'])) {
$user->fetch('', $_SESSION['dol_login'], '', 1);
- $user->getrights();
+ $user->loadRights();
// Reload menu now we have the good user (and we need the good menu to have ->showmenu('topnb') correct.
$menumanager = new MenuManager($db, empty($user->socid) ? 0 : 1);
diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php
index 8b7eac9d3e2..8e8d4083dd9 100644
--- a/htdocs/theme/md/style.css.php
+++ b/htdocs/theme/md/style.css.php
@@ -71,7 +71,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
// and permission, so we can later calculate number of top menu ($nbtopmenuentries) according to user profile.
if (empty($user->id) && !empty($_SESSION['dol_login'])) {
$user->fetch('', $_SESSION['dol_login'], '', 1);
- $user->getrights();
+ $user->loadRights();
//$user->loadPersonalConf();
// Reload menu now we have the good user (and we need the good menu to have ->showmenu('topnb') correct.
diff --git a/htdocs/user/agenda.php b/htdocs/user/agenda.php
index 5b8cf4ffe56..41f128cd68e 100644
--- a/htdocs/user/agenda.php
+++ b/htdocs/user/agenda.php
@@ -72,7 +72,7 @@ if (!$sortorder) {
$object = new User($db);
if ($id > 0 || !empty($ref)) {
$result = $object->fetch($id, $ref, '', 1);
- $object->getrights();
+ $object->loadRights();
}
// Security check
diff --git a/htdocs/user/agenda_extsites.php b/htdocs/user/agenda_extsites.php
index c3fc53bea3f..9c435ca8485 100644
--- a/htdocs/user/agenda_extsites.php
+++ b/htdocs/user/agenda_extsites.php
@@ -59,7 +59,7 @@ if (!isset($id) || empty($id)) {
$object = new User($db);
$object->fetch($id, '', '', 1);
-$object->getrights();
+$object->loadRights();
// Security check
$socid = 0;
diff --git a/htdocs/user/bank.php b/htdocs/user/bank.php
index 1a667909ad5..d6d857f0f27 100644
--- a/htdocs/user/bank.php
+++ b/htdocs/user/bank.php
@@ -71,7 +71,7 @@ $feature2 = (($socid && $user->hasRight('user', 'self', 'creer')) ? '' : 'user')
$object = new User($db);
if ($id > 0 || !empty($ref)) {
$result = $object->fetch($id, $ref, '', 1);
- $object->getrights();
+ $object->loadRights();
}
$account = new UserBankAccount($db);
diff --git a/htdocs/user/card.php b/htdocs/user/card.php
index a17d32c5f58..b0d64602e21 100644
--- a/htdocs/user/card.php
+++ b/htdocs/user/card.php
@@ -1437,7 +1437,7 @@ if ($action == 'create' || $action == 'adduserldap') {
// Check if user has rights
if (!getDolGlobalString('MULTICOMPANY_TRANSVERSE_MODE')) {
- $object->getrights();
+ $object->loadRights();
if (empty($object->nb_rights) && $object->statut != 0 && empty($object->admin)) {
setEventMessages($langs->trans('UserHasNoPermissions'), null, 'warnings');
}
diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php
index 1f2374dffdf..df1d2e782f0 100644
--- a/htdocs/user/class/user.class.php
+++ b/htdocs/user/class/user.class.php
@@ -1299,7 +1299,7 @@ class User extends CommonObject
$sql .= " ".$this->db->prefix()."usergroup_user as gu,";
$sql .= " ".$this->db->prefix()."rights_def as r";
$sql .= " WHERE r.id = gr.fk_id";
- // @FIXME Very strange business rules. Must be alays the same than into user->getrights() user/perms.php and user/group/perms.php
+ // @FIXME Very strange business rules. Must be always the same than into user->loadRights() user/perms.php and user/group/perms.php
if (getDolGlobalString('MULTICOMPANY_BACKWARD_COMPATIBILITY')) {
if (isModEnabled('multicompany') && getDolGlobalString('MULTICOMPANY_TRANSVERSE_MODE')) {
$sql .= " AND gu.entity IN (0,".$conf->entity.")";
@@ -1443,11 +1443,12 @@ class User extends CommonObject
/**
* Load permissions granted to a user->id into object user->rights
- * TODO Remove this method. It has a name conflict with getRights() in CommonObject.
+ * TODO Remove this method. It has a name conflict with getRights() in CommonObject and was replaced in v20 with loadRights()
*
* @param string $moduletag Limit permission for a particular module ('' by default means load all permissions)
* @param int $forcereload Force reload of permissions even if they were already loaded (ignore cache)
* @return void
+ * @deprecated
*
* @see clearrights(), delrights(), addrights(), hasRight()
* @phpstan-ignore-next-line
diff --git a/htdocs/user/clicktodial.php b/htdocs/user/clicktodial.php
index 0b67de7d197..6b540e1f407 100644
--- a/htdocs/user/clicktodial.php
+++ b/htdocs/user/clicktodial.php
@@ -81,7 +81,7 @@ $form = new Form($db);
if ($id > 0) {
$object = new User($db);
$object->fetch($id, '', '', 1);
- $object->getrights();
+ $object->loadRights();
$object->fetch_clicktodial();
$person_name = !empty($object->firstname) ? $object->lastname.", ".$object->firstname : $object->lastname;
diff --git a/htdocs/user/document.php b/htdocs/user/document.php
index 668890e0c91..06b51074c95 100644
--- a/htdocs/user/document.php
+++ b/htdocs/user/document.php
@@ -102,7 +102,7 @@ if (!$sortfield) {
$object = new User($db);
if ($id > 0 || !empty($ref)) {
$result = $object->fetch($id, $ref, '', 1);
- $object->getrights();
+ $object->loadRights();
//$upload_dir = $conf->user->multidir_output[$object->entity] . "/" . $object->id ;
// For users, the upload_dir is always $conf->user->entity for the moment
$upload_dir = $conf->user->dir_output."/".$object->id;
diff --git a/htdocs/user/group/card.php b/htdocs/user/group/card.php
index 51386fc3a07..22a6db65cdb 100644
--- a/htdocs/user/group/card.php
+++ b/htdocs/user/group/card.php
@@ -68,7 +68,7 @@ $extrafields->fetch_name_optionals_label($object->table_element);
// Load object
include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once'.
-$object->getrights();
+$object->loadRights();
// Initialize a technical object to manage hooks. Note that conf->hooks_modules contains array
$hookmanager->initHooks(array('groupcard', 'globalcard'));
diff --git a/htdocs/user/group/ldap.php b/htdocs/user/group/ldap.php
index 2bb9b4b2fac..7149862bb15 100644
--- a/htdocs/user/group/ldap.php
+++ b/htdocs/user/group/ldap.php
@@ -44,7 +44,7 @@ if ($user->socid > 0) {
$object = new UserGroup($db);
$object->fetch($id, '', true);
-$object->getrights();
+$object->loadRights();
// Users/Groups management only in master entity if transverse mode
if (isModEnabled('multicompany') && $conf->entity > 1 && getDolGlobalString('MULTICOMPANY_TRANSVERSE_MODE')) {
diff --git a/htdocs/user/group/perms.php b/htdocs/user/group/perms.php
index 58c254d2717..8166525316b 100644
--- a/htdocs/user/group/perms.php
+++ b/htdocs/user/group/perms.php
@@ -74,7 +74,7 @@ if (!$canreadperms) {
$object = new UserGroup($db);
$object->fetch($id);
-$object->getrights();
+$object->loadRights();
$entity = $conf->entity;
@@ -106,7 +106,7 @@ if (empty($reshook)) {
}
$user->clearrights();
- $user->getrights();
+ $user->loadRights();
}
if ($action == 'delrights' && $caneditperms) {
@@ -122,7 +122,7 @@ if (empty($reshook)) {
}
$user->clearrights();
- $user->getrights();
+ $user->loadRights();
}
}
diff --git a/htdocs/user/ldap.php b/htdocs/user/ldap.php
index 45549a29248..a40826c632f 100644
--- a/htdocs/user/ldap.php
+++ b/htdocs/user/ldap.php
@@ -47,7 +47,7 @@ $result = restrictedArea($user, 'user', $id, 'user&user', $feature2);
$object = new User($db);
$object->fetch($id, '', '', 1);
-$object->getrights();
+$object->loadRights();
// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context
$hookmanager->initHooks(array('usercard', 'userldap', 'globalcard'));
diff --git a/htdocs/user/messaging.php b/htdocs/user/messaging.php
index eabf89a25b3..713c7f83b34 100644
--- a/htdocs/user/messaging.php
+++ b/htdocs/user/messaging.php
@@ -80,7 +80,7 @@ if ($id > 0 || !empty($ref)) {
if ($result <= 0) {
accessforbidden('User not found');
}
- $object->getrights();
+ $object->loadRights();
}
// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context
diff --git a/htdocs/user/note.php b/htdocs/user/note.php
index 4fe5dd7e8de..c6db1416a7b 100644
--- a/htdocs/user/note.php
+++ b/htdocs/user/note.php
@@ -42,7 +42,7 @@ $langs->loadLangs(array('companies', 'members', 'bills', 'users'));
$object = new User($db);
$object->fetch($id, '', '', 1);
-$object->getrights();
+$object->loadRights();
// If user is not user read and no permission to read other users, we stop
if (($object->id != $user->id) && (!$user->hasRight("user", "user", "read"))) {
diff --git a/htdocs/user/notify/card.php b/htdocs/user/notify/card.php
index f0027bc3b2e..c0e20fb8893 100644
--- a/htdocs/user/notify/card.php
+++ b/htdocs/user/notify/card.php
@@ -69,7 +69,7 @@ $now = dol_now();
$object = new User($db);
if ($id > 0 || !empty($ref)) {
$result = $object->fetch($id, $ref, '', 1);
- $object->getrights();
+ $object->loadRights();
}
$permissiontoadd = (($object->id == $user->id) || ($user->hasRight('user', 'user', 'lire')));
@@ -141,7 +141,7 @@ $form = new Form($db);
$object = new User($db);
$result = $object->fetch($id, '', '', 1);
-$object->getrights();
+$object->loadRights();
$title = $langs->trans("ThirdParty").' - '.$langs->trans("Notification");
if (getDolGlobalString('MAIN_HTML_TITLE') && preg_match('/thirdpartynameonly/', getDolGlobalString('MAIN_HTML_TITLE')) && $object->name) {
diff --git a/htdocs/user/param_ihm.php b/htdocs/user/param_ihm.php
index b401d90863f..e97beefcde0 100644
--- a/htdocs/user/param_ihm.php
+++ b/htdocs/user/param_ihm.php
@@ -69,7 +69,7 @@ $dirleft = "../core/menus/standard";
// Charge utilisateur edite
$object = new User($db);
$object->fetch($id, '', '', 1);
-$object->getrights();
+$object->loadRights();
// Liste des zone de recherche permanentes supportees
/* deprecated
diff --git a/htdocs/user/perms.php b/htdocs/user/perms.php
index d553851236a..03d63465a01 100644
--- a/htdocs/user/perms.php
+++ b/htdocs/user/perms.php
@@ -81,7 +81,7 @@ if ($user->id != $id && !$canreaduser) {
$object = new User($db);
$object->fetch($id, '', '', 1);
-$object->getrights();
+$object->loadRights();
$entity = $conf->entity;
@@ -111,12 +111,12 @@ if (empty($reshook)) {
// If we are changing our own permissions, we reload permissions and menu
if ($object->id == $user->id) {
$user->clearrights();
- $user->getrights();
+ $user->loadRights();
$menumanager->loadMenu();
}
$object->clearrights();
- $object->getrights();
+ $object->loadRights();
}
if ($action == 'delrights' && $caneditperms && $confirm == 'yes') {
@@ -130,12 +130,12 @@ if (empty($reshook)) {
// If we are changing our own permissions, we reload permissions and menu
if ($object->id == $user->id) {
$user->clearrights();
- $user->getrights();
+ $user->loadRights();
$menumanager->loadMenu();
}
$object->clearrights();
- $object->getrights();
+ $object->loadRights();
}
}
diff --git a/htdocs/user/virtualcard.php b/htdocs/user/virtualcard.php
index b519b6d67bf..d2d180ba5a2 100644
--- a/htdocs/user/virtualcard.php
+++ b/htdocs/user/virtualcard.php
@@ -44,7 +44,7 @@ if (empty($id) && empty($ref)) {
$object = new User($db);
if ($id > 0 || !empty($ref)) {
$result = $object->fetch($id, $ref, '', 1);
- $object->getrights();
+ $object->loadRights();
}
// Security check
diff --git a/htdocs/webservices/server_actioncomm.php b/htdocs/webservices/server_actioncomm.php
index b1666442c01..d17e6682ebe 100644
--- a/htdocs/webservices/server_actioncomm.php
+++ b/htdocs/webservices/server_actioncomm.php
@@ -297,7 +297,7 @@ function getActionComm($authentication, $id)
}
if (!$error) {
- $fuser->getrights();
+ $fuser->loadRights();
if ($fuser->hasRight('agenda', 'allactions', 'read')) {
$actioncomm = new ActionComm($db);
@@ -393,7 +393,7 @@ function getListActionCommType($authentication)
$fuser = check_authentication($authentication, $error, $errorcode, $errorlabel);
if (!$error) {
- $fuser->getrights();
+ $fuser->loadRights();
if ($fuser->hasRight('agenda', 'myactions', 'read')) {
$cactioncomm = new CActionComm($db);
diff --git a/htdocs/webservices/server_category.php b/htdocs/webservices/server_category.php
index ee681c18c73..b584b88c091 100644
--- a/htdocs/webservices/server_category.php
+++ b/htdocs/webservices/server_category.php
@@ -231,7 +231,7 @@ function getCategory($authentication, $id)
}
if (!$error) {
- $fuser->getrights();
+ $fuser->loadRights();
$nbmax = 10;
if ($fuser->hasRight('categorie', 'lire')) {
diff --git a/htdocs/webservices/server_contact.php b/htdocs/webservices/server_contact.php
index d632ec121b7..c9f74cc8f58 100644
--- a/htdocs/webservices/server_contact.php
+++ b/htdocs/webservices/server_contact.php
@@ -289,7 +289,7 @@ function getContact($authentication, $id, $ref_ext)
}
if (!$error) {
- $fuser->getrights();
+ $fuser->loadRights();
$contact = new Contact($db);
$result = $contact->fetch($id, null, $ref_ext);
diff --git a/htdocs/webservices/server_invoice.php b/htdocs/webservices/server_invoice.php
index bb4d104c18d..aa25ba56d18 100644
--- a/htdocs/webservices/server_invoice.php
+++ b/htdocs/webservices/server_invoice.php
@@ -330,7 +330,7 @@ function getInvoice($authentication, $id = 0, $ref = '', $ref_ext = '')
}
if (!$error) {
- $fuser->getrights();
+ $fuser->loadRights();
if ($fuser->hasRight('facture', 'lire')) {
$invoice = new Facture($db);
@@ -698,7 +698,7 @@ function createInvoiceFromOrder($authentication, $id_order = '', $ref_order = ''
//////////////////////
if (!$error) {
- $fuser->getrights();
+ $fuser->loadRights();
if ($fuser->hasRight('commande', 'lire')) {
$order = new Commande($db);
diff --git a/htdocs/webservices/server_order.php b/htdocs/webservices/server_order.php
index 8c75b40dfac..b73d2bef2ff 100644
--- a/htdocs/webservices/server_order.php
+++ b/htdocs/webservices/server_order.php
@@ -407,7 +407,7 @@ function getOrder($authentication, $id = 0, $ref = '', $ref_ext = '')
}
if (!$error) {
- $fuser->getrights();
+ $fuser->loadRights();
if ($fuser->hasRight('commande', 'lire')) {
$order = new Commande($db);
@@ -831,7 +831,7 @@ function validOrder($authentication, $id = 0, $id_warehouse = 0)
$fuser = check_authentication($authentication, $error, $errorcode, $errorlabel);
if (!$error) {
- $fuser->getrights();
+ $fuser->loadRights();
if ($fuser->hasRight('commande', 'lire')) {
$order = new Commande($db);
diff --git a/htdocs/webservices/server_other.php b/htdocs/webservices/server_other.php
index 6fe3799c253..4d23b21c1a6 100644
--- a/htdocs/webservices/server_other.php
+++ b/htdocs/webservices/server_other.php
@@ -243,7 +243,7 @@ function getDocument($authentication, $modulepart, $file, $refname = '')
}
if (!$error) {
- $fuser->getrights();
+ $fuser->loadRights();
// Suppression de la chaine de character ../ dans $original_file
$original_file = str_replace("../", "/", $original_file);
diff --git a/htdocs/webservices/server_productorservice.php b/htdocs/webservices/server_productorservice.php
index 3d5ce1d17a2..443dc4ee53f 100644
--- a/htdocs/webservices/server_productorservice.php
+++ b/htdocs/webservices/server_productorservice.php
@@ -392,7 +392,7 @@ function getProductOrService($authentication, $id = 0, $ref = '', $ref_ext = '',
$langcode = ($lang ? $lang : (!getDolGlobalString('MAIN_LANG_DEFAULT') ? 'auto' : $conf->global->MAIN_LANG_DEFAULT));
$langs->setDefaultLang($langcode);
- $fuser->getrights();
+ $fuser->loadRights();
$nbmax = 10;
if ($fuser->hasRight('produit', 'lire') || $fuser->hasRight('service', 'lire')) {
@@ -1029,7 +1029,7 @@ function getProductsForCategory($authentication, $id, $lang = '')
$langcode = ($lang ? $lang : (!getDolGlobalString('MAIN_LANG_DEFAULT') ? 'auto' : $conf->global->MAIN_LANG_DEFAULT));
$langs->setDefaultLang($langcode);
- $fuser->getrights();
+ $fuser->loadRights();
$nbmax = 10;
if ($fuser->hasRight('produit', 'lire')) {
diff --git a/htdocs/webservices/server_project.php b/htdocs/webservices/server_project.php
index d254fa870f2..5e731ece5ce 100644
--- a/htdocs/webservices/server_project.php
+++ b/htdocs/webservices/server_project.php
@@ -281,7 +281,7 @@ function createProject($authentication, $project)
if (!$error) {
- $fuser->getrights();
+ $fuser->loadRights();
if ($fuser->hasRight('projet', 'creer')) {
$newobject = new Project($db);
@@ -376,7 +376,7 @@ function getProject($authentication, $id = '', $ref = '')
}
if (!$error) {
- $fuser->getrights();
+ $fuser->loadRights();
if ($fuser->hasRight('projet', 'lire')) {
$project = new Project($db);
diff --git a/htdocs/webservices/server_supplier_invoice.php b/htdocs/webservices/server_supplier_invoice.php
index 77442df3f03..482dbb74206 100644
--- a/htdocs/webservices/server_supplier_invoice.php
+++ b/htdocs/webservices/server_supplier_invoice.php
@@ -267,7 +267,7 @@ function getSupplierInvoice($authentication, $id = 0, $ref = '', $ref_ext = '')
}
if (!$error) {
- $fuser->getrights();
+ $fuser->loadRights();
if ($fuser->hasRight('fournisseur', 'facture', 'lire')) {
$invoice = new FactureFournisseur($db);
diff --git a/htdocs/webservices/server_thirdparty.php b/htdocs/webservices/server_thirdparty.php
index d53ee73ac9d..83e2acffa76 100644
--- a/htdocs/webservices/server_thirdparty.php
+++ b/htdocs/webservices/server_thirdparty.php
@@ -339,7 +339,7 @@ function getThirdParty($authentication, $id = '', $ref = '', $ref_ext = '', $bar
}
if (!$error) {
- $fuser->getrights();
+ $fuser->loadRights();
if ($fuser->hasRight('societe', 'lire')) {
$thirdparty = new Societe($db);
@@ -845,7 +845,7 @@ function deleteThirdParty($authentication, $id = '', $ref = '', $ref_ext = '')
dol_syslog("Function: deleteThirdParty 1");
if (!$error) {
- $fuser->getrights();
+ $fuser->loadRights();
if ($fuser->hasRight('societe', 'lire') && $fuser->hasRight('societe', 'supprimer')) {
$thirdparty = new Societe($db);
diff --git a/htdocs/webservices/server_user.php b/htdocs/webservices/server_user.php
index 1ffc7458d73..fd6a4e96f14 100644
--- a/htdocs/webservices/server_user.php
+++ b/htdocs/webservices/server_user.php
@@ -354,7 +354,7 @@ function getUser($authentication, $id, $ref = '', $ref_ext = '')
}
if (!$error) {
- $fuser->getrights();
+ $fuser->loadRights();
if ($fuser->hasRight('user', 'user', 'lire')
|| ($fuser->hasRight('user', 'self', 'creer') && $id && $id == $fuser->id)
@@ -517,7 +517,7 @@ function createUserFromThirdparty($authentication, $thirdpartywithuser)
}
if (!$error) {
- $fuser->getrights();
+ $fuser->loadRights();
if ($fuser->hasRight('societe', 'creer')) {
$thirdparty = new Societe($db);
@@ -716,7 +716,7 @@ function setUserPassword($authentication, $shortuser)
}
if (!$error) {
- $fuser->getrights();
+ $fuser->loadRights();
if ($fuser->hasRight('user', 'user', 'password') || $fuser->hasRight('user', 'self', 'password')) {
$userstat = new User($db);