Create Users PHP -> Alfresco

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-10-2011 08:39 AM
Hi,
Anybody know how to create users by PHP webservice? Can I write my own webserice client and server end for this?
Thank
CW
Anybody know how to create users by PHP webservice? Can I write my own webserice client and server end for this?
Thank
CW
Labels:
- Labels:
-
Archive
7 REPLIES 7
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-10-2011 08:43 AM
My ideas is, it is easy to use exiting Alfresco service for server-end. And also you can use "ifresco-phplib" for client side php coding works.
You can download
http://forge.alfresco.com/projects/ifresco-phplib/
And you can have more ideas from;
http://forums.alfresco.com/en/viewtopic.php?f=21&t=38685'>http://forums.alfresco.com/en/viewtopic.php?f=21&t=38685
You can download
http://forge.alfresco.com/projects/ifresco-phplib/
And you can have more ideas from;
http://forums.alfresco.com/en/viewtopic.php?f=21&t=38685'>http://forums.alfresco.com/en/viewtopic.php?f=21&t=38685
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-10-2011 08:44 AM

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-10-2011 08:59 AM
Thanks samudaya,
There is an another error;
Fatal error: Uncaught SoapFault exception: [Client] Function ("newUsers") is not a valid method for this service
Thank you very much
There is an another error;
Fatal error: Uncaught SoapFault exception: [Client] Function ("newUsers") is not a valid method for this service
Thank you very much
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-10-2011 09:10 AM
Hi,
Try to take ideas from with this forum;
http://forums.alfresco.com/en/viewtopic.php?f=21&t=38685
ifresco-phplib -> Alfresco/Service/Administration.php
Correct Code
Try to take ideas from with this forum;
http://forums.alfresco.com/en/viewtopic.php?f=21&t=38685
ifresco-phplib -> Alfresco/Service/Administration.php
public function createUser($userDetails) { $result = $this->administrationService->newUsers(array( "newUsers" => $userDetails)); $resultSet = $result->result; return $this->resultSetToUserDetails($this->_session,$this->_store,$resultSet); }
Correct Code
public function createUser($userDetails) { $result = $this->administrationService->createUsers(array( "newUsers" => $userDetails)); $resultSet = $result->result; return $this->resultSetToUserDetails($this->_session,$this->_store,$resultSet); }
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-10-2011 09:13 AM
This is the perfectly working code for me…..
$repositoryUrl = "http://test.com:8080/alfresco/api";$userName = "admin";$password = "password";// Include the required Alfresco PHP API objectsrequire_once "Alfresco/Service/Repository.php";require_once "Alfresco/Service/Session.php";require_once "Alfresco/Service/SpacesStore.php";require_once "Alfresco/Service/UserDetail.php";require_once "Alfresco/Service/Administration.php";require_once "Alfresco/Service/NamedValues.php";// Authenticate the user and create a session$repository = new Repository($repositoryUrl);$ticket = $repository->authenticate($userName, $password);$session = $repository->createSession($ticket);$spacesStore = new SpacesStore($session);$administration = new Administration($repository,$spacesStore,$session);$NamedValues = new NamedValues($session);$NamedValues->cm_firstName = "FIRSTNAME";$NamedValues->cm_lastName = "LASTNAME";$NamedValues->cm_email = "EMAIL@EMAIL.COM";$userDetails = array("userName"=>"USERNAME","password"=>"PASSWORD","properties"=>$NamedValues->__toArray());print_r($administration->createUser($userDetails));

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-10-2011 09:14 AM
Thanks samu,
Finally I solved the problem.
Thanks
CW
Finally I solved the problem.
Thanks
CW
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-10-2011 10:09 AM
Glad to see that the library works fine for most of you ;D and iam not the only one in php library who helps others
ill fix the problem next week 😃
hope the php area will grow on alfresco

ill fix the problem next week 😃
hope the php area will grow on alfresco

