06-10-2011 08:39 AM
06-10-2011 08:43 AM
06-10-2011 08:44 AM
06-10-2011 08:59 AM
06-10-2011 09:10 AM
public function createUser($userDetails) {
$result = $this->administrationService->newUsers(array(
"newUsers" => $userDetails));
$resultSet = $result->result;
return $this->resultSetToUserDetails($this->_session,$this->_store,$resultSet);
}
public function createUser($userDetails) {
$result = $this->administrationService->createUsers(array(
"newUsers" => $userDetails));
$resultSet = $result->result;
return $this->resultSetToUserDetails($this->_session,$this->_store,$resultSet);
}
06-10-2011 09:13 AM
$repositoryUrl = "http://test.com:8080/alfresco/api";
$userName = "admin";
$password = "password";
// Include the required Alfresco PHP API objects
require_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));
06-10-2011 09:14 AM
06-10-2011 10:09 AM
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.