• php add / delete user

  • We tried to make OpenKM as intuitive as possible, but an advice is always welcome.
We tried to make OpenKM as intuitive as possible, but an advice is always welcome.
Forum rules: Please, before asking something see the documentation wiki or use the search feature of the forum. And remember we don't have a crystal ball or mental readers, so if you post about an issue tell us which OpenKM are you using and also the browser and operating system version. For more info read How to Report Bugs Effectively.
 #47357  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
 #47368  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
 #47375  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?
 #47389  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.

About Us

OpenKM is part of the management software. A management software is a program that facilitates the accomplishment of administrative tasks. OpenKM is a document management system that allows you to manage business content and workflow in a more efficient way. Document managers guarantee data protection by establishing information security for business content.