Page 1 of 1

php add / delete user

PostPosted:Mon Jan 28, 2019 11:47 am
by alan.sanderson
Hello!

Is there a php method available to add / delete a user? I have looked through Auth examples but cant see one?

Alan

Re: php add / delete user

PostPosted:Tue Jan 29, 2019 9:43 pm
by jllort
Current php library does not support user and roles management ( https://docs.openkm.com/kcenter/view/sd ... mples.html ) this is only currenly implemented into professional edition. We have shared the management of users and roles from webservices API 1-2 years ago into the professional edition and later we added support into the SDK for the professional edition too.

Currently the API services are available in the community edition ( at least in the master branch what still has not been officially released as version 6.3.7 ) but we have not started to work in the PHP library support, however you can access to the webservice directly https://github.com/openkm/document-mana ... .java#L258

Re: php add / delete user

PostPosted:Wed Jan 30, 2019 11:09 am
by alan.sanderson
fantastic!

got it working can create user and assign role (tick)
how do I assign the default user profile - creating the my documents/{user} folder?
can I force a login /rest/auth/login to make that happen?

would it be helpful if posted the php code to create / delete user until the library is published?

Re: php add / delete user

PostPosted:Sat Feb 02, 2019 11:48 am
by jllort
Has not been exposed the method to set the profile from the REST API. By default when a user login it is automatically assigned the default profile ( I have not tested if from API happens the same, it is a good practice when users are only logged from API, at the begining call the login method, because this method will create missing folder /okm:trash/userId etc... reviewing the php API I see that has not been wrapped ).

About code into the zip you have all the php classes. You an apply changes into and share with us from here the modified classes. If we consider interesting your changes we will include into the next php release.