cancel
Showing results for 
Search instead for 
Did you mean: 

User Creation...

sheva7
Champ in-the-making
Champ in-the-making
Hello !

I have searched a lot but…. how to create a user with php ?

Did someone do something like that ?

Thank you !
6 REPLIES 6

sheva7
Champ in-the-making
Champ in-the-making
nobody ?

antonella
Champ in-the-making
Champ in-the-making
i would be very happy to know it!!i'm looking for the same thing!

samudaya
Champ on-the-rise
Champ on-the-rise
Hi all,

Did you find a how to create users by suing php module. Any idea ?

Thanks

ddanninger
Champ in-the-making
Champ in-the-making
already posted an answer on your new opened topic -> http://forums.alfresco.com/en/viewtopic.php?f=21&t=38685&p=113257#p113257

tnavarro
Champ in-the-making
Champ in-the-making
Hi all,

I also have the same problem on how to create a user with php?
Hope to have an expanded explanation and samples.

Thanks in advance. Smiley Happy

—————
[size=85]cholesterol levels[/size]

samudaya
Champ on-the-rise
Champ on-the-rise
download php library -> http://forge.alfresco.com/projects/ifresco-phplib/


$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));