Merge pull request #13119 from ptibogxiv/patch-305

NEW : api for  get user's documents
This commit is contained in:
Laurent Destailleur 2020-02-18 22:46:27 +01:00 committed by GitHub
commit ac2b13ea52
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -275,6 +275,22 @@ class Documents extends DolibarrApi
$upload_dir = $conf->societe->multidir_output[$object->entity]."/".$object->id;
}
elseif ($modulepart == 'user')
{
require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php';
if (!DolibarrApiAccess::$user->rights->societe->lire) {
throw new RestException(401);
}
$object = new User($this->db);
$result = $object->fetch($id, $ref);
if (!$result) {
throw new RestException(404, 'User not found');
}
$upload_dir = $conf->user->dir_output.'/'.get_exdir(0, 0, 0, 0, $object, 'user').'/'.$object->id;
}
elseif ($modulepart == 'adherent' || $modulepart == 'member')
{
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';