Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop
This commit is contained in:
commit
ae5b5defd5
@ -3385,7 +3385,7 @@ class Form
|
||||
if (!empty($objp->idprodfournprice) && $objp->idprodfournprice > 0) {
|
||||
$opt .= ' data-qty="'.$objp->quantity.'" data-up="'.$objp->unitprice.'" data-discount="'.$outdiscount.'"';
|
||||
}
|
||||
$opt .= ' data-description="'.dol_escape_htmltag($objp->description).'"';
|
||||
$opt .= ' data-description="'.dol_escape_htmltag($objp->description, 0, 1).'"';
|
||||
$opt .= ' data-html="'.dol_escape_htmltag($optlabel).'"';
|
||||
$opt .= '>';
|
||||
|
||||
|
||||
@ -548,7 +548,7 @@ if (!empty($search_user)) {
|
||||
if (!empty($search_batch)) {
|
||||
$sql .= natural_search('m.batch', $search_batch);
|
||||
}
|
||||
if (!empty($product_id)) {
|
||||
if (!empty($product_id) && $product_id != '-1') {
|
||||
$sql .= natural_search('p.rowid', $product_id);
|
||||
}
|
||||
if (!empty($search_fk_projet) && $search_fk_projet != '-1') {
|
||||
|
||||
@ -151,7 +151,7 @@ class Users extends DolibarrApi
|
||||
*/
|
||||
public function get($id, $includepermissions = 0)
|
||||
{
|
||||
if (empty(DolibarrApiAccess::$user->rights->user->user->lire) && empty(DolibarrApiAccess::$user->admin)) {
|
||||
if (empty(DolibarrApiAccess::$user->rights->user->user->lire) && empty(DolibarrApiAccess::$user->admin) && $id != 0 && DolibarrApiAccess::$user->id != $id) {
|
||||
throw new RestException(401, 'Not allowed');
|
||||
}
|
||||
|
||||
@ -184,12 +184,17 @@ class Users extends DolibarrApi
|
||||
*
|
||||
* @url GET login/{login}
|
||||
*
|
||||
* @throws RestException 401 Insufficient rights
|
||||
* @throws RestException 404 User or group not found
|
||||
* @throws RestException 400 Bad request
|
||||
* @throws RestException 401 Insufficient rights
|
||||
* @throws RestException 404 User or group not found
|
||||
*/
|
||||
public function getByLogin($login, $includepermissions = 0)
|
||||
{
|
||||
if (empty(DolibarrApiAccess::$user->rights->user->user->lire) && empty(DolibarrApiAccess::$user->admin)) {
|
||||
if (empty($login)) {
|
||||
throw new RestException(400, 'Bad parameters');
|
||||
}
|
||||
|
||||
if (empty(DolibarrApiAccess::$user->rights->user->user->lire) && empty(DolibarrApiAccess::$user->admin) && DolibarrApiAccess::$user->login != $login) {
|
||||
throw new RestException(401, 'Not allowed');
|
||||
}
|
||||
|
||||
@ -218,12 +223,17 @@ class Users extends DolibarrApi
|
||||
*
|
||||
* @url GET email/{email}
|
||||
*
|
||||
* @throws RestException 400 Bad request
|
||||
* @throws RestException 401 Insufficient rights
|
||||
* @throws RestException 404 User or group not found
|
||||
*/
|
||||
public function getByEmail($email, $includepermissions = 0)
|
||||
{
|
||||
if (empty(DolibarrApiAccess::$user->rights->user->user->lire) && empty(DolibarrApiAccess::$user->admin)) {
|
||||
if (empty($email)) {
|
||||
throw new RestException(400, 'Bad parameters');
|
||||
}
|
||||
|
||||
if (empty(DolibarrApiAccess::$user->rights->user->user->lire) && empty(DolibarrApiAccess::$user->admin) && DolibarrApiAccess::$user->email != $email) {
|
||||
throw new RestException(401, 'Not allowed');
|
||||
}
|
||||
|
||||
@ -256,7 +266,7 @@ class Users extends DolibarrApi
|
||||
*/
|
||||
public function getInfo($includepermissions = 0)
|
||||
{
|
||||
if (empty(DolibarrApiAccess::$user->rights->user->user->lire) && empty(DolibarrApiAccess::$user->admin)) {
|
||||
if (empty(DolibarrApiAccess::$user->rights->user->self->creer) && empty(DolibarrApiAccess::$user->rights->user->user->lire) && empty(DolibarrApiAccess::$user->admin)) {
|
||||
throw new RestException(401, 'Not allowed');
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user